10 years, 10 months ago.

Serial port for debugging and another for an Xbee

Naturally I'm a beginner in fact this is my first mbed program other than the usual helloworld types. I'm trying to use a USB serial port for debugging and another for the Xbee RX,TX. I'm getting pinmap not found. I tried the following

Serial pc(USBTX, USBRX); tx, rx Serial xbee(p14, p15); tx, rx int main() { while (1) { if (xbee.readable()) { pc.putc(xbee.getc()); } } although i would prefer the xbee.available/xbee.read routines. I'm sure its simple, any advice ? Best regards

2 Answers

10 years, 10 months ago.

I think you misread the available pins. The serial pins are p13 and p 14 instead of p14 and p15. That is also the error you get: It could not use those pins for a serial object.

10 years, 10 months ago.

Yes that was a rather silly mistake which i corrected, I am however having problems. The keyboard hangs. I even tried removing the USB wireless Keyboard and connected a standard serial keyboard. It still hangs and sometimes the USB mouse does too. Is there a way to have two serial connections to an mbed, one for the PC the other for an xbee ?

You could, theoretically use another USB to serial adaptor, if you have one or failing that, you could just use another mbed, arduino or similar development board as a usb serial passthrough.

posted by Matthew Else 30 Jul 2013

Thanks for the response Mathew, do you mean an rx/tx to tx/rx from mbed to mbed (or arduino), then connect the other mbed (aduino) via its usb to the PC ?

posted by Khaled El Nazer 31 Jul 2013