I'm trying to put a TIVAC TM4C123GE6PM into deep sleep mode when there isn't really anything going on. The catch is I still need to service a timer and the USB controller. In my main loop I'm using this:
if((WTimer0_running || ADC_running) == 0){ SysCtlDeepSleepClockSet(SYSCTL_DSLP_DIV_1 | SYSCTL_DSLP_OSC_MAIN | SYSCTL_DSLP_PIOSC_PD); TimerLoadSet(WTIMER1_BASE, TIMER_A, 1600000); SysCtlDeepSleep(); }
I thought this would preserve the clock for USB since the controller uses the 16Mhz main oscillator I've got. I also thought, from reading the users manual and what not, that this would also allow the Timer module to just pick up the clock at 16Mhz so while the ARM is asleep it is still running, but now at/expecting the correct 16Mhz clock speed. This isn't quite working yet. The code works fine without this....I'm strictly doing a sleeping test. My initial clock configuration looks like this:
SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);
I reconfigure the clock with this same instruction when the ISR for the timer hits so the rest of the instructions run at 16Mhz then it goes back to sleep in the main loop.
What am I missing here? Is there a document that discusses the sleep modes in more detail? I can't seem to get a good understanding form the datasheet and the peripheral driver guide.
Thanks,
Rob