Low power modes - Doze, Wait, Stop
Posted: Mon Aug 11, 2014 6:49 am
So I've been looking into trying to save power for some solar applications on the MOD5282, MOD5234, and NANO54415. I've read some ideas about adjusting the clock speed to save power, but I'm also interested in the low power modes described in the freescale manuals. I haven't seen much discussion about them, and I'm not even sure if they are supposed to work since we're running an operating system. Has anyone used these before successfully, or even know if its supposed to work from a theoretical perspective?
I did some experiments on the nano just to see what would happen. When I executed the stop instruction I could see the power drop, and I had a timer interrupt running around level 3, and I saw the power go back up. But I never actually saw execution resume, everything was just frozen. I presumed that execution would resume in the task where the the stop was called and everything would continue as normal.
I did some experiments on the nano just to see what would happen. When I executed the stop instruction I could see the power drop, and I had a timer interrupt running around level 3, and I saw the power go back up. But I never actually saw execution resume, everything was just frozen. I presumed that execution would resume in the task where the the stop was called and everything would continue as normal.
Code: Select all
sim2.scm.wcr |= (BYTE) 0x80;//enable stop mode
// sim2.scm.wcr |= (BYTE) 0x00;//run mode
// sim2.scm.wcr |= (BYTE) 0x10;//doze mode
sim2.scm.wcr |= (BYTE) 0x20;//wait mode
// sim2.scm.wcr |= (BYTE) 0x30;//stop mode
// sim2.scm.wcr |= (BYTE) 0x00;//ANY interrupt required to wake
// sim2.scm.wcr |= (BYTE) 0x01;//level 2-7 interrupt required to wake
sim2.scm.wcr |= (BYTE) 0x02;//level 3-7 interrupt required to wake
// sim2.scm.wcr |= (BYTE) 0x03;//level 4-7 interrupt required to wake
// sim2.scm.wcr |= (BYTE) 0x04;//level 5-7 interrupt required to wake
// sim2.scm.wcr |= (BYTE) 0x05;//level 6-7 interrupt required to wake
// sim2.scm.wcr |= (BYTE) 0x06;//level 7 interrupt required to wake
asm(" stop #0x2300 ");