Problem sending with USART_SendData
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-03-20 8:25 AM
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?
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-03-20 8:38 AM
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..
Up vote any posts that you find helpful, it shows what's working..
