TCON: Timer Control Register
Register address 88H, bit addressing 8FH~88H
Bit Address | 8F | 8E | 8D | 8C | 8B | 8A | 89 | 88 |
Bit Notation | TF1 | TR1 | TF0 | TR0 | IE1 | IT1 | IE0 | IT0 |
TF0(TF1)——Count overflow flag, when the counter overflows, this position is 1.
TR0 (TR1) - timer operation control bit
When TR0 (TR1) = 0, stop the timer/counter
When TR0 (TR1) = 1, the timer/counter starts working.
IE0 (IE1) - External interrupt request flag
When the CPU samples P3.2 (P3.3) and detects a valid interrupt request, this bit is set to 1 by hardware. After the interrupt response is completed and the interrupt service is turned to, it is automatically cleared to 0 by hardware.
IT0 (IT1) - External interrupt request signal mode control bit
When IT0 (IT1) = 1, pulse mode (negative edge jump is valid)
When IT0 (IT1) = 0 level mode (low level is valid), this bit is set or cleared by software.
TF0 (TF1)——Count overflow flag
When the counter overflows, this bit is set to 1 by hardware. When the interrupt service is turned, the hardware automatically clears it to 0. There are two situations for using the overflow flag: when the interrupt mode is used, it is used as an interrupt request flag; when the query mode is used, it is used as a query status bit.
TMOD register Timer/counter T0¦T1 mode register
GATE | C/T | M1 | M0 | GATE | C/T | M1 | M0 |
The lower four bits define timer/counter T0, and the upper four bits define timer/counter T1. Explanation of each bit:
Ⅰ, GATE - Gate control.
When GATE = 1, the timer is started by the external interrupt pins INT0, INT1 and the control register TR0, TR1.
When GATE=0, timers T0 and T1 are started only by setting TR0 and TR1.
Ⅱ, C/T - Function selection bit
When set, select the counting function, and when cleared, select the timing function.
Ⅲ, M0, M1——Mode selection function
Since there are 2 bits, there are 4 ways to work
================================================================
M1M0 working mode counter mode TMOD (set timer mode)
0 0 Mode 0 13-bit counter TMOD = 0x00
0 1 Mode 1 16-bit counter TMOD = 0x01
1 0 Mode 2 Automatically reload 8-bit counter TMOD=0x02
1 1 Mode 3 T0 is divided into two 8-bit counters, T1 is the baud rate generator TMOD=0x03
================================================================
Previous article:Common models of STC microcontrollers
Next article:Keil creates a multi-file project
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Three steps to govern hybrid multicloud environments
- Three steps to govern hybrid multicloud environments
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Today is International Day Against Spatting. Were you ever spanked as a child?
- B&O Beoplay E8 TWS True Wireless Bluetooth Earphones
- Flyback switching power supply simulation using Saber
- Our company makes FOC motor drivers. The algorithm is mature. We want to find a chip manufacturer to cooperate with us to make a motor-specific chip.
- How to build a simple and efficient isolated power supply below 2W
- Six common circuit board surface treatment processes
- [RISC-V MCU CH32V103 Review] - 5: Failed to leave API and enter Assembly, returned to API......
- BQ76940 sampling chip damage issue
- [RVB2601 Creative Application Development] LoRa Gateway Wireless Host Computer
- There is a program with a total of 10 feeders