Go Down

Topic: PS2keyboard library, teensy and usb keyboard with ps2 adapter (Read 2953 times) previous topic - next topic

xload

I'm working on a proyect that need read the keys from an usb keyboard with teensy and PS2keyboard library, really a modified PS2keyboardExt library to work with teensy , when I plug a native ps2 keyboard all works well, but when i plug a converted usb to ps2 keyboard i can't read anything, but if I plug this converted usb to ps2 keyboard to a computer it works.


Somebody can help me? i think that the keyboard must be set in "ps2 mode" by software, but i don't know how do it.

robtillaart

Do you get any signal with the "USB " keyboard on a scope ?

Maybe the data is fed through the mouse pin?
see - http://pinouts.ru/InputCables/usb_ps2_mouse_pinout.shtml -
and - http://www.burtonsys.com/PS2_keyboard_and_mouse_mini-DIN-6_connector_pinouts.html
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

xload

I'm using the usb to ps2 adaptor that came with the keyboard (I checked the wiring of adaptor and is these http://pinouts.ru/InputCables/usb_ps2_mouse_pinout.shtml) when I plug to a computer with the adapter it works well, but not when i plug to the teensy.

If I plug a PS2 native keyboard to teensy all works well.

it's possible that usb keyboards don't auto detect that are plugged to a ps2 port and works in usb mode? they will need a special initialization protocol?

robtillaart

Quote
it's possible that usb keyboards don't auto detect that are plugged to a ps2 port and works in usb mode?

They are allways in a USB mode.

The PS2 port is another subsystem than the USB. The converter cable should handle the diffs.

Quote
they will need a special initialization protocol?

Not that I know
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

xload

I will try with different keyboards this afternoon and post the results, is possible that these keyboard is a strange keyboard.

xload

when I plug a ps2 to usb adapted keyboard i only recive send 0xAA value in teensy, but if I plug the adapted keyboard to a computer works well...

xload

#6
Apr 06, 2011, 11:06 am Last Edit: Apr 06, 2011, 11:14 am by xload Reason: 1
I think that I found the problem!!!

I read this pdf ,sorry, in Spanish http://picmania.garcia-cuervo.net/recursos/teclado_at-ps2_interfaz_y_funciones_v1.2.pdf at page 29 (marked as 23), first paragraph tell that a constant 0xAA flow with incorrect parity bit is sent froom the keyboard to computer waiting for a "incorrect parity" 0xFE message from computer to cheack that teh computer is on.

Now I will try to modify the Ps2KeyboardExt2 library to check the parity bit and reply with 0xFE to the keyboard.

Also I'm thinking in send a RESET comand 0xFF beacuse when do a sofware reset do not send a a constant 0xAA flow.

Jonathan Oxer

That's interesting. Perhaps it's only some keyboards that need it: I've definitely had it working with a USB keyboard and adapter so *some* keyboards work with the library as-is, at least.

Have you tried it yet? I'd like to know the outcome.
--
Jon
Arduino-compatible with built-in Ethernet, coming soon: www.freetronics.com/etherten

xload

All native ps2 keyboards that I tested works well (6 keyboards), and the only two usb gave to me a constant 0xAA flow.

I'm planing modifiy the ps2interrupt function and if receive 0xAA with incorrect parity automatically return 0xFE to the keyboard, any ideas? reading the source code ps2Keyboard_CurrentBuffer only seems to be the data of the keyboard, not the entire value read  from keyboard.

xload


That's interesting. Perhaps it's only some keyboards that need it.


I think that's a dirty method to check the computer is on and BIOS is driving the keyboard.

Go Up