MOD 5234 Using both serial ports
Posted: Tue Sep 07, 2021 6:17 pm
We currently have an application that uses both serial ports. The issue is if we set the bootloader to 115200 it seem to override our 9600 baud in our main code. It seems like may our printf are competing with our serial reads and writes. Do we need to re-assign stdout or something? Can you re-assign to null or USB or something?
Sample of our code is very similar to some of you example code.
#define SERIALPORT_TO_USE (1) //0 for the main port, 1 for the 10pin aux serial port
#define BAUDRATE_TO_USE (9600)
#define STOP_BITS (1)
#define DATA_BITS (8)
#define SERIALPORT_TO_USE1 (0) //0 for the main port, 1 for the 10pin aux serial port
#define BAUDRATE_TO_USE1 (9600)
#define STOP_BITS1 (1)
#define DATA_BITS1 (8)
//Close the serial port incase it is already open.
SerialClose( SERIALPORT_TO_USE );
SerialClose( SERIALPORT_TO_USE1 );
//Open the serial port
fdserial = OpenSerial( SERIALPORT_TO_USE, BAUDRATE_TO_USE, STOP_BITS, DATA_BITS, eParityNone );
fd1 = OpenSerial( SERIALPORT_TO_USE1, BAUDRATE_TO_USE1, STOP_BITS1, DATA_BITS1, eParityNone );
Sample of our code is very similar to some of you example code.
#define SERIALPORT_TO_USE (1) //0 for the main port, 1 for the 10pin aux serial port
#define BAUDRATE_TO_USE (9600)
#define STOP_BITS (1)
#define DATA_BITS (8)
#define SERIALPORT_TO_USE1 (0) //0 for the main port, 1 for the 10pin aux serial port
#define BAUDRATE_TO_USE1 (9600)
#define STOP_BITS1 (1)
#define DATA_BITS1 (8)
//Close the serial port incase it is already open.
SerialClose( SERIALPORT_TO_USE );
SerialClose( SERIALPORT_TO_USE1 );
//Open the serial port
fdserial = OpenSerial( SERIALPORT_TO_USE, BAUDRATE_TO_USE, STOP_BITS, DATA_BITS, eParityNone );
fd1 = OpenSerial( SERIALPORT_TO_USE1, BAUDRATE_TO_USE1, STOP_BITS1, DATA_BITS1, eParityNone );