jakubkrnac
jakubkrnac

Reputation: 21

Attiny85 sleep but keep millis runnig

I’ve got a digispark Attiny85 board. Is there a way to set sleep on the board but keep millis runnig?? I’m working on small low-power watch and I don’t have RTC here so i need to get time from millis.

Upvotes: 0

Views: 860

Answers (1)

andy
andy

Reputation: 787

See datasheet, chapter 7.1 sleep modes. You can use "idle" mode when "stopping the CPU but allowing Analog Comparator, ADC, USI, Timer/Counter, Watchdog, and the interrupt system to continue operating". This way you can use timer counter to generate interrupt for periodic ticks counting. The less frequent interrupt (and less precision) the more power saving you gain. Other two modes will disable clocks necessary for your time measure so without external circuitry it is no go for you.

Upvotes: 1

Related Questions