11 years, 4 months ago.

Serial baud rate change

I need to change the serial baud rate durring my program.

I have a 4D systems display that requires 9600 to initialise. The baud rate can then be changed "on-the-fly" to any value, 115200 is what I want to set it to.

I can reset the display baud rate okay but when I try to reset the Mbed baud rate using something like

s.baud(115200);

I then loose connection.

Any ideas?

Many thanks

Paul

1 Answer

Paul Staron
poster
11 years, 4 months ago.

Erik confirmed I can change the baud rate on the fly, so I perused the issue and managed to get it working. the problem was the baud rate had been defined so trying the call baud again seemed to 'hang' the CPU. I found the '#undef' function and redefined the baud after sending the baud rate change to the display. That worked and I'm now up and running:)

Accepted Answer