cancel
Showing results for 
Search instead for 
Did you mean: 

Problem sending with USART_SendData

pedroh44
Associate
Posted on March 20, 2014 at 16:25

USART_SendData(USART1, 12);
USART_SendData(USART1, v_dc_int);
USART_SendData(USART1, v_dc_fra);

If I send only one of the it is received fine. But if I send them all, I only can see the last of them. Do I have to do something between each byte sent to make sure it is received well? Like to wait for the register to be empty? If so, how do I do that?
1 REPLY 1
Posted on March 20, 2014 at 16:38

Yes, like pretty much every USART ever, you have to check if it can take the byte you want to send.

while(USART_GetFlagStatus(USART1, USART_FLAG_TXE) == RESET); // Wait for Empty
USART_SendData(USART1, 0x49); // Send 'I'

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..