Timer Timer is a device, which counts the input at regular interval (δT) using clock pulses at its input. The counts increment on each pulse and store.

Slides:



Advertisements
Similar presentations
Computer-System Structures Er.Harsimran Singh
Advertisements

More fun with Timer/Counters
8051 Core Specification.
Microprocessor and Microcontroller
The Process Control Block From: A Process Control Block (PCB, also called Task Control Block or Task Struct) is.
68HC11 Polling and Interrupts
ECE 372 – Microcontroller Design Parallel IO Ports - Interrupts
COMP3221: Microprocessors and Embedded Systems Lecture 15: Interrupts I Lecturer: Hui Wu Session 1, 2005.
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
INTERRUPTS PROGRAMMING
Lecture 13: TI MSP430 Watchdog Timer and Real-Time Clock
1 Timing System Timing System Applications. 2 Timing System components Counting mechanisms Input capture mechanisms Output capture mechanisms.
General System Architecture and I/O.  I/O devices and the CPU can execute concurrently.  Each device controller is in charge of a particular device.
Introduction to Embedded Systems
Ch. 9 Interrupt Programming and Real-Time Sysstems From Valvano’s Introduction to Embedded Systems.
7/23 Timers in Coldfire Processor Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee (480)
ARM Timers.
System Clocks.
DAT2343 Accessing Services Through Interrupts © Alan T. Pinck / Algonquin College; 2003.
M Semiconductor Products Sector Computer Operating Properly Module Detail Slide #1 of 7 Tutorial Introduction PURPOSE -To explain how to configure and.
Chapter 4 TIMER OPERATION
Free Running Counter & Real Time Control
MICROPROCESSOR INPUT/OUTPUT
MCU: Interrupts and Timers Ganesh Pitchiah. What’s an MCU ?
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 2: Computer-System Structures Computer System Operation I/O Structure.
1 CSE Department MAITSandeep Tayal Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
Lecture 25: LM3S9B96 Microcontroller – Watchdog Timer.
Chapter 2: Computer-System Structures 2.1 Computer System Operation 2.5 Hardware Protection 2.6 Network Structure.
The Functions of Operating Systems Interrupts. Learning Objectives Explain how interrupts are used to obtain processor time. Explain how processing of.
Interrupts and reset operations. Overview  Introduction to interrupts – What are they – How are they used  68HC11 interrupt mechanisms – Types of interrupts.
Interrupts general concepts interrupt systems. Interrupts - concepts 2/27 Interrupt - the event inside or outside of microprocessor system, requested.
Time Management.  Time management is concerned with OS facilities and services which measure real time, and is essential to the operation of timesharing.
13-Nov-15 (1) CSC Computer Organization Lecture 7: Input/Output Organization.
CSNB374: Microprocessor Systems Chapter 5: Procedures and Interrupts.
1 68HC11 Timer Chapter HC11 Timer Subsystem Several timing functions: Basic timing Basic timing Real time interrupts Real time interrupts Output.
Timers and Interrupts Anurag Dwivedi. Let Us Revise.
1 © Unitec New Zealand Interrupt Lecture 6 Date: - 20 Sept, 2011 Embedded Hardware ETEC 6416.
Timers and Counters by Dr. Amin Danial Asham. References  Programmable Controllers-Theory and Implementation, 2nd Edition, L.A. Bryan and E.A. Bryan.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
1 Interrupts, Resets Today: First Hour: Interrupts –Section 5.2 of Huang’s Textbook –In-class Activity #1 Second Hour: More Interrupts Section 5.2 of Huang’s.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 2 Computer-System Structures Slide 1 Chapter 2 Computer-System Structures.
Conclusion Speech. Content Organization Pronunciation Handwriting.
1 68HC11 Timer HC11 or HC12: Chapter HC11 Timer Subsystem  Several timing functions: Basic timing Basic timing Real time interrupts Real time.
Interrupts  An interrupt is any service request that causes the CPU to stop its current execution stream and to execute an instruction stream that services.
Real Time Interrupts Section Real-Time Interrupt (RTI) Most operating systems (OS) require an interrupt every T seconds by the RTI RTI interrupts.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Computer Organization Instruction Set Architecture (ISA) Instruction Set Architecture (ISA), or simply Architecture, of a computer is the.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
Chapter 3 : Top Level View of Computer Functions Basic CPU function, Interconnection, Instruction Format and Interrupt.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
1 Run-to-Completion Non-Preemptive Scheduler. 2 In These Notes... What is Scheduling? What is non-preemptive scheduling? Examples Run to completion (cooperative)
1 68HC11 Timer. 2 68HC11 Timer Subsystem Several timing functions: Basic timing Basic timing Real time interrupts Real time interrupts Output compare.
Networked Embedded Systems Pengyu Zhang & Sachin Katti EE107 Spring 2016 Lecture 4 Timers and Interrupts.
INSTITUTE: INSTITUTE:PARUL INSTITUTE OF TECHNOLOGY BRANCH : BRANCH :B.E. E.C.5 TH SEM. SUBJECT:MICROCONTROLLER & INTERFACING TOPIC:AVR INTTRUPT TOPIC:AVR.
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
CS501 Advanced Computer Architecture
68HC11 Interrupts & Resets.
Lesson Objectives Aims Key Words Interrupt, Buffer, Priority, Stack
Timer and Interrupts.
UNIT 5 TIMRERS/COUNTERS
Module 2: Computer-System Structures
Accessing Services Through Interrupts
Module 2: Computer-System Structures
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
Module 2: Computer-System Structures
Module 2: Computer-System Structures
Presentation transcript:

