[Micro] Output behavior in SLEEP_MODE_PWR_DOWN

I am using an Arduino Micro to interface from USB to a custom controller board. The board has a bank of active-low inputs. I will go into power down mode periodically, mostly to reduce noise from the oscillators. While the MCU is asleep, I need one particular pin to stay low -- the other pins can be high or low, doesn't matter to me at all (but I'll do whatever is recommended in this case).

If I set a pin to LOW, and go into SLEEP_MODE_PWR_DOWN, will that pin stay low and sink enough current to drive a wimpy LED (2-5 mA)? I've found some blog posts and so forth indicating this works in IDLE mode, which is what I would expect, but nothing about other power modes. The datasheet doesn't seem to mention it either.

Thanks

Edit -- whoops, you know, this was originally going to be a question about external pull-down resistors, but maybe this wasn't the right section for where it ended up. Sorry.

Hi,

sorry if my post seems rude, (it is not supposed to be) but don't you think that it is exactly the kind of thing you should try to get your answer ?
When I ask myself "oh, what would happen if I did that ? " and if there is no chance to fry anything if I try.... then I try .

You could even try both states : you connect your led the way you told before +5V-> resistor ->LED -> ouput , and another one
the other way Output -> resistor -> LED -> GND - Just before you put arduino to sleep, you set one output LOW and the other HIGH and.... see what happens :wink:

The data sheet actually tells you everything you need to know:

  1. Pins that are set to input are isolated and tied to ground - this prevents any floating pins from causing excess power consumption.

As shown in Figure 13-2, the digital input signal can be clamped to ground at the input of the Schmitt Trigger. The signal denoted SLEEP in the figure, is set by the MCU Sleep Controller in Power-down mode, Power-save mode, and Standby mode to avoid high power consumption if some input signals are left floating, or have an analog signal level close to VCC/2.
SLEEP is overridden for port pins enabled as external interrupt pins. If the external interrupt request is not enabled, SLEEP is active also for these pins. SLEEP is also overridden by various
other alternate functions as described in “Alternate Port Functions” on page 71.

  1. No outputs should be affected by sleep.

This sleep mode basically halts all generated clocks, allowing operation of asynchronous modules only.

If you look at the schematic for an IO port you can see that the only reference to sleep is in the isolating of the input portion. The rest is completely static, made up of flipflops, which once set will remain set until changed.

@alnath
Yes, you're quite right, and if I were able to, I would have tested first and asked questions later. I'm experiencing software-related problems programming the Arduino and the answer to this question impacts design work on the rest of the system, so I figured the quickest way was to ask.

@majenko
I do see the schematic (we appear to be using slightly different datasheets, but never mind that); however, flip-flops are made of inverting gates, and inverters require power. I suppose I was taking SLEEP_MODE_PWR_DOWN a little too literally. (Yes, it's highly unlikely that a microcontroller would deliberately disconnect its output flops from Vcc when sleeping.) The "asynchronous modules only" line is somewhat less ambiguous.

Thanks

ok, I understand :slight_smile:
I should have thought of something like that, and I should also have told you about my recent experience. I put the arduino to sleep (pwr down) , and forgot to turn off a LED, which remained ON. I had to modify my sketch to turn it off just before sleep and make the arduino remember the LED state .

It's all good :slight_smile: Thanks for your help!