PIT Ticks off by one

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
2,241件の閲覧回数
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

 

タグ(1)
0 件の賞賛
1 解決策
2,136件の閲覧回数
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

元の投稿で解決策を見る

3 返答(返信)
2,137件の閲覧回数
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,203件の閲覧回数
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 件の賞賛
2,219件の閲覧回数
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.