2022-07-11 02:43 AM
2022-07-11 03:13 AM
Yes.
There are actually two data registers:
The RXNE bit refers only to the read-only receive register.
2022-07-11 03:27 AM
Thanks Andrew.
Iam using STm32F103 series controller, which has one Data Register(which can be read/written) and separate internal Receive Data Buffer and Write Data Buffer.
So, let's say If the UART receives/receiving a byte and at the same moment I write to the UART Data Register(to be transmitted on TX line), will the data byte be successfully transmitted?
And will I be able to read the data byte that came/was coming on the RX line at the moment?
2022-07-11 04:45 AM
Physically, there are two distinct registers and they share the same address:
Note that this is pretty much standard across all microcontrollers (and standalone UARTs) - not specific to ST or STM32.
This is how full-duplex operation is achieved.
"If the UART receives/receiving a byte"
That goes into RDR
"I write to the UART Data Register(to be transmitted on TX line)"
That goes into TDR
"will the data byte be successfully transmitted?"
Yes.
Note that an upshot of this is that reading-back DR will not give you what you wrote to DR.