AnsweredAssumed Answered

USART/RS232 Int Problem...

Question asked by MWP on Apr 11, 2013
Latest reply on Apr 16, 2013 by MWP
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!!

Outcomes