• Please review our updated Terms and Rules here

PC Keyboard to DEC Keyboard Adapter

RolexTM

Member
Joined
Nov 9, 2011
Messages
20
Hi all,

guess it's time now to present my little Keyboard Adapter to the public.

What it does is - take a PS2 or AT Keyboard and convert the keycodes to something compatible with
a DEC LK402 / 201 / other(?) Keyboard. I am using it to interfere with a VT320 terminal.

The controller is a PIC18f2520 that i had laying around. If you take another, you have to adjust the baud
rate and the internal speed settings.

The max232 can be used by datasheet specification for the capacitors and connects the terminal
rs232 data to the ttl level on the controller

The LM340 is just any 5V voltage regulator ;)

R1 and R2 are just for safety. They can be 100ohms

RB0 on the controller is the input for the Clock Line of the PS2 Keyboard,
RC1 is the input for the PS2 data.

The ICSP header is for in-circuit programming and debugging purposes.


The source-code is a Microchip MPLAB 8.8 Project written in C18. It is somehow hacked together.

NO real initialization takes place when the terminal requests it. We just fake some ACK messages.
If you have another terminal device you may have to tweak my *cough* ack-fake-loop to get the desired results....
In general there is NO communication between the host and keyboard, AKA no keyboard LEDs.
Sometimes the SHIFT Key gets stuck. Thank you IBM for your completely insane AT keyboard mappings. If you
are stuck just press shift again. On the other side this it not too bad since capslock is not implemented either ;)

What works are (mostly) all characters, escaping with ctrl works. F-Keys work, . Arrow keys work. Implementing new scancodes is
not too hard. Just look up the AT Keyboard scancode and enter your desired output keycode in the sourcecode definition array.

Feel free to improve my source. For me it is working good enough to install and use a OS. ;)

Have fun

http://bigalpha.ath.cx/schaltplan.png

View attachment vtadap.zip
 

Attachments

  • schaltplan.jpg
    schaltplan.jpg
    14.3 KB · Views: 3
Last edited:
Nice work!

It seems to me that a PIC18 is way above what's needed. You could probably do it with a PIC12 (but not in 'C'). Another alternative might be an AT90USB162 which has dedicated PS/2 interface, as well as USB (use either type of keyboard).

In any case, thanks for the good work. :thumbsup:
 
I know that its overkill. To make it even more overkill i let it run at full speed with 32 MHZ :D

I may have had it a bit easier if i used usb. After all there are ready made libs for usb, but i used PS2
for the DIY fun...and knowing that i might be a little less angry if i frý one of my many
old PS2 keyboards ;)
 
Back
Top