Pages: [1]   Go Down
Author Topic: Arduino Due Serial help  (Read 526 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi All,

I wrote a bit of code on a Arduino Uno using software Serial to talk to a Label printer and it worked fine.

Code:
#include <SoftwareSerial.h>
SoftwareSerial Printer(2,3,1);

Using this code above I got the printer to work on the Uno. Notice the inverted option in the Software Serial.

Now I have gone to the Due I am unable to get the printer to work. I am using the Serial3 on the Due as I am using the other serial ports for other devices.I also tried it on Serial2 and Serial3 on the Due. I have also used the Serial port on the Uno and it didn't work.

My brain is pointing me to the Inverted part of the Software Serial.

So the question is how do I invert the Hardware Serial on the Uno and Due. Or what do I have to do to get this to work.

Thanks in advance
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorted it out,

The printer is RS232 not TTL, well I think that is the reason so I have ordered a few converters and will try that.

Thanks
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well I got the item in the mail and I have tested it and it doesn't seem to work.

This is what I thought would help but it hasn't.
https://www.sparkfun.com/products/449

So I am up to anyone's  suggestions on this topic.

Thanks in advance
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 106
Posts: 6371
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you have a label printer with a DB9 connector designed to be connected directly to a PC, then it is speaking "rs232" signalling on it's serial port.

RS232 is "inverted" compared to "TTL Serial" - the "1" state (including idle) is supposed to become -3 to -15V, and the "0" state becomes +3 to +15V.  Because of the way that rs232 receivers are implemented, it USUALLY works if you just send "inverted TTL" (0V for "1", 5V for "0"), but that's not technically correct.  (Note that Due will be providing 0V/3.3V, which is even more questionable.)

Quote
I purchased a sparkfun RS-232 level converter and that didn't work.
A level converted like that is the correct solution, and IMNSHO you should be debugging why you weren't able to get it to work, rather than chasing obscure uart options that aren't "right" anyway.

That particular converter seems to assume a bidirectional serial connection; it sucks the higher voltage for transmitter from the receive data signal.  This is "clever", but it won't work if you don't connect both signals, or if the devices is truly "receive only" or if both sides are trying to do the same thing, or ... other circumstances.

Logged

Pages: [1]   Go Up
Jump to: