WFI Instruction

Hi,

I want to use the wfi instruction in my code. I'm sending a command to a module and wait for the reply.

I have configured UART communication with the module. Will it be good to use wfi() instruction? I know that it will turn  the cpu to power down mode.

Instead I can use some arbitrary delay, but the time taken for the reply is varying in nature.(.7 to 2 sec)

What if I poll the Interrupt flag? is there any alternate solution ?

Thank You.

Parents
  • Hi, Thanks for your response.

    This is what I need because I'm executing WFI instruction on the lowest priority interrupt service routine (occur continuously) which drives my code. I actually want to block the code until I get a response from the peripheral device(the expected interrupt after giving a command to the peripheral device - GSM) or else it would affect further progress in the code as I'm setting few flags based on this expected interrupt(like checking if the GSM is Offline or Online etc).

Reply
  • Hi, Thanks for your response.

    This is what I need because I'm executing WFI instruction on the lowest priority interrupt service routine (occur continuously) which drives my code. I actually want to block the code until I get a response from the peripheral device(the expected interrupt after giving a command to the peripheral device - GSM) or else it would affect further progress in the code as I'm setting few flags based on this expected interrupt(like checking if the GSM is Offline or Online etc).

Children
No data