Timer interrupt LDD Component - set period at runtime?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Timer interrupt LDD Component - set period at runtime?

2,871 次查看
thatonesaxkid
Contributor II

Hi,

I'm using the Periodic timer interrupt LDD component in PE on a Kinetis K20. I'm trying to turn on the "SetPeriodUS", "SetFrequencyHz", etc. methods, but they are greyed out, saying that I need to go to "Runtime setting type" and set it to "from interval". When I go to properties->Interrupt period->Runtime setting type and the only option is "fixed value". How can I enable the methods I want?

Many thanks,

Chris

标签 (1)
0 项奖励
回复
4 回复数

1,327 次查看
Petr_H
NXP Employee
NXP Employee

Hi,

unfortunatelly, the Timerint component on component doesn't provide these function for runtime time change on Kinetis (it's mentioned in the general info page of the component help).

What you can do is to use TimerUnit_LDD instead, which has functions for changing the period - SetPeriodTicks (you need to switch to Advanced view mode to see all methods).

See also Re: How to change a period at runtime

The SetPeriodTicks sets the period in ticks of the timer. If you need compute time from real time unit, you can use constants generated in the component .h file that specify the frequency of the ticks:

like this:

#define TU1_CNT_INP_FREQ_U_0 0x01400000UL /* Counter input frequency in Hz */

#define TU1_CNT_INP_FREQ_R_0 20971395.017196544F /* Counter input frequency in Hz */

Best regards

Petr Hradsky

Processor Expert Support Team

0 项奖励
回复

1,327 次查看
robotjosh
Contributor IV

You guys should hire more people!  Its almost 6 months later and the timer beans still only half work for kinetis.  What is the point of a timer bean if you can't use it to change the period?

0 项奖励
回复

1,327 次查看
daveboyle
Contributor III

I ended up using the PPG: Programmable Pulse Generator and it works very well.

0 项奖励
回复

1,327 次查看
BlackNight
NXP Employee
NXP Employee

It seems to me that this is not implemented. I ususally use the TimerInt component (which inherits from the TimerInt_LLD. But if I enable 'from list of values' in the TimerInt component, then it says that this is not supported in the underlying component.

What you could do is to change the timer modulo register directly from your application.

0 项奖励
回复