Page 1 of 1

PS/2 to USB converter

Posted: Thu Apr 22, 2010 10:11 pm
by wireframewolf
Hey all. I'm trying to use V-USB to create a PS/2 (technically an AT socket) to USB converter for an old Model M knockoff I have. There are two reasons I'm not just spending $5 to buy one off of ebay:

1. This is practice for another similar V-USB project I have in mind.
2. I want to convert the second alt key into a windows/apple key, since this old keyboard has neither

I already know that I can read the keyboard's signals via a PS/2 keyboard project for the arduino, and I figured it shouldn't be hard to couple that code (With modification of course) with the V-USB code to build an adapter, but I since I don't know much about microchips, I got to wondering if the fact that both the keyboard and the USB library work via interrupts would cause a conflict. Obviously the point of an interrupt it to facilitate time-critical actions, and it occurred to me that if say, the USB interrupt triggered while the PS/2's clock interrupt was trying to do its thing, there could be an issue.

Any thoughts on this? It might be obvious to some of you, but I am very new to programming at this low a level.
And I might as well ask if anyone has done a ps/2-to-usb adapter project before. I couldn't find a project quite like that, but if anyone has some helpful code to share, it would be much appreciated.

Thanks for taking the time to read.
-Wireframewolf

Re: PS/2 to USB converter

Posted: Fri Apr 23, 2010 7:12 pm
by maxi
Hi, I've not looked at the Adruino keyboard code but I would guess it should be ok. AFAIK the only thing you need to be careful of regarding interrupts is not use any interrupt lower (higher priority) than that which is used for the usb data line (usually INT0 anyway). The really inportant thing as far as V-USB goes is to ensure that usbPoll() gets called at least once every 50ms.

Be sure to check out the documentation wiki and community projects pages.

Edit: You might also want to read the Atmel application note AVR313 http://www.atmel.com/dyn/resources/prod_documents/doc1235.pdf