Lecture_08 - Timers

Lecture_08 - Timers - SEE215 Lecture 8 Timers Faculty of...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Faculty of Science and Technology Lecture 8 Timers SEE215
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Timing All activities in the universe involve time. Similarly activities performed by microcontrollers need to be under the control of time. In a microcontroller these Activities are time locked to the oscillator frequency of the 16 Mhz, by the quartz crystal. Typical quartz resonator To provide accurate timing related to the fundamental clock frequency, the AVR ATMega128 supports four very comprehensive timing modules providing a diverse range of timing functions. Timer/Counter0 and Timer/Counter2 ( 8 bit timers) Timer/Counter1 and Timer/Counter3 (16 bit timers) The counter/timers are perhaps one of the most versatile & complex peripherals. Only the more basic functions will be studied at this time. You have already used one of the Timers for generating pseudo random numbers.
Background image of page 2
Timer & counters ATMEGA 128 has four Timer/Counters 0,1 2 & 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Timing & Timers General Description In principle, a timer is a simple counter. Its advantage is that the input clock and operation of the timer is independent of the program execution. A deterministic clock makes it possible to measure time by counting the elapsed cycles and take the input frequency of the timer into account. Why so many different Timers The answer is quite simple: To have the right timer for the right application and to have enough resources to do this. Several timing functions may be required simultaneously The programmer needs to make a choice of most suitable timer(s) & function(s) to use.
Background image of page 4
Use of data sheets Much of the material for today’s lecture comes from the ATMEL AVR ATMega128 data sheet. It is not expected that the material in it should be committed to memory, but familiarity with its contents and how to read it is. It is a very comprehensive “text book” on the microcontroller. This banner is used to show the detail that is available, but should not be focussed on to much in today’s lecture. Skip quickly through these for now !
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8-bit Timer/Counter0 with PWM and asynchronous Operation Timer/Counter0 is a general purpose, single channel, 8-bit Timer/Counter module. The main features are: • Single Channel Counter • Clear Timer on Compare Match (Auto Reload) • Glitch-free, Phase Correct Pulse Width Modulator (PWM) • Frequency Generator • 10-bit Clock Pre-scaler • Overflow and Compare Match Interrupt Sources (TOV0 and OCF0) • Allows Clocking from External 32 kHz Watch Crystal Independent of the I/O Clock Skip quickly through these for now !
Background image of page 6
16-bit Timer/Counter (Timer/Counter1 and Timer/Counter3 ) The 16-bit Timer/Counters unit allows accurate program execution timing (event management), wave generation, and signal timing measurement. The main features are: • True 16-bit Design (i.e., Allows 16-bit PWM) • Three Independent Output Compare Units • Double Buffered Output Compare Registers • One Input Capture Unit • Input Capture Noise Canceller • Clear Timer on Compare Match (Auto Reload) • Glitch-free, Phase Correct Pulse width Modulator (PWM) • Variable PWM Period
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 38

Lecture_08 - Timers - SEE215 Lecture 8 Timers Faculty of...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online