frequency counter with pic16f877a

Status
Not open for further replies.

john120

Banned
Joined
Aug 13, 2011
Messages
257
Helped
11
Reputation
22
Reaction score
10
Trophy points
1,298
Visit site
Activity points
0
can you plz help me to count the frequency and display it on the lcd (4 bit mode).

Thanks
 

Frequency of what pulse input or AC? If pulse you have to use RB0/INT pin for pulse input. If AC then you have to use a circuit to convert AC freq to pulse. Write interrupt code where a counter gets incremented for every external interrupt on pin RB0. Get total interrupts for 10 ms then calculate how many interrupts you get for 1000 ms (1 sec) and it will give the frequency. If you get 500 interrupts for 10 ms then (500 * 1000 ms)/10 ms gives interrupts for 1 sec which is the frequency.

See these projects http://embedded-lab.com/blog/?p=1953
http://icanbuild.it/wiki/index.php?title=Timer0_Counting_AC_Line_Frequency
 
Last edited:

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…