Jump to content
znac049

PS2 keyboard for Atari 8-bits

Recommended Posts

Hi,

 

Not sure if there is any interest in this sort of thing, but I've just got a PS2 keyboard connected to the keyboard interface in my 65XE (via an Arduino) while I look into getting my Atari keyboard fixed. I can see that adapters like this have been available in the past, but as far as I can tell, are no longer. I'm in the process of laying out a board that would tidy everything up and minimise the number of wires that would need soldering onto the mainboard. The code works really well, and I've put it up on Github if anyone is interested: https://github.com/znac049/XEKeyboard

 

I started the project as a bit of fun for my own benefit but I'd be interested to know if there is any wider interest in this. I've started laying out a PCB and will get an initial run of ~10 boards made up, so if anyone wants one, I'd be happy to oblige. Just let me know.

 

The adapter should work in pretty much any 8-bit atari.

 

-Bob

 

 

  • Like 5

Share this post


Link to post
Share on other sites

Interesting! I haven't dived into arduino yet myself, but I wonder if with the popularity and abundance of arduino based boards, if it might eventually be cheaper than other available options? More options are always good regardless :)

 

One that comes to mind is dropchecks ps2+dual pokey combo in the $45-50 USD range.

 

https://www.bitsofthepast.com/?product=tk-ii-stereo-bundle-pre-order

Share this post


Link to post
Share on other sites

Interesting! I haven't dived into arduino yet myself, but I wonder if with the popularity and abundance of arduino based boards, if it might eventually be cheaper than other available options? More options are always good regardless :)

 

Yes I agree more options are always better, but I think if there were to be yet another keyboard option that it should be USB if at all possible. Sure makes things a lot easier from a wireless standpoint, as well as having a lot of possibilities in that arena to choose from. Even better still, would be if it could also provide for a USB-to-ST mouse aspect for plugging into the joystick port (also thinking for better wireless support).

 

However to base it on an arduino instead of a discrete microcontroller chip adds both cost and size issues. For instance if you look at the TK-II's PIC16F1847 chip it only cost $1.75 in single quantities and is pretty darn small. So it makes for a very compact an inexpensive package. Below are examples of an Arduino UNO and what I have developed (which could likely be made even smaller still).

 

A000066_SPL.jpg2868248_orig.png

 

Using even the smallest arduino board would still start out life at least the size of the TK-II-XEGS (actually much larger if I'm seeing this correctly), and then need to grow in order to have the connectors and such that are needed for interfacing. But from a development aspect, the break-out boards are the way to go.

 

znac049 if you do decide to pursue this, it would be nice to have it be compatible with the TK-II's key mapping, because I don't think we need yet another different keyboard layout to get confused by ;) . Please check out the link that DrV gave you or just click on the one in my signature to see what already exists.

 

Nice to see a fellow Atari hardware developer :) .

 

- Michael

  • Like 3

Share this post


Link to post
Share on other sites

Thanks for all the replies. I hadn't come across the TK-II before and it certainly looks like it does the job. My problem with it, and it's not very rational, is that I really, really don't like PICs, which is the microcontroller it uses. I much prefer the ATMEL ATMegas used by most Arduinos. Like I say, not very rational. I feel the same way about Z80s, btw :)

 

mytekcontrols, you are right about the size of the Arduino boards being on the large side. That's why I'm designing a board that just uses the ATMega328 device directly and won't need an Arduino. It will end up a similar size to the TK-II. Compatiibility with the TK-II mappings shouldn't be an issue.

 

I like the idea of USB instead of PS2. The pain is that it would need a USB host controller chip and to my knowledge, those things are only available in SMD packages, making it harder for anyone who wanted to self assemble. I've used one in the past and they are easy enough to interface with the Arduino, though require considerably more code to get them to work. The device I used was the MAX3421E and I think they come in at about £3.50/$5.00 for a single part - about twice the cost of the ATMega328! I think I have a shield somewhere (used it to control my DSLR) and see if I can get it hooked up.

 

Hmm, plenty of food for thought.

 

-Bob

Edited by znac049
  • Like 2

Share this post


Link to post
Share on other sites

Hi Bob,

Good to see you are only using the development or break-out board for testing. Sorry you don't like PICs and I can understand why in some regards, but it always comes down to what you are most familiar with and/or already have the tools for. I could go either way if I wished to invest more time and money to get there. I'm already programming in a very high level visual language called flowcode, which I could update to a version that works with ATMEL chips, but not worth spending the money to do so for me. Anyway doesn't matter which chip you decide to use, so long as the cost is reasonable, which it is in either case.

