I am working with the ATtiny85 board. I am working with data EEPROM and sleep modes of EEPROM. I have the following questions

  • Can we write data into Data EEPROM of ATtiny85 when the device is in IDLE sleep mode?
  • Will the data retain in EEPROM if data is written in IDLE sleep mode?

1 Answer 1


From the ATtiny85 datasheet:

7.1 Idle mode

When the SM[1:0] bits are written to 00, the SLEEP instruction makes the MCU enter Idle mode, stopping the CPU but allowing Analog Comparator, ADC, USI, 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.

Essentially, the CPU stops executing instructions in idle mode. So writing to EEPROM (which requires instructions to be executed) is not possible.

If the CPU gets woken up by one of the stated sources, then you can read/write to EEPROM (or do anything else) and go back to sleep.

I'd recommend reading through all of chapter 7 in the datasheet if you want to minimize power usage. There are quite a few options.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.