Download presentation
Presentation is loading. Please wait.
Published byRoland Rose Modified over 9 years ago
1
University of Tehran 1 Interface Design Keyboard and Printer Omid Fatemi
2
University of Tehran 2 Typical Interface Design Connect ComputeConveyCooperate 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
University of Tehran 3 Outline Keyboard design Key detection Keyboard buffer Centronics printer interface IO printer ports Parallel port types Interfacing LPT ports to various devices
4
University of Tehran 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
University of Tehran 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
University of Tehran 6 Detection Algorithm
7
University of Tehran 7 Assembly Code
8
University of Tehran 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
University of Tehran 9 PC Scan Codes Make (0-7FH and break (plus 80H)
10
University of Tehran 10 Advanced Scan Codes
11
University of Tehran 11 Status Bytes 0040:0017 H (first) 0040:0018 H (second)
12
University of Tehran 12 Printer Printer and Printer Interfacing
13
University of Tehran 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
University of Tehran 14 Pin Layout
15
University of Tehran 15
16
University of Tehran 16 Printer Connector
17
University of Tehran 17 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
18
University of Tehran 18 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
19
University of Tehran 19 Printer’s Ports
20
University of Tehran 20 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)
21
University of Tehran 21 Special Characters
22
University of Tehran 22 Inner Working of INT 17
23
University of Tehran 23 Printer Timing
24
University of Tehran 24 Buffering Ports
25
University of Tehran 25 Using Parallel Ports
26
University of Tehran 26 Stepper Motor
27
University of Tehran 27 Selected Problems 5, 6, 8 22, 28, 32, 43
28
University of Tehran 28 Summary
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.