11 years, 4 months ago.

Serial baud rate change on the fly

Is it possible to change the Serial baud rate on the fly?

I need to initialise a 4Dsystems Oled display using the Picaso controller that starts (autobaud) at 9600, then I need to chnage the Mbed to a higher speed (115200), can't see a way to do this. The processor hangs if I call baud again durring the program after I have sent the code to speed up the display baud. I know the display changes to the higher speed if I keep the power to the display and reset the Mbed with the coresponding baud rate. Any ideas?

Paul

Question relating to:

Post your code, without code we cant say much. Changing baudrate on the fly shouldnt be a problem and simply possible by calling baud when you like a different baudrate.

posted by Erik - 21 Dec 2012

1 Answer

Paul Staron
poster
11 years, 4 months ago.

Thank you Erik for responding.

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

Accepted Answer