My reason for suggesting that you look into USB other than the the ones I already mentioned, has more to do with "is there a need for yet another PS2 version?" My stuff is already developed, open source, and being used. And you might not be aware that their is also a previous project to mine called the AKI that was developed by a guy over in Germany, and it too was a PS2 to Atari Keyboard Interface (that's what the initials stand for). So there already exist a couple of different approaches using the same interface. Hence it might be time for a new twist on this keyboard interface thing. And USB would certainly make a lot of people quite happy, as well as open up new possibilities in the wireless arena.

My project is done other than the occasional firmware update to fix any bugs that crop up. The AKI is not under active support and improvements stopped quite a few years ago, with no source code being available (however there is firmware and schematics for it, and some 3rd party tweaks to each). So if you are still in a development mode, and haven't done a PCB layout and/or haven't had any boards made, it would seem like a good opportunity for introducing a more modern interface. Granted it is more work and adds a bit of extra cost, but I believe the extra cost would not deter people from wanting it. I even kicked this idea around myself, but had too many other things I wanted to do even more and didn't feel like investing the time.

But with all that said, if you are doing this out of pure enjoyment and/or have a PS2 version nearly ready to launch, by all means do so. People love to have options :).

- Michael

  • Like 2

Share this post


Link to post
Share on other sites

This was probably already answered somewhere, but are there any USB Keyboard to PS2 interface adapters that actually work?

Share this post


Link to post
Share on other sites

This was probably already answered somewhere, but are there any USB Keyboard to PS2 interface adapters that actually work?

They exist, but not cheap. https://www.cdw.com/product/Black-Box-USB-to-PS-2-Converter-keyboard-mouse-adapter/1867378?

 

Some KVM's will also convert USB to PS/2. I have a Belkin that supposively does this, but I need to buy the PS/2 cable...

Share this post


Link to post
Share on other sites

Michael et al.

 

So I dug out a USB host shield and did a quick proof of concept. I can reliably detect USB keyboards with an Arduino and get key press/release callbacks out of the USB library, which basically means this is doable. Still a long way to go before it becomes something people might want to build for themselves, but projects like this are mostly about the journey, right? I'll use the same github repository as above for the new code, but its on the 'usbmaster' branch, if anyone wants to look at it.

 

I'm doing the hardware design now and while it's still relatively simple, it does involve 5v and 3.3v devices coexisting, so extra voltage regulation will be needed and level converters. I use Kicad for schematic editing and board layout so I'll add that to the github repo as soon as I have something that I think might fly. As I think I mentioned, the USB host controller device (MAX 3421E) is only available as a surface mount part which will make assembly harder. Still, I've been wanting to try my hand at surface mount for some time now.

 

Once I have an initial design, I'll get some POKEY piggyback boards made and see where that goes. I'm based in the UK and will source boards from China (cheap but not very fast - four to six weeks).

 

Oh, I forgot to say, I tested my code with a few different USB keyboards, including wireless and they all behaved the same. Imagine that - a nice wireless keyboard talking to your Atari 8-bit :)

 

I'll post updates here as I have them and would welcome any thoughts or ideas you folks might have. When the code is a bit more stable, I'd welcome feedback on it; similarly for the schematic and pcb design.

 

One last thing - I'm not looking to make money out of this - it's all open source and hardware.

 

-Bob

  • Like 4

Share this post


Link to post
Share on other sites

Michael et al.

 

So I dug out a USB host shield and did a quick proof of concept. I can reliably detect USB keyboards with an Arduino and get key press/release callbacks out of the USB library, which basically means this is doable. Still a long way to go before it becomes something people might want to build for themselves, but projects like this are mostly about the journey, right? I'll use the same github repository as above for the new code, but its on the 'usbmaster' branch, if anyone wants to look at it.

 

I'm doing the hardware design now and while it's still relatively simple, it does involve 5v and 3.3v devices coexisting, so extra voltage regulation will be needed and level converters. I use Kicad for schematic editing and board layout so I'll add that to the github repo as soon as I have something that I think might fly. As I think I mentioned, the USB host controller device (MAX 3421E) is only available as a surface mount part which will make assembly harder. Still, I've been wanting to try my hand at surface mount for some time now.

 

Once I have an initial design, I'll get some POKEY piggyback boards made and see where that goes. I'm based in the UK and will source boards from China (cheap but not very fast - four to six weeks).

 

Oh, I forgot to say, I tested my code with a few different USB keyboards, including wireless and they all behaved the same. Imagine that - a nice wireless keyboard talking to your Atari 8-bit :)

 

I'll post updates here as I have them and would welcome any thoughts or ideas you folks might have. When the code is a bit more stable, I'd welcome feedback on it; similarly for the schematic and pcb design.

 

