Go Down

Topic: TTL and RS232 voltage levels. (Read 2496 times) previous topic - next topic

Lima7

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

retrolefty

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



Runaway Pancake

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)?
"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?"

Graynomad

#3
Nov 08, 2011, 03:34 am Last Edit: Nov 08, 2011, 03:37 am by Graynomad Reason: 1
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
Rob Gray aka the GRAYnomad www.robgray.com

zoomkat

Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

Runaway Pancake

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
"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?"

Grumpy_Mike

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.

Runaway Pancake

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.
"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?"

cyclegadget


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
Good links: Eagle tutorial= http://www.youtube.com/playlist?list=PLDE1858BD83D19C70
General Arduion tutorials = http://tronixstuff.wordpress.com
http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

retrolefty


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

Grumpy_Mike

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

Go Up