iMXRT1170 QTimer initialization for 1ms interrupt.

cancel
Showing results for 
Search instead for 
Did you mean: 

iMXRT1170 QTimer initialization for 1ms interrupt.

188 Views
Naveed
Contributor II

Hi,

I am using iMXRT1170 EVK board and tried executing the QTimer in interrupt mode for every 1msec. 

When I checked the output on DSO by configuring the GPIO output in the interrupt handler function. I got the output as attached here.

I am not able to go below 8.35msec for,

QTMR_SetTimerPeriod(BOARD_QTMR_BASEADDR, BOARD_SECOND_QTMR_CHANNEL,MSEC_TO_COUNT(1U, QTMR_SOURCE_CLOCK) );

and maximum I got 70msec for,

QTMR_SetTimerPeriod(BOARD_QTMR_BASEADDR, BOARD_SECOND_QTMR_CHANNEL,65000 );

Can you let me know why it is showing like this? In example code it says we can configure it for 1msec but I am not getting it.

Please let me know, did I missed any configuration here? How to resolve this for interrupt for every 1msec.

Code and DSO output is attached.

Thanks in advance.

0 Kudos
9 Replies

175 Views
Pavel_Hernandez
NXP Employee
NXP Employee

Hello, my name is Pavel, and I will be supporting your case, let me review your information, only for being sure could you tell me the example are you based on?

Best regards,
Pavel

0 Kudos

164 Views
Naveed
Contributor II

Hi Pavel,

I want to configure the QTimer for 1ms interrupt. and I am using the example code of qtimer for imxRT1170 EVK board: SDK_2_12_1_MIMXRT1170\boards\evkmimxrt1170\driver_examples\qtmr\timer\cm7.

I have attached the same code before with the DSO image. 

I have measured the time by toggling the GPIO in interrupt handler, It is not able go below 8.35msec but I have configure it for 1msec which I am not getting. Let me know how to get it for 1msec interrupt in qtimer.

Thanks in advance.

0 Kudos

147 Views
Pavel_Hernandez
NXP Employee
NXP Employee

Hello,

Let me test the example and when I have more details, I will contact you.

Best regards,
Pavel

0 Kudos

136 Views
Naveed
Contributor II

Hi Pavel,

Sure. Please let me know on this.

Thanks.

0 Kudos

111 Views
Pavel_Hernandez
NXP Employee
NXP Employee

Hello,

I made some tests and have some issues, so I review the code and I find this macro [ USEC_TO_COUNT] could you make a test with that? I will make the test too, and share my result, I get 4ms in the last test. 

QTMR_SetTimerPeriod(BOARD_QTMR_BASEADDR, BOARD_SECOND_QTMR_CHANNEL, USEC_TO_COUNT(1000U, QTMR_SOURCE_CLOCK));

Best regards,
Pavel

0 Kudos

100 Views
Naveed
Contributor II

Hi Pavel,

I have tried with this at my end, 

QTMR_SetTimerPeriod(BOARD_QTMR_BASEADDR, BOARD_SECOND_QTMR_CHANNEL, USEC_TO_COUNT(1000U, QTMR_SOURCE_CLOCK));

I am still getting complete cycle as Ttotal=8.4msec  Ton=4.2msec and Toff= 4.2msec. I have attached the image for your reference.

Let me know did you get the same, how to resolve this?

Thanks in advance. 

0 Kudos

92 Views
Pavel_Hernandez
NXP Employee
NXP Employee

Hello, 

Sorry for the late response, please comment on the PRINTF lines, it takes more time to print.

Best regards,
Pavel

 

0 Kudos

34 Views
Naveed
Contributor II

Hi Pavel,

It is working, I have commented the PRINTF and checked.

Thanks

0 Kudos

45 Views
Naveed
Contributor II

Hi 

Sorry for the delayed response, I will check and let you know on this.

Thanks.

0 Kudos