I am having problems waking up from sleep/stop mode,I set the external pin in LLWU setting enabled and in the routine of detecting that interrupt set
Cpu_SetOperationMode(DOM_RUN, NULL, NULL); but I think the processor isn't detecting any interrupt. Also when entering the stop mode (VLLS) the board losses connection . All I need is a blinking led and via an external interrupt(falling edge) to set the processor in sleep and wake it up when rising edge on the interrupt is detected. I am using processor expert.
main looks like this :
int main(void)
{
/* Write your local variable definition here */
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
PE_low_level_init();
EInt1_Enable();
Cpu_VLPModeEnable();
while(1){
Bit1_SetVal();WAIT1_Waitms(100);
Bit1_ClrVal();WAIT1_Waitms(100);
}
in events.c
void EInt1_OnInterrupt(void)
{
WAIT1_Waitms(100);
if (EInt1_GetVal())
{
Cpu_SetOperationMode(DOM_RUN, NULL, NULL);/* Write your code here ... */}
else {
Cpu_SetOperationMode(DOM_STOP, NULL, NULL);
}
}
Also tried this :
void Cpu_OnLLSWakeUpINT(void)
{
v = Cpu_SetOperationMode(DOM_RUN, NULL, NULL);// v is a char
Bit1_SetVal();WAIT1_Waitms(100);
Bit1_ClrVal();WAIT1_Waitms(100);// just to see if it is entering this function
}
This is my configuration of CPU
