1 / 28

Interface Design Keyboard and Printer

Interface Design Keyboard and Printer. Omid Fatemi. Compute. Convey. Cooperate. Typical Interface Design. Connect. Sense Reality Touch Reality Connect Transform. Embedded Systems Micros Assembler, C Real-Time Memory Peripherals Timers DMA. PC interfaces HCI. Busses Protocols

nemo
Download Presentation

Interface Design Keyboard and Printer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Interface DesignKeyboard and Printer Omid Fatemi

  2. Compute Convey Cooperate Typical Interface Design Connect Sense Reality Touch Reality Connect Transform Embedded Systems Micros Assembler, C Real-Time Memory Peripherals Timers DMA PC interfaces HCI Busses Protocols Standards PCI IEEE488 SCSI USB & FireWire CAN

  3. Outline • Keyboard design • Key detection • Keyboard buffer • Centronics printer interface • IO printer ports • Parallel port types • Interfacing LPT ports to various devices

  4. Keyboard Layout • Linear layout • N input ports for N keys • Matrix layout • 2N ports (N input and N output) for N^2 keys

  5. Scanning and Identifying • Micro controller • Rows to output ports • Columns to input ports • Grounding rows • Reading the columns • Grounding one row • Reading the columns

  6. Detection Algorithm

  7. Assembly Code

  8. PC Keyboard • Micro controller (8042) • Microprocessor, RAM, EPROM, I/O ports • Detection by 8042 • Scan code assign • Serial communication to motherboard • One start bit (0) • 8 bits for scan code • Odd-parity bit • One stop bit (1) • 74LS322 (serial-in-parallel-out SR) in motherboard • 74322 to port A of 8255 (port 60H) • In AT and later PCs another 8042 in motherboard

  9. PC Scan Codes Make (0-7FH and break (plus 80H)

  10. Advanced Scan Codes

  11. Status Bytes 0040:0017 H (first) 0040:0018 H (second)

  12. Printer Printer and Printer Interfacing

  13. Centronics printer interface • 36-pin • Grounds to reduce electrical noise (signal has its own ground return) • Data lines • Printer status signals • Printer control signals • Ground signals

  14. Pin Layout

  15. Printer Connector

  16. Printer-PC Communication • PC checks busy • If not busy, PC puts 8-bit data • PC activates #STROBE (.5 micro) • Data must stay (.5 micro after STROBE) • Printer assert busy • After reading data printer asserts #ACKNLG (5 micro) • De-assert busy

  17. I/O Base Address for LPT • -d 0040:0008 • LPT: 03BC, 0378, 0278 • 3 I/O ports • – LPT data lines • – LPT status lines • – LPT control lines

  18. Printer’s Ports

  19. BIOS: INT 17H • AH=0 • Print a character • AL: ASCII • DX: LPT number • AH returns status • AH=1 • Initialize • AH=2 • Get the status • Printer time out? • 20 seconds (-d 0040:0078)

  20. Special Characters

  21. Inner Working of INT 17

  22. Printer Timing

  23. Buffering Ports

  24. Using Parallel Ports

  25. Stepper Motor

  26. Selected Problems • 5, 6, 8 • 22, 28, 32, 43

  27. Summary

More Related