10 years, 1 month ago.

is it possible?

comunicate with the usb serial of mbed nxp lpc1768 through p9(tx) and p10(rx) to another tx rx of a modem?

1 Answer

10 years, 1 month ago.

Yes it is possible to simply pass through data from one serial port to another. Here is the standard example for a serial pass-through between the PC and the p9/p10 UART:

#include "mbed.h"
 
Serial pc(USBTX, USBRX); // tx, rx
Serial device(p9, p10);  // tx, rx
 
int main() {
    while(1) {
        if(pc.readable()) {
            device.putc(pc.getc());
        }
        if(device.readable()) {
            pc.putc(device.getc());
        }
    }
}

Accepted Answer