ATTINY 13 SLEEP MODE QUESTION

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is there any way to wake up an Attiny13 from sleep mode without using a reset pin or external interrupt?

Here's what I want to do:
- Microcontroller should sleep for xxx hours
- After xxx hours, microcontroller should automatically wake up

Any ideas?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Manual wrote:
When the SM1..0 bits are written to 00, the SLEEP instruction makes the MCU enter Idle mode, stopping the CPU but allowing Analog Comparator, ADC, Timer/Counter, Watchdog, and the interrupt system to continue operating. This sleep mode basically halts clkCPU and clkFLASH, while allowing the other clocks to run.

Idle mode enables the MCU to wake up from external triggered interrupts as well as internal ones like the Timer Overflow. If wake-up from the Analog Comparator interrupt is not required, the Analog Comparator can be powered down by setting the ACD bit in the Analog Comparator Control and Status Register – ACSR. This will reduce power consumption in Idle mode. If the ADC is enabled, a conversion starts automatically when this mode is entered.

In idle mode You can use the internal timer to wake it up. Should not be a problem.

The other mode, power-down might be used as well but then You should use the watchdog to do the wake up. This involves special handling in the startup code to decide whether it is a real reset or just another wake-up.