increase the baudrate

General discussion of the MCP motion controller product line
Post Reply
fausto.tromba
Posts: 37
Joined: Wed Jul 31, 2019 7:24 am
increase the baudrate

Post 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?
Attachments
Unbenannt.PNG
Unbenannt.PNG (7.01 KiB) Viewed 13479 times
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: increase the baudrate

Post 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.
fausto.tromba
Posts: 37
Joined: Wed Jul 31, 2019 7:24 am
Re: increase the baudrate

Post 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
Attachments
Unbenannt.PNG
Unbenannt.PNG (11.09 KiB) Viewed 13469 times
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: increase the baudrate

Post 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.

Post Reply