I was following along the PIT example of your basic training "Basic Application Development Using MCUXpresso IDE and MCUXpresso Config Tools" found at
In the example, one simply configures an LED pin and the PIT and writes a simple IRQ to handle the interrupt of the PIT to toggle an LED.
In the example, the IRQ directly handles the toggling of the LED. When I follow along on my RT1064 board however, the toggling of the LED pin in the IRQ does not work. When debugging and setting a break point inside the IRQ, I can see the IRQ is executed and it works as expected. When however I let the application run freely, the LED is not toggled.
I then looked at the PIT example provided in the SDK (which is not using the IDEs tools to configure the PIT but instead hard-codes everything, which is poor form if you ask me...) I noticed the IRQ only sets a flag and the LED toggle is performed in the while(true) loop.
I copied this behavior and voila, it works.
So my question is: Why does the LED toggle not work in the interrupt but it does work when put in main. I am aware that IRQ should do as little as possible, but toggling a single LED / Pin should be possible, right? I am trying to understand if there is some form of optimization / setting that disables my toggling the LED.
Cheers and thanks in advance for your help,
Joe
Solved! Go to Solution.
I had an issue where toogling the LED directly in the interrupt did not work, but setting a flag and toggling the led in main based on the flag did work. But toggling the LED in the interrupt is now working, I believe I simply had a bug...
I had an issue where toogling the LED directly in the interrupt did not work, but setting a flag and toggling the led in main based on the flag did work. But toggling the LED in the interrupt is now working, I believe I simply had a bug...
Hello, my name is Pavel, and I will be supporting your case, I reviewed your comments but what is your question sorry it was not clear to me, how can I help you? I review both examples and they are not similar but have the same solution. The IRQ function on the video is assigned to this function name.
The other hand is assigned to a macro.
Best regards,
Pavel