Dr A Sahu Dept of Comp Sc & Engg. IIT Guwahati. 8155 I/O + Timer 8155 I/O + Timer 8255 I/O 8255 I/O 8253/54 Timer 8253/54 Timer 2 Port (A,B), No Bidirectional.

Slides:



Advertisements
Similar presentations
Lecture 08: 8253/4 Timer and Music
Advertisements

Microprocessor & Interfacing
8086 [2] Ahad. Internal! External? 8086 vs _bit Data Bus 20_bit Address 8_bit Data Bus 20_bit Address Only external bus of 8088 is.
Dr A Sahu Dept of Comp Sc & Engg. IIT Guwahati. Very Easy – Question 1 Easy – Question 2 OK, If u have read the book/slide – Question 4 – Question 5 A.
The 8051 Microcontroller and Embedded Systems
PROGRAMMABLE PERIPHERAL INTERFACE -8255
DMA Controller (8237 Programming Examples)
Dr A Sahu Dept of Computer Science & Engineering IIT Guwahati.
Dr A Sahu Dept of Computer Science & Engineering IIT Guwahati.
Programmable Interval Timer
Dr A Sahu Dept of Computer Science & Engineering IIT Guwahati.
8253/54 Timer Section /54 Timer Description and Initialization
Using the 8254 Timer-Counter Understanding the role of the system’s 8254 programmable Interval-Timer/Counter.
Programmable Interval Timer Prepared By: Prof. M. B. Salunke SITS, Narhe, Pune - 41.
The 8085 Microprocessor Architecture
Microprocessor and Microcontroller
P Address bus Data bus Read-Only Memory (ROM) Read-Write Memory (RAM)
8254 Modes Made by: Ryan wahab (8) Modes Gate is low the count will be paused Gate is high Will continue counting Mode 0: An events counter.
DEEPAK.P MICROPROCESSORS AND APPLICATIONS Mr. DEEPAK P. Associate Professor ECE Department SNGCE 1.
1.  8051 Timers “count up,” incrementing the Timer’s respective “count register” each time there is a triggering clock pulse. 2  When the “count register”
Chapter 10 Input/Output Interface Circuits and LSI Peripheral Devices
Khaled A. Al-Utaibi  8086 Pinout & Pin Functions  Minimum & Maximum Mode Operations  Microcomputer System Design  Minimum Mode.
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
CHAPTER TIMER PROGRAMMING Timers The 8051 has two timers/counters, they can be used as ◦ Timers to generate a time delay ◦ Event counters.
8254 Programmable Interval Timer
ENEE 440 Chapter Timer 8254 Register Select The 8254 timer is actually 3 timers in one. It is an upgraded version of the 8253 timer which was.
1 Chapter 4 Timer Operation (I. Scott MacKenzie).
7/23 Timers in Coldfire Processor Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee (480)
Dec Hex Bin 13 D ORG ; THIRTEEN 8253/54 Timer.
8253 TIMER. Engr 4862 Microprocessors 8253 / 8254 Timer A.k.a. PIT (programmable Interval Timer), used to bring down the frequency to the desired level.
PIT: Programmable Interval Timer
8254 Counter/Timer Counter Each of the three counter has 3 pins associated CLK: input clock frequency- 8 MHz OUT GATE: Enable (high) or disable.
8254 SOFTWARE PROGRAMMABLE TIMER/COUNTER
CoE3DJ4 Digital Systems Design Chapter 4: Timer operation.
The 8253 Programmable Interval Timer
By, Prof. Tambe S. S. S.N.D. College of Engineering and Research Center Department of Electrical Engineering.
PIT Programming Examples Working with the modes of PIT.
Timers.
Advanced Microprocessor1 I/O Interface Programmable Interval Timer: 8254 Three independent 16-bit programmable counters (timers). Each capable in counting.
8279 KEYBOARD AND DISPLAY INTERFACING
University of Tehran 1 Microprocessor System Design Timers Omid Fatemi
8254 Timer.
12/16/  List the elements of 8255A Programmable Peripheral Interface (PPI)  Explain its various operating modes  Develop a simple program to.
Computer Architecture Lecture 6 by Engineer A. Lecturer Aymen Hasan AlAwady 1/12/2013 University of Kufa - Informatics Center for Research and Rehabilitation.
8279 KEYBOARD AND DISPLAY INTERFACING
PROGRAMMABLE PERIPHERAL INTERFACE -8255
Introduction to Microprocessors - chapter3 1 Chapter 3 The 8085 Microprocessor Architecture.
The 8085 Microprocessor Architecture. What 8085 meant for? 80 - year of invention bit processor 5 - uses +5V for power.
Chapter Microcontroller
8086 – I/O Interfacing - I/O mapped I/O
The 8085 Microprocessor Architecture
Homework Reading Machine Projects Labs
Diagram of microprocessor interface with IO devices
8254 – SOFTWARE PROGRAMMABLE TIMER
The 8085 Microprocessor Architecture
Programmable Interval Timer
Programmable Interval Timer
Programmable Interval Timer
Programmable Interval Timer 8254 LECTURE 3
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Introduction to Micro Controllers & Embedded System Design Timer Operation Department of Electrical & Computer Engineering Missouri University of Science.
8254 Timer and Counter (8254 IC).
Timers.
Programmable Interval timer 8253 / 8254
8279 – Programmable Keyboard/Display Interface
Programmable Interval timer 8253 / 8254
The 8085 Microprocessor Architecture
8051 Micro Controller.
8253 – PROGRAMMABLE INTERVAL TIMER (PIT). What is a Timer? Timer is a specialized type of device that is used to measure timing intervals. Timers can.
Programmable Interval Timer
Presentation transcript:

