English Amiga Board


Go Back   English Amiga Board > Support > support.Hardware > Hardware mods

 
 
Thread Tools
Old 14 September 2014, 16:25   #1
Solo761
Registered User
 
Join Date: Aug 2013
Location: Croatia
Age: 43
Posts: 341
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

__CONFIG _MCLRE_ON & _WDT_OFF & _INTOSC_OSC_NOCLKOUT & _LVP_OFF & _PWRTE_ON & _CP_OFF & _BOREN_OFF

and changed

ScratchPadRam equ 0x0C

to

ScratchPadRam equ 0x20

here's the complete source

http://pastebin.com/GEqWgBKW


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 is offline  
Old 17 September 2014, 13:38   #2
Solo761
Registered User
 
Join Date: Aug 2013
Location: Croatia
Age: 43
Posts: 341
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.
Solo761 is offline  
Old 17 September 2014, 20:27   #3
alenppc
Registered User
 
Join Date: Apr 2012
Location: Canada
Age: 44
Posts: 910
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?
alenppc is offline  
Old 18 September 2014, 09:40   #4
Solo761
Registered User
 
Join Date: Aug 2013
Location: Croatia
Age: 43
Posts: 341
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 is offline  
Old 21 September 2014, 14:27   #5
Solo761
Registered User
 
Join Date: Aug 2013
Location: Croatia
Age: 43
Posts: 341
I got permission to share these recompiled files so here's the whole pack.



Schematic and firmware files are attached.
Attached Files
File Type: rar PS2_key_to_A500.rar (60.0 KB, 1510 views)
Solo761 is offline  
Old 24 September 2014, 16:31   #6
alenppc
Registered User
 
Join Date: Apr 2012
Location: Canada
Age: 44
Posts: 910
Excellent!
alenppc is offline  
Old 18 May 2015, 22:09   #7
danko
Registered User
 
danko's Avatar
 
Join Date: Oct 2009
Location: Italy
Age: 45
Posts: 196
Good job, do you have for sale an empty pcb?
danko is offline  
Old 19 May 2015, 08:34   #8
Solo761
Registered User
 
Join Date: Aug 2013
Location: Croatia
Age: 43
Posts: 341
Unfortunately no. I don't order them, I make them myself. So I made only few pieces I needed.
Solo761 is offline  
Old 14 June 2015, 22:18   #9
danko
Registered User
 
danko's Avatar
 
Join Date: Oct 2009
Location: Italy
Age: 45
Posts: 196
Quote:
Originally Posted by Solo761 View Post
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?
danko is offline  
Old 15 June 2015, 09:40   #10
Solo761
Registered User
 
Join Date: Aug 2013
Location: Croatia
Age: 43
Posts: 341
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

Last edited by Solo761; 15 June 2015 at 10:41.
Solo761 is offline  
Old 15 June 2015, 10:02   #11
GhstWlf
Registered User
 
Join Date: May 2015
Location: Sweden
Posts: 48
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.
GhstWlf is offline  
Old 15 June 2015, 10:27   #12
MrFluffy
furtling tinkerer
 
Join Date: Jun 2015
Location: Mouhet France
Posts: 55
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...
MrFluffy is offline  
Old 15 June 2015, 10:30   #13
danko
Registered User
 
danko's Avatar
 
Join Date: Oct 2009
Location: Italy
Age: 45
Posts: 196
Hi, usb keyboard to a500.
danko is offline  
Old 15 June 2015, 10:47   #14
Solo761
Registered User
 
Join Date: Aug 2013
Location: Croatia
Age: 43
Posts: 341
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.
Solo761 is offline  
Old 16 June 2015, 23:55   #15
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,741
Quote:
Originally Posted by Solo761 View Post
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)
http://www.asahi-net.or.jp/~qx5k-isk...t/usbhost.html
pandy71 is offline  
Old 10 December 2015, 18:42   #16
xArtx
Registered User
 
Join Date: Jun 2013
Location: Australia
Posts: 685
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:
Code:
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:
Code:
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 is offline  
Old 13 December 2015, 11:02   #17
xArtx
Registered User
 
Join Date: Jun 2013
Location: Australia
Posts: 685
Hi,
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 is offline  
Old 14 December 2015, 10:22   #18
xArtx
Registered User
 
Join Date: Jun 2013
Location: Australia
Posts: 685
And on the way ....

Dual Keyboard:
[ Show youtube player ]

Dual Mouse:
[ Show youtube player ]

Last edited by xArtx; 16 December 2015 at 19:54.
xArtx is offline  
Old 18 June 2016, 19:19   #19
chapas
Registered User
 
Join Date: Sep 2012
Location: Lisbon/Portugal
Posts: 17
Quote:
Originally Posted by Solo761 View Post
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?

Regards,
Chapas
chapas is offline  
Old 19 June 2016, 02:01   #20
chapas
Registered User
 
Join Date: Sep 2012
Location: Lisbon/Portugal
Posts: 17
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.
chapas is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Amiga 500 keyboard power Hoopz support.Hardware 4 07 April 2013 06:27
Wanted: Amiga 500 Keyboard nebno6 MarketPlace 1 26 August 2011 23:46
Amiga 500 slight keyboard issue Dougal support.Hardware 10 23 January 2011 08:00
Amiga 500 keyboard problem lopos2000 support.Hardware 12 06 October 2005 14:56
Amiga 500 Plus keyboard problems adgloride support.Hardware 12 07 July 2004 16:48

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:42.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09795 seconds with 16 queries