Page 1 of 1

increase the baudrate

Posted: Mon Aug 17, 2020 8:10 am
by fausto.tromba
I would like to speed up the UART communication with MCP236 and Raspberry.
Image

The baudrate actually is 38400 bps. I tried to increase it, but without any success becasue the Python with Raspberry and the MCP don't communicate anymore.
Of couse i changes also the baudrate from Python side.

any idea?

Re: increase the baudrate

Posted: Mon Aug 17, 2020 8:18 am
by Basicmicro Support
You have to change the baudrate for the python code as well. Also you need to use supported baudrates. PCs only support 38400, 57600, 115200, 230400 etc. Since youa re suing Python I assume your are using a PC so you need to stick to the standard baudrates.

Re: increase the baudrate

Posted: Wed Aug 19, 2020 5:13 am
by fausto.tromba
I m using Raspberry 4 and logically have changed also the python code

Code: Select all

Roboclaw("/dev/ttyS0",38400)
to

Code: Select all

Roboclaw("/dev/ttyS0",115200)
to be more precise. I changed in Basic Motion Studio with the same rate

Image

Re: increase the baudrate

Posted: Wed Aug 19, 2020 8:29 am
by Basicmicro Support
So both sides are set to 38400. Have you confirmed your Pi serial port is working? Easiest way is to wire a loop back on the Pi. Pi serial ports are NOT active by default. You have to do several things to get them running IIRC. Its been a while since I had to setup one but Im pretty sure you have to edit the config.txt and do something with raspi-config as well. Also it differs from model to model in some cases.