Using a PC style keyboard as an ASCII keyboard
|Because PC keyboards are so cheap and because
of the difficulty of obtaining an ASCII keyboard it makes sense to use a PC keyboard with an 8-bit computer.
The difficulty with PC keyboards is that they produce serial scan codes which are synchronized with a clock signal. In addition the scan codes bear no relation to ASCII code or (it seems) to anything else :) Whereas an ASCII keyboard is completely different - it produces 7-bit parallel data that is not synchronized.
After a long journey I have finally produced some software which works well. I had looked around on the Internet initially, for software to do the conversion but the code that I found seemed to be fairly convoluted. There is plenty of information about the PC keyboard operation and from this I was able to write some code in PICBASIC PRO. After getting it working I spent several weeks simplifying the code and making it more efficient. It now compiles down to about 600 bytes and I really don't think it could be any more simple than this.
Documentation and schematic diagram Documented PICBASIC PRO code
of these Hex files to program the PIC ......... 648PC_ASCII.HEX
Right click on file then 'Save Link as' and if necessary add the .HEX extension
back to Home Page