Question about sleeping Attiny

I'm using James Sleeman's simplesleep library and it works great with the attiny44.

I have a generalize question for the group, especially you AVR Attiny experts out there:

When the attiny44 is sleeping, do the port pins stay latched HIGH or LOW in the state that they were last given when the processor is sleeping?

Thank you in advance

Mark

I don't know that specific library but, in general, putting a microcontroller into sleep mode does not affect the state of the gpio pins. Sometimes, however, it is useful to explicitly change the state of pins for optimal power saving prior to entering sleep mode say by forcing floating pins either high or LOW.

This is the answer from ChatGPT:
"In sleep mode, the behavior of the I/O pins on an ATtiny44 microcontroller depends on how you configure them before entering sleep mode. By default, if the pins are not configured to any specific state before entering sleep mode, they will retain their previous state.

If you want to ensure that the pins are latched to a specific state (either HIGH or LOW) during sleep mode, you should set them to that state explicitly before entering sleep mode. This can be done using the appropriate register settings in your microcontroller code.

For example, if you want to ensure that a pin is latched to a HIGH state during sleep mode, you would set the corresponding bit in the Data Direction Register (DDR) to output and then set the corresponding bit in the Port Register (PORT) to HIGH before entering sleep mode.

Keep in mind that waking up from sleep mode may involve resetting the pin states based on your application requirements."

Has this contribution from ChatGPT added anything to thread which was not blindingly obvious from the OP and previous post(s) ?

ChatGPT has expanded the content of post #2.

Why not just try it? You have the library, you have the chip, you have some way to measure the pins.

1 Like

It did not. It comes very close to spam because it clutters up the thread without adding any significant content.

Obviosly, your observation will be different from that of mine.

Because currently I cannot get to the chip but yes if I could I’d just measure the pin with a DMM. I have contacted the author of simplesleep and he has verified that the port stays latched when in deep sleep.

Thanks everyone for listening and responding.

Mark

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