Organize and Share your Electronics the way you want. Sign-Up for a free account now. It takes only 30 seconds!

A one chip frequency counter with serial output

A one chip frequency counter with serial output

Design for a single chip frequency counter using PIC12F675. It is possible to use the internal RC oscillator, instead of the crystal but the accuracy suffers.
The counter uses the 8 bit counter TMR0. The main loop samples the timer value, subtracts the sample from the last sample and adds the difference to a count. This is done over exactly 2 seconds, done by counting processor cycles, in a loop that cannot be interrupted. TMR0 is configured so that the input is divided by two.

The binary count is converted to BCD and this is output serially at 1200 baud.

GP3 controls if the comparator is used to pre-amplify the signal. if GP3 is high, then GP2 is Freq counter input. if GP3 is low, then GP1 is Freq counter input. It uses the Comparator and Vref set to about 1 volt.

Why serial? With only 8 pins, it is not possible to connect an LCD display using a parallel interface, and my serial LCD works quite well at 1200 baud.

You could use a serial terminal on a PC to capture the frequency.

Visit Here for more.

 

More Articles to Read

ESP8266 Weather Station Projects
ESP8266 Weather Station Projects
Free PCB coupon via Facebook to 2 random commenters
Free PCB coupon via Facebook to 2 random commenters
Single tube Lethal Nixie clock
Single tube Lethal Nixie clock
How to make a simple 1 watt audio amplifier (LM386 based)
How to make a simple 1 watt audio amplifier (LM386 based)
Flashing Binaries to DRA7xx Factory Boards Using Device Firmware Upgrade
Flashing Binaries to DRA7xx Factory Boards Using Device Firmware Upgrade
Dot² isn’t your typical coffee table
Dot² isn’t your typical coffee table
Debugging ARM Cortex-M0+ HardFaults
Debugging ARM Cortex-M0+ HardFaults
EMP Jammer build
EMP Jammer build
A 3D-printed e-drum pad
A 3D-printed e-drum pad
Interactive geodesic LED dome = extreme geometric fun!
Interactive geodesic LED dome = extreme geometric fun!

Top




Shares