TGB1718 Posted November 17, 2020 Share Posted November 17, 2020 I've been toying with the idea of using a USB keyboard with my 800 and 130XE, 2 reasons, as they get older, the more use, the more likely the keyboard will eventually give up the ghost, secondly for me it's a bit awkward to use the real keyboard due to the location (basically I can't sit at the keyboard), but the USB one can sit on my lap. So I started working on using an Arduino UNO with a USB HAT (I already had one that I use on my USB Joystick). I modified the Joystick code to read the key codes of a USB keyboard and map those keys to the internal key codes of the A8. It then sends 3 x 3 bit packets to the A8 Joystick Port 2 (low 3 bits, then mid 3 bits and then SHFT/CNTL bits). It handshakes with the TRIG input to flag a code is ready, the A8 handshakes with bit 7 of PORTA set as an output. On the A8 I wrote a VBI routine that places itself just above LOMEM and adjusts LOMEM to preserve the code area, the code survives a WARM Start. Obviously you can't use the keyboard with any games due to the VBI code, but for anything else it seems to work fine, I've given it a test run in BASIC and MAC/65. I can keep it attached and use the normal keyboard if I need it for games. I think I've managed to map most keys, but still a bit more testing to make sure. The code on the A8 is only 390 bytes, so uses very little memory. 2 Quote Link to comment Share on other sites More sharing options...
foft Posted November 17, 2020 Share Posted November 17, 2020 The next step is to wire it to k0-k5 and kr1/2 on pokey. If you have the usb- key code done then you are most of the way there. Is the arduino fast enough to track the keyboard scan while still polling usb? 1 Quote Link to comment Share on other sites More sharing options...
+Stephen Posted November 17, 2020 Share Posted November 17, 2020 Man - you get that working you'll sell a bunch! Quote Link to comment Share on other sites More sharing options...
candle Posted November 17, 2020 Share Posted November 17, 2020 USB keyboard interface is part of simplestereo v3 & v4 boards (you can also use regular PS/2 or even IKBD (Atari ST/TT) keyboards), there will be also stand-alone version provided there are quite few gotchas when doing this, but this is pretty strainght forward once you have USB host stack ready 1 Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted November 17, 2020 Author Share Posted November 17, 2020 16 minutes ago, foft said: The next step is to wire it to k0-k5 and kr1/2 on pokey. If you have the usb- key code done then you are most of the way there. Is the arduino fast enough to track the keyboard scan while still polling usb? Didn't set out to make internal mods, but now you've gone and put an idea in my mind Not sure about the Arduino being fast enough, it's running at 16MHz and has little to do but run my code, so it may be quick enough, the way I'm using at the moment it's fine. 6 minutes ago, candle said: USB keyboard interface is part of simplestereo v3 & v4 boards (you can also use regular PS/2 or even IKBD (Atari ST/TT) keyboards), I thought maybe someone else had done a USB interface, but it was just a little project for me Quote Link to comment Share on other sites More sharing options...
candle Posted November 17, 2020 Share Posted November 17, 2020 by all means please continue! there is a lot to be learned by doing this - especially about how funny USB HID class can be implemented by some keyboard manufacturers in some keyboard models filling reports bacwards, out of order, etc Quote Link to comment Share on other sites More sharing options...
Stephen J Carden Posted April 11, 2021 Share Posted April 11, 2021 On 11/17/2020 at 12:52 PM, TGB1718 said: I've been toying with the idea of using a USB keyboard with my 800 and 130XE, 2 reasons, as they get older, the more use, the more likely the keyboard will eventually give up the ghost, secondly for me it's a bit awkward to use the real keyboard due to the location (basically I can't sit at the keyboard), but the USB one can sit on my lap. So I started working on using an Arduino UNO with a USB HAT (I already had one that I use on my USB Joystick). I modified the Joystick code to read the key codes of a USB keyboard and map those keys to the internal key codes of the A8. It then sends 3 x 3 bit packets to the A8 Joystick Port 2 (low 3 bits, then mid 3 bits and then SHFT/CNTL bits). It handshakes with the TRIG input to flag a code is ready, the A8 handshakes with bit 7 of PORTA set as an output. On the A8 I wrote a VBI routine that places itself just above LOMEM and adjusts LOMEM to preserve the code area, the code survives a WARM Start. Obviously you can't use the keyboard with any games due to the VBI code, but for anything else it seems to work fine, I've given it a test run in BASIC and MAC/65. I can keep it attached and use the normal keyboard if I need it for games. I think I've managed to map most keys, but still a bit more testing to make sure. The code on the A8 is only 390 bytes, so uses very little memory. When CrazyBonz and I built our first AKI we fouse many software bugs in the scan code for USA keyboards one of the bug that was really bad was when you pressed the "." you would get the comma. The is when I redid the pic software and we now call it the KRH. But here is my point there are several keyboards that will plug right into the pc port of the AKI or KRH and work fine. Some of these keyboards also work in USB mode. I have a Kensington keyboard that hooks right in and work in wireless mode. at the moment there pc keyboard to atari hardware going back to the mid 80's. here is a list of the hardware I know about. Transkey made in the mid 1980's AKI which is a good upgrade. KRH our version of the AKI with fixed US keyboard scancodes. KRH2 TransKey II TranskeyII for the Atari Game System. Mike was nice enough to build me a transkeyII that also has Dual Pokey, and Switch in it. I was up on Lotharek Web site and I saw he now has some keyboard versions. I still want to see what you code up with so do not give up. Make it happen. Stephen J. C arden Quote Link to comment Share on other sites More sharing options...
BillC Posted April 17, 2021 Share Posted April 17, 2021 (edited) On 4/11/2021 at 4:44 PM, Stephen J Carden said: AKI which is a good upgrade. I was up on Lotharek Web site and I saw he now has some keyboard versions. Lotharek has a version of the AKI updated to USB. https://lotharek.pl/productdetail.php?id=311 Edited April 17, 2021 by BillC 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.