29.4.2.3 Data Transmission
Data transmission is initiated by writing the data to be sent to the DATA register. The data in TxDATA is then moved to the shift register when the shift register is empty and ready to send a new frame. After the shift register is loaded with data, the data frame will be transmitted.
When the entire data frame, including the Stop bit, has been transmitted (i.e., both the Tx buffer and shift register are empty) and no new data has been written to the DATA register, the Transmit Complete interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG.TXC) is set, and the optional interrupt is generated.
The Data Register Empty flag in the Interrupt Flag Status and Clear register (INTFLAG.DRE) indicates that the register is empty and ready for new data. The DATA register must be written to only when INTFLAG.DRE is set.
