I want to put an Attiny13 to sleep. In short chapter 7 of the datasheet says you have to do the following:
set sleep mode
sleep enable (set SE bit)
issue SLEEP command
Generally this is done with aid of the 'sleep.h' library and then translates to
set_sleep_mode(SLEEP_MODE_PWR_DOWN); sleep_enable(); sleep_cpu();
If I dont want to use the sleep.h library, the sleep mode and sleep enable are easy to set via 3 bits (SM[1:0] and SE) but how do I issue the SLEEP command?
If I look how the sleep.h library actually does it, it is defined as
__asm__ __volatile__ ( "sleep" "\n\t" :: );
That seems odd, do i really have to issue the word 'sleep' somewhere in a program to get the attiny to sleep? Cant I just set a register somewhere?
The Sleep.h library seems like a lot of overhead if i just want to put a chip to sleep