What am i trying to do is just entering to IDLE 3 Mode and coming out of it with an alarm interrupt of 5 Seconds,every time i get alarm interrupt in the isr i will try to update the time to zeros and alarm time to 5seconds thus each time i will generate alarm for every 5seconds,so my C55x has to sleep generally and has to getup for every 5seconds
there is no problem with my rtc alarm generation its working fine,when i enter in to IDLE3 mode my processor is just hung or i dont know how to put it in what state it is ?
but when i pause the my code i am stuck up at
Here is is the IDLE3 Routine
void Go2Sleep_IDLE3( void ) { unsigned int temp=0; //1.Stop DMA Tx DMA_Record_Stop(); //2.Disable USB Clock-not disabled //Request for stopping USB Clock CLK_STOP=0x0002; //Wait for ACK while(CLK_STOP & 0x04 == 0x04); //3.Disable Clocks to Peripherals //Request for stopping UART Clock CLK_STOP=0x0008; //Wait for ACK while(CLK_STOP & 0x10 == 0x10); IDLE_PCGCR=0XfFFF;//leave system clock and disable rest of the peripherals IDLE_PCGCR_MSW=0XFFFF;//disable the clock to the rest of the peripherals //4.Disable the PLL and make the Chip Run by only RTC //Enter PLL Bypass CONFIG_MSW = 0x0;//Now Program Run through RTC only //Power Down PLL PLL_CNTL1|=PLL_PWRDN; //5.Clear all Interrupts of IFRx IFR0=0xFFFF; IFR1=0xFFFF; //6.Enable appropriate Wakeup;wakeup through rtc temp=RTC_STAT; RTC_STAT=temp; RTC_INT=((RTC_ALARM_INT_EN) /*|(RTC_EXT_INT_EN)*/);//enable alarm interrupt //7.Disable the CPU domain by setting to 1 the CPUI, MPORTI, XPORTI, DPORTI, IPORTI, and CPI bits //of the idle configuration register (ICR) IDLE_ICR= CPU_IDLE|CLK_IDLE|DPORT_IDLE|XPORT_IDLE|MPORT_IDLE|IPORT_IDLE|HWA_IDLE ; //8.Appply the IDLE3 Configuration asm(" idle");//space mandatory before instruction ! }
Here is the Wakeup Routine
void Wakeup_IDLE3( void ) { unsigned int temp=0; //1.Enable the CPU domain by setting to 1 the CPUI, MPORTI, XPORTI, DPORTI, IPORTI, and CPI bits //of the idle configuration register (ICR) IDLE_PCGCR=0; IDLE_PCGCR_MSW=0; //Power Up PLL Board_Init(); temp=RTC_STAT; RTC_STAT=temp; rtc_reset(); RTC_Set_SecA(5); }
where exactly i am going wrong ???
i dont see any power reduction in my custom board at all,am i shutting down the ports properly