AnsweredAssumed Answered

USART writes seem to block or slow down reads

Question asked by powell.dane on Feb 9, 2013
Latest reply on Feb 12, 2013 by Andrew Neil
I'm really stumped on this one, and hoping someone can help. I'm using USART_ReceiveData() to receive data off of a USB line at 9600 baud, on an STM32F0Discovery. It works without any trouble until I try to send out any data, i.e.
while(USART_GetFlagStatus(USART2, USART_FLAG_TXE) == RESET);
  USART_SendData(USART2, 42);

As soon as I start sending data, USART_ReceiveData seems to start missing bytes. For instance, if I try to read two consecutive bytes, the second one just doesn't get read. However, if I separate the two bytes by about 20ms or more, then USART_ReceiveData has no trouble catching them.

Does anyone have any idea what might be causing this?

Outcomes