Dr A Sahu Dept of Comp Sc & Engg. IIT Guwahati

8155 I/O + Timer 8155 I/O + Timer 8255 I/O 8255 I/O 8253/54 Timer 8253/54 Timer 2 Port (A,B), No Bidirectional HS mode (C) 4 mode timer 2 Port (A,B) A is Bidirectional HS mode (C) Extra controls 6 mode timer 8259 Interrupt controller 8259 Interrupt controller 8237 DMA controller 8237 DMA controller 8251 Serial I/O USART controller 8251 Serial I/O USART controller

Basic Difference of 8155 I/O timer Vs Brief Architecture of 8254 Control register Status register Modes of Counters with example Read-Back modes

– 00: Single square wave of wavelength TC/2 (TC/2,TC/2 if TC even; [TC+1/2],[TC-1/2] if TC odd) – 01: Square waves of wavelength TC (TC/2,TC/2 if TC even; [TC+1/2],[TC-1/2] if TC odd) – 10: Single pulse on the TC'th clock pulse – 11: Single pulse on every TC'th clock pulse. CLK WR Mode 00 Mode 01 Mode 10 Mode 11 N/2 N NN

Three independent 16-bit programmable counters (timers). It generates accurate time delays and can be used for – Real time clock, an event Ctr, a digital one shot, a square wave gen, complex wave gen. Programmable and work DC to 8 MHz 5 different modes of operation

The 8254 Programmable Interval-timer is used by the PC system for (1) generating timer-tick interrupts (rate is 18.2 per sec), (2) performing dynamic memory-refresh (reads ram once every 15 microseconds), and (3) generates ‘beeps’ of PC speaker When the speaker-function isn’t needed, the 8254 is available for other purposes

Data Bus Buffer Data Bus Buffer Read/ Write Logic Read/ Write Logic Counter 0 Counter 0 CLK 0 GATE 0 OUT 0 InternalBusInternalBus InternalBusInternalBus Control Word Register Control Word Register Counter 1 Counter 1 CLK 1 GATE 1 OUT 1 Counter 2 Counter 2 CLK 2 GATE 2 OUT 2 D0-D7 RD b WR b A0 A1 CS b

RD b, WR b, CS b A0, A1: Selection of Counter and Control Register Suppose Address is (80H,81H,82H,83H) with interfacing Circuit A1A0Selection 00Counter 0 01Counter 1 10Counter 2 11Control Register

D7D6D5D4D3D2D1D0 SC1SC2RW1RW0M2M1M0BCD Select Counter 00: Counter 0 01: Counter 1 10: Counter 2 11: Read-Back Command Read Write 00: Counter latch Command 01:RW LSByte only 10: RW MSByte only 11:RW LSByte first then Msbyte 000 : Mode :Mode 1 X10 :Mode 2 X11 :Mode :Mode : Mode 5 0/1 = Binary / BCD Mode

Each counter may be programmed with a count of 1 to FFFFH. – Minimum count is 1 all modes except 2 and 3 with minimum count of 2. Each counter has a program control word used to select the way the counter operates. – If two bytes are programmed, then the first byte (LSB) stops the count, and the second byte (MSB) starts the counter with the new count.

Mode 0 : Interrupt on Terminal count Mode 1 : Hardware Retriggerable One Shot Mode 2 : Rate Generator Mode 3 : Square wave generator Mode 4 : Software Triggered Strobe Mode 5 : Hardware Triggered Strobe

