SDC2130 TTL TX/RX not working with Arduino SoftwareSerial

6 years 10 months ago #29528740 by richwill
I'm trying to communicate with an SDC2130 via SoftwareSerial on an Arduino. I am able to send/receive characters, but the returned data is garbled. I've attached a log of characters returned for the ?FID command. The number of characters appears to be correct, but the values are garbled. Any idea? Would I have better luck using the normal TX/RX pins and a level shifter?

Sent: ?FID

Read: 0: D 13
Received 0x0D and data still available
Read: 1: A3 163
Read: 2: 52 82
Read: 3: A8 168
Read: 4: 49 73
Read: 5: BD 189
Read: 6: C1 193
Read: 7: 6F 111
Read: 8: 74 116
Read: 9: AC 172
Read: 10: 2E 46
Read: 11: 92 146
Read: 12: 57 87
Read: 13: CB 203
Read: 14: 69 105
Read: 15: 2 2
Read: 16: 49 73
Read: 17: D 13
Received 0x0D and data still available
Read: 18: 84 132
Read: 19: 31 49
Read: 20: 98 152
Read: 21: 98 152
Read: 22: 48 72
Read: 23: 4C 76
Read: 24: A4 164
Read: 25: 14 20
Read: 26: C1 193
Read: 27: BD 189
Read: 28: 65 101
Read: 29: 30 48
Read: 30: 31 49
Read: 31: 26 38
Read: 32: F8 248

Please Log in or Create an account to join the conversation.

6 years 10 months ago #29528742 by Griffin Baker
We recommend a serial shifter.

www.sparkfun.com/products/449
Set 115200 for baud rate.

Since we are not experts in Arduino, our knowledge is bit limited. Have you tried inverting the TTL logic lines?

Please Log in or Create an account to join the conversation.

6 years 10 months ago #29528743 by richwill
No, I haven't tried inverting the TTL lines. I read somewhere else that that wasn't necessary. I'll try that and also the shifter.

Otherwise love the controllers, working great over USB via Robotrun+.

Please Log in or Create an account to join the conversation.

6 years 10 months ago #29528744 by Griffin Baker
After inverting those lines, make sure the baud rate is set to 115200. Please verify that you have done this.

Please Log in or Create an account to join the conversation.

6 years 10 months ago #29528745 by richwill
Do you think this part would do the job:

www.sparkfun.com/products/12009

Simpler and smaller than the bigger www.sparkfun.com/products/449 board.

Please Log in or Create an account to join the conversation.

6 years 10 months ago #29528746 by Griffin Baker
I think the best route is to first try inverting the TTL and makeing sure the baud rate is set to the correct rate first. If that doesn't work, then moving forward to the Shifter is the next option.

With the board you looked at, you would have to input a high voltage and a low voltage. With using the one I provided, you can use the RS232 lines instead of the TTL lines and will handle the conversion.

Please Log in or Create an account to join the conversation.

6 years 10 months ago #29528747 by richwill
Baud rate is correctly set. I actually don't know of an easy way to invert the TTL signals!

I do have a 12v and 5v available for the logic level converter. That's probably the easiest route.

Although, I do wonder if anyone has been able to get the TTL lines working with an Arduino. Seems like someone must have tried before.

Please Log in or Create an account to join the conversation.

6 years 10 months ago - 6 years 10 months ago #29528748 by Griffin Baker
Other people have been successful in doing so. I'm going to post you links to various threads we have on file related to your issue.

dev.roboteq.com/dev1/index.php/forum/9-c...c2150-over-ttl-issue
dev.roboteq.com/dev1/index.php/forum/9-c...tl-3-3v-to-rs232-12v
dev.roboteq.com/dev1/index.php/forum/14-...uino-serial#29528379

I'll see if I have anything on file on my end.

Edit:

You can also look here and see if they might be able to help you.

forum.arduino.cc/

Please Log in or Create an account to join the conversation.

6 years 10 months ago - 6 years 10 months ago #29528749 by richwill
I figured out how to invert the logic. Didn't work with the TTL signals connected to Arduino.

This is getting strange. I hooked up a bi-directional logic level converter. ( www.sparkfun.com/products/12009 ) I'm now able to use the normal 12v TX/RX pins on the controller. However, the Arduino now requires the signal to be inverted. This crazy thing is, after going through the level converter, and inverting the logic, I get similar bogus bytes returned from the controller, as with the TTL TX/RX pins!

versionSent: ?FID

Available Bytes: 33
Read: 0: D 13
Received 0x0D and data still available
Read: 1: A3 163
Read: 2: 52 82
Read: 3: A8 168
Read: 4: 92 146
Read: 5: DE 222
Read: 6: 62 98
Read: 7: AF 175
Read: 8: BA 186
Read: 9: 59 89
Read: 10: 2E 46
Read: 11: 24 36
Read: 12: 2B 43
Read: 13: B8 184
Read: 14: CD 205
Read: 15: 41 65
Read: 16: 52 82
Read: 17: 43 67
Read: 18: A1 161
Read: 19: 4C 76
Read: 20: 24 36
Read: 21: 26 38
Read: 22: 24 36
Read: 23: 13 19
Read: 24: D3 211
Read: 25: 29 41
Read: 26: C1 193
Read: 27: BD 189
Read: 28: 64 100
Read: 29: 30 48
Read: 30: 91 145
Read: 31: 26 38
Read: 32: F8 248

I ordered the serial shifter you recommended, but I think something else is causing the data corruption. No idea what!

Please Log in or Create an account to join the conversation.

6 years 10 months ago #29528750 by roboteq
In your data, it looks like some characters are captured correctly. So this would mean that connection is correct and inversion is not the issue. The fact that it responds at all to ?FID also means that you are getting correct operation, at least in the arduino to roboteq direction.

Garbled data can usually occur for the following reasons:

- mismatched baud rate. Since communication works partially, the rate looks ok, but if one of the two is not exactly 115200, this may cause the issue
- mismatched setting. We need 8-bit, no parity, one stop bit, no flow control
- floating ground. Make sure that a ground wire goes from the ground pin on the 15-pin DSub, to the Arduino ground. Do not depend on the main ground wire on the controller's terminal strip as a ground return.

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.137 seconds