RS-232 do's and don'ts

I have an Arduino Mega 2560 Rev3 and I know that supports RS-232 out of the box, but I'm seeing you need a level shifter to use it with a "normal" computer.

I want to be able to have my computer talk to my arduino over RS-232, and I'm trying to figure out what all is actually definable as a bare-bones requirement.

Do I just need a level shifter? Or do I need something more robust like a Maxim 3323-compatible?

I like the ESD features I'm seeing on the Maxim part, but how hard would that be to integrate?

How do folks typically get their arduinos talking to PCs?

Not using Mega, only its brother, I wonder. Can You elaborate that? I don't believe You......

No. I my opinion You need an RS232 - TTL converter, something totally different from a level shifter. Yes, MAXIM makes RS232 to TTL devices.

They use USB, maybe Wifi, sometimes Bluetooth.

Via its UART - and 'Serial Monitor'.

Of course........ First choice on the list.

One way, or two way comms? There is a cheesy hack to convert an RS-232 level into a TTL level without a +/-12V supply, but not the reverse.

Is 'normal' a euphemism for 'old'?
Do you really mean to interface with some legacy RS-232 peripherals or what?

Let's be clear about this, in no way is this true.

You only get TTL levels of serial data out of an Arduino.

An RS232 requires the signals to be at +12 and -12V. Where the TTL level is high or +5V the. The equivalent RS232 level is -12V.

Where the TTL signal is at 0V the equivalent RS232 level is +12V.

Wow, I didn't expect this many replies so fast, so thanks everyone!

So I need to elaborate on my whole scope here...

The intent is to be able to plug this arduino into what I imagine would have to be a null modem cable, and plug that into a pc where, yes, "normal" means "old" but for all intents and purposes, I'm expecting the arduino to give some data and accept some data while interacting with that computer (which won't be running the arduino IDE so I'm not taking the serial monitor/UART path in this project - my bad for not being more clear)

To Railroader specifically....I may have read the 2560 MEGA R3 specs wrong, I saw RX/TX lines and my imagination ran wild - paired with the readily available serial libraries/functions, I just figured that's what those lines were.

I really need to walk back "how do folks get their Arduinos talking to PCs" and narrow it way down to a use case where it's specifically rs-232 and...how do I say this...I'm using the Arduino to control a bunch of PWM fans, I want to be able to read and set the pwm/rpms of those fans with the arduino with my system's available rs-232 port. I'm developing on one system and breadboards and such, but I'm deploying on a linux system elsewhere and all that linux system should need to care about is "here's a 9600 baud thing I can talk to" and all of the business that goes into making that work on the linux side isn't something I'd junk up the arduino forums with...I don't think this is the right place for it, but maybe it is, I don't know I haven't posted here in ages but I'm also not at that point yet.

The point I'm at now is, if I want my Arduino to be a thing that an old computer can talk to over rs-232 and set some fan speeds, and read some fan speeds, that'd be amazing. To do that, it sounds like I either need a rudimentary TTL-RS232 device or something like this:

https://www.mouser.com/datasheet/2/256/MAX3323E-1512545.pdf

and it looks to me like that device in the link above provides TTL-RS232 in addition to other features, mainly the ESD protection which I find particularly attractive.

I hope this clears up what i'm after...thanks again, everyone

Yes something like that. I would use a MAX232 because you don't need the low voltage capability that the device in your link provides.

1 Like

Cool and much appreciated!

I did order a small sample last week (only 2 units) of the chips in the link (panic buying, not knowing what will become of chip shortages and all that going on in the world), if I already have them coming, is there a reason I shouldn't use them and get something else?

No reason to use them at all.

I'm confused, you said earlier "Yes, something like that" with the only caveat I wouldn't need a low voltage capability....I'm reading capability as "something I can use but something I won't need in this case"

Does the low voltage capability make them so I can't use them at all in this case? It's not a feature I could just not use?

The chips by themselves do not solve your problem of having both + voltage and - voltages for your RS-232. The module/board with the chip creates both of those voltages for you. The result is about +8 volts and about -8 volts.

well...now I'm a little more turned around...I know rs232 uses positive and negative voltages for signaling...when you say "module/board with chip creates both of those voltages for you" I assume you mean the Arduino paired with the Maxim chip creates both those voltages, which...sounds like a good thing. I'm not expecting to use this Maxim chip on its own - it will only be used in conjunction/integration with the 2560 Mega.

I think that lands me back at wondering if the low voltage capability of this chip precludes me from using it in this case. Is it a feature in addition to also being able to handle +8/-8 or does it only do low voltage that would make it not work? (and if an rs232 chip can't do rs232...why does it exist? i'm missing something)

Sure you could just not use the low voltage capacity but why pay extra for something you are not going to use.

Yes they do, no need for an extra board, they contain the charge pump circuitry you need.

Ah, only because I already bought them and they're on the way. Thankfully I only bought two..
However...now that i'm thinking more carefully about voltages.....I don't see on their datasheet if they clearly say it also handles +8/-8 I'm only seeing 3.3V and 5V....am I going to release the magic smoke if I expect this thing to handle the eights?

Thought so. Thanks.

No you won't. A valid RS232 signal can be anything between +/- 5V and +/- 15V. Don't get hung up on the actual voltage, it is irrelevant.

That is the power supply requirement for the chip, nothing to do with the signal levels.

1 Like

As You likely know by now, those RX/TX lines should be considered as "TTL" logic.

Maybe answered already...... "Talk to" has variations. Using serial monitor controller printings can easily be shown on the Pc using "Serial monitor".
If some kind of task, code, running in the Pc is supposed receive microcontroller data, Pc programs are needed.

1 Like

Both can in some way be considered as "TTL levels" with the exception that TTL is best described as "5 volt logic". Between 3.3 and 5 volt devices a so called level shifter is needed when transmitting a 5 volt signal into a 3.3 volt device.
From a 3.3 volt device into a 5 volt version, just connect them. It works.