Roboclaw and Arduino Mega 2560 Hardware Serial

General discussion of using Roboclaw motor controllers
Post Reply
Tun
Posts: 2
Joined: Tue Mar 06, 2018 6:19 am
Roboclaw and Arduino Mega 2560 Hardware Serial

Post by Tun »

Roboclaw does not function fully ( e.g PacketSerialEncoderSpeedAccelDistance) when we connect RoboClaw RX/TX to Arduino Mega 2560's hardware serial 1,2,3 ports. Especially, it moves only one direction and then it stops. It only works if and only if we connect to hardware serial port 0 which is the same port that Arduino uses to communicate with laptop. Can someone please advice me on this? Thanks in advance.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Roboclaw and Arduino Mega 2560

Post by Basicmicro Support »

There is no reason it would have the described probablem. Have you tried all three other hardware serial ports? What baudrate are you using? Have you tried different baudrates?

Also, next time dont hijack a thread. I've split your post into a separate thread.
Tun
Posts: 2
Joined: Tue Mar 06, 2018 6:19 am
Re: Roboclaw and Arduino Mega 2560 Hardware Serial

Post by Tun »

Thanks for your reply. I was using default baudrate 38400 but it did not work properly. I had tried 115200 as well after changing the setting using ionstudio. Whenever I connect to hardware serial ports 1,2,3, it does not work. It only works with hardware serial port 0.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Roboclaw and Arduino Mega 2560 Hardware Serial

Post by Basicmicro Support »

Are you using the latest arduino software, which version?

Are you using a simple test program with nothing else going on? If not make a test program that does nothing else and post a copy here.

Are you using the latest arduino library from our website?

I've used all three extra hardsware serial ports on the 2560 at one point or another. Also the symptom is very odd. Moving in one direction only seem wierd. Maybe it only runs the first command you send. Change the test program up to move the motor in a different direction at the start. Add serial print statements to your program to see if it is locking up somewhere.

Functionally there is no difference between any of the hardware serial ports.

Post Reply