Other Parts Discussed in Thread: C2000WARE
HI !
I am using the F280025C uC as a master to communicate through SCI(UART) with a WiFi module to send and receive the AT commands and their responses.
I am using the Tx FiFo and Rx FiFo interrupts to acheive the same. Since the AT commnads and their corresponding response is an array of characters, I have modified the SCI_writeCharArray and SCI_ReadCharArray accordingly for my application.
The interrupts functions and the Responses to AT commnads work as I want, as long the length doesn´t exceed the maximum FiFo length which is 16. When the response is more than 16 characters which is most of the times, FiFo overflow occurs and I can only read the last 16 characters where the first ones are lost.
The Rx interrupt looks as below:
__interrupt void sciaRXISR(void)
{
//ESTOP0;
uint16_t i;
for(i = 0U; i < 100 ; i++)
{
FifoFromWlanUart[FifoFromWlanUartWritePointer] = (uint16_t)
(HWREGH(SCIA_BASE + SCI_O_RXBUF) & SCI_RXBUF_SAR_M);
delay(30000);
if(++FifoFromWlanUartWritePointer>=FifoFromWlanUartLength)
FifoFromWlanUartWritePointer=0;
if((FifoFromWlanUart[i-3] == 0x4F && FifoFromWlanUart[i-2] == 0x4B && FifoFromWlanUart[i-1] == 0xD && FifoFromWlanUart[i] == 0xA) ||
(FifoFromWlanUart[i-6] == 0x45 && FifoFromWlanUart[i-5] == 0x52 && FifoFromWlanUart[i-4] == 0x52 && FifoFromWlanUart[i-3] == 0x4F &&
FifoFromWlanUart[i-2] == 0x52 && FifoFromWlanUart[i-1] == 0xD && FifoFromWlanUart[i] == 0xA))
{
break;
}
}
SCI_clearOverflowStatus(SCIA_BASE);
SCI_clearInterruptStatus(mySCIA_BASE, SCI_INT_RXFF);
//SCI_clearInterruptStatus(mySCIA_BASE, SCI_INT_RXRDY_BRKDT);
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9);
}
So my question is, How can I read the complete response without the overflow problem? Solutions and suggestions regarding a way to be able to read the complete responses from the Wifi module without the FiFo overflow would be really helpful. I am stuck at this problem for sometime now and would really apprecite any help. Thank you!!