2
\$\begingroup\$

I'm working on a synthesizer with multiple functionalities (OLED I2C screen, encoder, audio, midi input, several keys input) on a Xiao RP2040.

I wanted to add a PS2 keyboard input.

RP2040 GPIO are 3.3V logic voltage, so I started by adding a voltage divider on the PS2 keyboard clock and data (R1 = 15K, R2 = 33K) and it worked but the keyboard LEDs don't light when pressing corresponding keys. I learned that the PS2 protocol is bidirectional so it needs a bidirectional level shifter with MOSFETs.

The LEDs seem to work (except software library problems) and other periphericals also except for my resistor ladder with 7 buttons inputs. Only the 3 first buttons work.

What I don't understand is before, with the voltage divider, everything worked and now but the level shifter, all voltage seems OK (resistor ladder is 3.2V.)

I think there is something I don't know about the relation between current and voltage happening.

Schematic:

schematic

\$\endgroup\$
9
  • \$\begingroup\$ How does the PS/2 interface and your resistive ladder buttons relate to each other? Do they use the same pins? Or is this a software issue? \$\endgroup\$
    – Justme
    Commented Jan 4 at 12:47
  • \$\begingroup\$ They use mcu's different pins, they just share 3.3V voltage \$\endgroup\$
    – Sercurio
    Commented Jan 4 at 12:51
  • \$\begingroup\$ Then we need the schematics. The parts you show can't interfere so either the problem is elsewhere or there is an error so what you built does not match the schematics. \$\endgroup\$
    – Justme
    Commented Jan 4 at 12:53
  • 1
    \$\begingroup\$ Updated with schematic \$\endgroup\$
    – Sercurio
    Commented Jan 4 at 14:14
  • \$\begingroup\$ I'd suggest getting it working with an IC level shifter, since that will be dependable and won't require much analog experimentation. Only later, after you've got the firmware going, and still have time to mess with things, you can try to make it cheaper by using discrete mosfets. I bet you'll find it not worth your while, though. It'd need to be a fairly high volume product for it to make a useful difference. \$\endgroup\$ Commented Jan 4 at 18:13

0