One last thing - I'm not looking to make money out of this - it's all open source and hardware.

 

-Bob

 

Check out ALLPCB for boards. Ships quick with DHL, and last time I used them shipping was free (although that might have changed). Also up to 10 small 2-layer boards only cost $2 at the time (although that too might have been a limited offer).

 

Glad to see you pursuing the USB idea :thumbsup: :) .

 

- Michael

  • Like 2

Share this post


Link to post
Share on other sites

If you want / need help beta testing, I'll gladly help with a USB to A8 keyboard interface. I have a dedicated mechanical keyboard PS/2 keyboard (Focus 2001) for my 1088XEL. But I also have several backlit mechanical keyboards which I would love to use on the A8.

Share this post


Link to post
Share on other sites

Hi Bob,

 

Very nice project. I tried to open KICAD file from GitHub repo and I saw the warning: "The following libraries were not found: BobsDevs". Could you please add missing libs?

 

Regards,

pancio

Share this post


Link to post
Share on other sites

Wireless USB keyboard for 8 bit atari would rock!

 

Is this only planned for xegs? Id be keen to see this as an internal 800xl mod with orIgnal keyboard attached and still working.

 

A wireless joystick port interface that communicates with modern Bluetooth joysticks would be a fine companion too.

 

As I have no skills or expertise in this area I can only dream and wish.

 

Good luck with this great project!!!

Share this post


Link to post
Share on other sites

didn't SJC's keyboard adapter do wireless keyboards... not sure how much success there has been with the new 1088XEL will but I don't see why it couldn't or can't. If we did do thins the one thing everybody does that ruins these things is picking the cheapest or lag inducing device with the idea it won't make a difference because the Atari isn't as fast as a 'modern' machine, the better device is MORE crucial because a missed scan or beet has an amplified effect. So many great things created over the years failed because of this. After that happens few people try again, because it's been done and it failed. The failure was not the Idea or the Atari. It was the device used in the design.

Share this post


Link to post
Share on other sites

didn't SJC's keyboard adapter do wireless keyboards...

I believe you are referring to his KRH project, which was simply a minor change to the AKI, using a different chip, and substituting a couple of key codes in the English key map. Still PS2.

 

Edit: it did work with a wireless PS2 keyboard, but those are far and few between, and are based on clunky, big, low frequency RF receivers. With USB you get to use those tiny little 2.4Ghz dongles.

  • Like 3

Share this post


Link to post
Share on other sites

Hi Bob,

 

Very nice project. I tried to open KICAD file from GitHub repo and I saw the warning: "The following libraries were not found: BobsDevs". Could you please add missing libs?

 

Regards,

pancio

Hi Pancio,

 

I will sort out the missing library, though I will probably create a new library with just the parts needed. I'll try to do that in the next couple of days. The schematic is evolving fast so do pull frequently.

 

-Bob

Share this post


Link to post
Share on other sites

Wireless USB keyboard for 8 bit atari would rock!

 

Is this only planned for xegs? Id be keen to see this as an internal 800xl mod with orIgnal keyboard attached and still working.

 

A wireless joystick port interface that communicates with modern Bluetooth joysticks would be a fine companion too.

 

As I have no skills or expertise in this area I can only dream and wish.

 

Good luck with this great project!!!

 

The hardware I own is a 65XE, so I guess that's my initial target. Obviously that means it will work with the 130XE as well. I think though that all Atari 8-bits have the same keyboard interface circuit, based mostly around the POKEY which means it should work with them all. To be honest, though, I haven't consulted all the schematics for all Atari 8-bits so can't say that for sure. Part of the development will be doing that research and trying to find willing A8 owners to try it out on their hardware.

 

You mentioned the 800XL and I'm pretty certain that the 65XE is essentially just a rebranded 800XL, so I'd be really surprised if this didn't work. Still, it wouldn't be the first time in my life I've been surprised!

 

While I hope the circuit should be the same for all A8s, how it's installed will vary from system to system. The basic idea is that the board will plug into the POKEY socket and the POKEY will plug into the board. If you're unlucky, this may involve desoldering your POKEY and fitting a socket. The board will also have a small number (4 or 5) wires that need soldering on to various points on your Atari. I'm sure there will be reasons why that approach won't work in all A8 systems and if that's the case, we may need model specific variants of the board, but obviously I'd want to keep that to a minimum. The first job though is to take my working Arduino hardware and turn it into a custom PCB for my 65XE. Once that's done, we'll see what the next step is: revise the board/make available as-is/something else.

Share this post


Link to post
Share on other sites

