Pulse counter using Timer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Pulse counter using Timer

1,143 Views
rajani_sureja33
Contributor III

Is it possible to use timer to count the pulses ??? if yes then how??

Labels (1)
0 Kudos
Reply
7 Replies

830 Views
rajani_sureja33
Contributor III

I am getting the pclk freq but don't get external input freq, Can anyone suggest me what has been remained to select external input on this pin?.

830 Views
rajani_sureja33
Contributor III

Instant help will be appreciated:smileyhappy:

0 Kudos
Reply

830 Views
rajani_sureja33
Contributor III

This is the P1.0 (Timer1/capture1) initialization code for rpm reading.

 

TIM_COUNTERCFG_Type TIM_FanspeedTimerConfig;
TIM_CAPTURECFG_Type TIM_FanspeedCaptureConfig;

TIM_FanspeedCaptureConfig.CaptureChannel = TIM_COUNTER_INCAP1;
TIM_FanspeedCaptureConfig.RisingEdge = ENABLE;
TIM_FanspeedCaptureConfig.FallingEdge = DISABLE;
TIM_FanspeedCaptureConfig.IntOnCaption = DISABLE;


TIM_ConfigCapture(LPC_TIMER1,&TIM_FanspeedCaptureConfig);
TIM_ResetCounter(LPC_TIMER1);

TIM_Cmd(LPC_TIMER1,ENABLE);

830 Views
rajani_sureja33
Contributor III

I am using Timer0 to generate an interrupt at every 1sec and I am reading capture value at pin 1.0 to count value of rpm. is it a right way to measure the rpm of fan?

But, I m still not getting actual rpm reading on this pin.

Can you please advice me asap? 

830 Views
soledad
NXP Employee
NXP Employee

Please check the below thread and let me know if this helps.

Any example to use CAPTURE PINS as pulse counters? | www.LPCware.com 


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

830 Views
soledad
NXP Employee
NXP Employee

Hello,

 

Could you please mention the device you are using?

Regards

Sol

0 Kudos
Reply

830 Views
rajani_sureja33
Contributor III

we are using lpc1833 on P1.0 

0 Kudos
Reply