Hi all, i'm currently trying to wakeup my tiva from sleep using a timer interrupt. as on now, the interrupt does wake up the tiva board, but it doesn't run the program in my loop the second time it wakes up. below is my timer interrupt function and how i make my board sleep.
// timer intterupt void Timer0IntHandler(void) { UARTprintf("TIMER FIRE\n"); ROM_TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT); ROM_IntMasterDisable(); if(GPIOPinRead(GPIO_PORTF_BASE, GPIO_PIN_0)) { GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_0, 0); } else { GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_0, 1); } ROM_IntMasterEnable(); } //sleep function void uC_Controller_Sleep(void) { UARTprintf("System in Sleep Mode\n"); SysCtlDelay(SysCtlClockGet()/3); ROM_SysCtlPeripheralClockGating(true); SysCtlPeripheralSleepEnable(SYSCTL_PERIPH_GPIOF); SysCtlPeripheralSleepEnable(SYSCTL_PERIPH_TIMER0); SysCtlLDOSleepSet(SYSCTL_LDO_0_90V); SysCtlSleepPowerSet(SYSCTL_FLASH_LOW_POWER | SYSCTL_SRAM_LOW_POWER); SysCtlSleep(); } while(1) { //functions that requires constant running, like data logging etc SysCtlDelay(SysCtlClockGet()/3); uC_Controller_Sleep(); }
Do need desperate help on this because this is getting frustrating. thanks in advance.