Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Keyboard



On Mon, Mar 26, 2001 at 12:00:41PM +0900, SN_Diamond wrote:

> OK, you haven't seen the two I've used, and I haven't seen most or all of
> the ones you've seen.

Fair enough.

> So they're smarter than most OSes and BIOSes?

They have to be.  From the comp.sys.ibm.pc.hardware FAQ, section 3.26:

The AT uses a 5-pin DIN and the PS/2 uses a smaller connector with the same
signals:

     1     CLK/CTS (open-collector)
     2     RxD/TxD/RTS (open-collector)
     3     Not connected or Reset
     4     GND
     5     +5V

Now the interface is bi-directional.  When the computer wants to send a byte
to the keyboard, it asserts RTS and releases CTS.  If you're lucky, the
keyboard isn't deciding to transmit at the same time and it responds by    
giving 10 clock pulses (at about 10000 baud) on the CLK line.  The computer
shifts a frame out on TxD on rising clock edges.  The frame format is now 1
start bit, 8 data bits and 1 odd parity bit.  The keyboard takes RTS being 
held low as the first start bit, and the first data bit should be sent on
TxD after the first clock edge is received.  Yes, now you need a full UART
for the keyboard interface since you have to both transmit and receive and  
generate and check parity (but it's still not RS-232- that would have been
too logical).  Why do you need parity checking on a three foot long keyboard
cable?  Because collisions can occur since the lines are so overloaded with
signals with different meanings and parity provides the means for detecting
these collisions.

(end included text)

The USB keyboard spec is an encapsulation of the above.

-- Chris


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links