1. Serial port control register SCON
2 Power Management Register PCON
3 Introduction to Serial Port
4 Baud rate
(1) Definition
The speed at which a microcontroller or computer communicates over a serial port is expressed in baud rate, which is defined as the number of bits of binary code transmitted per second.
Practical knowledge points | The maximum distance of serial information transmitted directly by the serial interface or interrupt is also related to the transmission rate and the electrical characteristics of the transmission line. When the transmission line uses an unbalanced shielded twisted pair with a 50pf capacitor per 0.3m, the transmission distance decreases as the transmission rate increases. When the bit rate exceeds 1000bps, the maximum transmission distance drops rapidly. For example, at 9600bps, the maximum distance drops to only 76m. Therefore, when we choose a higher rate to transmit data in a serial port communication experiment, we should try to shorten the length of the data line. In order to ensure safe data transmission, do not use too long a data line at a lower rate. Generally speaking, the higher the transmission rate, the smaller the maximum transmission distance of the line. |
(2) Calculation of baud rate
The 51 single-chip microcomputer serial port has four working modes. The baud rate of mode 0 and mode 2 is fixed, while the baud rate of mode 1 and mode 3 is variable, which is determined by the overflow rate of timer T1.
The four working modes of the serial port correspond to three baud rates. Since the input shift clock sources are different, the calculation formulas for various baud rates are also different:
Mode 0 baud rate = f(osc)/12
Mode 1 baud rate = (2^SMOD/32) * (T1 overflow rate)
Mode 2 baud rate = (2^SMOD/64) * f(osc)
Mode 3 baud rate = (2^SMOD/32) * (T1 overflow rate)
f(osc) is the system crystal oscillator frequency, SMOD is the highest bit of the PCOM register, which is either 0 or 1; T1 overflow rate is the frequency of timer T1 overflow.
All knowledge points and notes are sourced from "New Concept 51 MCU C Language Tutorial" by Guo Tianxiang
This note record is complete.
Previous article:Solution to the failure of downloading hex file to MCU
Next article:51 MCU RAM data storage area
- 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
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- 【Silicon Labs Development Kit Review 07】_freeRtos+UART+TH+IMU+PainterEngine
- Live broadcast at 2 pm today [Introduction to TI MSP430 capacitive touch development]
- Effect of Temperature on Performance and Life of Communication Switching Power Supplies
- Comparison of two PWM motor drives
- CircuitPython 6.0.0 Alpha 2 released
- Here is the stock: I am talking about the out-of-stock FT232. You can also get eeworld rewards by placing an order~
- Comics Database
- How to identify the parameters of ceramic capacitors
- 10 ways 5G will change our daily lives, the last one is thought-provoking
- STC8 MCU Problem