Timer interrupt LDD Component - set period at runtime?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Timer interrupt LDD Component - set period at runtime?

2,777件の閲覧回数
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,233件の閲覧回数
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,233件の閲覧回数
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,233件の閲覧回数
daveboyle
Contributor III

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

0 件の賞賛
返信

1,233件の閲覧回数
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 件の賞賛
返信