68HC11 Sample Code - PS/2 keyboard scancode reader/reporter

Simple interrupt-driven program to deserialise data-bitstream from a PS/2 keyboard, asynchronously insert scancode bytes into a circular buffer, and to on-demand report the contents of the buffered scancodes so received.

Uses on-chip SCI for commands/responses.
Uses PORT A pin 0 (input-capture #3) to detect falling PS/2 clock-edges.
Uses PORT C pin 3 to sample the PS/2 data-line. Uses PORT B pins 0 1 to drive indicator/debug LEDs.

Runtime commands:

Whilst all the above is going on, you can type on the PS/2 keyboard attached via the passive interface circuit described at https://sparc90s.wordpress.com/2017/04/28/with-a-cherry-on-the-side-episode-seven-peripheral-action/.

Source Code:

Mike Spooner, 30th April 2017