Question
USART/RS232 Int Problem...
Posted on April 11, 2013 at 19:16
Hi all,
I have the following code:void
RS232_UART_Interrupt(
void
)
{
if
(USART_GetFlagStatus(USART3, USART_FLAG_TXE) != RESET)
{
//last byte has been transmitted, send another
if
(FIFO_Count(RS232_OutFIFO))
{
//have data to send
FIFO_Pop(RS232_OutFIFO, &Data);
USART_SendData(USART3, Data);
}
else
//no data, ready to restart with new data
USART_ITConfig(USART3, USART_IT_TXE, DISABLE);
}
}
Im having the problem where if i try to transmit a lot of data quickly, the FIFO buffer will empty out, the function will stop sending data, but the int keeps being called with
USART_FLAG_TXE set.
As soon as the int returns, it is immediately called again hanging my program. Any ideas what the issue could be here? Thanks in advance!!