cancel
Showing results for 
Search instead for 
Did you mean: 

how can i implement UART wake up from halt mode ? please give me suggestion

DJosh.0
Associate II

I have development board of STM8L152R8. I want process like after uart interrupt comes controller should exit from halt mode . and after completing the routine it goes in halt mode again.

I didn't find example regarding this subject.

please help me to find the solution

thanks and regards

Deoyani

15 REPLIES 15
DJosh.0
Associate II

And after changing it to GPIO_Mode_In_PU_IT I am getting the result as you said .

Thank you

:thumbs_up:

DJosh.0
Associate II

void EXTI_setup(void)

{

   disableInterrupts();

   GPIO_Init(GPIOC, GPIO_Pin_0, GPIO_Mode_In_PU_IT);

   EXTI_DeInit();

   EXTI_ClearITPendingBit(EXTI_IT_Pin0);            //to be absolutely sure

   EXTI_SetPinSensitivity(EXTI_Pin_0, EXTI_Trigger_Rising_Falling);

   enableInterrupts();

}

/**

 * @brief external interrput handler .

        ResetRegistration Switch Interrupt handler   

 * @param None

 * @retval None

*/

 void ButtonIntHandler (void)

 {

      if (EXTI_GetITStatus(EXTI_IT_Pin0))

      {

       exti_signal = 1;

         ResetRegistration();

      }

      else if (EXTI_GetITStatus(EXTI_IT_Pin1))

      {

       //boollocklocked=IsLock();         

         

         //ui8PreviousState=ui8CurrentState;

         //ui8CurrentState=STATE_MOTOR_CONTROL;

      

      }

      EXTI_ClearITPendingBit(EXTI_IT_Pin0);

      EXTI_ClearITPendingBit(EXTI_IT_Pin1);

      

 }

Is this above code correct for 2 exti interrupt ,

With this code I am getting interrupt correctly for sometime , and for sometime , not getting interrupt .

Am I missed out something in configuring or clearing Interrupt ?

Please help me to resolve this problem.

Thanks and Regards

Deoyani

"Is this above code correct for 2 exti interrupt"

No.

You seem to want to use two GPIO with EXTI but you configure only one.

DJosh.0
Associate II

Sorry I have not share you the configuration of 2nd GPIO , But I have configure in another file .

but my handler is same.

Is this the problem?

thanks and regards

Deoyani

WilkoL
Senior

"Is this the problem?"

Not if that code is called. Try single stepping and see where / when it does or doesn't work.