Advice for Levelshifting wanted

Status
Not open for further replies.

Frank B

Senior Member
Hi,

ok, I think I need some help here - I tried the Sn74CBTD3861, which looked good at the first sight, but in my application it has the problem, that it produces too high voltages on the 3V side.
Reproducable, I tried two chips.
I think, the problem is, that I added 1K as pull-up - resitors on the 5V side.

Ok, more details:
I need level-shifting for (minimum) two busses: Commodore IEC and PS2 (Keyboard, 5V 2x Datalines)

IEC is :
1 x 5V -> Teensy input
1 x Teensy output -> 5V
3 x 5V <--> teensy bidirectional.

The speed is not high - absolute maximum is around 300kBIT / second.

The solution should be small, I don't want masses of transistors and resistors, and I try to use a minimum amount of SMD parts.

The problem with integrated circuits is : The serial IEC Bus is quite old. It is a active-low bus ("open collector") with 1K PULL-UPs in every device. It is possible to connect up to 8 devices - so 8*5mA = 40mA per line!! max.
But it is very unlikely that all all lines will be driven low at the same time.

Transistors + resistors take much room ... and is a lot to solder.

Does anyone have any hints for me ?

Edit: + I need a solution for the PS2 Keyboard which is 5V, too.
Edit2: Later, I want to add the "UserPort" wich adds >10 more 5 Volt signals, bidirectional (but without the pullup resitors on board) "open collector"
Edit3: Worst case, I can reduce the amount of allowed devices to one, two, or three..
Edit4: I have NO direction signal for the bidirectional lines.
 
Last edited:
HI Frank. What about the adafruit ID 757 ? These shift between 5 v and 3.3v and are bidirectional. Your freq requirements are much lower than these are rated for. I've used a Sparkfun equivalent to this for SD card (3.3v) SPI bus to 5 v MCUs at 4 MHz SPI clock rate.
That TI part is odd. The datasheet indicates it should work, especially looking at Figure 2. But in the description they say that there is a diode to Vcc to limit output to 3 volts, but Vcc is specified as 5 v . So, I don't know how that would work.
 
I need level-shifting for (minimum) two busses: Commodore IEC and PS2 (Keyboard, 5V 2x Datalines)
TXB0104 or TXS0104E? You should be able to have five devices per bus (25mA max per bit, 4 per chip = 100mA, which the chips should handle through GND or VCCs). I haven't used either, though, just considered them for my own use. (Ended up going unidirectional, SN74LVC1T45 per bit.)
 
The TXB level shifters don't work well with pull-ups and open drain, and are generally a bad idea in almost any use case (and I expect pretty much the same from the TXS). The forum (and that of TI) is full of bad experiences with them.

Without thinking about it too much, the voltage levels and current drain Frank mentions seem to be in the envelope of an AVR. Maybe use that as a fancy intelligent converter?
 
Since this is an open collector protocol, and your goal is to minimize the number of parts to buy & hand solder, perhaps there's some way to implement it with tri-state buffers. Like connect the input to GND and use the tri-state enable as your signal. Maybe a 74AHCT125 part could do the 3 to 5V and a 74LCX125 part could to the 5 to 3V part?
 
Since this is an open collector protocol, and your goal is to minimize the number of parts to buy & hand solder, perhaps there's some way to implement it with tri-state buffers. Like connect the input to GND and use the tri-state enable as your signal. Maybe a 74AHCT125 part could do the 3 to 5V and a 74LCX125 part could to the 5 to 3V part?

Wow, that's brilliant!
 
@bmillier: thats' almost what i'm doing on my old board, but with a transistor. With trough-hole parts, this needs a lot of room on the board. I would have to test if the bss138 solution is good is this case.. and if i can use the boards.
@Nominal Animal: these chips don't like pull-up resistors < 50k
@Epyon: hm, how do i translate the 5 V from AVR to 3.3v?

@Paul: Great idea - but how would bi-directional work ? I don't get it... I think I need a bit more input :)
 
lvlshift125.png
like this ? (of course different ICs - ignore the"IC1")
 
@Frank. The Adafruit boards are tiny- 4 channels in about 0.6" X 0.6" package. I've used them, but not with O.C. Configuration with the max pull down current of 40 ma that you quote, worst case.
Paul's idea is fine for unidirectional, but, like you, I can't off the top of my head figure out how you could use it for a bidirectional line, lacking a direction control pin which you say you don't have.
 
I have also been following this thread, as I am also interested in playing with a board that supports two different types of servos:
Dynamixel - Half duplex I was using two chips for this 74LVC..126 and a ... 125. Will mostly go at 1mbs

But I may also support a servo by XYZ which has 4 wires full duplex. Spec says 5v... Not sure if 3.3v will work. So was thinking BSS138 on both RX and TX. Probably could go with other unidirectional converter but if I don't use these servos maybe want the +5v signals for other purposes. With the XYZ servos look like fastest baud is 115200

So again very interested in ideas for different level shifters.
 
@Frank. The Adafruit boards are tiny- 4 channels in about 0.6" X 0.6" package. I've used them, but not with O.C. Configuration with the max pull down current of 40 ma that you quote, worst case.
Paul's idea is fine for unidirectional, but, like you, I can't off the top of my head figure out how you could use it for a bidirectional line, lacking a direction control pin which you say you don't have.

Hi,

yes, i've verified this. I found a I2C levelshifter like this in my stock, removed both pullups and measured with external resistors. Looks like, the pull-up on the 3V side is not needed, if I use INPUT_PULLUP on the teensy.
So only two parts - the bss and one 1k pullup on the 5V side. 40mA is OK. I thought about using the boards - the ones you mentioned are a bit expensive.. i'd need two of them for my boards. On alixxpress, they are much cheaper, but take weeks to arrieve and all are different sizes.

- Is there a bss138 equivalent as through-hole part ?

If not, I'll use just SMD bss138 + resistors... not nice, but I *really* want to finish it now. I've spend too much time with this..

Edit: oops..still have to measure the speed - will do that asap.
Edit:With 1K (on 5V side) ~313ns , with 0.5k 167ns, 0.25k 83ns (rising edge) , falling edge 41ns -thats OK
 
Last edited:
Last edited:
Status
Not open for further replies.
Back
Top