Cortex M7 Quad Timer QTMR Clock Speed

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

Cortex M7 Quad Timer QTMR Clock Speed

990 Views
kamal1
Contributor III

I am using the MIMXRT1050 board with Keilv5 Pro edition. I am working with the Quad Timer (QTMR) and I want to set the timer count to 1 second. Looking at the manual, it states that the QTMR timers all use the IP Bus Clock Frequency, and the QTMR_SetTimerPeriod function uses a 16 bit register to set the count.

 

This means that the max timer count time with a prescaler of 128 is 65535 resulting in a 55ms timer. Is there anyway to change the clock to the OSC_CLK or a slower clock? How can I use the QTMR timer to a higher count time?

 

My goal is to use the QTMR timer to clear the OFLAG when the counter time is reached. I will be changing the count time during runtime. Is there a way to do this with the current setup of the QTMR?

 

Also if I set the OUTMODE register to "Clear OFLAG output on successful compare (001), do I still need an interrupt for the timer or just hitting the count will work?

 

I will be setting the OFLAG using Force OFLAG Output bit.

0 Kudos
Reply
1 Reply

974 Views
FelipeGarcia
NXP Employee
NXP Employee

Hello!

It is not possible to select a different clock as the clock source. However, if you need to count to 1 second then you can chain the first channel and the second channel, this way you can interrupt every 1 sec. I recommend you to check the qtmr_timer example of the SDK that implements this with different scenarios.

You can change the count time as you mentioned as well, please check the same example I mentioned above to see how you can do it in more detail.

Regarding your last question, If you do not need an interrupt to be triggered at match time you can leave interrupt disabled.

Best regards,

Felipe

0 Kudos
Reply