Reset vs waking up from deep sleep

Hello,

I have an ATTiny85 with one spare pin which happens to be the reset pin. For my project, I need the ATTiny to be in deep sleep, then when a button is pushed, it wakes up and does something then goes back to sleep.

Now, I have 2 options:

  1. Use the reset pin for the button to reset the ATTiny then it automatically goes back to sleep

  2. Free up another pin for the button to wake up the ATTiny then it

Both options essentially do the same thing (in theory), which is start up from deep sleep, do something then go back to sleep. However, is there a difference between the two methods?

Use the reset pin for the button to reset the ATTiny

Reset in what way? Processor Reset is totally different from "wake from sleep".

Absolutly there is, and in no way do both methods do "essentially do the same thing".

Reset restarts the processor as if you had just turned it on. Program runs from the beginning, memory and thus variables cleared.

Wake up from sleep, runs the program from the point where sleep was called and memory (and variables) should still be intact.

If "turned it on" refers to "applying power", then there is a difference between "starting the processor by pressing Reset button" and "starting the processor by applying power". The former is the "Hot Start" and the later is "Cold Start".

Yes I know that.

But in practical terms for an Arduino program, what is the difference ?

Thanks for the reply!

I thought when you wake up from sleep, you start the program from the beginning not from the point where sleep was called.

Regardless, I think best practice is to free up a pin for the button so that the reset pin is available if a reset is required, correct?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.