Pages: [1]   Go Down
Author Topic: PS2keyboard library, teensy and usb keyboard with ps2 adapter  (Read 2167 times)
0 Members and 1 Guest are viewing this topic.
Zaragoza
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12465
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Rob Tillaart

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

Zaragoza
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12465
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Rob Tillaart

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

Zaragoza
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Zaragoza
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

Zaragoza
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: April 06, 2011, 04:14:23 am by xload » Logged

Melbourne, Australia
Offline Offline
Full Member
***
Karma: 1
Posts: 226
Cyborg-in-progress
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Zaragoza
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Zaragoza
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: