How to create a timer?

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

How to create a timer?

1,241件の閲覧回数
augustopolettoc
Contributor I

Hi, I am new at using kinetis and a microprocessor.

I am using a FRDM -KL25Z, and it's being hard to find literature to create a timer as I need.

I need to create a timer to count at rising edges. And the signal comes from an external interruption.

I am thinking about using the component "TimerUnit_LDD". I know how to configure it. However, I am having problems regarding the code to initialize it properly, how to use the events and to capture the signal.

 

Thank you!

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

1,095件の閲覧回数
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Augusto:

Have you made progress on your project?

David has a good suggestion if you only need to simply count pulses in a variable.

If you want to use an integrated timer/counter then you can take the Capture_LDD component, which uses the TPM module in input capture mode to count the input pulses according to the selected edge (rising/falling or both).

For help and typical code for the component you can right-click on it and then select "Help on component". See this brief tutorial:

Getting Help on Processor Expert Components | MCU on Eclipse

Regards!

Jorge Gonzalez

0 件の賞賛
返信

1,095件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi Augusto,

Could you use a GPIO pin configured as input with interrupt enabled and simple increment a counter in the ISR?

Regards,

David

0 件の賞賛
返信