geekhack
geekhack Projects => Making Stuff Together! => Topic started by: keru on Wed, 13 January 2016, 11:14:21
-
Hi,
I'm trying to make the tmk firmware with the chibios port (https://github.com/flabbergast/tmk_keyboard/tree/chibios) work with a PS/2 device.
My main goal will be to use it with a trackpoint, but since I am not sure of the pinout, I am currently trying with an old PS/2 mouse. This way I can debug and make sure my PS/2 thread works with known pinouts.
I added a ps2_io_chibios.c and adapted the other files to work with chibios. I made sure those adaptations work with debugging and implementing a joystick mouse that works.
Now, my PS/2 thread runs, and I get past the mouse initializing, but the mouse replies 0003 and 0002 which doesn't look like anything in the specs.
On the wiring side, do I need to connect the data and clock lines to the 5V with some resistors or should I just plug them on the corresponding pins ?
Thanks,
Keru.
-
So I tried adding a resistor between the from data and clock to VCC, and I still get the same :
ps2_mouse_init: send Reset: 0003
ps2_mouse_init: read BAT: 0001
ps2_mouse_init: read DevID: 0001
ps2_mouse_init: send 0xF0: 0003
then it always prints
ps2_mouse_task: received packet from mouse
0003
*EDIT* : I found that the 0003 and so on are not the received messages, but an error regarding the part waiting for the clock to be at a certain state. I tried changing pins, adding a pullup resistor, setting the input with pullup or pulldown, but no luck.
here are the parts : https://github.com/abondis/tmk_keyboard/blob/a18defcc49a5b6f46a0da50298e4d3cda272c1d1/tmk_core/protocol/ps2_io_chibios.c and https://github.com/abondis/tmk_keyboard/blob/abondis_atreus_joystick/tmk_core/protocol/ps2_busywait.c