Two Serial Ports on LPC11U24

07 Mar 2012

Curious problem arises when I added a second serial instance to my program.

When adding the Second serial instance Serial device(p9, p10); The Serial pc stops sending data to the terminal screen listening on the mbeds serial port.

Comment the Serial device(p9, p10) and the device.baud(4800); and compile message start to flow to the terminal screen.

Is this a bug?

BELOW NO MESSAGES in the terminal screen

#include "mbed.h"

Serial pc(USBTX, USBRX); // tx, rx
Serial device(p9, p10);  // tx, rx

int main() {
device.baud(4800);
    while(1) {
    pc.printf("test print %d%d%d\r\n", 1, 2, 3);
    }
}

BELOW Messages flow

#include "mbed.h"

Serial pc(USBTX, USBRX); // tx, rx
//Serial device(p9, p10);  // tx, rx

int main() {
//device.baud(4800);
    while(1) {
    pc.printf("test print %d%d%d\r\n", 1, 2, 3);
    }
}

07 Mar 2012

LPC11U24 has only one UART, and it's connected both to USB (via the interface chip) and p9/p10.

07 Mar 2012

Perhaps you could initiate it inside the main routine.

Serial pc(USBTX, USBRX);
// code, code, code. 
// When needed:
Serial pc(NULL);
Serial something(p9, p10);
// Code code code,

I don't know if it will work, but it could.

Lerche

07 Mar 2012

Thanks for the reply The representation of the LPC11U24 is a little mis leading.

Lots of examples are given which are specific to the LPC1768 and fail to indicate those examples will not work with the LPC11U24.

Very frustrating.

08 Mar 2012

Agreed, I made the same remark in another thread. Serge