The other technique to generate time delays is to load the counter register and wait for the time when the overflow of the counter takes place and flag is set. When the counter overflows the flag is set. There is also a flag for each counter in the microcontrollers. We can easily calculate the tick period as the speed of oscillator is known and we will recognize how much time has been over and done from the content of the register. This shows that how many ticks have been occurred when cleared the counter. This results an increment in the content of the counter when an oscillator ticks. Now if we want to generate time delays then we can connect the oscillator to the clock pin of counter register. This increment shows that how many times an event has occurred. The content of the counter is incremented when an event is occurred. Timers can be used to generate time delays or as a counter to count events.If we want to use timer as counter then we can join the external source to the clock pin of counter register. Modes of operation of timers Timers of AVR microcontroller.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |