Serial port at 300 baudrate

Home Forums mDot/xDot Serial port at 300 baudrate

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #14518
    Alejandro Veiga
    Participant

    I am trying to read data with an mDot from a serial device that only accepts a baudrate of 300, protocol 7E1. Code follows. Baudrate of 300 is not working, as far as I can see. Is there a lower limit for that parameter? I tested the port with a different device at 9600,8N1 and it works ok. Any advice?


    #include "mbed.h"
    #include "mDot.h"

    Serial mmm(PA_2, PA_3); // D1,D0 in kit
    Serial pc(USBTX, USBRX); // debug

    int main() {

    // Console
    pc.baud(115200);
    pc.printf("\n\rHello Serial\n\r");

    // Device
    mmm.format(7, SerialBase::Even, 1);
    mmm.baud(300);

    mmm.putc(0x2f); // Command
    mmm.putc(0x3f);
    mmm.putc(0x21);
    mmm.putc(0x0d);
    mmm.putc(0x0a);

    while(1) pc.printf("%c",mmm.getc()); // Read answer
    }

    #14526
    Mike Fiore
    Blocked

    Alejandro,

    I’m sure you saw this, but I’m linking the answer on mbed for the benefit of others.

    https://developer.mbed.org/questions/73255/Serial-port-at-300-baud/#answer10767

    Cheers,

    Mike

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.