First post, by migry
I did check but no other threads seemed similar.
I have been working on a IBM PC-like 8088 PCB. I have modified the Tandy1000 BIOS to work on my board. My board has a 8255 PPI for keyboard but not the usual TTL circuitry. Consequently I was interested in how I might interface a keyboard (and mouse?) to my board. Given that in the AT system there is a chip specifically to perform this function, I bought a 40 pin device lacelled "AMIBIOS" to see if I could use this as a solution.
I have previous experience (back in the early 80's) of the Intel 8048 microcontroller, so was surprised to find out that the 8042 used the same architecture and instruction set. I was surprised to find out that on the 8042 the RD and WR lines are *inputs* rather than outputs as is much much more common, which allows this device to appear as a memory mapped peripherial in a system such as the 8088. The only other microcontroller which I have seen to implement this behaviour are some members of the PIC family (it's not a common feature/module and the last time I looked it was hard to locate parts with this feature).
I am aware that the ROM code of the 8042 has been dumped. I am pretty sure that it is documented how to "read" the ROM in the databook for the 8048. There is also a disassembly. This is likely to be for a very early clone of the AT 8042 keyboard controller chip. I would be interested to find out if the ROM code for any "newer" 8042 varients has been dumped. This might not be so easy for the custom clone 8042's.
So I found a seller of these parts on Ebay (UK) and bought one for £7. I decided to use a simple Arduino Nano (which has 5V I/O) as a test platform. I searched the net for all the information about this type of part, including datasheets of clone devices.
Here is my board.
I have wired up the databus, RESET, WR, RD, CS and A0 lines to the Nano. I have connected a PS2 keyboard as that was to hand.
I have spent a few days experimenting. I suspect that different 8042 devices/clones implement different firmware and so have different command sets.
Firstly I discovered that the device is unresponsive until the 0xAA (self test) c0mmand is issued. This is documented on some websites, but it's easy to forget.
I tried issuing all command varients, and the list of those which return values are given in the attached text file. I have no idea if this part works with AT keyboard only, or PS2 keyboard or PS2 keyboard and mouse.
Yesterday I did have the keyboard working, in that I could press a key and read the key value in the 8042 output register. Today the circuit is not playing ball and I'm unsure what is wrong.
Since other buyers have bought "AMIBIOS" devices from the same seller, perhaps if they read this thread they would share any knowledge?
I will return to this thread to add information as I have it.