Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - PIC16F877 digital display and frequency counter

(you are viewing a thread; or go back to list of threads)

PIC16F877 digital display and frequency counter (by Juan)
Here's another program that will display an analogue value on a 4 digit direct drive 7 segment display using a PIC16F877.

Also a frequency counter program with UART output. Tweak the time cycle a bit to accommodate for the scan cycle.

Both programs need to run on 20MHz with a scan cycle of 0.2ms.

Using a 7.2MHz crystal and 0.6ms scan cycle I can accurately display 800Hz.
Tue Feb 23 2010, 08:09:19, download attachment porgrams.zip
Frequency counter in 20MHz crystal. (by jose)
Hello Juan,
You didn't tell us how many hertz you got on a 20mhz crystal. I've been asking you because I'm having problem with a Encoder tester project.I don't get good accuracy from PIC in hight frequency. If you have time take a look at the example atached: The encoder generates 2500 pulses per revolution ( this sends A and B TTL signal 90 degrees delayed.
Fri Mar 12 2010, 15:35:32, download attachment encoder.rar
(no subject) (by Juan)
Hi Jose,

If your program is as short as mine the maximum frequency you can get that's accurate is about 1500Hz. Even then the readout is still intermittent from time to time. Your program is quite long and its doubtfull that you will get accurate readouts at high frequency. Frequency = (RPM * Pulses)/60.
Thus at 2500PPR and lets say for instance at a 100rpm the frequency will be 4167Hz which is way to high for the pic at 0.1ms scan time.

I dont know if this helps...
Mon Mar 15 2010, 07:16:42
Encoder (by jose)
hi Juan,
Yes it helps... I put an external flip-flop D before send pulses to Pic, this way I decreased program size in Pic and I think it decreases program scan.I got bether speeds but it's stil not what I want.I'll make more reaserts about.
Thank you very much!
Mon Mar 15 2010, 15:21:30, download attachment encoder.rar
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):