4

I am trying to get a Raspberry Pi to communicate with a microcontroller via a USB - Serial adapter.

The microcontroller requires a baud rate of 1562500. This rate is not supported as one of minicom's standard baud rates.

Is there anyway to change the baud rate on minicom to 1562500?

MatsK
  • 2,791
  • 3
  • 16
  • 20
WillReiner
  • 49
  • 1
  • 1
  • 2
  • 4
    It is easier to use Screen instead of fiddling with configuring Minicom: sudo screen -L /dev/ttyACM0 9600. This will connect to the first COM port at 9600 baud and log (option -L) the output to file screenlog.0. Escape by Ctrl + A, K. It can also run in the background, even after logging off (Ctrl + A, D. Reconnect with screen -r). – Peter Mortensen Mar 17 '20 at 18:26

3 Answers3

7

You can set a baud rate on launch of minicom by doing

$sudo minicom -b BAUDRATE

But I haven't got that to change it to the rate you have specified.

Another Option:

UARTs allow for a tolerance in their baud rates which is about 5% in total (source).

Using minicom if you do Ctrl+A then Z, and then press P for port parameters, you can press A to cycle through the standard baud rates that minicom has. If you select 1500000 then that will give an error of about 4% at a desired baud rate of 1562500. This isn't guaranteed to work but it is worth a try.

pfl
  • 341
  • 1
  • 6
0

Minicom has an internal table with "standard" baud rates and it checks your desired baud against table. If it's not in the table, it's not accepted. I edited the source by adding extra "acceptable" rates, then finally just removed the check altogether. Now, it accepts anything. Unfortunately, you need to compile your own binary to use it. Minicom "out of the box" does not support oddball baud rates. Hope this helps.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. – Community Nov 02 '22 at 20:16
  • Perhaps you could give a pointer to where you changed the baudrate "adding extra "acceptable" rates" – MatsK Nov 02 '22 at 20:17
0

You have to modify minicom source code to support non-standard baudrates. After you clone the source code from GitHub, go to minicom/src/config.c and you'll find an array named "speeds". Add whatever baudrate you desire in this array, compile the source code and you will find this baudrate when you run minicom -s