SoftwareSerial doesn't work with Arduino Nano

  • IDE 6.12
  • UBUNTU 14
  • Arduino Nano

Hallo,
i'm working on a project that i need to use softwareSerial library to communicate with a servo motor (Dynamixel's servo, so i can't use the normal servo's library). I tested the example program (dynamixel softwareSerial example) and didn't work. So i tested the SoftwareSerial's example (with simple modifications) and didn't work too.
PS: the code is compiling normally.
PS: i'm using a oscilloscope to test the TX pin.

Here is the code:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(5,6); // RX, TX

void setup()
{
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
delay(500);
mySerial.println("Hello, world?");
}

void loop() // run over and over
{
mySerial.print("abcdefghijklmno");
delay(1000);
}

Has someone the same problem to work with SoftwareSerial in Nano too?
Does someone know how to fixed it?

Define "doesn't work". What voltage(s) are on the TX pin?

"Doesn't work": the tx pin have low level (the serial communication set the tx pin high when it don't communicate) or the tx pin have no pulse.

   mySerial.print("abcdefghijklmno");

What, exactly, do you expect the Dynamixel to do with that data?

Have you another Arduino that you can connect to the Nano's pins 5 and 6 to receive the data from the Nano and display it on the Serial Monitor?

Or if you have a USB-TTL cable you could connect that to pins 5, 6 and GND to view the output in the Serial Monitor.

...R
Serial Input Basics

PaulS:

   mySerial.print("abcdefghijklmno");

What, exactly, do you expect the Dynamixel to do with that data?

this code just test the softwareSerial..

Robin2:
Have you another Arduino that you can connect to the Nano's pins 5 and 6 to receive the data from the Nano and display it on the Serial Monitor?

Or if you have a USB-TTL cable you could connect that to pins 5, 6 and GND to view the output in the Serial Monitor.

...R
Serial Input Basics

i have tried to communicate with another nano from i/o softwareSerial pins to normally serial pins, and nothing (i used the LED pin to debug the reciever's nano and blink when recieve something). But just the oscilloscope is enough to check if nano send somethnig or not.

this code just test the softwareSerial..

By sending data to, and expecting a response from, a Dynamixel servo controller. Sending it crap, and expecting a response, doesn't seem logical to me.

How did you connect the RX and TX pins on the Arduino? If not done correctly, you will not see the returned message. Also, those servos are all shipped with an address of 0x00 and need to be reprogrammed to unique values.