PIT Ticks off by one

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

PIT Ticks off by one

Jump to solution
2,210 Views
IdrisCodes
Contributor I

Hello,

 

I'm using MCUXpresso IDE v11.4.1 with the FRDM-K64F SDK v2.10.0

I noticed that the PIT configuration tool creates a #define called PIT_X_TICKS with the number of ticks minus 1.

The PIT driver function PIT_SetTimerPeriod also subtracts 1 from the parameter before updating the PIT reload value.

I believe this should be changed in the config tool.

 

Thanks

 

Tags (1)
0 Kudos
1 Solution
2,105 Views
marek_neuzil
NXP Employee
NXP Employee

Hello,

Thank you for reporting the issue. I have analyzed it. The latest version of the PIT driver has been updated to decrement the count value by one in the PIT_SetTimerPeriod() function. A new version of the PIT component has been created and it will be available in the upcoming release MCUXPresso Config Tools V11.

Best Regards,

Marek Neuzil

View solution in original post

3 Replies
2,106 Views
marek_neuzil
NXP Employee
NXP Employee

Hello,

Thank you for reporting the issue. I have analyzed it. The latest version of the PIT driver has been updated to decrement the count value by one in the PIT_SetTimerPeriod() function. A new version of the PIT component has been created and it will be available in the upcoming release MCUXPresso Config Tools V11.

Best Regards,

Marek Neuzil

2,172 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @IdrisCodes 

I just wanted to let you know that our SW team is now aware of the error that you reported.

According changes will be made whenever possible. Please note that we do not have any expected date for this. 

Thank you for your understanding and for reporting this. 

Diego.

0 Kudos
2,188 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @IdrisCodes 

Thank you for noticing this! I will escalate the below  report. 

 

In the SDK PIT example we can see: 

PIT_SetTimerPeriod(DEMO_PIT_BASEADDR, DEMO_PIT_CHANNEL, USEC_TO_COUNT(1000000U, PIT_SOURCE_CLOCK));

Where the  USEC_TO_COUNT is only decremented by one inside the function. 

But if we  use Config tools to do PIT setup : 

#define PIT_CHANNEL_0_TICKS USEC_TO_COUNT(100000U, PIT_CLK_FREQ) - 1U

PIT_SetTimerPeriod(PIT_PERIPHERAL, PIT_CHANNEL_0, PIT_CHANNEL_0_TICKS);

The USEC_TO_COUNT  is decremented by one twice, by the define generated by config tools and the function.

 

Thank you.

Diego.