PSoC 5 UART loss bytes when HW fifo more than 1.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Dudi_Ildis
Level 1
Level 1
5 sign-ins First reply posted First question asked

We are using the UART with the HW fifo of 4, we find that when disabling interrupts for long time (not for 4 fifo long), we start to loss bytes sometimes (for our opinion the HW fifo not works OK).

Here is our interrupt handler that we used for testing:

CY_ISR(drvUART_A_RxISR)
{
uint8 dataByte, statusByte;
uint16 receivedData;
uAmaxrcv=0;
do{
  receivedData = UART_A_GetByte();
 
dataA[k] = receivedData;
  k = (k+1)%BLEN_TEST;
 
dataByte = (uint8)(receivedData & 0x00FFu);
 
 statusByte = (uint8)((receivedData & 0xFF00u) >> 8u);
 
if((statusByte & UART_A_RX_STS_FIFO_NOTEMPTY) != 0u){
          if((statusByte & (UART_A_RX_STS_BREAK | UART_A_RX_STS_PAR_ERROR |
               
UART_A_RX_STS_STOP_ERROR | UART_A_RX_STS_OVERRUN)) != 0u){
                g_drvUART_driverStatus.uart_rxStatusErr[DRV_UART_MODULE_A]++;
    
}
         else{
              drvUART_fifoPushByte(DRV_UART_RX_FIFO_A, dataByte);
     
uAmaxrcv++;
        }
    }
}while((statusByte & UART_B_RX_STS_FIFO_NOTEMPTY) != 0u);
if (uAmaxrcv > uAprevmaxrcv){
     uAprevmaxrcv=uAmaxrcv;
}
}

What we have seen that when we care disabling the interrupt for short time (not more than 1 byte in 4 bytes HW fifo) we are not loosing bytes, but when we are increasing the time of disale interrupt (global interrupt) we start to loose bytes even when 'uAprevmaxrcv'  is 2.
Thanks for any help,

Dudi

 

0 Likes
8 Replies