Using UART1 with LPCExpresso11U68

28 May 2014

Hi,

I'm trying to use USART1 on pins P0_14 and P0_13 because it already has the arduion header. But when I define

Serial myport(P0_14, P0_13); // USART1

the program halts.

The same problem is when I define:

Serial myport(P1_0, P0_20); // USART2

or

Serial myport(P1_23, P1_6); // USART2

Serial pc(USBTX, USBRX); //(P0_19, P0_18);

is working ok.

Any ideas?

Will start looking into the serial class source to understand how it is selecting the required pin function.

28 May 2014

Ok, looks like it has not been implemented https://github.com/mbedmicro/mbed/blob/master/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11U6X/serial_api.c

How can I enable support for UART1-4?

/******************************************************************************
 * INITIALIZATION
 ******************************************************************************/

#define UART_NUM    1

static const PinMap PinMap_UART_TX[] = {
    {P0_19, UART_0, 1},
    {P1_18, UART_0, 2},
    {P1_27, UART_0, 2},
//    {P1_18, UART_1, 2},
//    {P1_0 , UART_2, 3},
//    {P1_23, UART_2, 3},
//    {P2_4 , UART_3, 1},
//    {P2_12, UART_4, 1},
    { NC  , NC    , 0}
};

static const PinMap PinMap_UART_RX[] = {
    {P0_18, UART_0, 1},
    {P1_17, UART_0, 2},
    {P1_26, UART_0, 2},
//    {P1_2 , UART_1, 3},
//    {P0_20, UART_2, 2},
//    {P1_6 , UART_2, 2},
//    {P2_3 , UART_3, 1},
//    {P2_11, UART_4, 1},
    {NC   , NC    , 0}
};
29 May 2014

I posted also a question about the problem http://mbed.org/questions/3612/Using-UART1-with-LPCExpresso11U68/