Hello Everyone,
I am using the Hercules Dev Kit (HDK) for the RM46. I am trying to utilize some of the low power modes that i can put the microcontroller in but i cannot seem to find any examples where this is done. Are there any examples on using the various low power modes (doze, snooze, sleep) on the Hercules RM4x? I've been trying to puzzle out how to do it on my own and this is what I've come up with.
On page 108 of the technical reference manual it says to:
- Program the flash banks and flash pump fall-back modes to be “sleep”. The flash pump transitions from active to sleep mode only after all the flash banks have switched from active to sleep mode. The flash banks start switching from active to sleep mode only after the bank are not accessed for at least a duration defined by the Active Grace Period (AGP) parameter configured for the banks. See Chapter 5 for more details.
- Disable the clock sources that are not required to be kept active. A clock source does not get disabled until all clock domains using that clock source are disabled first, or are configured to use an alternate clock source.
- Disable the clock domains that are not required to be kept active. A clock domain does not get disabled until all modules using that clock domain “give their permission” for that clock domain to be turned off.
- 4. Idle the Cortex-R4F core. The ARM Cortex-R4F CPU has internal power management logic, and requires a dedicated instruction to be used in order to enter a low power mode. This is the Wait For Interrupt (WFI) instruction. When a WFI instruction is executed, the Cortex-R4F core flushes its pipeline, flushes all write buffers, and completes all pending bus transactions. At this time the core indicates to the system that the clock to the core can be stopped. This indication is used by the Global Clock Module (GCM) to turn off the CPU clock domain (GCLK) if the CDDIS register bit 0 is set.
My guesses on how to do these things are as follows:
- I read and mostly understand what its telling me to do but i don't see how to do it exactly. When i go to chapter 5 I see there is are PSLEEP bits (16-26) in register FPAC1. Do i set ALL of these to 1?
- There are these 3 registers CSDIS, CSDISSET and CSDISCLR. I can set bits in these registers to disable the various clock sources. Which ones i set in which registers is a little unclear to me.... bit 1 corrsiponds to clock source 1 but in which register?
- Apparently the 3 registers CDDIS, CDDISSET and CDDISCLR are also used to disable clock domains??? Now i'm confused because it sais bit 1 ALSO disables the clock domain for a clock domain... 0.o
- I think i have to set CDDIS bit 0 to 1 and this should do it for me....
This is my best guess... if anyone knows where i can find some example code of where this is done it'd help me a lot :-) Also, I'm not even sure how to configure it to wake up. I'm guessing there is a bit somewhere i can set so that an interrupt can wake it up??
Any help will be much appreciated,
Josiah s. Yeagley