How to create a timer?

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

How to create a timer?

963 次查看
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 回复数

817 次查看
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 项奖励
回复

817 次查看
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 项奖励
回复