This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PGA900: UART issue

Genius 12760 points
Part Number: PGA900

I am experiencing a problem with the PGA900. In my application I listen for incoming data on the UART but for some reason the UART will sometimes become unresponsive. It’s like the UART ISR is just suddenly disabled so nothing happens when I send data on the RX pin.

I have no idea why this happens because the UART communication runs without problems most of the time. At first I thought it might be a stack overflow or some other fault condition causing a Reset (Watchdog timer is active). But it does not seem like the device resets, it just stops reacting to UART communication.

I cannot make the error occur when I’m debugging with the XDS200. It seems like the error only occurs when the application is running from the OTP memory.  This makes it quite difficult to troubleshoot!

Do you have any idea what the problem could be?

Relevant code snippits:

 

Initialization of UART:

void UART_Reset_Init(void)

{

       UART_Config(PARITY_ENABLE | PARITY_EVEN | TWO_STOP_BITS, BAUD_RATE_DIVIDER_9600_1MHZ_CPU_CLK);

 

       /* Clear UART_RXRDY_I bit */

       UART_INTERRUPT_STATUS |= UART_RXRDY_I;

 

       /* Clear UART_TXCOMPLETE_I bit */

       UART_INTERRUPT_STATUS |= UART_TXCOMPLETE_I;

 

       UART_RX_INT_ENABLE();

       UART_ENABLE();

}

 

UART ISR:

interrupt void UART_Handler(void)

{

       /* Check status registers */

       if (UART_INTERRUPT_STATUS & UART_RXRDY_I)

       {

              /* Clear UART_RXRDY_I bit */

              UART_INTERRUPT_STATUS |= UART_RXRDY_I;

 

              /* Calculate buffer index */

              UART_RxHead = ( UART_RxHead + 1) & UART_RX_BUF_MASK;

 

              /* Ignore overflow, just "drag" tail along */

              if (UART_RxHead == UART_RxTail)

              {

                     UART_RxTail = (UART_RxTail + 1) & UART_RX_BUF_MASK;

              }

 

              /* Read received data */

              /* The RX_READY bit of UART_LINE_STATUS is cleared when UART_RX_BUF register is read */

              UART_RX_Buf[UART_RxHead] = (UC)UART_RX_BUF;

 

              uart_putc(UART_RX_Buf[UART_RxHead]);

       }

}

Regards Bernd