ATmega32A Datasheet - Sunrom Technologies
ATmega32A Datasheet - Sunrom Technologies ATmega32A Datasheet - Sunrom Technologies
ATmega32Aface, Timer/Counters, Watchdog, and the interrupt system to continue operating. This sleepmode basically halts clk CPU and clk FLASH , while allowing the other clocks to run.Idle mode enables the MCU to wake up from external triggered interrupts as well as internalones like the Timer Overflow and USART Transmit Complete interrupts. If wake-up from theAnalog Comparator interrupt is not required, the Analog Comparator can be powered down bysetting the ACD bit in the Analog Comparator Control and Status Register – ACSR. This willreduce power consumption in Idle mode. If the ADC is enabled, a conversion starts automaticallywhen this mode is entered.9.3 ADC Noise Reduction ModeWhen the SM2:0 bits are written to 001, the SLEEP instruction makes the MCU enter ADCNoise Reduction mode, stopping the CPU but allowing the ADC, the External Interrupts, theTwo-wire Serial Interface address watch, Timer/Counter2 and the Watchdog to continue operating(if enabled). This sleep mode basically halts clk I/O , clk CPU , and clk FLASH , while allowing theother clocks to run.This improves the noise environment for the ADC, enabling higher resolution measurements. Ifthe ADC is enabled, a conversion starts automatically when this mode is entered. Apart form theADC Conversion Complete interrupt, only an External Reset, a Watchdog Reset, a Brown-outReset, a Two-wire Serial Interface Address Match Interrupt, a Timer/Counter2 interrupt, anSPM/EEPROM ready interrupt, an External level interrupt on INT0 or INT1, or an external interrupton INT2 can wake up the MCU from ADC Noise Reduction mode.9.4 Power-down ModeWhen the SM2:0 bits are written to 010, the SLEEP instruction makes the MCU enter Powerdownmode. In this mode, the External Oscillator is stopped, while the External interrupts, theTwo-wire Serial Interface address watch, and the Watchdog continue operating (if enabled).Only an External Reset, a Watchdog Reset, a Brown-out Reset, a Two-wire Serial Interfaceaddress match interrupt, an External level interrupt on INT0 or INT1, or an External interrupt onINT2 can wake up the MCU. This sleep mode basically halts all generated clocks, allowing operationof asynchronous modules only.Note that if a level triggered interrupt is used for wake-up from Power-down mode, the changedlevel must be held for some time to wake up the MCU. Refer to “External Interrupts” on page 69for details.When waking up from Power-down mode, there is a delay from the wake-up condition occursuntil the wake-up becomes effective. This allows the clock to restart and become stable afterhaving been stopped. The wake-up period is defined by the same CKSEL fuses that define thereset time-out period, as described in “Clock Sources” on page 26.9.5 Power-save ModeWhen the SM2:0 bits are written to 011, the SLEEP instruction makes the MCU enter Powersavemode. This mode is identical to Power-down, with one exception:If Timer/Counter2 is clocked asynchronously, that is, the AS2 bit in ASSR is set, Timer/Counter2will run during sleep. The device can wake up from either Timer Overflow or Output Compareevent from Timer/Counter2 if the corresponding Timer/Counter2 interrupt enable bits are set inTIMSK, and the Global Interrupt Enable bit in SREG is set.8155C–AVR–02/1134
ATmega32AIf the Asynchronous Timer is NOT clocked asynchronously, Power-down mode is recommendedinstead of Power-save mode because the contents of the registers in the Asynchronous Timershould be considered undefined after wake-up in Power-save mode if AS2 is 0.This sleep mode basically halts all clocks except clk ASY , allowing operation only of asynchronousmodules, including Timer/Counter2 if clocked asynchronously.9.6 Standby ModeWhen the SM2:0 bits are 110 and an external crystal/resonator clock option is selected, theSLEEP instruction makes the MCU enter Standby mode. This mode is identical to Power-downwith the exception that the Oscillator is kept running. From Standby mode, the device wakes upin six clock cycles.9.7 Extended Standby ModeWhen the SM2:0 bits are 111 and an external crystal/resonator clock option is selected, theSLEEP instruction makes the MCU enter Extended Standby mode. This mode is identical toPower-save mode with the exception that the Oscillator is kept running. From Extended Standbymode, the device wakes up in six clock cycles.9.8 Minimizing Power ConsumptionThere are several issues to consider when trying to minimize the power consumption in an AVRcontrolled system. In general, sleep modes should be used as much as possible, and the sleepmode should be selected so that as few as possible of the device’s functions are operating. Allfunctions not needed should be disabled. In particular, the following modules may need specialconsideration when trying to achieve the lowest possible power consumption.9.8.1 Analog to Digital ConverterIf enabled, the ADC will be enabled in all sleep modes. To save power, the ADC should be disabledbefore entering any sleep mode. When the ADC is turned off and on again, the nextconversion will be an extended conversion. Refer to “Analog to Digital Converter” on page 209for details on ADC operation.9.8.2 Analog ComparatorWhen entering Idle mode, the Analog Comparator should be disabled if not used. When enteringADC Noise Reduction mode, the Analog Comparator should be disabled. In the other sleepmodes, the Analog Comparator is automatically disabled. However, if the Analog Comparator isset up to use the Internal Voltage Reference as input, the Analog Comparator should be disabledin all sleep modes. Otherwise, the Internal Voltage Reference will be enabled,independent of sleep mode. Refer to “Analog Comparator” on page 206 for details on how toconfigure the Analog Comparator.9.8.3 Brown-out DetectorIf the Brown-out Detector is not needed in the application, this module should be turned off. If theBrown-out Detector is enabled by the BODEN Fuse, it will be enabled in all sleep modes, andhence, always consume power. In the deeper sleep modes, this will contribute significantly tothe total current consumption. Refer to “Brown-out Detector” on page 35 for details on how toconfigure the Brown-out Detector.8155C–AVR–02/1135
- Page 3 and 4: ATmega32A2. OverviewThe Atmel ® AV
- Page 5: ATmega32Ametrical drive characteris
- Page 9 and 10: ATmega32A6.3.1 SREG - AVR Status Re
- Page 11 and 12: ATmega32A6.4.1 The X-register, Y-re
- Page 13 and 14: ATmega32AFigure 6-5.Single Cycle AL
- Page 15: ATmega32AA return from an interrupt
- Page 18 and 19: ATmega32AFigure 7-2.Data Memory Map
- Page 20 and 21: ATmega32AEEPROM data corruption can
- Page 22 and 23: ATmega32ASupport - Read-While-Write
- Page 24 and 25: ATmega32AThe next code examples sho
- Page 26 and 27: ATmega32A8.1.3 Flash Clock - clk FL
- Page 28 and 29: ATmega32AThe CKSEL0 Fuse together w
- Page 30 and 31: ATmega32A8.7 Calibrated Internal RC
- Page 32 and 33: ATmega32A8.10 Register Description8
- Page 36 and 37: ATmega32A9.8.4 Internal Voltage Ref
- Page 38 and 39: ATmega32A10. System Control and Res
- Page 40 and 41: ATmega32AFigure 10-3.MCU Start-up,
- Page 42 and 43: ATmega32AADC is used. To reduce pow
- Page 44 and 45: ATmega32AThe WDP2, WDP1, and WDP0 b
- Page 46 and 47: ATmega32Athe case if the Reset Vect
- Page 48 and 49: ATmega32A$382D out SPL,r16$382E sei
- Page 50 and 51: ATmega32A12. I/O Ports12.1 Overview
- Page 52 and 53: ATmega32AIf PORTxn is written logic
- Page 54 and 55: ATmega32AThe following code example
- Page 56 and 57: ATmega32AFigure 12-5. Alternate Por
- Page 58 and 59: ATmega32ATable 12-3.Table 12-4 and
- Page 60 and 61: ATmega32A• MOSI - Port B, Bit 5MO
- Page 62 and 63: ATmega32A12.3.3 Alternate Functions
- Page 64 and 65: ATmega32ATable 12-11. Overriding Si
- Page 66 and 67: ATmega32A12.4 Register Description1
- Page 68 and 69: ATmega32A12.4.13 PIND - Port D Inpu
- Page 70 and 71: ATmega32Alow level interrupt is sel
- Page 73 and 74: ATmega32A14. 8-bit Timer/Counter0 w
- Page 75 and 76: ATmega32ASignal description (intern
- Page 77 and 78: ATmega32Athe OCR0 value, the compar
- Page 79 and 80: ATmega32AFigure 14-5.CTC Mode, Timi
- Page 81 and 82: ATmega32AThe PWM resolution for the
- Page 83 and 84: ATmega32AFigure 14-9. Timer/Counter
<strong>ATmega32A</strong>face, Timer/Counters, Watchdog, and the interrupt system to continue operating. This sleepmode basically halts clk CPU and clk FLASH , while allowing the other clocks to run.Idle mode enables the MCU to wake up from external triggered interrupts as well as internalones like the Timer Overflow and USART Transmit Complete interrupts. If wake-up from theAnalog Comparator interrupt is not required, the Analog Comparator can be powered down bysetting the ACD bit in the Analog Comparator Control and Status Register – ACSR. This willreduce power consumption in Idle mode. If the ADC is enabled, a conversion starts automaticallywhen this mode is entered.9.3 ADC Noise Reduction ModeWhen the SM2:0 bits are written to 001, the SLEEP instruction makes the MCU enter ADCNoise Reduction mode, stopping the CPU but allowing the ADC, the External Interrupts, theTwo-wire Serial Interface address watch, Timer/Counter2 and the Watchdog to continue operating(if enabled). This sleep mode basically halts clk I/O , clk CPU , and clk FLASH , while allowing theother clocks to run.This improves the noise environment for the ADC, enabling higher resolution measurements. Ifthe ADC is enabled, a conversion starts automatically when this mode is entered. Apart form theADC Conversion Complete interrupt, only an External Reset, a Watchdog Reset, a Brown-outReset, a Two-wire Serial Interface Address Match Interrupt, a Timer/Counter2 interrupt, anSPM/EEPROM ready interrupt, an External level interrupt on INT0 or INT1, or an external interrupton INT2 can wake up the MCU from ADC Noise Reduction mode.9.4 Power-down ModeWhen the SM2:0 bits are written to 010, the SLEEP instruction makes the MCU enter Powerdownmode. In this mode, the External Oscillator is stopped, while the External interrupts, theTwo-wire Serial Interface address watch, and the Watchdog continue operating (if enabled).Only an External Reset, a Watchdog Reset, a Brown-out Reset, a Two-wire Serial Interfaceaddress match interrupt, an External level interrupt on INT0 or INT1, or an External interrupt onINT2 can wake up the MCU. This sleep mode basically halts all generated clocks, allowing operationof asynchronous modules only.Note that if a level triggered interrupt is used for wake-up from Power-down mode, the changedlevel must be held for some time to wake up the MCU. Refer to “External Interrupts” on page 69for details.When waking up from Power-down mode, there is a delay from the wake-up condition occursuntil the wake-up becomes effective. This allows the clock to restart and become stable afterhaving been stopped. The wake-up period is defined by the same CKSEL fuses that define thereset time-out period, as described in “Clock Sources” on page 26.9.5 Power-save ModeWhen the SM2:0 bits are written to 011, the SLEEP instruction makes the MCU enter Powersavemode. This mode is identical to Power-down, with one exception:If Timer/Counter2 is clocked asynchronously, that is, the AS2 bit in ASSR is set, Timer/Counter2will run during sleep. The device can wake up from either Timer Overflow or Output Compareevent from Timer/Counter2 if the corresponding Timer/Counter2 interrupt enable bits are set inTIMSK, and the Global Interrupt Enable bit in SREG is set.8155C–AVR–02/1134