Go Down

Topic: What to turn off, and how? (Read 1 time) previous topic - next topic


I'm trying to figure out what all I can turn off on a 328P to save on battery consumption.  The majority of what it's doing is driving two LED strings (2-wire communication) using A0 - A3 (don't ask), then it has 2 separate LEDs (pins 3 and 4) that act as indicators, one's a heartbeat and the other flashes when the unit receives an RF signal.  The RF module uses pins 13, 12, 11, 8, and 7 (SPI communications).  The SPI pins are broken out but they're shared with the RF module pins.  The FTDI pins are also broken out (RX/TX/RST), and there's an external oscillator attached as well.

So what can be turned off?  Do I need the watchdog?  Do I need the ADC?  What about the timers?  And how does one turn them off?  Is it all done in programming?


Is it all done in programming?

yes, of course.
Practically, your best bet is to make sure your unused pins are set to outputs or have pullups enabled.  The other things you're talking about probably only make a small difference compared to the other things you have in your system (the whole AVR should consume less than 25mA when active.  (table 29-16 "Additional current consumption" in the datasheet says that the peripherals add 1 to 4% additional for each of the 7 possible.  ADC is most power hungry.)


Ok, so basically just do something like '[font=Verdana]pinMode(UNUSED_PIN, OUTPUT);[/font]' would suffice?  What about killing the ADC?


You could also use low current LED (around 3mA instead of 20mA)


Your best bet is to look in the datasheet. It's really not that bad if you know what you're looking for, and I hadn't even thought of it as a good place to find information.

Here's a similar project.

Also, please don't cross-post.

Go Up