V.V.P. ENGINEERING COLLEGE,RAJKOT

Slides:



Advertisements
Similar presentations
More fun with Timer/Counters
Advertisements

4-1 Timers Timers can be used for  timing  event counting  pulse width measurement  pulse generation  frequency multiplication There are 8 Timers.
Microcontroller Programming II MP6-1
ECT 357 Ch 16 Output Control. Today’s Quote: The measure of a man is not how great his faith is bt how great his love is. The measure of a man is not.
Kuliah Mikrokontroler AVR Comparator AVR Eru©September 2009 PENS.
Introduction of Holtek HT-46 series MCU
COMP3221: Microprocessors and Embedded Systems Lecture 16: Interrupts II Lecturer: Hui Wu Session 2, 2005.
Mark Neil - Microprocessor Course 1 Timers and Interrupts.
8-Bit Timer/Counter 0 Counter/Timer 0 and 2 (TCNT0, TCNT2) are nearly identical. Differences: -TCNT0 can run off an external 32Khz clock (Tosc) or the.
ATtiny2313 Timers/Counters CS-423 Dick Steflik. What Do You Use Timers For? Timing of events (internal or external)‏ Scheduling Events Measuring the width.
5-1 Timer/Counters In many microprocessor systems we need to:  count logic pulses  measure the frequency of signals  measure the period of pulses 
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
Pulse Width Modulation modes
16-Bit Timer/Counter 1 and 3 Counter/Timer 1,3 (TCNT1, TCNT3) are identical in function. Three separate comparison registers exist. Thus, three separate.
1 Timing System Timing System Applications. 2 Timing System components Counting mechanisms Input capture mechanisms Output capture mechanisms.
ECE 371- Unit 11 Timers and Counters (“Stop Watches and Alarm Clocks”)
7/23 Timers in Coldfire Processor Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee (480)
Slides created by: Professor Ian G. Harris Interrupts  Embedded systems often perform some tasks which are infrequent and possibly unpredictable Hang.
Timer/counter Chapter 12
ARM Timers.
A Few Words From Dilbert
Timers ELEC 330 Digital Systems Engineering Dr. Ron Hayne
Unit 10.2 Timer Examples. Example – Music Generation Channel 6 – Set up as a timer Output to Generate Square Waves Channel 4 – Set up as a timer Output.
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose This course provides an introduction to the peripheral functions.
ELE22MIC Lecture 18 The AVR Sleep Modes The ATMEGA128’s Timer System
Counter/Timer/PWM. incoming Lab. Counter counter is a device which stores the number of times a particular event or process has occurred synchronous/asynchronous.
CCP MODULES  The CCP module (Capture/Compare/PWM) is a peripheral which allows the user to time and control different events.  Capture Mode provides.
AVR Programming: Timers October 8, What is a timer? A register that keeps track of a current value This value is updated at a certain frequency.
1 68HC11 Timer Chapter HC11 Timer Subsystem Several timing functions: Basic timing Basic timing Real time interrupts Real time interrupts Output.
Lecture 12 Multi-Function Timer Pulse Unit 2 (MTU2a)
CS-280 Dr. Mark L. Hornick 1 Atmel Timer/Counter System Most microcontrollers include some type of timer system Facilitates real-time monitoring and control.
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.
Timers and Interrupts Mark Neil - Microprocessor Course.
Timers and Scheduled Interrupts
The AVR microcontroller and embedded systems using assembly and c AVR Microcontroller and Embedded System Using Assembly and C Mazidi, Naimi, and Naimi.
#1 of 10 Tutorial Introduction PURPOSE -To explain how to configure and use the Timer Interface Module in common applications OBJECTIVES: -Identify the.
Mark Neil - Microprocessor Course 1 Timers and Interrupts.
Timer 1 and 2 operation, PWM Principles. Timer 1 Operation.
INSTITUTE: INSTITUTE:PARUL INSTITUTE OF TECHNOLOGY BRANCH : BRANCH :B.E. E.C.5 TH SEM. SUBJECT:MICROCONTROLLER & INTERFACING TOPIC:AVR INTTRUPT TOPIC:AVR.
16-Bit Timer/Counter 1 and 3
Timer modules in PIC 16F877.  The PIC 16F877 basically has three independent timer modules,  denoted by the symbols, TIMER-0, TIMER1,andTIMER2. . These.
Timers and Scheduled Interrupts
Why are Timer Functions Important?
ECE 3430 – Intro to Microcomputer Systems
PWM and DC Motor Control
BITS EDU. CAMPUS , VARNAMA
AVR Addressing Modes Subject: Microcontoller & Interfacing
RX 8-Bit Timer (TMR) 4/20/2011 Rev. 1.00
8-Bit Timer/Counter 0 Counter/Timer 0 and 2 (TCNT0, TCNT2) are nearly identical. Differences: -TCNT0 can run off an external 32Khz clock (Tosc) or the.
Timer/Counter Modified from Dr. Lam Phung’s Slides.
16-bit Timer/Counter1 Features
8-bit Timer/Counter0 with PWM
ATmega103 Timer0 and Interrupts
8051 Timers Prof. Rajiv R Bhandari.
PWM and DC Motor Control
Pugazhendhi.M 11/12/2018 TIMERS 11/12/2018 CCET CCET.
8051 Timers / Counters It has two timers Timer 0 and Timer 1.
DC motor and PWM.
8-bit Timer/Counter2 with PWM and Asynchronous Operation
UNIT 19 PWM 로봇 SW 교육원 조용수.
Lecture 12 Multi-Function Timer Pulse Unit 2 (MTU2a)
Timers/Counters.
Example 18 Pulse Train Using Interrupts
Wave Generation and Input Capturing
Timer/Counter Timer/Counter 0 Timer/Counter 1 Timer/Counter 2 8 bit
COMP3221: Microprocessors and Embedded Systems
Presentation transcript:

