Well, I managed to spend some time yesterday on advancing the PS/2 interface completeness for the CreatiVision Keyboard.
I’m now at the point where I have evolved my original PS/2 transmission only code, to an early-alpha version of PS/2 bidirectional interface code, where I simultaneously support ScanCode transmission (from a ScanCode buffer), and Host Command reception (into a Command buffer).
This is all interrupt driven (like the original code), to provide perfectly consistent PS/2 clock cycle timing.
Then, separately, I have written a simple handler for any Host commands received into the Command buffer, so I can easily add any additional command responses needed.
I’ve also been able to use my existing generic PS/2 PC keyboard in order to directly compare how it responds (as compared to my CreatiVision Keyboard).
So far, good progress! I’m able to directly compare on the scope, the PC PS/2 keyboard’s communications, as compared to my CreatiVision Keyboard communications.
Here’s how the CreatiVision Keyboard PS/2 currently looks, following a computer reset (that it’s attached to).
Note, channel 1 (yellow) is the Clock, and channel 2 (purple) is the Data. I have the Data channel displaying at half amplitude (2V/div instead of the Clock's 1V/div), so it’s easier to see the relative transitions (but they are obviously the same 5V level).
So, triggered by me resetting the computer, first you can see the Host Command “Reset” (0xFF) packet being received (clocked-in) by the Keyboard from the Host (computer).
This is followed by my Keyboard then sending back an “Ack” acknowledgement code packet (0xFA), and subsequently sending a BAT test (Basic Assurance Test), Success code packet (0xAA), back to the Host (computer).
The transmission of actual key press scan codes from the CreatiVision Keyboard (as viewed on my scope), also exactly duplicates my PC keyboard same key press transmission. Even down to the timing!
Note also, I'm coding my own PS/2 implementation from scratch, just based on descriptions of the PS/2 protocol and verification of the protocol by observing a generic PC PS/2 keyboard in operation. As a retired software developer, I find that most other code that I look at doesn't meet my own standard of "how things should be done" (I'm sure we all have different views on this). Case in point, is that other PS/2 code implementations I've seen don't impress me. Notably with hardwired code with software delay based transmission, and hardwired loop expectation of command responses (leading to infinite loop possibilities etc.). Nasty, nasty!
Anyway, so far, so good. Now that I have the groundwork done, I can hopefully progress it further in the next day or so.
