cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

pemac_1611436
New Contributor

I have problem with UART communication.

I use CY8CKIT-059 PSoC® 5LP

UART block v2.5 (Mode: Full UART, RX Buffer size: 10, Name: RFID_UART, rx_interrupt connect to cy_isr (RFID_UART_isr))

Program

Init UART:

    RFID_UART_Start();

    RFID_UART_ClearRxBuffer();

    RFID_UART_ClearTxBuffer();

    RFID_UART_isr_StartEx(RFID_UART_int);

Callback interrupt:

     CY_ISR(RFID_UART_int)

     {

   

         do

         {

             /* Read receiver status register */

             rxStatus = RFID_UART_RXSTATUS_REG;

             rxSizeBuffer = RFID_UART_GetRxBufferSize();

             if((rxStatus & (RFID_UART_RX_STS_BREAK | RFID_UART_RX_STS_PAR_ERROR |RFID_UART_RX_STS_STOP_ERROR | RFID_UART_RX_STS_OVERRUN | UART_RX_STS_SOFT_BUFF_OVER )) != 0u)

             {

                 /* ERROR handling. */

                 errorStatus |= rxStatus & ( RFID_UART_RX_STS_BREAK | RFID_UART_RX_STS_PAR_ERROR | RFID_UART_RX_STS_STOP_ERROR | RFID_UART_RX_STS_OVERRUN | UART_RX_STS_SOFT_BUFF_OVER );

             }

       

             if((rxStatus & RFID_UART_RX_STS_FIFO_NOTEMPTY) != 0u)

             {

                 /* Read data from the RX data register */

                 rxData = RFID_UART_RXDATA_REG;

           

                 if(errorStatus == 0u && counter < 30u)

                 {

                     bufferUART[counter++] = rxData;

                 }

             }

         }while((rxStatus & RFID_UART_RX_STS_FIFO_NOTEMPTY) != 0u);

}

-------------------------------------------------------------------------------------------------------------------

First receive byte:     rxStatus = 0xA0     -   (1010 0000)         UART_RX_STS_FIFO_NOTEMPTY - OK

                                                                                                UART_RX_STS_SOFT_BUFF_OVER - WHY? rxSizeBuffer = 0!

                                                                                                If set, indicates the RX buffer was overrun.

UART_RX_STS_SOFT_BUFF_OVER flag is always aktive. I send 1 byte to PSoC from external device.

Thank you for answer!


0 Likes
1 Reply
rola_264706
Honored Contributor II

Please post your complete code.  Select File then Create Work Space Bundle and the attach the Zip file to a new comment.

0 Likes