The output becomes a logic 0 when the control word is written and remains there until N plus the number of programmed counts. CLK OUT Count of 7 loaded

The G input triggers the counter to output a 0 pulse for `count' clocks. Counter reloaded if G is pulsed again. CLK GATE OUT Triggered with count of 5

Counter generates a series of pulses 1 clock pulse wide. The separation between pulses is determined by the count. The cycle is repeated until reprogrammed or G pin set to 0. CLK OUT Count of 5 loaded

Control word = 14H – D7D6=00 Select ctr 0 – D5D4=01 load 8 bit count – D3D2D1=010 mode 2 – D0=0 Binary Count = 50x10 -6 /0.5x10 -6 =64H PULSE: MVI A 14H ; Control word OUTCTRAdd 83H MVI A,64H ;Count value OUT80H ; load counter 0 with low order byte HALT

Generates a continuous square-wave with G set to 1. If count is even, 50% duty cycle otherwise OUT is high 1 cycle longer CLK OUT Count of 6 loaded

Control word = 76H Count= 1x10 -3 /0.5x10 -6 =2000=07D0H Instructions MVI A,76H ; load Control word for Ctr 1 mode 3 OUT83H; write to Ctrl reg MVI A, D0H; lower order byte cnt OUT81H MVIA,07H ; higher order byte OUT81H HLT D7D6D5D4D3D2D1D0 SC1SC2RW1RW0M2M1M0BCD 01Load 16 bit (11)011 (mode 3)0

Software triggered one-shot (G must be 1). OUT goes initially High, it goes low for one clock at the end of count The count must be reloaded for subsequent output CLK OUT Triggered with count of 8

Hardware triggered is one-shot It is triggered by rising edge at the Gate Initially the OUT is low and Gate triggered from low to high the count begins OUT goes low for one clock periood H/W trigger with count of 8 CLK OUT

ModesLow or Going Low RisingHigh Mode 0Disable Counting-Enable Counting Mode Initiate Counting 2. Reset O/P after next Clock Disable counting 2.Set O/P immediately high 1.Reloads Counter 2.Initiate Counting Enable Counting 1.Disable counting 2.Set O/P immediately high Initiates CountingEnable Counting Disable CountingEnable Counting Initiates Counting

This allow user to read the count and status of the counter Command Written in control register and count of the specified counter can be latched Control word (D6H) in control word will latch the count of CNT0 & CNT1 D7D6D5D4D3D2D1D0 SC1SC2COUNT b STATUS b CNT2CNT1CNT00 11: Read- Back Command If (D5=0) count is lateched D3=1 select counter 2 D2=1 select counter 1 D1=1 select counter 0

Status can be read if STATUS b bit D4 =0 D7=1 : Outpin is 1, 0 Outpin is 0 D6=1: Null count, D6: 0= Count available for reading D5-D0:Counter Programmed mode D7D6D5D4D3D2D1D0 OUTPUTNULL COUNT RW1RW0M2M1M0BCD

Assume Clock Freq=2MhZ Count is too large Counter 1 load with 50,000 to generate 25ms – CNTLOAD=50, =C350H Counter 2 load with 40 to generate 25msX40=-1S pulse (CNTLOAD=40 10 =28H) Counter1 input is to counter 2 Both Counter 1 & Counter 2 in Mode 2

Counter 1 (74H) Counter 2 (94H) D7D6D5D4D3D2D1D0 SC1SC2RW1RW0M2M1M0BCD 01Load 16 bit (11)010 (mode 2)0 D7D6D5D4D3D2D1D0 SC1SC2RW1RW0M2M1M0BCD 10Load 8 bit (01)010 (mode 2)0

MVIA, 74H; Mode for 1 st CTR OUT83H;Write in control register MVIA,94H ; Mode for 2 nd CTR OUT83H; Write to control register MVI A,50; low byte of CTR1=C350 OUT81H; load to CTR1 low byte MVIA,C3; high byte of CTR1=C350 OUT81H; load to CTR1 high byte MVIA,28H; Count for Counter 2 OUT82H; Load Counter 2 RET MVIA, 74H; Mode for 1 st CTR OUT83H;Write in control register MVIA,94H ; Mode for 2 nd CTR OUT83H; Write to control register MVI A,50; low byte of CTR1=C350 OUT81H; load to CTR1 low byte MVIA,C3; high byte of CTR1=C350 OUT81H; load to CTR1 high byte MVIA,28H; Count for Counter 2 OUT82H; Load Counter 2 RET