BS2 Generates PS/2 Keybd Scancodes
Here's an implementation. It sends the scan codes for a and z, repeatedly.
You just have to get the interconnect right.
I was using a GOSUB routine to CLOCK with, but it was better to go with clock=0:clock=1.
Have the Stamp powered off when you plug_in the PS/2 connector.
The first time through it'll probably generate a post code. Maybe somebody can smooth that out.
It bangs out the MAKE scancode byte and then the BREAK scancode bytes.
NB - Those are the pins, not the solder cups on the reverse.
My favoured site/link was/is -- http://www.beyondlogic.org/keyboard/keybrd.htm
!!! - Found that the device wrote over my stuff because I had the IDE open and then I saved it. Bad things can happen with this stuff. Burned that copy and put in this _02 version
You just have to get the interconnect right.
I was using a GOSUB routine to CLOCK with, but it was better to go with clock=0:clock=1.
Have the Stamp powered off when you plug_in the PS/2 connector.
The first time through it'll probably generate a post code. Maybe somebody can smooth that out.
It bangs out the MAKE scancode byte and then the BREAK scancode bytes.
NB - Those are the pins, not the solder cups on the reverse.
My favoured site/link was/is -- http://www.beyondlogic.org/keyboard/keybrd.htm
!!! - Found that the device wrote over my stuff because I had the IDE open and then I saved it. Bad things can happen with this stuff. Burned that copy and put in this _02 version
Comments
PE - I didn't write the program for speed, I wrote it to be illustrative, instructional.
I was busy being helpful and recalled this having been asked about before and since I'd been on the floor, reaching behind the computer and everything, that I'd just make it a Completed Project, having slain the beast.
Not so tough.
Overcome, Advance.
See what happens when you start doing this stuff?
Anyway, here's the working program that the device didn't write on.
Is this a boot issue from the PC side of things? IOW, can you have the "stamp keyboard" plugged in upon a PC boot and things settle (eventually)? ... or do you have to have a "PC keyboard" plugged in initially to get past the handshaking?
I say this because I have had issue with the latter ... the PC keyboard needed to be plugged in to initialize with the PC or the PC would post code at me.
What I did was to read the keyboard stream by tapping the signal lines. First I used a scope, but then moved on to a PIC program (<--Before Propeller existed) that would serialize the data so that a second PC could display the info. Since the data stream is open driven, meaning the PC can send data as well as the Keyboard on the same line, it was a matter of decoding who was who. Then finally after mimicking the PC keyboard I was using to test with, from the PIC, I could 'emulate' a PC keyboard.
Edit: The Speed issue I mentioned in the other thread "...I didn't think the BS2 was fast enough..." ... It might be that what I found is that the BS2 can "send" ok, but for the initial handshaking it was not fast enough to receive and store the data to parse it .... it could be that you might be able to fake that portion out, by just looking to see when the data stream from the PC is done before you respond... In other words, pretend to listen, but do it your own way regardless (<- sounds like my 8 year old)
1) I do a cold start on the PC with the BS2_AT plugged in (but powered off) and the PC didn't find it and it couldn't find the keyboard afterward.
2) I do a cold start with its keyboard plugged in, then unplug that and plug the BS2_AT in, unpowered, and then the PC starts post coding for a bit, it's verging on frantic. If I leave the BS2_AT off till the post coding stops then it behaves on Notepad.
I'm not sure if I have a handle on all this. I agree there's likely a code set that could help mitigate this; reading and writing, really going to school.
A keyboard extension cable, 3feet, 6 feet - to facilitate my work.
Still, getting the connectors, for the Y-adapter. Any thoughts?
Hey, I have two panel mount connectors. JB_Weld, flying leads, more Frankenstein. Tomorrow.
I hacked a "Cue-Kat" cable when I did it... that's basically a 'Y' adapter.
and another PS/2 plug.
Should be aggravating.
When does this Host:Keyboard traffic take place, when the PC is in BIOS looking for the peripherals, etc.?
Post Edit - From what I'm reading, there's no time to lose in making replies to the Host query or it resets or something.
PE -- A-ha, "the keybd provides the CLOCK for all data transfer."
So, at first, the keybd (BS2_AT) should wait/look for the Host's having taken DATA Lo, being a Start bit that the PC wants to have clocked out?
Oooh, I hate not knowing.
I've been working on this very project with a Propeller. My intention is to 100% emulate the handshaking the existing PS2 keyboards do. Right now I'm still working on receiving reliable data from the host (currently a motherboard that posts with a ps2 keyboard) and a "ps2" cable from an old PC to plug into it (and a 2 5k resistors, one on the clock, one on the data)... still working on it.. my "electronics" skills rot, and my propeller programming skills are somewhat but not much better..
KK