AnsweredAssumed Answered

LPC4330 NGX Xplorer - USART0 Can't Receive

Question asked by Nathan Smith on Nov 18, 2016
Latest reply on Nov 22, 2016 by Kerry Zhou

I've been struggling to understand what I'm missing with respect to getting the USART0 on the NGX Xplorer board to receive.  Code I'm using is almost identical to what I'm using on USART3 that works perfectly.

 

I've verified physical connection of the GPIO pins to the vias by setting high and low and the physical connection is good.

 

I have two Xplorer boards, both exhibit the same problem so I believe this to be configuration.

 

Again, USART3 is working and receive interrupt is processing received data perfectly.  Transmission of data on USART0_TX is fine.

 

Init code:

 

#define LPC_UART_BTMOD          LPC_USART0
#define LPC_UARTIRQ_BTMOD       USART0_IRQn

#define             FPUART_BTMOD_BAUD           (115200)    //baudrate for BT module interface

 

    Chip_UART_Init( LPC_UART_BTMOD );
    Chip_UART_SetBaud( LPC_UART_BTMOD , FPUART_BTMOD_BAUD);
    Chip_UART_ConfigData( LPC_UART_BTMOD , UART_LCR_WLEN8 | UART_LCR_SBS_1BIT | UART_LCR_PARITY_DIS);

 

    Chip_UART_TXEnable(LPC_UART_BTMOD);

 

    //setup the FIFO for receive on 1 character threshold (FCR register)
    Chip_UART_SetupFIFOS( LPC_UART_BTMOD, ( UART_FCR_FIFO_EN    //must be set for UART operation
                                        |
                                        UART_FCR_RX_RS      //reset RX fifo
                                        |
                                        UART_FCR_TX_RS      //reset TX fifo
                                        |
                                        UART_FCR_TRG_LEV0   //level 0 - one character
                                       ));

 


    //enable interrupt for received characters (receive buffer register)
    Chip_UART_IntEnable( LPC_UART_BTMOD, (UART_IER_RBRINT | UART_IER_RLSINT));

 

    // Priority
    NVIC_SetPriority( LPC_UARTIRQ_BTMOD , IRQ_PRI_USARTBTMOD );
    // Enable Interrupt for UART channel
    NVIC_ClearPendingIRQ( LPC_UARTIRQ_BTMOD );
    NVIC_EnableIRQ( LPC_UARTIRQ_BTMOD );

 

    // USART0_TXD - F6 (P6_4 - GPIO3[3])
    Chip_SCU_PinMuxSet(0x6, 4, (SCU_MODE_PULLDOWN | SCU_MODE_FUNC2));
    // USART0_RXD - F9 (P6_5 - GPIO3[4])
    Chip_SCU_PinMuxSet(0x6, 5, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC2));

 

 

I see well formed data on the RX line with the scope at the proper rate.  I've verified the actual register values of the USART0 peripheral and it all looks correct with respect to what the above code should be setting up.  I don't see the interrupt called as data comes in and I don't see the interrupt pending flags get set for USART0.

 

Can anyone tell me what I'm missing here?

Outcomes