Putting Teensy 4.0 to sleep does not reduce power consumption?

ColdFire

Member
The Teensy consumes 30 to 33 mA regardless if in sleep or not. What am I doing wrong here?

This is the code:

#include <Snooze.h>

SnoozeDigital digital;
SnoozeTimer timer;

SnoozeBlock config_teensy40(digital, timer);

void setup()
{
timer.setTimer(10);
}

void loop()
{

Snooze.sleep( config_teensy40 );

for (int i = 0; i < 4; i++)
{
digitalWrite(LED_BUILTIN, HIGH);
delay(500);
digitalWrite(LED_BUILTIN, LOW);
delay(500);
}
}
 
If I understand this page correctly then timer.setTimer(10); instructs the Teensy to sleep for 10 milliseconds only and then wakeup and flash the LED for 4 secs. That will indeed not show a lower power consumption.
But I could be wrong in interpreting the API...

Paul
 
The Teensy consumes 30 to 33 mA regardless if in sleep or not. What am I doing wrong here?

This is the code:

#include <Snooze.h>

SnoozeDigital digital;
SnoozeTimer timer;

SnoozeBlock config_teensy40(digital, timer);

void setup()
{
timer.setTimer(10);
}

void loop()
{

Snooze.sleep( config_teensy40 );

for (int i = 0; i < 4; i++)
{
digitalWrite(LED_BUILTIN, HIGH);
delay(500);
digitalWrite(LED_BUILTIN, LOW);
delay(500);
}
}
Firstly could you enclose any code posted between CODE tags using the # button as I have done below.
Code:
#include <Snooze.h>

[COLOR="#FF0000"]SnoozeDigital digital;[/COLOR]
SnoozeTimer timer;

SnoozeBlock config_teensy40([COLOR="#FF0000"]digital, [/COLOR]timer);

void setup()
{
	timer.setTimer(10);
}

void loop()
{

	Snooze.sleep(config_teensy40);

	for (int i = 0; i < 4; i++)
	{
		digitalWrite(LED_BUILTIN, HIGH);
		delay(500);
		digitalWrite(LED_BUILTIN, LOW);
		delay(500);
	}
}
As far as your code goes, I don't know if it makes any difference but you have specified a digital sleep component but not initialised it.
As I said I don't if it makes any difference but make some changes and give it a try.
 
For the Teensy 4.0 this is seconds as far as I understood it.

Karl

You're right, it's stated on the page...
/********************************************************
* Set Low Power Timer wake up in milliseconds T3.x/LC,
* seconds T4.x.
********************************************************/

Paul
 
I copied this from the example code

sleep_all_wakeups.ino

that can be found in the examples of the Snooze library in hardware\teensy\avr\libraries\Snooze\examples\sleep\

Karl
 
I tried the OP's program with both T4.0 and T4.1, and as soon as it gets loaded the Teensy crashes and does 9 blinks, which means...

9 Blinks = ARM JTAG DAP Init Error
The ARM JTAG DAP was detected (4 blinks) but could not be initialized. This error is rather unlikely!

So, I tried several of the Snooze Example programs, and they all have the same effect on both T4.0 and T4.1

I'm using Arduino 1.8.19 and TD 1.58b3
 
I copied this from the example code

sleep_all_wakeups.ino

that can be found in the examples of the Snooze library in hardware\teensy\avr\libraries\Snooze\examples\sleep\

Karl
Yes and deleted all the parameters which you did not require, unfortunately YOU DID NOT delete the digital parameter.
As I said I don't know if it will make any difference but without setting up the digital component you could have some un-initialised wake up states causing a premature wake up.
 
I tried the OP's program with both T4.0 and T4.1, and as soon as it gets loaded the Teensy crashes and does 9 blinks, which means...



So, I tried several of the Snooze Example programs, and they all have the same effect on both T4.0 and T4.1

I'm using Arduino 1.8.19 and TD 1.58b3

See a needed correction to the Snooze Library here.
 
Anyway, it's not very important. I will just use a different board for my project.

Thank you all for your help.

Karl
 
Back
Top