Using the 8254 Timer-Counter Understanding the role of the system’s 8254 programmable Interval-Timer/Counter.

Slides:



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

1 Homework Reading –Intel 8254 Programmable Interval Timer (PIT) Data Sheet Machine Projects –Continue on MP3 Labs –Continue in labs with your assigned.
Dr A Sahu Dept of Comp Sc & Engg. IIT Guwahati 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.
4-1 Timers Timers can be used for  timing  event counting  pulse width measurement  pulse generation  frequency multiplication There are 8 Timers.
Programmable Interval Timer
Dr A Sahu Dept of Computer Science & Engineering IIT Guwahati.
Chapter 10 Input/Output Organization. Connections between a CPU and an I/O device Types of bus (Figure 10.1) –Address bus –Data bus –Control bus.
8253/54 Timer Section /54 Timer Description and Initialization
Programmable Interval Timer Prepared By: Prof. M. B. Salunke SITS, Narhe, Pune - 41.
Microprocessor and Microcontroller
CS-334: Computer Architecture
Using the 8254 Timer-Counter Understanding the role of the system’s 8254 programmable Interval-Timer/Counter.
Using the 8254 Timer-Counter
Outline  Examine some of the H/W supplied with a typical PC and consider the software required to control it.  Introduce Commkit, a software tool that.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
I/O Subsystem Organization and Interfacing Cs 147 Peter Nguyen
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.
Group 7 Jhonathan Briceño Reginal Etienne Christian Kruger Felix Martinez Dane Minott Immer S Rivera Ander Sahonero.
Lecture 13: TI MSP430 Watchdog Timer and Real-Time Clock
Higher Computing Computer Systems S. McCrossan 1 Higher Grade Computing Studies 2. Computer Structure Computer Structure The traditional diagram of a computer...
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
Lecture 9. - Synchronous Devices require a timing signal. Clock generated Interval Timer Microprocessor Interval Timer Clk PCLK = MHz PCLK (for.
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.
created by :Gaurav Shrivastava
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.
System Clocks.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
8254 SOFTWARE PROGRAMMABLE TIMER/COUNTER
The 8253 Programmable Interval Timer
MICROPROCESSOR INPUT/OUTPUT
PIT Programming Examples Working with the modes of PIT.
Timers.
I/O Interfacing A lot of handshaking is required between the CPU and most I/O devices. All I/O devices operate asynchronously with respect to the CPU.
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
Direct Memory Access (DMA) Microprocessors I -1. Topics to be discussed  Basic DMA Concept Basic DMA Concept  DMA pins and timing DMA pins and timing.
ECE291 Computer Engineering II Lecture 12 Josh Potts University of Illinois at Urbana- Champaign.
University of Tehran 1 Microprocessor System Design Timers Omid Fatemi
Features of the new Alibava firmware: 1. Universal for laboratory use (readout of stand-alone detector via USB interface) and for the telescope readout.
8254 Timer.
8279 KEYBOARD AND DISPLAY INTERFACING
Computer operation is of how the different parts of a computer system work together to perform a task.
بسم الله الرحمن الرحيم MEMORY AND I/O.
The 8085 Microprocessor Architecture. What 8085 meant for? 80 - year of invention bit processor 5 - uses +5V for power.
8086 – I/O Interfacing - I/O mapped I/O
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
8254 SOFTWARE PROGRAMMABLE TIMER/COUNTER. Difference between 8253 and Maximum input clock frequency is 2.6 MHz Maximum input clock frequency.
Homework Reading Machine Projects Labs
Homework Reading Machine Projects Labs
Discussions on hw5 Objectives:
Direct Memory address and 8237 dma controller LECTURE 6
Programmable Interval Timer
Programmable Interval Timer
Programmable Interval Timer
Programmable Interval Timer 8254 LECTURE 3
8254 Timer and Counter (8254 IC).
Discussions on hw5 Objectives:
Timers.
Programmable Interval timer 8253 / 8254
Programmable Interval timer 8253 / 8254
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:

Using the 8254 Timer-Counter Understanding the role of the system’s 8254 programmable Interval-Timer/Counter

Motivation We want to explore the Pentium’s support for multiprocessing (as distinguished from multitasking, which we already examined) The algorithms for multiprocessor startup will require us to use some ‘timed delays’ (for example, a delay of 10 milliseconds) Various other systems programming tasks require the use of carefully timed delays

The 8254 PIT 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

Counter decrements when pulsed OUT CLK GATE LSB STATUS MSB LSBMSB LATCH REGISTER COUNT REGISTER TIMER/COUNTER CHANNEL

Three timer/counter ‘channels’ Channel 0 Channel 1 Channel PIT 8284 PCLK +5 V CLK0 CLK1 CLK2 GATE0 GATE1 GATE2 OUT0 OUT1 OUT2 Interrupt IRQ0 DRAM refresh speaker Port 0x61, bit #0 Port 0x61, bit #1 AND Port 0x61, bit #5 Port 0x61, bit # Hz

8254 Command-Port Channel-ID 00 = chn 0 01 = chn 1 10 = chn 2 Command-ID 00 = Latch 01 = LSB r/w 10 = MSB r/w 11 = LSB-MSB r/w Output Mode 000 = one-shot level 001 = retriggerable 010 = rate-generator 011 = square-wave 100 = software strobe 101 = hardware strobe Counting Mode 0 = binary 1 = BCD CHANNELOUTPUT MODECOMMAND binary / BCD Commands are sent to the 8254 via io/port 0x43

Programming a PIT channel Step 1: send command to PIT (port 0x43) Step 2: read or write the channel’s Latch – via port 0x40 for channel 0 – via port 0x41 for channel 1 – via port 0x42 for channel 2

Status/control (via port 0x61) R/O R/W GATE2 1 = on 0 = off speaker 1 = on 0 = off OUT1 1 = on 0 = off OUT2 1 = on 0 = off memory parity check i/o channel check i/o channel check enable memory parity check enable

Algorithm for 10-ms delay Step 1: turn off Channel 2 counting (and disable PC speaker) by clearing bits #0 and #1 at i/o port 0x61 (called ‘PORT_B’) Step 2: issue command to 8254 to accept a new value in Channel 2 Latch Register, by outputing b to io-port 0x43: i.e., chn2, r/w LSB/MSB, one-shot, binary

Algorithm (continued) Step 3: compute the frequency-divisor for a ten millisecond delay (one hundredth of one second) by dividing CLK2 frequency (1,193,182 Hz) by one-hundred Step 4: write quotient’s LSB, followed by its MSB, to channel 2 Latch (io-port 0x42)

Algorithm (continued again) Begin the Channel 2 countdown (set bit #0 at io-port 0x61) and immediately read and save the Pentium’s TimeStamp Counter Spin in a tight loop until the OUT2 signal goes active (Channel 2 count exhausted) by testing bit #5 at io-port 0x61 Immediately re-read TimeStamp Counter Perform subtraction (to get CPU cycles)

Algorithm (concluded) Divide cycle-count by ten-thousand, to get processor’s clock-speed in Mega-Hertz (i.e., in millions of cycles-per-second) Display this quotient in decimal format!

In-class exercise The Real-Time Clock chip automatically updates its clock/calendar registers once each second Register values cannot be reliably read while the RTC’s update is in progress Most significant bit in RTC register 0x0A provides indication of ‘update-in-progress’ How long does the RTC ‘update’ last?

Algorithm for update-duration Wait until a new RTC update begins Immediately read the TimeStamp Counter Wait until this update-operation finishes Immediately read the TimeStamp Counter Wait until the next update begins Immediately read the TimeStamp Counter The RATIO of these two time-intervals gives ‘update-duration’ as a fraction of one second