OK, another update.
Things have been going kinda slow. It's really hard to use sink-source-float capable PICs to make buses and protocols that are open drain/collector, do only to the fact that MPLAB doesn't have support for simulating pull-up resistors. Thanks to this, what should be 200~300 lines of code, is at about 500, do to all the if-then statements I had to add, just so I can make the waveforms show up in the dang logic analyzer and let me... analyze them. I have basically had to write all my code twice, one set of algos for the sim, and another that
SHOULD approximate that exact behavior when in the chip.
And therein lies the crux...
We can't be sure, when we run into problems with the test circuit and chip, that it isn't a bug in my code, caused by the two different algos not matching in functionality, as I intended.
But we will deal with that bridge when we come to it...
===========================================================================
In any case, I *DO* actually have what appears to be fully working PS/2 transmitting capability in simulation as of right now. Does starts and stops, parity, LSb first order, checking for bus idle state... pretty much everything. Here is a screen shot of what the sim claims I'm sending out of the chip. The byte being sent is "Q" or 0x15 exactly as in the PS/2 article from before...
(I even duplicated the last low clock pulse lagging a bit, for kicks.)
And here again, is what the waveform for the same code/sequence/protocol looks like with a real device, from the same PS/2 article...
This should work, as is, provided that...
(A) My alternate code works exactly the same as my sim friendly code.
(B) We can get the calibration value for your PICs easily.
(C) The KVM works with just receiving
the code for L-CTL L-CTL 2.
(E) The KVM *DOESN'T* need any other coms, or to be connected to a PC.
(F) You have all the parts, and can actually build the circuit. (it's simple.)
However, I highly suspect bugs at this point. I almost never have code work the very first time. So, I want to try and come up with some hardware tests and experiment on my end still. What I really need to do is try and emulate a key board and then just plug it into one of my spare PCs. If it works, then it should be able to send a bunch of key strokes or something.
The better option would be to scope/logic analyze the pins when they are not attached to anything. This would show me a real waveform, and would let me use the real part. then I could also do away with all the if-then statements all over the place.
EDIT:
By the way, this is what it looks like with the full command...