Electronic – Open collectors & 74LVC245

3.3v5vlevel-shiftingmsp430open-collector

I am trying to interface a PS/2 keyboard to a MSP430 for a toy. The PS/2 keyboard runs off 5V, but the MSP430 microcontroller runs off 3.3V. So I have a 74LVC245 level shifter to convert between the two.

Now I have this, however, I have discovered that the PS/2 keyboard interface uses open collector signals, so that they can be driven from either end, and apparently using a 74LVC245 with these is complicated. This is the first time I've met such a thing; I'm mostly a software guy.

I'm not interested in sending commands TO the keyboard, only in receiving commands FROM the keyboard, so I never need to drive the data and clock lines from the microcontroller end. Is it sufficient simply to tie the keyboard signals to Vcc via a (large) pullup resistor, so that they stay high when the keyboard's not driving them (this is required by the protocol; if they're not high, the keyboard won't send). But this means that when the keyboard tries to bring the lines low, it's driving against the resistor, and I don't know what the implications of this are. And I don't know whether the 74LVC245 itself has its own pullup/pulldown resistors in the inputs.

Is this a good idea? If not, why, and is there any way I can make this work without having to build a proper driver circuit with resistors?

The 74LVC245 datasheet is here, for reference: http://www.adafruit.com/datasheets/sn74lvc245a.pdf

Best Answer

This is just an $0.02 thought, and not necessarily an answer.

Level shifting of a bi-direction open-collector signal sometimes is done in I2C bus. There are specialized level shifter ICs for I2C, such as PCA9306, which you could try to adopt for PS/2. There's another method, where level shifting is done with a MOSFET connected like this

enter image description here

This picture shows level shifting of 2 separate lines (obviously). More details in this app note by Philips (now NXP).