Show Posts
Pages: 1 ... 3 4 [5]
61  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Is there a low power mode? on: October 28, 2009, 08:04:04 pm
I'm looking for something related to sleep modes.  

I'd like to know the list of Arduino commands that I can execute just prior to a sleep, to know (guarantee) that all features, devices, and pins I've used in the program get return to the default / idle / off state.  

Why?  I have built a battery powered application that has a strange power consumption.  I have built a target board, so now the chip is not socketed onto Arduino board, but rather my board.   When I apply power, the program starts, which is to setup both external interrupt buttons to input w/ pullup, then sleep.  The idle consumption in this state is 0.11 mA.  It stays this way until one of the interrupt buttons (I use both) is pressed, then it goes into action and transmits over a radio, spiking up to 45mA when doing that, then I sleep the radio (it's active low), and change all the atmega pins to inputs no pullup, except for pullups on the interrupt buttons...  Then I call a reset routine (jump to address 0).  Now, power consumption is 0.29mA, and it doesn't drop below that.  The cycle can be repeated of pushing buttons, spike, settle... but never again down to 0.11mA.   Unless I remove power from the board, and reapply... then it starts at 0.11mA

So, I'd like to run all commands necessary to force the chip into the state it was in when power was first applied.   I'll run these commands as the last step before I call the reset routine - that promptly leads to a sleep.


Advice?

62  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Software crash when using open or save on: October 30, 2009, 08:54:34 pm
Is something else on the machine being used at the same time as the Arduino IDE, sharing the files?
63  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: turn off analog power? on: November 01, 2009, 01:06:03 pm
Aha!    Found the following in init() section of code in wiring.c, the comments say init() is called before setup().  
Anyways:

      // enable a2d conversions
      sbi(ADCSRA, ADEN);

So, this means in my application I'm going to do as you say:

ADCSRA &= ~(1<<ADEN);
Or, probably cbi(ADCSRA, ADEN) because it looks cleaner.

And reading the low power section of the 328P specsheet, there is a power register I'm going to explicitly de-power the ADC before sleep using what it suggests.   And also disable brownout, that sucks resting power too.  And make sure internal voltage reference is off.... lot's of advice there.

Then upon waking up, sbi(ADCSRA, ADEN),
and re-power or do whatever else is needed.

Be cool if Arduino took care of this housing keeping when a specific sleep mode is called.   I can always wish for 0018 or 19.. or whatever

64  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: turn off analog power? on: October 30, 2009, 08:53:10 pm
Thanks, I'll check the 328P spec sheet and see if the same bit is used in the same register.  Seeing the technique for flipping bits in registers just by naming them like that is helpful to know.   Very handy.   I can do anything now!

Cheers
Scott
65  Forum 2005-2010 (read only) / Frequently-Asked Questions / turn off analog power? on: October 29, 2009, 10:07:05 pm
I've used analogRead() and suspect it is keeping analog circuitry powered, even after I've gone into deep sleep mode.   What command can I use just prior to sleep to power off any on-chip analog circuitry?  

Thanks
Scott
66  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: where to see code behind aurduino functions() ? on: October 31, 2009, 01:17:08 pm
Found it,
arduino-0017\hardware\cores\arduino\wiring_analog.c

thank you

67  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: where to see code behind aurduino functions() ? on: October 31, 2009, 12:32:23 pm
edit is a verb

I'm looking for the noun
68  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: where to see code behind aurduino functions() ? on: October 31, 2009, 12:21:16 pm
maybe I should have put this in the development forum, but I figure it would be a fairly commonly asked question, hence FAQ

69  Forum 2005-2010 (read only) / Frequently-Asked Questions / where to see code behind aurduino functions() ? on: October 31, 2009, 12:06:48 pm
I want to see what code is compiled when I use the analogRead() statement.  Where can I find that?

Thanks!
Pages: 1 ... 3 4 [5]