Serial port at 300 baudrate
- This topic has 1 reply, 2 voices, and was last updated 9 years, 4 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Tagged: mDot Serial baud
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
}
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