English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   Hardware mods (http://eab.abime.net/forumdisplay.php?f=105)
-   -   DIY PS/2 keyboard to Amiga 500? (http://eab.abime.net/showthread.php?t=75106)

Solo761 14 September 2014 16:25

DIY PS/2 keyboard to Amiga 500?
I've looked for diy adapter to connect PS/2 keyboard to A500 motherboard and I've found PIC based adapter, it can be found in epic1_2.lha and epic1_3.lha, that was made for PIC 16c84. And with a bit of googling I also found it's port to 16F84A.

I only have 16F628A chips so I've tried to port it. Since 16F628A has internal oscillator I've adjusted config declaration to use it and set other flags so ti would behave as close to 16F84A as it can.
I've done this once before with Tom Kirk's PS/2 Mouse to Amiga/Atari adapter. It too was for 16F84A but I successfully modified it to compile and work on 16F628A.

Basically I changed address of general purpose register to those of 16F628A and adjusted flags (config declaration)

In, this case I added


and changed

ScratchPadRam equ 0x0C


ScratchPadRam equ 0x20

here's the complete source


and here's schematic I made from schematic contained in lha files from aminet. I threw out R and C from RC oscillator since I planned to use internal one.


Above config declaration should make it use internal oscillator at 4MHz, in original schematic 16F84A uses RC oscillator. I also tried using slower internal oscillator at 48kHz (bcf PCON, 3), but it didn't make any difference.

It doesn't work, when I connect it to A500 and turn it on I get red screen (kickstart error?), then in few seconds it reboots by itself and I get usual kickstart screen (1.2 in this case, it's rev 5 board). PS/2 keyboard flashes it's leds and num lock stays on (I guess this is init done by it's controller, nothing to do with PIC). I tried loading WB to test it but none of the keys register

Any ideas what could be the issue? Has anyone made original schematic with 16F84A and can confirm it works? I've tried simulating it with Proteus suite and PIC powers on and stays that way, it doesn't do anything on it's pins so now I wonder if even original schematic works.

Solo761 17 September 2014 13:38

Managed to get it working in the end. I forgot to tie MCLRE pin to 5V so it remained in reset state. Adjusting MCLRE flag to off fixed this issue.

But original firmware still didn't work. There's an alternative from MMKeyboard pack, compatible with this schematic so I ported that from 16F627 to 16F628A and that did the trick, adapter now works and I can use cheap PS/2 keyboard with this A500 motherboard.

alenppc 17 September 2014 20:27

I don't have an A500 anymore, but maybe you can share these files here so that whoever wants to undertake the project has them available?

Solo761 18 September 2014 09:40

I have to sort it all first. One downside of original schematic (at least when it comes to A500) is that you loose power and floppy led. So yesterday I added LEDs to the schematic that should take care of that. But first I need to test if it works.

Also, I'm not sure if it's OK to share the firmware myself. It's available for download at http://www.geit.de/eng_mmkeyboard.html , with version 4.10 come firmwares for 16F84, 16F627 and 12F629 PICs. I've decompiled 16F627 version, adjusted it and recompiled it for 16F628A. That kinda makes it tricky :/.

Solo761 21 September 2014 14:27

1 Attachment(s)
I got permission to share these recompiled files so here's the whole pack.


Schematic and firmware files are attached.

alenppc 24 September 2014 16:31

Excellent! :)

danko 18 May 2015 22:09

Good job, do you have for sale an empty pcb?

Solo761 19 May 2015 08:34

Unfortunately no. I don't order them, I make them myself. So I made only few pieces I needed.

danko 14 June 2015 22:18


Originally Posted by Solo761 (Post 1020493)
Unfortunately no. I don't order them, I make them myself. So I made only few pieces I needed.

Ok,USB to A500 is possible?

Solo761 15 June 2015 09:40

I'd say no, in mouse world some use PS/2 over USB so they can be used with those cheap ps/2 to amiga adapters, but for keyboards I'm not sure if there are some that also use PS/2 protocol over USB

GhstWlf 15 June 2015 10:02

There are microcontrollers that support USB host like the pic32mx270f256b. It would need a voltage regulator and interface chip since it is a 3.3v device and the AMIGA is 5v. So it is possible.

MrFluffy 15 June 2015 10:27

danko, are you asking about usb mouse to amiga 500 or usb keyboard onto the pin headers inside the a500 motherboard?

Solo I ask danko just to clear up the question how it reads to me. I read this because I am considering making a broken a500 into a new casing as a project...

danko 15 June 2015 10:30

Hi, usb keyboard to a500.

Solo761 15 June 2015 10:47

Yup, but someone would have to write the firmware :), plus this PIC costs few times more than the one used here. This was simply old project that I recompiled to work with PIC that is now more common than the one originally used.

Few months back there's been an attempt to make USB mouse/gamepad to Amiga adapter, from what I heard it works but not very well, plus it's a bit pricey.

pandy71 16 June 2015 23:55


Originally Posted by Solo761 (Post 1025619)
Yup, but someone would have to write the firmware :), plus this PIC costs few times more than the one used here.

USB hub (low speed) with KB/Mouse to UART translation - all in software on plain AVR (no HW USB)

xArtx 10 December 2015 18:42

Hi Solo761 :)
If you back right up to the start of the thread, the original 16F84A source you have tried to use for 16F628A,
Do you know if that is given away free (or GPL, etc)? There are no notes left in the source.
I would assume so since the source is released.

It would be nice to free that up again, since not everything is being given away nowadays.
It is easier to find a hex file without commented source or something for sale.

It’s evident the code uses PortA for the Amiga keyboard, and here are the bits:

Aclk        equ    0x4
Adat        equ    0x3

Now for 16C84/16F84(A), all pins are digital, but for 16F628A extra peripherals were introduced,
including ADC converters, so PortA has pins on portA that are by default, analogue:


and have to be switched digital by setting CMCON register:

movlw        0x07
movwf        CMCON

PortA bit 3 (Amiga keyboard data) is one of these.

It does look like you have accommodated the memory map and used RAM from location 0x20,
so I think the two extra lines will compile and run the original commented code.
If it is still convenient to try that I’d be interested to hear, but will do it in a little time myself anyway.
The schematic can be derived from the source code,
and possibly an updated complete project put back together.
Cheers, Art.

xArtx 13 December 2015 11:02

Just to confirm the original commented source does compile and work fine with
those two lines added under the “start” label in the source code.

If someone were making this in future they might prefer to use commented source
rather than a disassembly.

Now that Aminet is up again and the links work I can see the author, etc.
Cheers, Art.

xArtx 14 December 2015 10:22

And on the way :) ....

Dual Keyboard:

Dual Mouse:

chapas 18 June 2016 19:19


Originally Posted by Solo761 (Post 976962)
I got permission to share these recompiled files so here's the whole pack.


Schematic and firmware files are attached.

Thanks for the files Solo761,
i have assembled it on a breadboard and unchecked MCLR before programing the PIC.
I have 5V coming out of the PIC to the AMIGA 500 Rev 6A (CLOCK and DATA), i can see the key strokes going from the PS2 Keyboard in to the PIC, but not getting out.

Can you help?


chapas 19 June 2016 02:01

Never mind, I assume to much, i read above that you disabled MCLR on the config and followed the hit on the filename, so i did that before programing and i did not work. I gave it another try without touching anything and it's working right now. Thanks.

All times are GMT +2. The time now is 17:43.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.

Page generated in 0.06016 seconds with 11 queries