How to use GPT timer Channels on RT1024

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to use GPT timer Channels on RT1024

774件の閲覧回数
Patrick_K
Contributor I

Hello,

currently I am trying to evaluate the i.MX RT1024 for use in a future product.

I'm trying to create a simple application with two timer driven subsystems, where one subsystem is executed at 1ms and the other subsystem is executed at 10ms.

I chose to use channel 1 and 2 of GPT2 for this purpose. However, when I run the project, both of the subsystems run at the same 10ms rate.
How can I run two tasks from the same timer but from different channels using the MBDT?

The attached solution is the closest I could manage. The attached model is entirely self-contained - no need for the simulink project (if you are asked to open the project file as well)

タグ(2)
0 件の賞賛
返信
1 返信

656件の閲覧回数
georgevictor
NXP Employee
NXP Employee

Hi, @Patrick_K,

Thank you for using MBDT for i.MX on your projects.

I have downloaded the attached example and tried to run it on my side considering your specific requirements of using the GPT2 instance with two channels configured but I didn't encounter any issues.

I have replaced the two subsystems provided with an LED toggle, but I have kept the logic for the interrupts generated by the GPT2 peripheral. The attached example demonstrates how the board LED is controlled by two interrupts from channel 1 and channel 2. The interrupt from channel 2 occurs every 2 seconds and turns on the LED, while the interrupt from channel 1 occurs every 2.5 seconds and turns off the LED right after it has been on for 0.5 seconds.

In the picture below is the actual configuration, where I highlighted the Output Compare interrupt enablement for both Channel 1 and Channel 2, along with the Compare value (period) that is set to 2 seconds for the second channel and to 2.5 seconds for the first one.

georgevictor_0-1697122824351.png

Please let me know if this model works as expected on your side and if it helps you find the issue with your project.

 

Cheers,

Victor

 

0 件の賞賛
返信