Page 1 of 4

PS/2 keyboard adapter for VIC20 and C64

Posted: Sun Oct 17, 2021 11:11 am
by levoman
Banman pointed me to a project that he would like to create that enables the use of a PS/2 keyboard on either the C64 or VIC20 .

https://github.com/Hartland/C64-Keyboard

It uses an MT8808 switch matrix ic to recreate the matrix of the keyboard from the scan codes of the PS/2 interface. I have already re-created the schematic to use an atmega88 and the software is readily available to program it. Just need Banman to breadboard it up so that it can be verified as working. Gerber files will be available , and indeed have already been produced.

It will be a through hole product that will be easy to make yourself.

Anybody interested?

Re: PS/2 keyboard adapter for VIC20 and C64

Posted: Mon Oct 18, 2021 3:15 am
by banman
Hi levoman,

I'll get on it! Thanks.

I had a go at uploading the code and it appears to fit on to a Atmega88 chip including the required libraries.

With some changes to the keyboard code I believe it could possibly be used on a C16 computer. The C16's keyboard matrix is wired slightly different to the Vic20 and C64.

Re: PS/2 keyboard adapter for VIC20 and C64

Posted: Tue Oct 19, 2021 10:00 am
by levoman
Indeed , the output pins of this circuit could be matched to replace any matrix keyboard of up to 64 keys!

PS/2 to spectrum or ZX80 anyone??

Re: PS/2 keyboard adapter for VIC20 and C64

Posted: Mon Nov 22, 2021 10:07 am
by levoman
The project is now off the ground and the software has proved to be fine , Just sorted out a problem with the MT8808 footprint for the PCB and awaiting arrival of some redesigned PCB's . Once the PCB has been confirmed to be OK it will be good to go!

https://www.pcbway.com/project/sharepro ... board.html

Re: PS/2 keyboard adapter for VIC20 and C64

Posted: Wed Nov 24, 2021 5:19 am
by eslapion
banman wrote: Mon Oct 18, 2021 3:15 am With some changes to the keyboard code I believe it could possibly be used on a C16 computer. The C16's keyboard matrix is wired slightly different to the Vic20 and C64.
Getting replacement keyboards for the C128 / C128D is incredibly difficult. However the keyboard matrix on these machines is a little more than 8x8.

A PS/2 to C128 conversion system would be incredibly useful.

Re: PS/2 keyboard adapter for VIC20 and C64

Posted: Wed Nov 24, 2021 6:26 am
by banman
Hi eslapion,


The mt8808, I believe has a bigger brother an mt8816.

I wonder if this might be of some use?

Re: PS/2 keyboard adapter for VIC20 and C64

Posted: Wed Nov 24, 2021 9:53 am
by levoman
c128 keyboard is mainly an 8x11 matrix which would fit on the MT8816 ( 8x16 matrix ) , just leaving the 40/80 column mode switch , the caps lock switch and the restore key to be handled directly by the AVR.

I could work it in theory however i do not have a C128 to test it on ( not that i don't want one , i just don't have one! ).

It could be emulated with a strobed supply on one side of the matrix and resistor to LED to GND on the other side to show which key would be functioning , but this does not guarantee it working.

Give me a bit of time to get some components and ' play around ' and i will give it a go!

Re: PS/2 keyboard adapter for VIC20 and C64

Posted: Fri Nov 26, 2021 8:11 pm
by eslapion
@levoman

On the PC keyboards, there is the NUMLK key which could be used for the 40/80 column mode.

Re: PS/2 keyboard adapter for VIC20 and C64

Posted: Sun Nov 28, 2021 10:02 am
by banman
Hi levoman and eslapion,

Apologies for interrupting this fascinating discussion regarding c128 keyboards.

I can confirm that PS/2 keyboard adapter for VIC20 and C64 works for the 2 NTSC Short board Vic 20 machines I have with an AT style keyboard.

No modifications needed to board.

It works on an Atmega8 with the internal oscillator set to 8 mhz no problems. I cannot type faster than the Vic 20 displays text on the screen.


I was very hasty and wanted to see if it worked so l used the internal oscillator. I will of course continue construction of the PCB to reflect an external crystal oscillator.

One will note that it is very important to make sure the pin 1 orientation of the two IC chips are not in the in the one direction. The Mt8808 is orientated North and the Atmega8 heads South.
I am sure this is done to keep the PCB board design tidy and easy to trace down faults. I know when I started to veroboard my own version it was an absolute wiring mess.

I will say this is a great project for beginners wanting to push their skills to a new level. It looks great attached to the mainboard too.

Thank you levoman for bringing back 2 Vic 20 machines. :D

Re: PS/2 keyboard adapter for VIC20 and C64

Posted: Mon Nov 29, 2021 12:06 am
by levoman
You're welcome @banman.

I will make sure to put an extra indicator for pin 1 on each chip to help stop mistakes. The orientation of the chips was done to make the routing of the board simpler.

I will send the details for the C16 and the measurements i need from it.