Hi
I'm developing a UART driver for the C6747.
When Working with the Tx and the Rx alone, All is well.
When Working with both the channels together, I get 2 kinds of errors :
1.Some of the Bytes I send into the DSP (My Rx Channel) get lost on the way and dont find their way into the Rx FIFO
2.as the number of lost bytes in the RX Fifo, I get Unidentifyed interrupts,
That means interrupts with an ID of "000" written in the IIR.
It works Like so:
1.TX :
I have a task with high priority which Sends 1 byte by writing to the THR Register.
CSL_FINS(BSW_t_Uart2Regs->THR, UART_THR_DATA, pu8_DataSource[u16_ReadIndex]);
I'm writing to this register only After I made sure that the TX Fifo and the Tx Shift Register is empty
CSL_FEXT(BSW_t_Uart2Regs->LSR, UART_LSR_TEMT) == CSL_UART_LSR_TEMT_EMPTY
2.RX :
I configured the BIOS to give me an interrupt incase there is 1 byte waiting in the Rx Fifo.
Once the byte had arrived, my ISR Goes to the IIR Register to identify which interrupt was it
If the interrupt was an "Threshold Reached" or "Byte in fifo Time out", I go and read the Rx Fifo
For All the bytes that are in there
while(CSL_FEXT(BSW_t_Uart2Regs->LSR, UART_LSR_DR) == CSL_UART_LSR_DR_READY)
{
pu8_RecBuffer[u16_WriteIndex] = CSL_FEXT(BSW_t_Uart2Regs->RBR, UART_RBR_DATA);
}
For Example :
I'm writing 200 bytes into the Rx Channel while I'm randomly writing data out of my Tx channel.
I get 200 interrupts, lets say 198 of them are "Data Ready" interrupts and 2 of them come with "000" in the IIR register.
Any Ideas?
Yoav