Timer Timer is a device, which counts the input at regular interval (δT) using clock pulses at its input. The counts increment on each pulse and store in a register called count register Output bits (in a count register or at the output pins) for the present counts. Evaluation of Time The counts multiplied by the interval δT give the time. The (present counts −initial counts) × δT interval gives the time interval between two instances when present count bits are read and initial counts were read or set.

Timer Has an input pin (or a control bit in control register) for resetting it for all count bits = 0s. Has an output pin (or a status bit in status register) for output when all count bits = 0s after reaching the maximum value, which also means after timeout or overflow.

Counter A device, which counts the input due to the events at irregular or regular intervals. The count gives the number of input events or pulses since it was last read. Has a register to enable read of present counts Functions as timer when counting regular interval clock pulses Has an input pin (or a control bit in control register) for resetting it for all count bits = 0s. Has an output pin (or a status bit in status register) for output when all count bits = 0s after reaching the maximum value, which also means after timeout or overflow.

Timer or Counter Interrupt When a timer or counter becomes 0x00 or 0x0000 after 0xFF or 0xFFFF (maximum value), it can generate an ‘interrupt’, or an output ‘Time-Out’ or set a status bit ‘TOV’

Software Timer A software, which executes and increases or decreases a count-variable (count value) on an interrupt from on a system timer output or from on a real time clock interrupt. The software timer also generate interrupt on overflow of count-value or on finishing value of the count variable.

System clock In a system an hardware-timing device is programmed to tick at constant intervals. At each tick there is an interrupt A chain of interrupts thus occur at periodic intervals. The interval is as per a preset count value The interrupts are called system clock interrupts, when used to control the schedules and timings of the system.

Software timer (SWT) SWT is a timer based on the system clock interrupts The interrupt functions as a clock input to an SWT. This input is common to all the SWTs that are in the list of activated SWTs. Any number of SWTs can be made active in a list. Each SWT will set a status flag on its timeout (count-value reaching 0).

SWT Actions are analogous to that of a hardware timer. While there is physical limit (1, 2 or 3 or 4) for the number of hardware timers in a system, SWTs can be limited by the number of interrupt vectors provided by the user. Certain processors (microcontrollers) also defines the interrupt vector addresses of 2 or 4 SWTs

Watchdog timer A timing device such that it is set for a preset time interval and an event must occur during that interval else the device will generate the timeout signal on failure to get that event in the watched time interval. On that event, the watchdog timer is disabled to disable generation of timeout or reset. Timeout may result in processor start a service routine or start from beginning.

Watchdog timer : Example Assume that we anticipate that a set of tasks must finish in 100 ms interval. The watchdog timer is disabled and stopped by the program instruction in case the tasks finish within 100 ms interval. In case task does not finish (not disabled by the program instruction), watchdog timer generates interrupts after 100 ms and executes a routine, which is programmed to run because there is failure of finishing the task in anticipated interval.

Watchdog timer application An application in mobile phone is that display is off in case no GUI interaction takes place within a watched time interval. The interval is usually set at 15 s, 20 s, 25 s, 30 s in mobile phone. This saves power. An application in temperature controller is that if controller takes no action to switch off the current within preset watched time interval, the current is switched off and warning signal is raised as indication of controller failure. Failure to switch off current may burst a boiler in which water is heated.

Provisioning of watchdog timer A software task can also be programmed as a watchdog timer Microcontroller may also provide for a watchdog timer. 68HC11 microcontroller watchdog timer There are two registers, CONFIG (system configuration control register) and COPRST (computer operating properly and processor reset on failure). They are for programming the interrupts of the watchdog timer.

Real Time Clock (RTC) A clock, which is based on the interrupts at preset intervals. An interrupt service routine executes on each timeout (overflow) of this clock. This timing device once started never resets or never reloaded with another value. Once it is set, it is not modified later. Used in a system to save the time and date. Used in a system to initiate return of control to the system (OS) after the set system clock periods.

RTC Application Assume that a hardware timer of an RTC for calendar is programmed to interrupt after every 5.15 ms (=1 day period/ 2 24 ) Assume each tick (interrupt) a service routine runs and updates at a memory location. Within one day (86400 s) there will be 2 24 ticks, the memory location will reach 0x after reaching the maximum value 0xFFFFFF. Within 256 days there will be 2 32 ticks, the memory location will reach 0x after reaching the maximum value 0xFFFFFFFF. A battery is used to protect the memory for long period.