Home > other >  STM32F103 USART send data SR register TXE and TC flag bit did not
STM32F103 USART send data SR register TXE and TC flag bit did not

Time:10-01

STM32F103 USART send data was set to check, the data sent has been no problem, now you need to set to parity, the results after the register configuration for parity checking, boot for the first time to DR TXE while writing register and TC logo in setting state, have written to the first byte data, two symbols are 0, did not place any longer, is this exactly is what reason, ah, I don't think is that the data has been sent out, but don't know how to solve, bosses teach me,

This is sending code
ENUM_DEVICE_ERROR PAL_RS485WriteByte (struct dal_port_type * type, uint8 byte)
{
Uint32 index;
DelayTime=RS485_Send_Delay_Count;
OSSchedLock ();
RS485_Send_En;
while (! (UART4 - & gt; The SR & amp; USART_FLAG_TXE));
UART4 - & gt; DR=(byte & amp; (uint16_t) 0 x01ff);

For (index=0; The index & lt; DelayTime; Index++);
RS485_Rev_En;
OSSchedUnlock ();
Return DEVICE_OK;

}
In the While loop has not gone

CodePudding user response:

CodePudding user response:

This place is correct?

CodePudding user response:

STM32 serial port communication there is a place to note that no validation is 8 bits of data, parity is nine, estimation is you made a mistake here

CodePudding user response:

"Now you need to set up for parity"

In fact you have odd parity!!
  • Related