Pages: [1]   Go Down
Author Topic: TTL and RS232 voltage levels.  (Read 2334 times)
0 Members and 1 Guest are viewing this topic.
UK
Offline Offline
Jr. Member
**
Karma: 2
Posts: 90
It was like it when I found it
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I know that this question pops up now and again, but can someone please refresh my memory on what an arduino can and can’t talk to directly on the serial and serial 2,3 & 4 ports?

I’m looking at a couple of GPS modules  LS20031 &  LS20032 (http://www.sparkfun.com/datasheets/GPS/Modules/LS20030~3_datasheet_v1.0.pdf). The LS20031 uses TTL voltage levels, I think this mean it can be plugged directly to an arduino port, is this correct? The LS20032 uses RS232 and therefore needs to go through a MAX232 level converter (or something similar). Is this correct?

Thanks
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The LS20031 uses TTL voltage levels, I think this mean it can be plugged directly to an arduino port, is this correct? The LS20032 uses RS232 and therefore needs to go through a MAX232 level converter (or something similar). Is this correct?

Correct on both statements. Also the MAX232 does a logic inversion as well as the voltage conversion, both required for the send and rec signals when converting from true RS-232 to TTL level serial data.

Lefty


Logged

Offline Offline
Faraday Member
**
Karma: 65
Posts: 2528
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there an inversion via software so that a RS232 signal (+/-12V) could be connected direct to an Arduino input (with a series resistor, 22K or so)?
Logged

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 129
Posts: 8525
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is there an inversion via software so that a RS232 signal (+/-12V) could be connected direct to an Arduino input
Not when using the hardware serial ports. They have to have non-inverted data.

However Softwareserial can invert I believe.

As for the +-12v, on the receiving side you could use a diode to cut the negative and a zener or voltage divider to trim the positive.

You can transmit 5v to RS232 and it will often work, but it's not guaranteed.

______
Rob
« Last Edit: November 07, 2011, 09:37:20 pm by Graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9631
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Simple inverting setup.

Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Faraday Member
**
Karma: 65
Posts: 2528
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, graynomad and zoomcat,

I was thinking that playing it fast and loose with the clamping diodes on the I/O pins could be utilised here, figuring maybe there was something like, oh.. serial.begin(/9600); or something.

I guess part of the culture here is being familiar with these libraries.
OK, MAX232 it is then
Logged

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 627
Posts: 34219
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i guess part of the culture here is being familiar with these libraries.
No it is familiarity with the hardware, the UART is looking for a logic zero as a start bit and there is no register in the machine to invert it. In fact inverting serial input to a hardware UART is something I have never seen on any processor.
Logged

Offline Offline
Faraday Member
**
Karma: 65
Posts: 2528
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In fact inverting serial input to a hardware UART is something I have never seen on any processor.
Basic Stamps have baudmodes, True and Inverted.
When their Inverted baudmode is used, an RS-232 signal (+/-12V) can be connected to a Stamp input (through a 22K resistor). 
That's a nice feature, perhaps unique.
Logged

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Greenville, IL
Offline Offline
Edison Member
*
Karma: 15
Posts: 1330
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there an inversion via software so that a RS232 signal (+/-12V) could be connected direct to an Arduino input (with a series resistor, 22K or so)?

Copied from Aruiniana : http://arduiniana.org/libraries/newsoftserial/

Signal Inversion

“Normal” TTL serial signaling defines a start bit as a transition from “high” to “low” logic.  Logical 1 is “high”, 0 is “low”.  But some serial devices turn this logic upside down, using what we call “inverted signaling”.  As of version 10, NewSoftSerial supports these devices natively with a third parameter in the constructor.

NewSoftSerial myInvertedConn(7, 5, true); // this device uses inverted signaling
NewSoftSerial myGPS(3, 2); // this one doesn't
Logged


Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In fact inverting serial input to a hardware UART is something I have never seen on any processor.
Basic Stamps have baudmodes, True and Inverted.
When their Inverted baudmode is used, an RS-232 signal (+/-12V) can be connected to a Stamp input (through a 22K resistor). 
That's a nice feature, perhaps unique.


The pixaxe standard also uses the same current limiting resistor input method and direct wiring to true rs-232 signals. They also have serial functions that can work with normal TTL serial data.

Lefty
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 627
Posts: 34219
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes but is this in the actual UART or in the chips feeding into it. Or is the UART in fact software?
Logged

Pages: [1]   Go Up
Jump to: