Picture of PICAXE - Interface a PS2 Keyboard with an LCD
This project uses a PICAXE 20X2 microcontroller to interface an old style PS2 keyboard with a 2 X 16 LCD. The program is quite lengthy and is probably not perfect but most functions seem to work. Because some special keys use a preceeding $E0 character which the PICAXE Kbin command ignores, I was not able to decode them. This is my second PICAXE project so there are probably more elegant ways to program these functions, this is just the way that I figured out to do it on my own as very much a beginner.

The PICAXE has been programmed to ignore most keys that don't have much use in this application such as the up and down arrow, ALT, esc, break etc keys for example. CAP lock and Shift work. Shift behaves like CAP lock, press down once and it stays on until you press Shift again. It also displays "CAP" or "SHF" at the top right of line 1 to show that the function is active. The 20X2 has been programmed so that when Line 2 of the LCD display is full, pressing the key for any displayed or right cursor moving character will clear the display and return the cursor to start of Line 2. You will then need to press the key again to get it to display. Also I find that this keyboard to LCD interface is not fast. You need to wait about 1/2 sec after each keypress before it is ready to accept another keypress. I did not persue this because I don't need it to be fast, but suspect that this could be made faster by buffering the incoming characters in multiple variables.

The program is included and you will be able to follow how it works by reading the comments which are quite detailed. They are detailed because I left off working on this program for about a month and was totally lost when I came back to it, so I wanted to make sure that did not happen again. You can easily modify this program to use the keys that are currently ignored. Also, it will be fairly obvious to anyone familiar with PICAXE that this program and hardware can be modified so that instead of displaying characters on an LCD, you could control just about anything - relays, servos, logic, lights etc with a keyboard using this kind technique. I will leave it to the ambitious to do that!
Remove these adsRemove these ads by Signing Up
sncarter (author) 1 year ago
Hi Dylon,

Yes, I'm just getting to know Arduino, know PICAXE much better. There are lots of Arduino Temp monitor projects out there already too. One day maybe....
Dylon1241 year ago
Very Nice, but you should do one with avr adruino too!
Dylon1241 year ago
Very Nice, but you should do one with avr adruino too!
panic mode1 year ago
hey, i shop there too ;-)