Register address B0H, bit addressing B7H~B0H.
Pinout | P3.0 | P3.1 | P3.2 | P3.3 | P3.4 | P3.5 | P3.6 | P3.7 |
Replacement function | RxD | TXD | /INT0 | /INT1 | T0 | T1 | /WR | /RD |
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 |
TR0(TR1)——Timer operation control bit
When TR0(TR1)=0
When TR0(TR1)=1,
IE0(IE1)——External interrupt request flag
When the CPU samples P3.2(P3.3) and a valid interrupt request appears, this bit is set to 1 by hardware. After the interrupt response is completed and the interrupt service is turned, it is automatically cleared to 0 by hardware.
IT0(IT1)——External interrupt request signal mode control bit
When IT0(IT1)=1 Pulse mode (negative jump of the trailing edge is valid)
When IT0(IT1)=0 Level mode (low level is valid) This bit is set to 1 or cleared to 0 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, it is automatically cleared to 0 by hardware. There are two situations in which the count overflow flag is used: 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. [page]
Register address 89H, not bit addressable.
Sequence | B7 | B6 | B5 | B4 | B3 | B2 | B1 | B0 |
Bit Notation | GATE | C/T | M1 | M0 | GATE | C/T | M1 | M0 |
When = 0, start or disable the timer and counter by running TR0 (or TR1)
When = 1, start or disable the timer and counter by TR0*/INT0 (or TR1*/INT1)
GATE=0
GATE=1
T2MOD: Working mode control register
Register address 0C9H, not bit addressable
- | - | - | - | - | - | T2O | DCEN |
Register address 0C8H, bit addressing 0C8H~0CFH.
Bit Address | CF | CE | CD | CC | CB | CA | C9 | C8 |
Bit Notation | TF2 | EXF2 | RCLK | TCLK | EXEN2 | TR2 | C/T2 | CP/RL2 |
When T2 overflows, TF2=1, TD2 can only be cleared by software
When RCLK=1 or TCLK=1, TF2 will not be set
EXF2: T2 external flag
When EXEN2=1, the negative transition on the T2EX/P1.1 pin causes the capture/reload operation of T2, at which time EXF2=1. When T2 interrupt is enabled, EXF2=1 will cause an interrupt, and EXF2 can only be cleared by software. In the up-counting and down-counting modes of T2 (DCEN=1), the setting of EXF2 will not cause an interrupt.
RCLK: Receive clock enabled
When RCLK=1, the overflow pulse of T2 can be used as the receive clock signal of the serial port, suitable for serial port modes 1 and 3. When RCLK=0, the overflow pulse of T1 is used as the receive clock signal of the serial port.
TCLK: Transmit clock enabled
EXEN2: T2 external event (external signal causing capture/reload) enabled
When EXEN2=1, if T2 does not output serial clock (ie RCLK+TCLK=0), the jump of T2EX/P1.1 pin will cause T2 capture/reload operation ;
When EXEN2 = 0, negative transitions on the T2EX pin will not work
TR2: T2 start/stop control
C/T2: count timing
CP/RL2: capture/reload selection
When CP/RL2 = 1 and EXEN2 = 1, negative transitions on the T2EX/P1.1 pin will cause a capture operation
When CP/RL2 = 0 and EXEN2 = 1, negative transitions on the T2EX/P1.1 pin will cause a reload operation
When CP/RL2 = 0 and EXEN2 = 0, overflow of T2 will cause an automatic reload operation of T2
Register address 98H, bit addressing 9FH~98H.
Bit Address | 9F | 9E | 9D | 9C | 9B | 9A | 99 | 98 |
Bit Notation | SM0 | SM1 | SM2 | REN | TB8 | RB8 | TI | RI |
SM2: Multi-machine communication control bit
REN: Control bit to enable/disable serial port reception
TB8: In mode 2 and mode 3, it is the 9th data bit sent, which can be set to 1 or cleared by software as needed, and can also be used as a parity bit. In mode 1, it is a stop bit.
RB8: In mode 2 and mode 3, it is the 9th data bit received (from the TB8th bit); in mode 1, RB8 receives the stop bit, which is not used in mode 0.
TI - Serial port transmit interrupt request flag bit
When a frame of serial data is sent, it is set to 1 by hardware; after turning to the interrupt service program, it is cleared to 0 by software.
RI - Serial port receive interrupt request flag bit
Register address A8H, bit addressing AFH~A8H.
Bit Address | AF | AE | AD | AC | AB | AA | A9 | A8 |
Bit Notation | EA | / | ET2 | ES | ET1 | EX1 | ET0 | EX0 |
When EA=0, interrupts are always disabled.
When EA=1, interrupts are always enabled, and the disablement and enablement of interrupts are set by the interrupt enable control bit of each interrupt source.
EX0 (EX1): External interrupt enable control bit
When EX0 (EX1) = 0, external interrupts are disabled
When EX0 (EX1) = 1, external interrupts are enabled
ET0 (EX1): Timing/counting interrupt enable control bit
When ET0 (ET1) = 0
When ET0 (ET1) = 1,
ET2: Timer 2 interrupt enable control bit, in AT89S52 and AT89C52
ES: Serial interrupt enable control bit
When ES = 0,
When ES = 1,
IP: Interrupt priority control register
Register address B8H, bit addressing BFH~B8H.
Bit Address | BF | BE | BD | BC | BB | BA | B9 | B8 |
Bit Notation | / | / | PT2 | PS | PT1 | PX1 | PT0 | PX0 |
PT0——Timer interrupt 0 priority setting bit
PX1——External interrupt 1 priority setting bit
PT1——Timer interrupt 1 priority setting bit
PS——Serial port interrupt priority setting bit
PT2——Timer 2 priority setting bit
Register address D0H, bit addressing D7H~D0H.
Bit Address | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
Bit Notation | CY | AC | F0 | RS1 | RS0 | OV | - | P |
AC——Half carry mark
F0——User set mark
RS1, RS0——Selection bits of 4 working register areas.
VO——Overflow mark
P——Parity check mark
PCON: Power controller and baud rate selection register
Byte address = 87H, not bit addressable
SMOD | - | - | POF | GF1 | GF0 | PD | IDL |
GF1, GF0——User general mark
PD——Power-down mode control bit, when PD=1, it enters power-down mode
IDL——Idle mode control bit, when IDL=1, it enters idle mode
PCON: Power controller and baud rate selection register
SMOD | - | - | POF | GF1 | GF0 | PD | IDL |
Sina.com
Previous article:51 MCU read and write SD card program
Next article:I^2C Bus EEPROM Programming Experience
Recommended ReadingLatest update time:2024-11-16 22:00
- Popular Resources
- Popular amplifiers
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
- The msp430 microcontroller sends floating point numbers to the host computer through the serial port
- Talking about software architecture from a historical perspective - DOS era (Part 2)
- Participate in TE's prize-giving event and solve the problems of smart meters!
- WiFi remote control coffee shop equipment
- Oscilloscope test inductor saturation current and inductance value
- MTK7686 serial port transparent transmission
- 【Silicon Labs Development Kit Review】+Breathing Light Example
- Shouldn't the positive and negative power supplies of the op amp be connected in series to have a reference point?
- The amplifier has a high PSRR, so there is no need to worry about power supply variations?
- How to design the mobile phone power-on circuit