Teensy 2 Low-Pwr Question...

Status
Not open for further replies.

jack

Active member
Putting Teensy to sleep...

// enable INT0, go to sleep, wake-up on BAV low...

cli(); // clear global interrupt bit in SREG
EICRA &= ~(1<<0); // low on PD0 asserts INT0
EIMSK |= (1<<0); // enable INT0
set_sleep_mode(0x05);
sei(); // set global interrupt bit in SREG
sleep_mode();

...reduces power consumption to ~40 uA.

Disabling peripherals before invoking SLEEP ... does'nt make any difference; still ~ 40 uA.

// config Power Reduction Regs

PRR0 |= ((1<<PRTWI) | (1<<PRTIM0) | (1<<PRTIM1) | (PRSPI) | (1<<PRADC));

PRR1 |= ((1<<PRUSB) | (1<<4) | (1<<PRTIM3) | (PRUSART1)); // (1<<PRTIM4) produces an error, presumably there's a typo in the Include file...

Could someone suggest what I'm missing?

thanks, Jack
 
Status
Not open for further replies.
Back
Top