UPD: The problem was resolved. The reason was in the time required to wake up from pwr_down mode, delay(2000) after wake up resolved an issue.
Initial question was:
Hi.
I am trying to make power efficient keyboard with Teensy 2.0, and need your advice.
I use keyboard class and watchdog timer to check key presses in idle mode. When key press detected, keyboard remains in full speed mode for some time ,then goes to sleep.
It works just fine if I use SLEEP_MODE_IDLE, but it still consume about 6mA, so I want to use SLEEP_MODE_PWR_DOWN which consumes much less power.
But after SLEEP_MODE_PWR_DOWN mode Keyboard is not working ( no reaction on Keyboard.print() etc. )
Is it normal behavior, how can I save battery, preserving USB connectivity?
Thank you
My sleep code is:
void system_sleep() {
cli();
CPU_PRESCALE(CPU_125kHz);
sei();
set_sleep_mode(SLEEP_MODE_IDLE); // SLEEP_MODE_PWR_DOWN is not working properly with usb
power_all_disable();
noInterrupts();
sleep_enable();
interrupts();
sleep_cpu();
sleep_disable();
power_all_enable();
cli();
CPU_PRESCALE(CPU_1MHz);
sei();
}
Initial question was:
Hi.
I am trying to make power efficient keyboard with Teensy 2.0, and need your advice.
I use keyboard class and watchdog timer to check key presses in idle mode. When key press detected, keyboard remains in full speed mode for some time ,then goes to sleep.
It works just fine if I use SLEEP_MODE_IDLE, but it still consume about 6mA, so I want to use SLEEP_MODE_PWR_DOWN which consumes much less power.
But after SLEEP_MODE_PWR_DOWN mode Keyboard is not working ( no reaction on Keyboard.print() etc. )
Is it normal behavior, how can I save battery, preserving USB connectivity?
Thank you
My sleep code is:
void system_sleep() {
cli();
CPU_PRESCALE(CPU_125kHz);
sei();
set_sleep_mode(SLEEP_MODE_IDLE); // SLEEP_MODE_PWR_DOWN is not working properly with usb
power_all_disable();
noInterrupts();
sleep_enable();
interrupts();
sleep_cpu();
sleep_disable();
power_all_enable();
cli();
CPU_PRESCALE(CPU_1MHz);
sei();
}
Last edited: