Category
Home

>

All News

>

How a microcontroller timer works

How a microcontroller timer works

Oct 11,2022
How a microcontroller timer works
A microcontroller is, in fact, a chip used in an integrated circuit, and a microcontroller timer is an electronic component that is a stable counter that is provided by the microcontroller itself.It is also a connected part on the microcontroller that can be used for programming.Another function of timer is obvious that it can be used for timing and also, it can be used to count some pulse signals.

Use of Microcontroller Timer

.
The use of the timer is divided into five main steps, the first is to open the location of the interrupt can be allowed, mainly the control of the IE register, and then select the form of the timer work, a format of the timer is the form of TMOD, there are four main ways.The first way of counting is in the form of thirteen bits plus one, the second is a sixteen bit plus one counter, and the third type of timer is broken up into two parts, one is an eight bit register and the other is an eight bit counter.


Microcontroller timer working principle

.
Microcontroller timer works like a basin of water, according to different settings (working mode 0,1,2,3) the size of the basin is different, but the way to catch water is the same (clock cycle), for a drop of water, for example, in a certain working mode, to catch a full basin of water to 1000 drops, each drop of water takes 1 second, at this time to catch a full basin of water to use 1000 seconds time, so thatThe number of drops of water (count value) and time has a relative relationship, but must remember that the water in the basin is always full, if we want to time 50 seconds, then we must first pour 50 drops of water in the basin, and then start to receive water, when the basin is full and overflowing, the microcontroller will prompt, has timed 50 seconds, please turn off the water or do other processing.


microcontroller timer working mode

.
Working in mode 0, timer/counter T0 works in mode 0, the 16-bit counter uses only 13 bits, the high 8 bits of TH0 and the low 5 bits of TL0, to form a 13-bit timer/counter.

< Previous
How about Yuasa battery?
Next Up >
abb inverter manual

Recommend News

Contact Now

Name

Mobile

Email

Subjection

Message