T2CON (T2 control register), byte address
Bit address 0CFH 0CEH 0CDH 0CCH 0CBH 0CAH
Symbol TF2 EXF2 RCLK TCLK EXEN2 TR
The definitions of each are as follows:
TF2: Timer/Counter 2 overflow flag, set when T2 overflows and request an interrupt. It can only be cleared by software, but when T2 is used as a baud rate generator (i.e. RCLK=1 or TCLK=1), TF2 is not set when T2 overflows.
EXF2: When EXEN2 = 1, and a negative transition occurs on the T2EX pin (P1.0) causing T2 to be captured or reloaded, EXF2 is set and an interrupt is requested. EXF2 can only be cleared by software.
RCLK: Serial receive clock flag, which can only be set or cleared by software; used to select T1 (RCLK=0) or T2 (RCLK=1) as the serial receive baud rate generator
TCLK: serial transmission clock flag, which can only be set or cleared by software; used to select T1 (TCLK=0) or T2 (TCLK=1) as the baud rate generator for serial transmission
EXEN2: External enable flag of T2, which can only be set or cleared by software; EXEN2=0: Disable external clock to trigger T2; EXEN2=1: When T2 is not used as a serial baud rate generator, allow external clock to trigger T2. When a negative transition is input to the T2EX pin, it will cause T2 to be captured or reloaded, and set EXF2 to request an interrupt.
TR2: T2 start control flag; TR2=0: stop T2; TR2=1: start T2
C/T2: T2 timing mode or counting mode selection bit. Can only be set or cleared by software; C/T2=0: Select T2 as timer mode; C/T2=1: Select T2 as counter mode, falling edge triggered.
CP/RT2: Capture/reload flag, which can only be set or cleared by software. When CP/RT2=0, the reload mode is selected. At this time, if T2 overflows (EXEN2=0) or the T2EX pin (P1.0) has a negative transition (EXEN2=1), T2 will be reloaded; when CP/RT2=1, the capture mode is selected. At this time, if the T2EX pin (P1.0) has a negative transition (EXEN2=1), T2 capture operation will be caused. However, if RCLK=1 or TCLK=1, the CP/RT2 control bit does not work and is forced to work in the timer overflow automatic reload mode.
T2MOD (mode register), byte address
D7 D6 D5 D4 D3 D2 D1 D0
-- -- -- -- -- -- T2OE DCEN
T2OE: T2 output enable bit. When T2OE=1, the clock is allowed to output to P1.0. (Only for
DCEN: Down-counting enable bit. DCEN=1 allows T2 to count down, otherwise it counts up.
The data registers TH2 and TL2 of T2 are used in the same way as T0 and T1, while the capture registers RCAP2H and RCAP
The above is the description of the relevant registers of T2. In fact, the usage is similar to T0 and T1, but the functions are enhanced and there are more settings. I hope it will be helpful to you.
Previous article:Dynamic configuration of interrupt vector table in ARM system
Next article:Distributed Control System of Humanoid Robot Based on CAN Bus
Recommended ReadingLatest update time:2024-11-16 12:49
- Popular Resources
- Popular amplifiers
- Siemens PLC Programming Technology and Application Cases (Edited by Liu Zhenquan, Wang Hanzhi, Yang Kun, etc.)
- Siemens PLC from Beginner to Mastery with Color Illustrations (Yang Rui)
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- [Last Week] Watch the Power Supply Seminar to Share a 3,000 RMB Red Packet - Learn How to Correctly Complete a Modular DC-DC System
- Solution to the failure of CCS8.0 and XDS100V3 emulators to connect to the target board
- [Nucleo G071 Review] Serial port 1 idle interrupt + DMA to achieve variable length reception
- SAMPCON for msp430
- 【DFRobot wireless communication module】SIM test
- How much do you know about flash memory technology?
- Copper Radiator VS Aluminum Radiator
- The founder of the Phicomm router that was bought for 0 yuan was sentenced to life imprisonment
- A small talk: Do you like reading books? Do you read e-books, buy books, or go to physical stores?
- Why does the CAN message fail to send?