Zdravím,
chci se vás zeptat jakým způsobem přechazíte do sleep modu a z nej.
Stacili by funkce
[code]void SleepModeActivated()
{
SMCR|=(1<<SM0)|(1<<SM1);
SMCR|=(1<<SE);
}
void SleepModeDeactivated()
{
SMCR|=(1<<SM0)|(1<<SM1)|(1<<SM2);
SMCR&=(0<<SE);
}[/code]
Nebo je to jeste slozitejsi? A v kdy tento režim použiváte?
Jinak:
Bits 3…1 – SM2…0: Sleep Mode Select Bits 2, 1, and 0
These bits select between the five available sleep modes as shown in Table 9-2.
Bit 0 – SE: Sleep Enable
The SE bit must be written to logic one to make the MCU enter the sleep mode when the SLEEP instruction is executed. To avoid the MCU entering the sleep mode unless it is the programmer’s purpose, it is recommended to write the Sleep Enable (SE) bit to one just before the execution of the SLEEP instruction and to clear it immediately after waking up.
administrator: přejmenováno z “ATmega88 a sleep mode?”