Programmable Interval Timer INTEL 8253 8254 The 8254
Programmable Interval Timer INTEL 8253 / 8254
The 8254 Programmable Interval Timer • 3 independent 16 -bit programmable counters • Counting in binary/BCD • Applications – Real-time clock – Event counter
• • 8254 I/O D 7 -D 0: System data bus CLK 0: Clock for counter 0 Gate 0: Gate for counter 0 CLK 1: Clock for counter 1 Gate 1: Gate for counter 1 CLK 2: Clock for counter 2 Gate 2: Gate for counter 2 A 1 -A 0: Address select – – • • 00: Counter 0 01: Counter 1 10: Counter 2 11: Control Register Vcc: Power (+5 V) Ground: RD: Read enable WR: Write enable CS: Chip select signal OUT 0: Output of counter 0 OUT 1: Output of counter 1 OUT 2: Output of counter 2
8254 Block Diagram
Control Register
Programming the 8254 • Each counter is programmed individually by writing – A control word – The initial count • Control word selects – – • Program sequence 1: – – – • Counter Mode of operation Type of operation (read/write) Type of count (binary/BCD) PROGRAM CONTROL WORD 1 PROGRAM CONTROL WORD 2 PROGRAM LSB 1 PROGRAM LSB 2 PROGRAM MSB 1 PROGRAM MSB 2 Program sequence 2: – – – PROGRAM CONTROL WORD 1 PROGRAM LSB 1 PROGRAM MSB 1 PROGRAM CONTROL WORD 2 PROGRAM LSB 2 PROGRAM MSB 2
8254 Modes of Operation • Mode 0: Events counter. • Mode 1: One shot pulse • Mode 2: Continuous pulses, one clock pulse wide • Mode 3: Continuous square-wave as long as Gate is 1 • Mode 4: Software triggered one-shot pulse • Mode 5: Hardware triggered one-shot pulse
Modes of Operation • Mode 0: Events counter (used for system time) • Mode 1: One shot pulse
Modes of Operation • Mode 2: Continuous pulses • Mode 3: Continuous squarewave
Modes of Operation • Mode 4: Software triggered one-shot pulse • Mode 5: Hardware triggered one-shot pulse
Example • Connect an 8254 in a 8085 processor system so that it occupies the address range 4 CH-4 FH • Program counter 0 in mode 0 with a count of ABCDH and counter 1 in mode 3 and a count of 3456 H • Program counter 0 to generate an interrupt every 10 ms using a 10 MHz oscillator – Write an interrupt service routine that calls a sleep function every 1 min • Program counter 1 to produce a 1. 25 MHz clock output with 50% duty cycle
- Slides: 11