COMP541 Keyboard Interface - PowerPoint PPT Presentation

About This Presentation
Title:

COMP541 Keyboard Interface

Description:

Kybd-to-host and host-to-kybd on same wires. CAPS LOCK light for example. To send, host takes data line ... http://www.barcodeman.com/altek/mule/scandoc.php ... – PowerPoint PPT presentation

Number of Views:192
Avg rating:3.0/5.0
Slides: 12
Provided by: Montek5
Learn more at: http://www.cs.unc.edu
Category:

less

Transcript and Presenter's Notes

Title: COMP541 Keyboard Interface


1
COMP541Keyboard Interface
  • Montek Singh
  • April 9, 2007

2
PS/2 Keyboard
  • Uses a synchronous serial protocol
  • What does that mean?

3
Physical Interface
  • Two lines
  • Clock (10-20KHz)
  • Data
  • Pulled high by resistors
  • Asserted low
  • Takes away your pushbutton unless you do clever
    stuff

4
Bidirectional
  • Kybd-to-host and host-to-kybd on same wires
  • CAPS LOCK light for example
  • To send, host takes data line low
  • Sometimes take clk low first
  • Then kybd starts clocking
  • Host sends data synced to kybd clock
  • You shouldnt need to send to kybd

5
Protocol
  • 11 bits
  • Start always 0
  • 8 bits of data
  • Odd parity bit
  • Stop bit always 1
  • Clocked by keyboard
  • Value should be latched on negedge of keyboard
    clock

Illustration from http//www.beyondlogic.org/keybo
ard/keybrd.htm
6
What is Sent
  • ASCII is not sent
  • Scan codes for keys
  • Least significant bit first

Illustration from http//www.beyondlogic.org/keybo
ard/keybrd.htm
7
Scan Codes
  • Normally translated by software
  • You remap your keys, for example
  • Software takes care of
  • Shift, caps lock, control

8
Some Scan Codes Long
  • Two code sequence common
  • Have a look at Break key!

9
Even More Complicated
  • Scan code generated when you press
  • And when you release
  • Two bytes F0 followed by key scan code
  • Example
  • Space pressed, 29 sent
  • Space released, F0 29 sent
  • If you hold key, scan code repeated

10
Resources
  • Information
  • http//www.beyondlogic.org/keyboard/keybrd.htm
  • Scan codes
  • http//www.barcodeman.com/altek/mule/scandoc.php
  • There is also Verilog for keyboard interfaces
    available on web.

11
My Verilog
  • I will post my Verilog code on the web site
  • You should memory-map the character code register
  • Maybe add a single bit register to indicate that
    new character has arrived
Write a Comment
User Comments (0)
About PowerShow.com