Back to Blog
8051 timer calculation5/31/2023 ![]() The microcontroller can also generate/measure the required time delays by running loops, but the timer relieves the CPU from that redundant and repetitive task, allowing it to allocate maximum processing time for other tasks. ![]() As the name suggests these are used to measure the time or generate the accurate time delay. It maintains the timing of operation in sync with a system clock or an external clock. It is an important application in an embedded system. ![]() ![]() PIC16F877A timer The Timer is used to measure the time or generate an accurate time delay. We also want to activate prescaler for reducing the clock speed supplied to microcontroller. An external crystal with frequency Fosc = 20Mhz is used as clock source to microcontroller. Suppose we want to generate 1 second delay using timer-1 of pic16f877a microcontroller. Set the Presaclar bits in OPTION_REG as per the delay calculations. Below are the steps for configuring and using the Timer0 for delay generation: Calculate the Timer Count for the required delay.
0 Comments
Read More
Leave a Reply. |