Difference between revisions of "PIC16f877a Timer"
Line 6: | Line 6: | ||
=Timer Basics= | =Timer Basics= | ||
As the name suggests these are used to measure the time or generate the accurate time delay. The microcontroller can also generate/measure the required time delays by running loops, but the timer/counter peripheral relieves the CPU from that redundant and repetitive task, allowing it to allocate maximum processing time for other tasks.<br><br> | As the name suggests these are used to measure the time or generate the accurate time delay. The microcontroller can also generate/measure the required time delays by running loops, but the timer/counter peripheral relieves the CPU from that redundant and repetitive task, allowing it to allocate maximum processing time for other tasks.<br><br> | ||
− | Timer is nothing but a simple binary counter that can be configured to count clock pulses(Internal/External). Once it reaches the Max value, it will roll back to zero setting up an < | + | Timer is nothing but a simple binary counter that can be configured to count clock pulses(Internal/External). Once it reaches the Max value, it will roll back to zero setting up an <b>OverFlow</b> flag and generates the interrupt if enabled. |
<br><br> | <br><br> | ||
[[FILE:timer.gif]] | [[FILE:timer.gif]] |
Revision as of 11:49, 6 May 2016
In this tutorial we are going to discuss the Timer module of Pic16f877a.
First we will see what are timers, their working and later we will configure the PIC16f877a timers to generate delay of 100ms and 500ms respectively. At the end we will see how to use the ExploreEmdedded Timer library.
Timer Basics
As the name suggests these are used to measure the time or generate the accurate time delay. The microcontroller can also generate/measure the required time delays by running loops, but the timer/counter peripheral relieves the CPU from that redundant and repetitive task, allowing it to allocate maximum processing time for other tasks.
Timer is nothing but a simple binary counter that can be configured to count clock pulses(Internal/External). Once it reaches the Max value, it will roll back to zero setting up an OverFlow flag and generates the interrupt if enabled.