Keyboard adapter for the C64 or VIC20
Banman from the MELON64 forum contacted me about a project that could adapt a PS/2 or AT 5 pin din keyboard to the C64 , but there was no pcb for it , only the software.
I told him it could be done quite easily and we set about creating and testing it .
This is the result.
What you need :-
A PS/2 ( 6 pin mini din ) or 5 pin din connector ( according to what keyboard you have to use ) .
If you are using a PS/2 connector it is preferable ( but not necessary ) to have a purple or black one as the green one is meant for mice .
1x 470R resistor ( optional )
1x 3mm LED ( optional , i am using a blue one but it could be any color )
1x narrow 28 pin ic socket
1x wide 28 pin ic socket ( optional but recommended )
1x 20 pin pcb header socket
1x 0.1uf capacitor ( must have a minimum of 6v capability to allow for spikes on the supply >10v recommended , mine is 0.1uf at 63v )
1x keyboard socket ( your choice )
1x MT8808 IC
1x atmel avr ( it will fit on the 8 , 88 , 328 and other 28 pin avr but it must be the narrow format package , i am using a 328 )
and , of course , the pcb which is available on PCBWay .
A picture of all the parts required for a basic version is shown below.
Now that all the parts are together it is time to assemble the board.
First up is the 20 pin pcb header socket as stated on the pcb this fits to the underside of the board to connect directly on the c64 keyboard header.
If you are going to sloder in the MT8808 ic you will need to flatten the pins that sit underneath it before soldering
( just bend them to opposite sides and it will hold the connector straight for soldering! ) .
Next are the IC sockets ( or MT8808 IC and socket if you do not want to fit the wide socket )
Please note the pin 1 marking on the board as the two chips have pin 1 at the opposite ends
Then the capacitor , resistor and led
Finally your chosen keyboard socket
Be aware that some PS/2 connectors might require Kapton tape or nail varnish over this pad before you fit the socket to stop any shorts
Building is now complete , time to program the chip
For this i am going to use the TL866-II Plus programmer and the Xgpro software that comes with it.
Based on code from https://github.com/Hartland/C64-Keyboard .
If you wish to use the arduino IDE full code is here under ps2/c64_keyboard.
There are 4 files to download and a library to install . All the details are on that website.
This is a pre compiled file to burn into an atmega328 avr.
( right click on it and save link as )
You will need to download this file and save it somwhere easily accesible .
First open the Xgpro software and select the ATMEGA328P @DIP28 as the IC to program
Then click load and find your downloaded file
and click open
Click OK and this will load it into the programming buffer
Now we need to adjust the fuse bit for the divide by 8 clock , click on the config tab ( circled in red )
The first tick box in the 'Fuse Low Byte' section needs to be un-ticked
Now you can click the 'PROG.' button to program the 328
Click the Program button and once it has finished you are ready to fit it into the adapter
Fit the MT8808 as well ( if you did not solder it in ) and you are ready to go !!
I tend to use mine when i am fixing C64's but there is no reason why it cannot be a permanent replacement!