lorenzli
lorenzli

Reputation: 630

AVR Instruction to turn Atmel Atmega completely off

Is there an instruction or fuse setting accessible form the running program which can turn off a Atmel Atmega completely?

My program measures via ADC the powering battery's level and then goes back to sleep mode woken up only by external interrupts to measure again and sleep again, this in an endless cycle. Since the battery level should not pass below a certain threshold (otherwise the battery will rapidly loose its recharging capabilities) I prefer to be safe and turn the Atmega off completely instead of using endless deep-sleep modes.

Upvotes: 0

Views: 1640

Answers (2)

Pieter Conradie
Pieter Conradie

Reputation: 61

The closest you can get is to put the AVR in Power-down Mode, which consumes 0.1uA on an ATmega328P. You select the mode by writing to the SMCR register (Sleep Mode Control Register). See Tutorial 08_sleep_mode in the Piconomix FW Library and modify it.

Upvotes: 1

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798456

No, there is not. You will need to use a high-side switch to control power to the MCU, activating it when a button is pressed and deactivating it from a pin on the MCU. Check EE.SE for various MCU-controlled power circuits.

Upvotes: 0

Related Questions