PIT Example not working on RT1064

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PIT Example not working on RT1064

Jump to solution
414 Views
r0oland
Contributor III

I was following along the PIT example of your basic training "Basic Application Development Using MCUXpresso IDE and MCUXpresso Config Tools" found at

https://www.nxp.com/pages/basic-application-development-using-mcuxpresso-ide-and-mcuxpresso-config-t...

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  

 

Tags (2)
0 Kudos
1 Solution
367 Views
r0oland
Contributor III

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...

View solution in original post

0 Kudos
2 Replies
368 Views
r0oland
Contributor III

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...

0 Kudos
384 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

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. 

Pavel_Hernandez_0-1697584043661.png

The other hand is assigned to a macro. 

Pavel_Hernandez_1-1697584074958.png

Pavel_Hernandez_2-1697584087015.png

Best regards,
Pavel

 

0 Kudos