Serial port on pins 17 and 18 not working

15 Aug 2011

I am having problems in getting to work the Serial port on pins 17/18 (UART3). I'm using this test program. I can see with a scope activity on pins 26 & 28 but not on p17.

  1. include "mbed.h"

Serial aux1 (p17,p18); Serial aux2 (p26,p25); Serial aux3 (p28,p27);

int main() { while (1) { aux1.putc(0xAA); nothing on pin 17 aux2.putc(0xAA); pin 26 OK aux3.putc(0xAA); pin 28 OK wait_ms(10); scope sync } }

Any suggestions?.

Thanks in advance

Jaime

15 Aug 2011

Hi Jaime,

I remember I had problem with p13, p14 and I solve it like that, but I have not use p17 and p18. So try this:

Serial aux1(p13, p14);

int main() {

...

aux1.baud(115200);

aux1.format(8, Serial::None, 1);

...

}

Regards, Stas

15 Aug 2011

Thanks Lerche & Stas for your input. I tried both ways and unfortunately the problem is still there. /media/uploads/jchait/serial1.cpp

21 Oct 2011

FWIW, I got p17, p18 working fine earlier this week with this program that echoes data between the two serial peripherals:

#include "mbed.h"

// Program to use the  mbed as a serial bridge
//

Serial pc(USBTX, USBRX); // tx, rx
Serial dev(p17, p18);

void recvPC() {
    while (pc.readable()) {
        dev.putc(pc.getc());
    }
}

void recvDev() {
    while (dev.readable()) {
        pc.putc(dev.getc());
    }
}

int main() {
    // PC serial     
    pc.baud(115200);
    
    // Device serial 
    dev.baud(4800); // iGPS-500

    while(1) {
        recvDev();
        recvPC();
    }
}