Timer interrupt LDD Component - set period at runtime?

cancel
Showing results for 
Search instead for 
Did you mean: 

Timer interrupt LDD Component - set period at runtime?

1,823 Views
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

Labels (1)
0 Kudos
4 Replies

279 Views
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 Kudos

279 Views
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 Kudos

279 Views
daveboyle
Contributor III

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

0 Kudos

279 Views
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 Kudos