Maker Pro
Maker Pro

Emulating a PC keyboard

I

Iain Wilkie

Jan 1, 1970
0
I have a micro that is emulating an AT keyboard by sending scan codes and
simply plugs onto the keyboard port of a PC. This works fine, but if I plug
it
into a laptop PS2 port it does not work UNLESS I put an AT keyboard in
parallel
with the data and clock lines. I have scoped the lines and all looks ok and
after investigation
it would appear that when there is no key activity, there is activity on the
clock and data line every
second or so which I can only imagine is the laptop asking something from
the keyboard and if
it doesn't get a reply then it shuts down.

Anyone any idea what this message may be.

Thanks in advance

Iain Wilkie

--
 
D

Don Pearce

Jan 1, 1970
0
I have a micro that is emulating an AT keyboard by sending scan codes and
simply plugs onto the keyboard port of a PC. This works fine, but if I plug
it
into a laptop PS2 port it does not work UNLESS I put an AT keyboard in
parallel
with the data and clock lines. I have scoped the lines and all looks ok and
after investigation
it would appear that when there is no key activity, there is activity on the
clock and data line every
second or so which I can only imagine is the laptop asking something from
the keyboard and if
it doesn't get a reply then it shuts down.

Anyone any idea what this message may be.

Thanks in advance

Iain Wilkie

I think it is just the keyboard saying "Hey, there's still a keyboard
plugged in".

d

Pearce Consulting
http://www.pearce.uk.com
 
S

Spehro Pefhany

Jan 1, 1970
0
I have a micro that is emulating an AT keyboard by sending scan codes and
simply plugs onto the keyboard port of a PC. This works fine, but if I plug
it
into a laptop PS2 port it does not work UNLESS I put an AT keyboard in
parallel
with the data and clock lines. I have scoped the lines and all looks ok and
after investigation
it would appear that when there is no key activity, there is activity on the
clock and data line every
second or so which I can only imagine is the laptop asking something from
the keyboard and if
it doesn't get a reply then it shuts down.

Anyone any idea what this message may be.

Possibly echo? (code: 0xEE response: 0xEE)

or maybe read ID (code 0xF2)


Best regards,
Spehro Pefhany
 
R

Rich Grise

Jan 1, 1970
0
I have a micro that is emulating an AT keyboard by sending scan codes and
simply plugs onto the keyboard port of a PC. This works fine, but if I plug
it
into a laptop PS2 port it does not work UNLESS I put an AT keyboard in
parallel
with the data and clock lines. I have scoped the lines and all looks ok and
after investigation
it would appear that when there is no key activity, there is activity on the
clock and data line every
second or so which I can only imagine is the laptop asking something from
the keyboard and if
it doesn't get a reply then it shuts down.

Anyone any idea what this message may be.

I'd try to get a snapshot of the message with and without and AT
keycoard plugged in. When they're plugged in, you can't tell which
way the data is going, because it's just open-collector. Maybe
just use a couple of pullup resistors, with no keyboard, and see
what the laptop sending, then when you plug in the keyboard, see
if it's a sort of query/ack - you can spot this if the message is
longer than without the keyboard - and if so, then in your device,
just respond to the query with the same singal as the ack that you
saw.

Hope This Helps!
Rich
 
J

Jonathan Kirwan

Jan 1, 1970
0
I have a micro that is emulating an AT keyboard by sending scan codes and
simply plugs onto the keyboard port of a PC. This works fine, but if I plug
it into a laptop PS2 port it does not work UNLESS I put an AT keyboard in
parallel with the data and clock lines. I have scoped the lines and all
looks ok and after investigation it would appear that when there is no key
activity, there is activity on the clock and data line every second or so
which I can only imagine is the laptop asking something from the keyboard
and if it doesn't get a reply then it shuts down.

Anyone any idea what this message may be.

First off, just in case anyone is otherwise interested, the keyboard
port on a PC has power and two communication lines, CLOCK and DATA.
The two communication lines are bidirectional and nominally
implemented on the IBM PC side as 7407 outputs with a 10k pull-up and
a 47pF to ground, with the output readable by an internal 8042
controller chip. Data exchange is synchronous and can be at any rate,
so long as the first rising clock edge starts within a 15ms window
after pulling it low to take ownership of the line and so long as it
doesn't take more than 2ms to complete an 11-bit dialog, once that
first clock starts the cycle. Also, while the clock line is supposed
to be high, the keyboard samples it every 60us or sooner to ensure
that it remains high. If it goes low, this signals line contention.

