2005-11-11 02:06 AM
changing GP Outputs from interrupt and task
2005-11-11 12:44 AM
Actually we evaluate the STR7xx for our new products.
Now I consulted the Reference- manual and didn't find any solution for following problem/issue: I use digital outputs. One digital output pin (Bit 0) is controlled by an interrupt routine. The other digital output pin (Bit 1, same register) is controlled by a normal task. I don't know exactly, how the compiler/assembler works but following scenario is possible: 1. The main- routine tries to set its Bit 1: This has to be done by reading, modifying and writing the GPIO- data- memory. 2. Exact after reading the main- task is interrupted. 3. The interrupt routine has to sets its bit 0. This is also done by reading, modifying and writing the GPIO- data- memory. 4. After the interrupt routine the main task continues its work with modifying and writing. 5. The bit 0 (set by the interrupt) will be ZERO after this action! Because the main task doesn't know nothing about the interrupt- routine. This problem is essential for handling the GPIO's. Are there any suggestions or work arounds to solve this problem?2005-11-11 01:01 AM
you must put a disable/enable interrupt in your main loop around the bit read/set command.
of course this will possibly increase your interrupt latency2005-11-11 01:56 AM
That's the problem! I don't like to disable the interrupts to switch on and off an output.
The further problem is that I not only have to disable and enable the interrupt, but I have also to save the actual interrupt enable- register and to restore it safe.