Learn To Write Code For 8051, Arduino, AVR, dsPIC, PIC, STM32 ARM Microcontroller, etc.
Coding Embedded Controller With C/C++.
Printed Circuit Board (PCB) Project For Electronics Hobbyists.
PIC16F628A 50MHz Frequency Meters Using Timer1 External Counting
CCS PICC have a ready to use example, demonstrating the technique of using timer 1 external pulses counting to make a 50 MHz frequency meter.
The ex_freq.c explained the the process of making frequency meter using timer 1 of PIC16F877 with a one second delay. The output data is presented in serial terminal.
We can use timer 1 of PIC16F628A to count external digital input pulses. With this advantage, we can make a simple frequency meters, measuring the number of pulses per second.
In this example, I switch the CPU to PIC16F628A with the same build-in timer 1. A 16x2 character LCD uses to present the frequency and period.
PIC16F628A supplied at +5V, clocks at 20 MHz.
Digital Clock pulse feds into pin RB6 Timer 1 Clock In.
SW1 hold the current frequency/period Value,
when shorted to ground
C Source code and simulation file could be download here:
No comments:
Post a Comment