didn't SJC's keyboard adapter do wireless keyboards... not sure how much success there has been with the new 1088XEL will but I don't see why it couldn't or can't. If we did do thins the one thing everybody does that ruins these things is picking the cheapest or lag inducing device with the idea it won't make a difference because the Atari isn't as fast as a 'modern' machine, the better device is MORE crucial because a missed scan or beet has an amplified effect. So many great things created over the years failed because of this. After that happens few people try again, because it's been done and it failed. The failure was not the Idea or the Atari. It was the device used in the design.

 

I agree that cheapest isn't always best and much prefer "simplest is usually best" myself. Where I do find myself disagreeing with you is that one failure to solve a problem or a bad implementation prevents future attempts. That's not been my experience and it would be a bit depressing if it did. To me, being told that something can't be done because we tried and it failed just makes me want to proved that it can be done, and done well. Dwelling on past failures only has value insofar as an understanding of why they failed can help future developments.

 

Still, that's probably a bit too much philosohpy for this thread :)

 

-Bob, standing on the shoulders of giants!

  • Like 2

Share this post


Link to post
Share on other sites

 

Check out ALLPCB for boards. Ships quick with DHL, and last time I used them shipping was free (although that might have changed). Also up to 10 small 2-layer boards only cost $2 at the time (although that too might have been a limited offer).

 

Glad to see you pursuing the USB idea :thumbsup: :) .

 

- Michael

 

Thanks Michael, ALLPCB looks pretty good.

  • Like 1

Share this post


Link to post
Share on other sites

Just a little info that might help...

 

Interfacing to Pokey's KR inputs and syncing to its key scan counter will work on all Atari 8-bit computers, and produce the same results. So in other words, from an electronic design point of view you're only looking at one design to be compatible with every A8.

 

If you wish to still be able to use the internal keyboard simultaneously, then an open collector methodology should be implemented for the KR inputs. This can be done by switching the I/O lines of the microcontroller to inputs when not actively trying to send key code information to Pokey (TK-II) or by the use of blocking diodes (AKI/KRH).

 

Two A8 models (XEGS and 1200XL) have complete key scan circuitry implemented in the keyboard circuit board, including the KR pull up resistors. So if not attached, and no pull-ups for the KR lines are used on the microcontroller board, you will get ghost key presses when not asserting active control (not leaving microcontroller I/O set to outputs). So either a secondary pull up for each KR input needs to exist on the microcontroller board, or a means to switch from active to float needs to be established to accommodate the possibility of the stock keyboard not being used for those A8 models. TK-II has an EEPROM bit that can be toggled via a unique multi-key press that changes the selection between float and always active for the I/O (the EEPROM allows the selection to be restored upon power-up). This eliminates the need for the two secondary pull up resistors, but it does add complication in the code, and for the user, whereas implementing secondary pull ups keeps things simple and automatic.

 

Hopefully you find this information useful.

 

- Michael

  • Like 4

Share this post


Link to post
Share on other sites

Hi Michael,

 

Thanks for the info - saved me a lot of checking. I'd thought I'd pass the onboard KR1/2 signals through the AVR (there are spare inputs) but maybe that's overkill and simple open collector solution makes more sense.Good to know about the XEGS and 1200XL keyboards; I'll have a think about that. It might be a good excuse to buy one so that I can properly test it :)

 

Thanks for the time you've taken to share your knowledge and ideas. Hopefully it will mean a better solution at the end of the day.

 

-Bob

Just a little info that might help...

<stuff deleted>

Hopefully you find this information useful.

- Michael

  • Like 1

Share this post


Link to post
Share on other sites

Well, just to keep folks interested, here's a couple of photos of the Arduino prototype, showing a wireless USB keyboard working with the 65XE. I've got all of the keys mapped now.

 

https://1drv.ms/i/s!AjMVYTGVtR6KiegH3WE8prWWv54rGg

https://1drv.ms/i/s!AjMVYTGVtR6KiegIF3GTrTCCAe5G8A

 

I hope to have a schematic I'm happy with in the next few days and will put that up on Github as a PDF, as well as Kicad files. I'm also learning a lot about SMD packaging types - SOIC/SSOP/TSOP etc. Looks like a bit of a minefield so I'm paranoid I'll put the wrong package types on the board.I've also ordered up a bunch of parts, including MAX3421Es, ATMEGA328Ps, crystals, 3.3v regulators and so on. I thought I'd better do that as it's all coming from China, and usually takes a few weeks.

 

-Bob

  • Like 3

Share this post


Link to post
Share on other sites

I'm hoping this is working by the time I get to the end of my 1088XEL builds so I can use it for them :thumbsup:

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...