The difference between AVR MCU communication transmission identifier UDRE and TXC

Single chip microcomputer STM32L151CCU6
1206RGB (single)
Crystal Patch 2520 2.5*2.0MM 32MHZ 32.000MHZ 1.6V~3.6V Universal OSC

The difference between the AVR MCU communication transmission identifier UDRE and TXC:

The instructions of the AVR say:

"The TXC flag can be used to check if the transmission of a data frame has been completed. The RXC flag can be used to check if there is still data in the receive buffer. Before each data transmission (before writing the data register UDR) The TXC flag must be cleared."

"The data register empty UDRE flag indicates whether the transmit buffer can accept a new data. This bit is set to "1" when the transmit buffer is empty; it is cleared when the transmit buffer contains data to be transmitted."

"When the entire data frame moves out of the transmit shift register and there is no new data in the transmit buffer, the transmit end flag TXC is set. TXC is automatically cleared when the transfer end interrupt is executed, or "1" can be written in this bit. To clear."

After reading the above instructions, I have been wondering if I want to do two things at the same time when sending data:

1. Determine UDRE to be 1.

2. Clear the TXC logo.

But in the utility that I saw on the Internet, there is no second operation above, and it seems to work. With this doubt, I found a better answer on the Internet:

"About the AVR serial port, explain as follows:

For transmission, there is a UDR buffer register and a shift register. When you write a UDR once, the microcontroller will immediately transfer this data to the shift register, so you can write the second data immediately. In the future, whenever the UDR buffer register is empty, a UDRE interrupt will be generated. To generate a TXC interrupt, it must be generated after the data of the shift register has been transmitted.

For reception, there are two UDR buffer registers and one shift register. The two receive buffers are equivalent to a FIFO structure. When there is data reception, if a complete data is received into the shift register, it will be transferred to the buffer register. This will result in an RXC interrupt.

AVR is different from 51, and such a structure will be better. For example, when your program is busy in another interrupt, there is a serial port to receive data. Two buffers will win you time without losing data. The same is true for sending data. And 51 is not like this. "

"If two buffer data are written consecutively, because one data of the write buffer is shifted to the shift register, one data can be written immediately. That is, when the UDRE is set, the microcontroller has one byte shifted. The register is being sent."

The conclusion is:

Swing Steel Electro-hydraulic Actuator

Swing Steel Electro-hydraulic Actuator When we need abnormal anti deviation ability, high thrust and fast formation speed, we often choose hydraulic or electro-hydraulic actuator. Because of the incompressibility of the liquid, the advantage of using the hydraulic actuator is the better anti deviation ability, which is very important for the regulating working condition, because when the regulating element is close to the valve seat, the flow working condition is unstable, and the greater the pressure difference, the worse this situation is. In addition, the hydraulic actuator runs very smoothly and responds quickly, so it can realize high-precision control.

Swing Steel Electro-Hydraulic Actuator,Hydraulic Actuator For Industrial,Electro-Hydraulic Actuator,Hydraulic Actuator Electro

Taizhou Jiabo Instrument Technology Co., Ltd. , https://www.taizhoujiabo.com

This entry was posted in on