Git Product home page Git Product logo

Comments (6)

mikaelpatel avatar mikaelpatel commented on May 29, 2024

Hi Fabien. I have to start with the obvious questions; Have you measured with another test program ie not Cosa. And second what are you measuring with. To measure below 1 mA requires good tools, wired, etc

Cheers Mikael

25 sep 2013 kl. 14:41 skrev duayfabi [email protected]:

Hi, Mikael,

I'm currently testing your watchdog API to enable low power consumption with an Attiny85 (with Arduino IDE).

I taked one of your exemple (VWI transmitter) and modified it to only have the Watchdog part running.

Here is the final code I have :

#include "Cosa/Pins.hh"
#include "Cosa/Watchdog.hh"
#include "Cosa/Power.hh"

void setup()
{
// Set up watchdog for power down sleep
Watchdog::begin(1024, SLEEP_MODE_PWR_DOWN);

// Disable hardware
Power::adc_disable();
Power::timer0_disable();
Power::timer1_disable();
#if defined(ARDUINO_TINY)
Power::usi_disable();
#else
Power::spi_disable();
Power::twi_disable();
Power::timer2_disable();
Power::usart0_disable();
#endif
}

void loop()
{
SLEEP(2);
}
I measured a constant current of 250 - 300 µA (3.3 V and my Attiny is cadenced at 8 Mhz). I know it is possible to get a lower current, so, what's wrong with this code?

For info : BOD is disabled with the fuses and the only component I have on my breadboard is the Attiny85 and a resistor on the reset PIN (my ISP programmer is disconnected) and I have tested with two different tiny85 chip.

Any hints for me?

Thank you.

Fabien D.


Reply to this email directly or view it on GitHub.

from cosa.

mikaelpatel avatar mikaelpatel commented on May 29, 2024

Hi again. I see one thing that you can test. You must disable the ADC and possible the timers. Check the ATmega manual for more details.

Cheers Mikael

25 sep 2013 kl. 14:41 skrev duayfabi [email protected]:

Hi, Mikael,

I'm currently testing your watchdog API to enable low power consumption with an Attiny85 (with Arduino IDE).

I taked one of your exemple (VWI transmitter) and modified it to only have the Watchdog part running.

Here is the final code I have :

#include "Cosa/Pins.hh"
#include "Cosa/Watchdog.hh"
#include "Cosa/Power.hh"

void setup()
{
// Set up watchdog for power down sleep
Watchdog::begin(1024, SLEEP_MODE_PWR_DOWN);

// Disable hardware
Power::adc_disable();
Power::timer0_disable();
Power::timer1_disable();
#if defined(ARDUINO_TINY)
Power::usi_disable();
#else
Power::spi_disable();
Power::twi_disable();
Power::timer2_disable();
Power::usart0_disable();
#endif
}

void loop()
{
SLEEP(2);
}
I measured a constant current of 250 - 300 µA (3.3 V and my Attiny is cadenced at 8 Mhz). I know it is possible to get a lower current, so, what's wrong with this code?

For info : BOD is disabled with the fuses and the only component I have on my breadboard is the Attiny85 and a resistor on the reset PIN (my ISP programmer is disconnected) and I have tested with two different tiny85 chip.

Any hints for me?

Thank you.

Fabien D.


Reply to this email directly or view it on GitHub.

from cosa.

duayfabi avatar duayfabi commented on May 29, 2024

Hi Mikael,

Yes, I have tested with a code of my own and I measured (with good tools and with the same chip) < 10 µA.

I see one thing that you can test. You must disable the ADC and possible the timers

Doesn't the code below do these?

Power::adc_disable();
Power::timer0_disable();
Power::timer1_disable();

Fabien

from cosa.

mikaelpatel avatar mikaelpatel commented on May 29, 2024

Hi Fabien.

Ok. First questions cleared. The Power class only handles the power setting and not the enable or disable of the hardware module. It is often done by a control register. The Cosa init enables the ADC.

Mikael

26 sep 2013 kl. 08:12 skrev duayfabi [email protected]:

Hi Mikael,

Yes, I have tested with a code of my own and I measured (with good tools and with the same chip) < 10 µA.

I see one thing that you can test. You must disable the ADC and possible the timers

Doesn't the code below do these?

Power::adc_disable();
Power::timer0_disable();
Power::timer1_disable();
Fabien


Reply to this email directly or view it on GitHub.

from cosa.

duayfabi avatar duayfabi commented on May 29, 2024

Ok, I'll check this a disable the ADC, timers, etc. by using the registers.

Thank you

Fabien

from cosa.

mikaelpatel avatar mikaelpatel commented on May 29, 2024

Improve the Power class to avoid this issue; 877ffb4

from cosa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.