PIT Example not working on RT1064

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

PIT Example not working on RT1064

跳至解决方案
693 次查看
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  

 

标记 (2)
0 项奖励
回复
1 解答
646 次查看
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 项奖励
回复
2 回复数
647 次查看
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 项奖励
回复
663 次查看
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 项奖励
回复