AnsweredAssumed Answered

Stop code execution during 8 timer interrupts

Question asked by mnem on Jul 3, 2015
Latest reply on Jul 10, 2015 by mnem
Hi everyone,

I'm working with the stm32f405 microcontroller and I am trying to send some characters using a simple GPIO pin. My problem is that I have to send each bit of one character every 20ms. For that I use a timer interruption. In this case, every 8 executions of the interrupt I will have sent a complete character and I can start sending the next one.

The problem is that I have to wait until 8 interruptions have execute or the code continues executing between interruptions and the character value will change. Therefore, I would need to stop the code durint 8 interruptions. To do that, I use a counter into the interruption and a while(counter < 8); in my main code but nothing happens. The code executes entirelly before the interrupts and only can send the last character.

What could I do to stop the code during 8 interruptions?

I hope you can help me. Thank you very much in advance.