Go Down

Topic: Narcoleptic library (Read 13490 times) previous topic - next topic

sbright33

This works with Atmega328.  Shouldn't it also work the same way with Atmega168?
It's a Pro Mini 168 using Vcc instead of Raw I measure 25ma with or without sleeping.
Aren't they very similar chips?  Other than the memory capacity?

Code: [Select]

#include
void setup(void) {
while(1) Narcoleptic.delay(8000);
}

sbright33

Turns out it is working?  When it's awake it uses 36ma, asleep 23ma.  That difference is about right. 
But where is the 20ma or so going?  The sketch is like I posted so all pins are Input mode?
There's an LM335 connected to A0 and D12.
My battery is attached to Vcc not Raw.

AND A 20 ohm RESISTOR between Vcc and A0.
How did that get there?  It was mixed in with my 2k res's.
Let me fix that...
Huh?  Really?  That explains it?

sbright33

I scraped off the green power LED, now only 1.0ma!!!!!!!!

spcomputing

According to the white papers, @ 1MHz/1.8V, 1uA is as low as you can go with Power-down mode.

Nice job.

sbright33

Still it should be 18+4=22ua according to this:
http://www.rocketscream.com/blog/2011/07/04/lightweight-low-power-arduino-library/

Why is my circuit taking nearly a milliamp when pinMode(all are INPUT)?

The LM335Z is across A0-D12 with the 3rd pin open.
1K res from Vcc to A0 which is an INPUT.
Nothing else is attached not even the serial pins.

sbright33

As Inputs, digitalWrite(HIGH) or LOW for those 2 pins didn't help. 

spcomputing

Did you try the power down example?

Code: [Select]
// **** INCLUDES *****
#include "LowPower.h"

void setup()
{
    // No setup is required for this library
}

void loop()
{
    // Enter power down state for 8 s with ADC and BOD module disabled
    LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); 
   
    // Do something here
    // Example: Read sensor, data logging, data transmission.
}

sbright33

Yes very nice, same results as Narcoleptic.
I'm confused.

It doesn't matter if the pins are INPUT or OUTPUT if the pins are not connected.
http://www.gammon.com.au/forum/?id=11497

But mine are, as described above, so it should matter if A0,D12 are INPUT or OUTPUTHIGH or OUTPUTLOW.
Yet the results are always 1.0ma.  Help?

Code: [Select]

void setup(void){
//pinMode(A0,INPUT);
pinMode(12,OUTPUT);
//digitalWrite(A0,HIGH);
digitalWrite(12,LOW);
while(1) Narcoleptic.delay(8000);

spcomputing

I am no expert in the pico power, but what I do understand is that *everything* is shut down with exception of a watchdog timer and a 125kHz signal for that timer, and of course power.  Your A0,D12 shouldn't matter until the WDT wakes the system up.

pito

..show the schematics..

sbright33

@spc- That's not true, you can even drive an LED while sleeping.  The pins stay in the state you left them when you fell asleep.

The circuit is kindergarten simple.  And the sketch is only 3-5 lines above.  I've changed the first 2 it doesn't effect current.

I have a Pro Mini 168 5v
The LM335Z is across A0-D12 with the 3rd adj pin open.
1K res from Vcc to A0 which is an INPUT.
Nothing else is attached not even the serial pins.
Power to Vcc, not Raw.

It doesn't get much simpler than that eh?

spcomputing

You are correct.  My bad.  I just read Gammon's excellent tutorial and see that my assumption was incorrect.

sbright33

Can anyone help me explain why the current draw is the same 1.0ma regardless of the OUTPUT state of the 2 pins?

Compared to INPUT, no matter if it is HIGH o LOW.  How can I get it lower?  I would test it without any connections, but that wouldn't help, because I can't disconnects them in the final design.  The circuit is simple as described above.

Do I need to cut the trace to the regulator on a Pro Mini?  According to what I read this could reduce it by 1ma.

sbright33

In general, do I have to cut the trace to the voltage regulator on a Pro Mini when supplying 5.0v to save 1ma power?

spcomputing

Have you tried putting 5v into one of the 5v pins?  Does that hit the regulator?  If so, you are going to have to cut the trace to the voltage reg to get that 1mA.

Go Up