There are other timings. 20ms and 25ms for some responses. Etc.

I don't remember reading about anything that operated automatically on
a one-second time period, though. But there are messages that could
be used by an IBM PC system for some kind of verification of a
keyboard connection. In the case of laptops, which have their own
built in keyboards, it would make a LOT OF SENSE to be using something
like that. You should look at the digital data and see what it
suggests.

We could all guess what it is, but there are many possibilities. The
BIOS could send something with incorrect parity, for example, and
expect an FE response. Or it could be something like Spehro suggests.
Or others, such as one of the variety of NOP commands. You will just
have to look, I think, or find some site that documents what laptops
use. But I think it is possible that different laptop BIOSes may
actually use different ideas, depending on the programmer involved (I
assume here that there may be at least two widely used laptop BIOS
source codes written by different writers.)

Jon
 
M

Michael Lange

Jan 1, 1970
0
Hi Iain,

did you find out anything, I'm interested too. I think on the notebook,
it would be an mechanism of hardware detection, for that your uC must react.

Michael
 
M

mike

Jan 1, 1970
0
Michael said:
Hi Iain,

did you find out anything, I'm interested too. I think on the notebook,
it would be an mechanism of hardware detection, for that your uC must
react.

Michael

KVM switches have some sort of keyboard and mouse emulation to keep
things alive. Might be interesting to watch the KVM interaction.
mike

--
Return address is VALID but some sites block emails
with links. Delete this sig when replying.
..
Wanted, PCMCIA SCSI Card for HP m820 CDRW.
FS 500MHz Tek DSOscilloscope TDS540 Make Offer
Wanted 12" LCD for Compaq Armada 7770MT.
Bunch of stuff For Sale and Wanted at the link below.
MAKE THE OBVIOUS CHANGES TO THE LINK
ht<removethis>tp://www.geocities.com/SiliconValley/Monitor/4710/
 
M

Michael Lange

Jan 1, 1970
0
mike said:
KVM switches have some sort of keyboard and mouse emulation to keep
things alive. Might be interesting to watch the KVM interaction.

this could be a other way, but currently I have no oscilloscope. But the
OP plugs an standard keyboard in parallel and it works, so this should
be inspected.
KVMs on the other side are very mysterious things: confuse notebooks
when connected as PS/2 mouse and keyboard same time, switch some mouses
all times to the same pc and so one.

Michael
 
Hi Iain:

Would you be kind enough to provide me with details (circuit, etc.) on
your PC emulator? I will be happy to purchase this info . I have an
application I would like to work on. Regards, George
 
J

Jonathan Kirwan

Jan 1, 1970
0
Would you be kind enough to provide me with details (circuit, etc.) on
your PC emulator? I will be happy to purchase this info . I have an
application I would like to work on.

I think it is a PC __keyboard__ emulator.

Jon
 
J

Jonathan Kirwan

Jan 1, 1970
0
I have a micro that is emulating an AT keyboard by sending scan codes and
simply plugs onto the keyboard port of a PC. This works fine, but if I plug
it into a laptop PS2 port it does not work UNLESS I put an AT keyboard in
parallel with the data and clock lines. I have scoped the lines and all looks
ok and after investigation it would appear that when there is no key activity,
there is activity on the clock and data line every second or so which I can
only imagine is the laptop asking something from the keyboard and if
it doesn't get a reply then it shuts down.

Anyone any idea what this message may be.

By the way, in case it may help, I have the complete IBM documentation
set, "Technical Reference/Personal Computer AT" and "Technical
Reference/Options and Adapters/Volumes 1, 2, & 3", which includes
rather clear information on the AT keyboard in chapters 1 and 4 in the
first mentioned reference. This includes the schematics, as well,
plus the complete BIOS listings for the PC side (no 8042 code for the
keyboard side that I've found.) If there is something I can look up
for you, let me know.

Also, as an interesting aside, there was a feature in the AT BIOS
(which, if my talking to BIOS writers at Phoenix some years back is
any indication may no longer be supported on newer systems) where you
could download code to the AT at power-up through the keyboard port.
This was used in motherboard testing fixtures. If you recall, these
motherboards did NOT include floppy/hard disk adapters, serial I/O,
etc., so this method used as the only standard feature available on
every motherboard for which code could be loaded for system testing.

Jon
 
Top