Download presentation
Presentation is loading. Please wait.
Published bySuzan Jacobs Modified over 9 years ago
1
ELE22MIC Lecture 18 The AVR Sleep Modes The ATMEGA128’s Timer System
Clock Sources The 8-bit Timer 0 Modes Clear Timer on Compare match (CTC) Two Pulse Width Modulation (PWM) modes Fast Pulse Width Modulation Phase Correct Pulse Width Modulation
2
8-bit Timer/Counter 0 The ATMEGA128 contains 4 timer modules. The Bilby is the device we use in lab sessions: an ATMEGA128 on a PCB. Each module has a selection of possible clock or oscillator sources: I/O Clock, System Clock The Bilby’s main crystal is MHz, An External low-power crystal connected to TOSC1 & TOSC2 pins.
3
8-bit Timer/Counter 0 The Bilby’s main crystal is 7.3728MHz,
ATMEGA128 Current consumption with the main oscillator running is in the order of 5mA. The Bilby’s low-power crystal connected to TOSC1 & TOSC2 pins. The Bilby’s low power crystal is 32768Hz The ATMEGA128 has sleep modes where only this counter remains active. Total current consumption with a 32768Hz crystal clock running, in power-down sleep mode, is around 200nA (all other subsystems switched off).
4
Modes of Sleep - Sleep Depth
5
Modes of Sleep - Clock Domains
6
Power-Save Considerations
Every enabled CPU feature consumes extra current. For example the Bandgap voltage reference consumes 10uA current. The ultra-low power-down sleep mode power consumption can only be achieved IF the features can be switched off.. We can then achieve ultra-low power operation - suitable for miniature battery operation.
7
Timer / Counter 0 Main Features:
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)
8
Timer / Counter 0 Glitch-free, Phase Correct Pulse Width Modulator (PWM) Frequency Generator 10-bit Clock Prescaler Overflow and Compare Match Interrupt Sources (TOV0 and OCF0) Allows Clocking from External 32 kHz Watch Crystal Independent of the I/O Clock
9
8-Bit Timer Block Diagram
10
8-Bit Timer Block Diagram
11
8-Bit Timer Counter Unit Block Diagram
12
8-Bit Timer Output Compare Unit
13
CTC Mode Timing Diagram
14
Fast PWM Mode, Timing Diagram
15
Phase Correct PWM Mode, Timing Diagram
16
ULN2003
17
Stepper Motor
18
ULN2003
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.