V.V.P. ENGINEERING COLLEGE,RAJKOT AVR Timer/Counter Subject : Micro Controller & Interfacing Name of the Students: 1) JAGATIYA KEVAL(130470111015)

Timer/Counter Timer/Counter 0 Timer/Counter 1 Timer/Counter 2 8 bit

8-bit Timer/Counter0 with PWM Features Single Compare Unit Counter Clear Timer on Compare Match (Auto Reload) Glitch-free, Phase Correct Pulse Width Modulator (PWM) Frequency Generator External Event Counter 10-bit Clock Prescaler (1, 8, 64, 256, 1024) Overflow and Compare Match Interrupt Sources (TOV0 and OCF0)

Timer0

Registers The Timer/Counter (TCNT0) and Output Compare Register (OCR0) are 8-bit registers. Interrupt request (abbreviated to Int.Req. in the figure) signals are all visible in the Timer Interrupt Flag Register (TIFR). All interrupts are individually masked with the Timer Interrupt Mask Register (TIMSK). TIFR and TIMSK are not shown in the figure since these registers are shared by other timer units.

The Timer/Counter can be clocked internally, via the prescaler, or by an external clock source on the T0 pin. The Clock Select logic block controls which clock source and edge the Timer/Counter uses to increment (or decrement) its value. The Timer/Counter is inactive when no clock source is selected. The output from the Clock Select logic is referred to as the timer clock (clkT0).

The double buffered Output Compare Register (OCR0) is compared with the Timer/Counter value at all times. The result of the compare can be used by the waveform generator to generate a PWM or variable frequency output on the Output Compare Pin (OC0). The compare match event will also set the Compare Flag (OCF0) which can be used to generate an output compare interrupt request.

Registers TCCR0 – Timer/Counter Control Register TCNT0 – Timer/Counter Register OCR0 – Output Compare Register TIMSK – Timer/Counter Interrupt Mask Register TIFR – Timer/Counter Interrupt Flag Register

Bit 5:4 – COM01:0: Compare Match Output Mode

Bit 2:0 – CS02:0: Clock Select

TIMSK – Timer/Counter Interrupt Mask Register

TIFR – Timer/Counter Interrupt Flag Register

Thank you