lpcware

The mysterious TIMER32_0_IRQHandler

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Luis Digital on Mon Sep 12 19:53:57 MST 2011
Once upon a time ... on a distant island, while creating a new program, things started to go wrong.

First, and strangely, the program began to stop in an infinite loop:

void IntDefaultHandler(void)
{
    while(1)
    {
    }
}
The problem was solved by creating the procedure for handling the timer in use to pause the program (delay32Ms()).

void TIMER32_0_IRQHandler (void) {

};
Finally, turn off the interruption, as it was not in use.
NVIC_DisableIRQ(TIMER_32_0_IRQn);
But I decided to find the cause, why the program had operated erratically and discovered something strange:

The interruption is only executed before calling the function: [B]GPIOSetValue()[/B]

For example:
If we execute the following code, the timer interrupt will be executed 3 times, all before entering the function:

Quote:
GPIOSetValue(PORT0,  7, 0);
GPIOSetValue(PORT0, 7, 0);
GPIOSetValue(PORT0, 7, 0);

Other code does not cause activation of the interruption:
while(1) {
i++;
}
So for this story have a happy ending, someone can tell me:

[SIZE=4]What has[/SIZE][SIZE=4] in particular the "[/SIZE][SIZE=4]GPIOSetValue" procedure for activating the interruption?[/SIZE]

Thank you!

Outcomes