On 11/30/2014 4:52 PM, Michal Pleban wrote: > Hello! > > Today I hot hold of a Microchip development board populated with a > midrange PIC. So I hooked it to the Commodore 900 keyboard port and > played with it until I reverse-engineered the keyboard protocol. I am > posting it here in case anyone else needs it :-) > > The kyeboard connector has the same pinout as Amiga 2000, except the > pin that is "n.c." on the A2000 is the /RESET signal (which is needed > - see below). > > The signals, however, are used differently than on the A2000. In fact, > the keyboard interface is crudely constructed with a shift register > piggybacked on an IO chip in the C900 as an afterthought - originally > they constructed the computer without the keyboard at all (!) so the > protocol is quite primitive. > > The keyboard clock is driven by the keyboard. The keyboard data is > clocked on the negative edge of the clock. A start bit of 1 must be > sent first, then 7 bits of the scancode, then a make (0) or break (1) > bit. > > The scancodes are different than those from the Amiga. They are laid > out sequentially following the layout of the keys, so 0x01 = Esc, 0x02 > = 1, and so on. > > The break bit is significant for the Ctrl, Shift and Alt keys. For all > the other keys, the break scancodes are ignored by the computer. > > There is no special make/break mechanism for Caps Lock as on the > Amiga. So the computer and the keyboard must keep track of the Caps > Lock state / LED separately. Perhaps the RESET line tells the keyboard > that the computer has been reset so it can reset the LED (?). > > Most probably there is also no mechanism of transmission > resynchronization if some bits are sent incorrectly, such as on the > Amiga. Because each transmission must begin with a "1", the keyboard > is free to transmit any number of "0" bits before the actual > transmission as these will be dutifully ignored by the computer. > > So here it is - the Commodore 900 keyboard protocol. Now I can create > the AT to C900 adapter :-) > > Regards, > Michau. > > > Message was sent through the cbm-hackers mailing list If you'd like some help and can handle C code and AVR uCs, I can send you a PS2Encoder, which has the PS/2 code already there, and I think you can coax the protocol above out of the built in SPI port (Mode 2 maybe). Or, if you are just into the code, I got that on my site, it's GPL. Jim -- Jim Brain brain@jbrain.com www.jbrain.com Message was sent through the cbm-hackers mailing listReceived on 2014-12-02 04:00:02
Archive generated by hypermail 2.2.0.