We detect you are using an unsupported browser. For the best experience, please visit the site using Chrome, Firefox, Safari, or Edge. X
Maximize Your Experience: Reap the Personalized Advantages by Completing Your Profile to Its Fullest! Update Here
Stay in the loop with the latest from Microchip! Update your profile while you are at it. Update Here
Complete your profile to access more resources.Update Here!

AN592

Title
Title
Frequency Counter Using PIC16C5x
Name
Name
AN592
Date
Date
06/24/2015
Product Categories
Product Categories
8-bit MCU
Description
Description
The PIC16C5X has one 8-bit timer (Timer0), which can be used with an 8-bit prescaler. The prescaler runs asynchronously, hence it can count a very high frequency. The minimum rise and fall times of the input frequency are specified to be 10 ns, so the fastest clock rate the TMR0 can count is 50 MHz. The prescaler must be used when measuring high frequency. Since the prescaler can be configured as a divide by 256 counter, the maximum resolution at which the input frequency can be measured is 16-bits. However, the prescaler cannot be directly read like a file register. This application note depicts a unique method by which the user can ?extract? the 8-bit value in the prescaler, whereby the resolution of the measurement is 16-bits with the high 8-bits in TMR0 and the low 8-bits in the prescaler. "The PIC16C5X has one 8-bit timer (Timer0) which can use an 8-bit prescaler. In some instances, the user would like to use this timer for some other purpose and yet, be able to do a transmit and receive using the serial port. This application note offers routines to do a simple 8-bit transmit and receive with no handshake, at baud rates from 1200 to 9600. Please note that these routines use a timed loop which is as accurate as the clock which drives the PIC16C5X. The user enters the frequency and baud rate desired. The calculated value ?delay? in the serial routine has to be an 8-bit value only. if the value is greater than 8-bits, the frequency and baud rate values have to be changed." 8-bit transmit and receive with no handshake, at baud rates from 1200 to 9600. Please note that these routines use a timed loop which is as accurate as the clock which drives the PIC16C5X. The user enters the frequency and baud rate desired. The calculated value ?delay? in the serial routine has to be an 8-bit value only. if the value is greater than 8-bits, the frequency and baud rate values have to be changed.

Files

Title Title Download Date Size
AN592 Source Code - Frequency Counter Using PIC16C5x 17.0 KB 06/23/2015 AN592 Source Code - Frequency Counter Using PIC16C5x Download 06/23/2015 17.0 KB