Go Down

Topic: Query on SoftwareSerial (Read 439 times) previous topic - next topic

rhaegar62

May 23, 2018, 09:15 pm Last Edit: May 24, 2018, 06:12 am by rhaegar62
Hey everyone,
This is my first question in the forum. I'm using 10 Dynamixel XL320 motors for my robot. They are divided into 3 sets: all motors in each set are daisy-chained. The robot also has a micro-LiDAR (Benewake TFMini) module attached. I want to control the entire thing with an Arduino nano board. The motors use TTL serial but has only 3 pins (no receiver end on the Arduino) so I can define 3 separate SoftwareSerial ports for them. I could also define another SoftwareSerial for the LiDAR (which requires both RX and TX on the Arduino). Now here's my question: am I right in saying that I can make the robot work with 4 SoftwareSerial ports itself and there's no need to go for boards with more hardware serial ports (like Teensy)? My explanation is that if we look into the limitations of SoftwareSerial,

1. Only one SoftwareSerial port can receive at a time : This is fine because the motors don't have RX port on the Arduino end.

2. You cannot simultaneously transmit and receive : This I am not quite sure. I guess it (LiDAR) doesn't need to transmit and receive simultaneously. Does anyone have experience with this?

I really don't want to go for Teensy board since I already own an Arduino nano.

BTW, I didn't check this out for myself because I don't have the micro-LiDAR yet.


Thanks,
Aswin

PaulS

Quote
1. Only one SoftwareSerial port can receive at a time : This is fine because the motors don't have RX port on the Arduino end.
That's an odd point of view. The motors don't have a transmit pin. That's all that you can, or need to, say.

Quote
2. You cannot simultaneously transmit and receive : This I am not quite sure. I guess it (LiDAR) doesn't need to transmit and receive simultaneously. Does anyone have experience with this?
What are you sending TO the LiDAR? Does it continuously send data? Or does it only send data in response to you sending a request?

If it only sends data when you request it, AND you can afford to block waiting for a response, then you can easily use multiple instances of SoftwareSerial, since all but one of them don't need to listen for data, and that one only needs to listen for short periods of time.

Quote
I really don't want to go for Teensy board since I already own an Arduino nano.
By the time you are done, the cost of a faster Teensy, with multiple hardware serial ports, will be a tiny fraction of the investment you make in robot, so I do not understand this stance.
The art of getting good answers lies in asking good questions.

Go Up