Inverting & Level Shifting a Digital Signal

Status
Not open for further replies.

dssvo

New Member
I have a TTL (3.3V HIGH, 0V LOW) serial port on my microcontroller. I want to use it to communicate with another device, which uses (5V HIGH, 0V LOW) and the signal is also inverted.

What's simple circuit to invert and level-shift this signal in each direction?
 
Last edited:
To complete Mike ML's suggestion, if you want to to go from the device output to 3.3V TTL on your µC, use the same circuit but connect the 4.7k pull-up to +3.3V.
 
Thanks for your replies!

I was trying to do this with an NPN BJT, 3.3v signal IN to base, emitter to GND, collector to 10k resistor to +5v, then reading the signal from the collector. I must have screwed up.

I took a picture of the correct, desired signal from the original USB serial adapter that came with my device ---



Unfortunately I didn't manage to get a picture of the output of the uC but it measures +3.3v, idle on high.
 
I was trying to do this with an NPN BJT, 3.3v signal IN to base, emitter to GND, collector to 10k resistor to +5v, then reading the signal from the collector. I must have screwed up.
You need a resistor in series with the base (see Mike ML's circuit). Otherwise you could zap the transistor.
 
the level shifter shown within the dotted box is for a 3.3V OC output (with or without a pullup). for active outputs, you can simplify it by shorting across R4 and removing R2.
 
Last edited:
3.3V logic meets the VIL and VIh input requirements for TTL logic. You could just use a cmos inverter with TTL compatible inputs like HCT or ACT family.
 
MikeMl said:
2n3904, 10K base resistor, 4.7K pull-up to +5V.

I tried putting this together. The waveform looks perfectly like what I need in the oscilloscope, but the target device won't respond to this signal. Looks like I need to have an open drain or totem pole output for this to work, like in the drawing shown by unclejed613... but I don't fully understand it yet.

unclejed613 said:
the level shifter shown within the dotted box is for a 3.3V OC output (with or without a pullup). for active outputs, you can simplify it by shorting across R4 and removing R2

Thanks !!! --- But what's V1 for in this diagram?
 
V1 is a pulse signal used to drive the transistor that simulates your 3.3V device output. it's just a signal source used for part of the example.. it's not part of the level shifter. i will post the waveforms from the circuit in operation if you like, then you can see what's going on in it.
 

Oh, I understand now. Thanks!

Mikebits said:
As I tried to elude to, your 3.3v logic device will drive TTL compatible parts. All you need is a cmos inverter with TTL compatible inputs.

Got it. Thanks!
 
Last edited:
A little after the fact, but this is one other alternative I just designed for something at work:
**broken link removed**
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…