Pages: [1]   Go Down
Author Topic: Do the 3.3v Serial1-3 ports work with 5v?  (Read 738 times)
0 Members and 1 Guest are viewing this topic.
Brisbane, Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

New to Arduino and I have a UNO and DUE.

On the DUE, I tried to get a serial port mirror working - where I copy incoming data on 1 port and write it out on the other port and same in reverse. This isn't working - garbage and shifted bits/bytes seem to be being transmitted instead - I'm actually getting really weird results.

Quick question to avoid me working on this further when clearly it won't work, do I need to consider that Serial1 through Serial3 on the DUE are at 3.3v TTL and therefore I can't just wire them directly to most serial ports working at 5v ?? If so, what was the point of 3.3v TTL ports? Do any cheap converters exist that I can wire in???

Perhaps I should have bought a Mega then??  smiley-roll-sweat

G
Logged

Brisbane, Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is what I have in my main loop.... but alas it produces garbage between the two ports even though they are both at the same baud rate and just typing simple characters to each other.....

Code:
  if (SerialUSB.available()) {   
    Serial2.write((byte)SerialUSB.read());
  }
   
  if (Serial2.available()) {   
    SerialUSB.write((byte)Serial2.read());
  }
Logged

US
Offline Offline
Full Member
***
Karma: 4
Posts: 182
Electronics are the new Legos
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, so you are using the Console for the SerialUSB right?

What are you using to read the Serial2 port?  Maybe a TTL serial to USB board and using a terminal program?

Things to check:
1) Set the signal levels on your TTL board for 3.3v if you can
2) Make sure the wiring is correct
3) Ensure the baud rate is set right, bits, stop bit, parity
4) Maybe simplify your program, print a letter "A" from the program once every few seconds, see if that is what you are receiving.
Logged

Brisbane, Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

....ahhh, I'm guessing my lack of TTL to RS232 convertor is the problem. I incorrectly assumed that the presence of a UART with 4 ports meant you just had to wire the RX/TX to the corresponding DB9 connector. It isn't clear that whilst the UART exists, it doesn't really afford you much benefit as you'll need to add further circuits to enable any kind of real RS232 communication.

Mmmmm.... would recommend this bit of information be added to the Serial reference pages or perhaps somewhere on the Due or Uno pages where people might be thinking like I was (unless it already is and I did not see it).

G
Logged

US
Offline Offline
Full Member
***
Karma: 4
Posts: 182
Electronics are the new Legos
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Most people know the UART TX/RX are at signal (3.3V) levels and would require the ubiqitous RS232 signal level translation chip if needed.  The 5V Unos and other dev boards generally are the same deal.  The advertising says UART TX/RX or some sort, it does not say RS232 standard signaling so I doubt more language is required.  Maybe in the "Unoffocial Diagram", this might be noted for those not "in the business".
Logged

Pages: [1]   Go Up
Jump to: