TTL and RS232 voltage levels.

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

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

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

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

Simple inverting setup.

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

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.

Grumpy_Mike: 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.

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

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

runaway_pancake:

Grumpy_Mike: 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

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