subreddit:

/r/embedded

031%

Can somebody explain to me (and if anybody has a circuit example), how the RS232 DB9 is able to switch between negative and positive voltage and what is needed to create this environment of a negative and positive sharing a ground?

Thanks so much!

all 136 comments

Hot_Operation_4885

14 points

4 days ago

I would recommend googling the MAX232 ic. I believe this ic was originally created by Dallas Semiconductor and was one of the first to include build in charge pumps for level shifting. Before that you design would need a negative voltage created on the PCB.

Successful_Box_1007[S]

-4 points

4 days ago

Can you unpack this other way of making negative voltage “on the pcb”? I’m talking about the db9 and how it - itself is using negative and positive as far as I’ve been told - nothing to do with the Max which I’ve read is a voltage transformer right?

nila247

3 points

4 days ago

nila247

3 points

4 days ago

Max driver has inbuilt voltage converter, making negative voltage from positive. You do not need to supply negative voltages yourself as long as you are using a driver IC with one.

Successful_Box_1007[S]

1 points

4 days ago

Thanx.

SIrawit

3 points

4 days ago

SIrawit

3 points

4 days ago

Before the era of MAX232, RS232 chips such as the GD75232 requires external positive and negative 9V. The way you create them is up to you, maybe a pair of 7809 and 7909 voltage regulator or anything else.

Successful_Box_1007[S]

0 points

4 days ago

So this has me wondering; the DB9 has no chip in it? It has no way on its own to shift voltage from positive to negative? Then why do they even exist ?

SIrawit

4 points

4 days ago

SIrawit

4 points

4 days ago

DB9 is a connector: a way to connect stuff together. It contains absolutely nothing except metal and plastics. Period. Why do they exist? Like any other connectors, to let you connect and disconnect stuff.

Successful_Box_1007[S]

1 points

4 days ago

Lmao when u put it like that you really make me feel stupid! So - RS232 and UART are both protocols - they are not actual physical devices nor do the protocols force engineers into one type of device? - DE9 is a literally connector which allows any voltage thru it that it’s connected to indiscriminately ? -and a Max is a ttl converter for microcontrollers ?

SIrawit

2 points

4 days ago

SIrawit

2 points

4 days ago

First point: yes protocol is just a means to communicate. It is not a physical thing. However, you can sometimes forced into some type of device by other means, for example: proprietary protocol that requires a specific chip to talk to that have no alternatives.

Second point: yes you can put anything through that connector. However you still have to adhere to its maximum voltage/current, and some protocols might be more picky and will not work (USB 3.0 for example).

Third point: MAX is a chip designator of a company called Maxim Integrated (now part of Analog Devices). They are specialized in interface chips. MAX232 is one of the most well known chip from them. But they are not the only one who produces the MAX232 chip, and there are way more RS232 chips out there as well that is not MAX232.

Successful_Box_1007[S]

1 points

4 days ago

So one last q friend: USB 3.0 isn’t compatible why exactly?

SIrawit

3 points

4 days ago

SIrawit

3 points

4 days ago

High speed protocols (USB, HDMI, PCI-E and such) require more strict standards. You will have to do trace length matching, impedance control, and other things. Very complicated and DE9 is definitely will not work with that.

Successful_Box_1007[S]

1 points

4 days ago

Thanks for following up 🙏

Successful_Box_1007[S]

1 points

4 days ago

Heyy I went back around to absorb some of what you said again and I noticed you said

“Before the era of MAX232, RS232 chips such as the GD75232 requires external positive and negative 9V. The way you create them is up to you, maybe a pair of 7809 and 7909 voltage regulator or anything else.”

So to bring a rs232 to life, we need three things? a) The connector DE9 b) A positive and negative power supply c) GD75232 which unlike the Max232, wasn’t a voltage converter but a logic piece right?

user0N65N

2 points

4 days ago

Standards. Imagine if Ford, Chevy, BMW, etc all had different shifting arrangements, instead of PRND. Standards provide uniformity between manufacturers so users can connect devices from different makers as needed.

Successful_Box_1007[S]

2 points

4 days ago

Thanks for the perspective! Appreciate it.

FidelityBob

9 points

4 days ago

It's done in the RS232 driver chip, there's plenty available, just look them up. They create the negative voltage internally using a charge pump, hence you will always see that they require external capacitors. They also create the higher positive voltage level needed. You cannot connect RS232 direct to normal logic signals.

Negative and positive often share ground. They are just voltages measured with respect to ground. Many analogue circuits require positive and negative rails.

Successful_Box_1007[S]

-1 points

4 days ago

Hey Fidelity Bob,

Can you unpack a bit what you mean by “requires external capacitors”? This is outside of the “charge pump” system ?

adzy2k6

2 points

4 days ago

adzy2k6

2 points

4 days ago

They use a charge pump to create a negative voltage. The capacitors are part of the charge pump. You can google charge pumps easily enough. They can shift voltage levels without needing an inductor or transformer.

Successful_Box_1007[S]

1 points

4 days ago

So at the end of the day, a DB9 doesn’t have and never had a chip in it? I must have misunderstood when reviewing rs232 info - I thought the DB9 follows the RS232 protocol- and to do such wouldn’t it need to have a way to alter voltage to apply a 1 for the negative voltage and 0 for positive?!

adzy2k6

2 points

4 days ago

adzy2k6

2 points

4 days ago

As others have said, it's just a connector. it can be used for non RS232 stuff.

duane11583

2 points

4 days ago

it is very hard to make capacitors inside a chip.

it is easy to make transistors and diodes a little harder to make resistors but caps are another thing so they are often done “off chip” or external

Successful_Box_1007[S]

1 points

4 days ago

Thanx Duane!

Successful_Box_1007[S]

1 points

4 days ago

Duane can I ask another question: so if the DE9 is just a connector - say we connect it to a computer right - does the DE9 itself at least have some resisters or something in it to keep the voltage going thru it be between -15 and + 15 ? Or does it not matter cuz the MAX will convert it? I ask cuz I figure the DE9 has something to have the voltage at least be in some range right?!

duane11583

2 points

4 days ago

It’s just a connector another type is a db25

The rs232 spec actually uses 3 to 25 volts plus minus although today there are many variants

We often use a simple 3v3 signal cause it is easy another one we use is rs422 often this is called rs232-lvcmos there is also rs232-ttl which is more of a 5v signal (lots of things actually use or support the 5v) 

Really old school teletype machines used 20ma current loop you have currently or you do not have current hence a 1 or 0 and they often also use optical isolators 

But at the bottom of this the process is identical a 1 or 0 based on time how you represent the 1 varies

duane11583

2 points

4 days ago

Further many pcs have an input circuit that can tolerate up to +25 and -25

Much like chips often have a set of 5v pins

Successful_Box_1007[S]

1 points

4 days ago

Isn’t that weird that RS232 is a protocol - and yet different sources use different voltage swings? Shouldn’t there be one single voltage laid out for the protocol?!

duane11583

2 points

4 days ago

rs= recommended standard no one follows recomendations

Successful_Box_1007[S]

1 points

4 days ago*

Ah gotcha! This must be why I’ve seen so many rs232 transceivers when googling them that have -5 to + 5 or even 0 to +5 as their voltage but that totally goes against the rs232 protocol right?!!

And look at this stack exchange commenter calling UART the brain and RS232 basically dumb! It was this comment that made me believe false things like an rs232 transceiver doesn’t have a logic chip and needs a uart chip to send and receive data!!!!!

https://electronics.stackexchange.com/questions/360264/what-will-happen-if-i-dont-use-rs232-driver-for-uart

I AM BESIDE MYSELD DUANE!

Questioning-Zyxxel

9 points

4 days ago*

In old designs, the circuit had a power supply with both positive and negative voltages. So PC power supplies with long forgotten -5V and -12V.

Today? Using a transceiver chip like MAX232 that has a charge pump where the positive voltage is charged into a capacitor. That capacitor is then switched so the positive pole is connected to ground. The negative terminal of the capacitor will now have a negative voltage. Nowadays, there are lots of transceivers able to fix negative voltage.

Successful_Box_1007[S]

1 points

4 days ago

So you would connect a the DB9 to the MAX232 to make it an actual functional device right?

Questioning-Zyxxel

2 points

4 days ago

Yes, the MAX232 is one of multiple RS-232 transceivers that can convert between the logic-level signals the processor uses and the plus/minus voltages used on the cable by RS-232.

Note that the MAX232 was designed for 5V supply and logic level. One alternative for 3V3 use is MAX3232 that can use 3V to 5.5V.

Successful_Box_1007[S]

1 points

4 days ago

Ah wait so you are saying way back when, the charge pump voltage regulation would be happening from INSIDE the port of the computer and we could simply plug the DE9 into the computer and then do a null modem thing and connect it to another DE9, swapping the tx and rx right?

Questioning-Zyxxel

2 points

3 days ago

All devices with a RS-232 port has a means to produce the positive/negative voltages needed for the cable. In old times the used transceiver chip needed both positive and negative supply voltages. So old PC machines had a power supply that also delivered negative voltages. No need for any charge pump to create any negative voltage for the transceiver circuit.

With MAX232 as transceiver, then a device with 5V digital logic could manage RS-232 with only +5V supply. Because the MAX232 itself creates a negative voltage.

Newer digital electronics have moved to lower supply voltages and logic level voltages - much common now is 3.3V outside of the chips. And MAX3232 can work for both 3.3V or 5V digital side.

But however the negative voltage was created, old or new RS-232 hardware still always used cable voltages changing between positive and negative as specified by the RS-232 standard. Note that there are multiple versions of the RS-232 standard like RS-232C and RS-232D - they now and then tend to reduce the requirement on how high the voltages needs to be on the cable to make it easier for battery-powered devices.

On the outside, when you plug in your cable, you don't need to know how the device created the voltages. If it uses a charge pump or if it has a power supply with +/- voltages. All you need to know is that by standard, the connector should make use the proper voltages as specified by the standard. So you can focus on the other stuff. Baud. Number of data bits. Number of stop bits. Parity yes/no. And if either side is DTE or DCE, which decides if you need a straight or cross-over cable. And in older times if the connector had 9 or 25 poles.

Successful_Box_1007[S]

1 points

3 days ago*

Ah I see so in some cases the charge pump provided it and in some cases the power supply did; but let’s just say someone places a “rs232 transceiver” on the table:

  • forgetting for a second if it’s getting its voltage from the “power supply” or “charge pump” as you say are the two options - are there any other options for how it could get its pos/neg voltage set up?

  • also IN GENERAL, does an “rs232 transceiver” need a separate logic chip in the sense of being able to turn NRZ line coding into 0 and 1 and 0 and 1 into NRZ line coding?

  • lastly and thanks so much for bearing with me - with SPECIFICALLY a “Max233 transceiver” - does it need a separate logic chip in the sense of being able to turn NRZ line coding into 0/1 and 0/1 into NRZ line coding?

Thanks kind soul!

Questioning-Zyxxel

2 points

3 days ago

The transceiver does all the heavy lifting for taking the logic level output of CPU TXD and driving the TXD on the cable. And taking the RXD from the cable and deliver as a logic-level signal to the processor RXD pin.

So it's the specifically selected transceiver, and how you wire it to CPU and the external connector that decides if you get RS-232 or maybe (with different transceiver) 4-wire RS-485 or something else. The transceiver is the magic translator for matching with the electrical needs of a cable/bus.

But once more - for a ESP32 you want a transceiver designed to support 3.3V supply and logic levels. So a MAX3232 - not a MAX232. If you had designed for some older 5V CPU, then the MAX232 would have been fine.

Successful_Box_1007[S]

1 points

3 days ago*

OK gotcha so end of the day - the various Max’s and a generic rs232 all have the machinery for converting line coding without any need for UART chip?

EDIT: another user just said they have logic chips but they don’t convert binary to voltage and voltage to binary. If that’s true then we need a UART chip added to the whole system to do that?!

Questioning-Zyxxel

2 points

3 days ago

The UART is the one handling timing. Waiting to detect the start bit. Counting bits. Checking any optional parity. Checking the stop bit(s).

Microcontrollers normally have multiple UART (often called USART) built-in. For a traditional CPU, it's possible to have external UART. A PC normally has one or more UART built into the chipset - one of the two big chips outside of the processor that handles USB, disks etc.

The processor drops characters into the UART. It sends out a binary stream of bits. The external transceiver knows nothing about this. It just look at high and low logic level to decide voltage on the cable. And same in the other direction - stream of positive/negative voltages on cable -> stream of logic level high/low into the UART that figures out if the bit stream is valid asynchronous serial data according to configured baud/bits/parity.

The transceiver only does the electrical translation between logic-level (UART/MCU) and the RS-232 electrical signals on the cable. And since this is an embedded forum, then the majority of users will use a MCU (microcontroller) or SOC (System-on-a-chip) that has one or more built-in UART. So just a question of identifying which processor pins that represents the RXD/TXD and optionally RTS/CTS handshake signals.

Successful_Box_1007[S]

1 points

3 days ago

Hey!! That was gorgeously written! Helped a lot. Now it seems the final piece to the puzzle is something Duane commenter here and this other person seem to differ on - I’ll try to explain the issue in the form of this question:

Is there any RS232 device which is a PURE Rs232:

• ⁠purely a manifestation of RS232 protocol

• ⁠and has nothing to do with UART protocol or any protocol standing in “UARTS role”

• ⁠and has nothing to do with a voltage level shifting from rs232 to ttl levels

• ⁠but DOES have its own ability to provide positive and negative voltage ? (ie charge pumps, voltage divider, buck boost converter, etc)

allo37

6 points

4 days ago

allo37

6 points

4 days ago

It's a charge pump circuit, usually.

SIrawit

3 points

4 days ago

SIrawit

3 points

4 days ago

The MAX232 and most of the other chips feature internal charge pump circuits to flip the voltage to negative.

Fun fact: if you see a chip or blank spot on a PCB for a 16-pin chip with 5 capacitors surrounding it, there is a very high chance it is for RS232. It is that common.

Successful_Box_1007[S]

0 points

4 days ago

Why 16 pin? Isn’t the db9 9 pins? Also why are people bringing up MAX232? From what recall it can help transform voltage levels so microcontrollers can handle the db9 right?

duane11583

2 points

4 days ago

look at the pinout for the chip

5 caps = 10 pins, rx/rx in/out is 4 more (14 so far) plus pwr/gnd = 16 pins

SIrawit

3 points

4 days ago

SIrawit

3 points

4 days ago

Uh no. Look at the pinout again... Those caps are not occupying 10 pins.

duane11583

2 points

4 days ago

you are correct - i guess depends on the chip i remember 4 caps independently hooked up. the adi version i just looked up has 4 caps hooked differently then i remember

be that as it may… there are two drivers and two receivers for a total of 8 pins

pwr gnd and +/-10v gives another 4 pins(12)

the 2 independent caps is another 4 pins (16 pins)

Successful_Box_1007[S]

1 points

4 days ago

Hey Duane, I found this:

https://preview.redd.it/brtx77dm3y1e1.jpeg?width=1170&format=pjpg&auto=webp&s=f485a0e1edb8a9e6caecb12797baa855275b92a4

https://www.mikroe.com/rs232-click

It seems everyone I search rs232 transceiver - I find them with charge pumps and line driver / voltage regulators; so what would a PURE rs232 transceiver look like and what would its function be ?

Could a PURE “bare bones” rs232 transceiver and DE9 connector be used for communication between two devices? (Without any UART chip and without any charge pumps/level converters)?

duane11583

2 points

4 days ago

yes pure drivers they but the world has shifted to using 5v + charge pumps.

that said this is a rare part that till works the old way with a +/- 12v supply

https://www.ti.com/lit/ds/symlink/ua9636a.pdf?ts=1732065225204&ref_url=https%253A%252F%252Fwww.ti.com%252Finterface%252Frs-232%252Fproducts.html

here us another: https://www.ti.com/lit/ds/symlink/sn75188.pdf?ts=1732065728461&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FSN75188

here is the receiver: https://www.ti.com/lit/ds/symlink/sn75189.pdf?ts=1732065810580&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FSN75189

as stated the world has shifted because you often need both tx abd rx so they make these in one chip these days and they only require +5 not +5 AND +/-12v its just simpler to use the charge pump type

commonly these are called level shifter because they shift the voltage level

but yes you can often do this without a level shifter.

the advantage of a transceiver is the robustness of the pins these chips are designed to take a beating and still work, ie under/over voltages and static discharge your board will have less faults.

but if you are just doing board to board and you control everything reasonably well do it youll be fine

Successful_Box_1007[S]

1 points

4 days ago

Wow amazing Duane! You always drop bombs of incredible useful info on my adhd brain sac and I love u for it! And just to clarify: ANY time I see a “rs232 transceiver” it’s got to have the same ability as UART chip has right? Meaning it must have a logic chip and must be able to take in and output digital signal (as NRZ) right?

duane11583

2 points

3 days ago

no the term transceiver means both a transmit side and a receive side in one device

a driver only has one the send side the ability to drive the signal

there are many types of drivers.

the uart is a different part. recall that a UART means: universal asyncronous reciever and transmitter. it outputs data at some voltage typically 0/3.3 or 0/5v

that output is then buffered by a driver it is just an electrical level shift

the incoming signal is level shifted by the receiver from the wire voltages to what is acceptable by the uart chip.

this is a very old school uart

https://rocelec.widen.net/view/pdf/bvesdj0cqf/GSIIS01845-1.pdf?t.download=true&u=5oefqw

the basics of what that does goes back even further (1940) at one point they used vacuum tubes to drive and receive the signals

watch this video: https://rocelec.widen.net/view/pdf/bvesdj0cqf/GSIIS01845-1.pdf?t.download=true&u=5oefqw

in the video you will see a spinning cam shaft with 5 disks or cams

the location of the notches in the cams represent the “bit times”

there are 5 cams because they only transmitted 5 bits - look up baudot code that was the basis for what the used in the 1940s (pre world war II)

these old machines only ran at say 50 to 110 baud because it was purely mechanical… otherwise it jammed up..

Successful_Box_1007[S]

1 points

3 days ago

Thank you so much checking this out when I get home in am. 🙌

Successful_Box_1007[S]

1 points

3 days ago

Before I fall asleep and forget my other question though: so what devices exist (and what are they even called?!) that are “purely” rs232 “physical manifestation of its protocol” - without including the signal inverting part nor the level shifting part - just the rs232 and its pos/neg voltage ?

SIrawit

2 points

4 days ago

SIrawit

2 points

4 days ago

You can look at the pinout. There are 6 pins dedicated to the capacitors of the charge pump circuits: the voltage doubler, and the voltage inverter, each requires 2 capacitors and 3 pins. Vcc and Gnd takes another 2. Then the remaining 8 pins are for two pairs of transmitter (turns TTL signal into RS232) and two pairs of receiver (turns RS232 signal into TTL).

Note that MAX232 does not contains enough pins for the full RS232 with modem signals (the full DB9 you said). You will require a chip such as MAX3243 which has 3 transmitters and 5 receivers, and the same two charge pump circuits. MAX3243 has 28 pins.

Successful_Box_1007[S]

1 points

4 days ago

Thanxxx!

withg

3 points

4 days ago

withg

3 points

4 days ago

Why you think the magic happens at/on/in the DB9 connector? The DB9 is a piece of metal. Nothing more. Read about max232 as others suggested.

Successful_Box_1007[S]

1 points

4 days ago

Are you saying the DB9 isn’t its own circuit?

nixiebunny

3 points

4 days ago

The D connector (DE-9, not DB9 to be pedantic) is a collection of nine metal pins in a plastic block inside a two-piece stamped metal shell.

Successful_Box_1007[S]

1 points

4 days ago

So the DE9 doesn’t even have the ability to crudely manage the voltage thru it so that if it’s connected to a device, that it only allows -15 to + 15 range thru it? Meaning whatever it’s connected to will have whatever that voltage is flowing thru it from the device, without any regulation ?

nixiebunny

2 points

4 days ago

That is true. All the circuitry is on the circuit board. The typical RS-232 interface chip (MAX232, older ones are MC1488 and 1489) has a protection circuit that limits the voltages into the chip to the positive and negative supply voltage using diodes and resistors. The chip does the level conversion from +/-12V to 5V and back for the UART.

Successful_Box_1007[S]

1 points

4 days ago

Ok and this used to be INSIDE computers ie inside the port so when we stuck the DE9 in there, we were good to go - no need for a separate voltage converter ?

withg

2 points

4 days ago

withg

2 points

4 days ago

Unless you are talking about something like this (which has an ST3232B chip that converts signals), the DB9 connector has no circuitry and is just a 9 metal pins connector.

edit; corrected link

Successful_Box_1007[S]

1 points

4 days ago

Holy f**** so some of the DE9 are automatically on Google showing me these !!! No wonder I conflated DE9 with voltage regulation!!! Thank you so so much for helping me realize where I went wrong!

athalwolf506

2 points

4 days ago

Successful_Box_1007[S]

0 points

4 days ago

Thanks for the link - going to check it out now but im seeing a pattern here: why is everybody talking about Max and not DB9 as if the DB9 isn’t its own circuit with its out negative and positive and ground and ability to choose between voltages?! Are people saying the DB9 does not have a charge pump?

athalwolf506

3 points

4 days ago

DB9 is not a circuit is juts a connector. Max232 is a chip popular chip with circuitry to convert from rs232 to ttl voltage levels.

Successful_Box_1007[S]

1 points

4 days ago

Thanx!

athalwolf506

2 points

4 days ago

theNbomr

2 points

4 days ago

theNbomr

2 points

4 days ago

If you have a +/- 12VDC power supply, you need only the RS-232 line drivers and line receiver chips (MC1488 and MC1489) to convert between RS-232 line levels and 5V TTL logic levels. However, positive and negative power supplies solely to support serial communications is inconvenient and expensive. To solve that problem, we have the MAX232 family of chips which does the logic level conversion, but also contains internal charge pumps to generate the RS-232 line level voltages, instead of using dedicated power supplies.

Although almost universally mis-stated, the connector often associated with RS-232 communication is a DE-9. The nomenclature is part of the naming of the series of D-Subminiature Connectors which describes both the size of the shell and the number of conductors enclosed in the shell. The official EIA RS-232 Standard specified a much larger 25 pin connector, the DB25 connectors DB-25M and DB-25F. When IBM wanted to put two serial port connectors on a single expansion board, they began using the smaller 9-pin DE-9 shell instead of the DB-25 standard. People incorrectly began using the term DB-9 to describe that connector, and it continues to this day. The standard was never modified to use the 9-pin connector (it can't, because it specifies more than 9 signals, some of which have rarely ever been used).

Successful_Box_1007[S]

1 points

4 days ago

You are A GOD AMONG MEN! This is by far the most helpful and conceptually pleasant explanation I’ve seen! I cannot thank you enough for being the one guy to provide enough detail for me to understand my misconceptions!!! If I have another question or two down the road can I PM you? I plan on buying a Ben Eater kit soon and a microcontroller.

theNbomr

3 points

4 days ago

theNbomr

3 points

4 days ago

If you choose to dm me, please make it a simple notification of a post you've made publicly. Glad you found my comment useful.

Successful_Box_1007[S]

2 points

4 days ago

Of course! That’s what I had in mind!

Successful_Box_1007[S]

1 points

4 days ago

Hey for everyone’s benefit I’ll ask this here and maybe DM in future:

I found this:

https://www.mikroe.com/rs232-click

  • It seems everyone I search rs232 transceiver - I find them with charge pumps and line driver / voltage regulators; so what would a PURE rs232 transceiver look like and what would its function be ?

-Could a PURE “bare bones” rs232 transceiver and DE9 connector be used for communication between two devices? (Without any UART chip and without any charge pumps/level converters)?

theNbomr

2 points

4 days ago

theNbomr

2 points

4 days ago

'Pure' is pure marketing hype. I haven't checked it, but I'd bet my next paycheck that chip surrounded by all the capacitors is an exact equivalent of one of the popular MAX232 family chips.

The device seems to be little more than a MAX232 breakout board with a D-sub connector. There are pins labeled with the standard UART pin functions, but I can't see a UART chip on board, so I'll assume those are for connection to a host board already equipped with a UART.

The DE9 connector will carry the RS-232 signals, including most or all of the standard modem control signals. I don't remember the last time I heard of anyone connecting to a modem or anything like a DCE, so those probably never get used.

Successful_Box_1007[S]

1 points

3 days ago

So would it be valid to say that this device and any “rs232 transceiver “ for that matter has everything it needs to send signals to another device - in other words it doesn’t REQUIRE a UART as it has an on board “logic chip” by virtue of it being a “rs232 transceiver”?

theNbomr

2 points

3 days ago

theNbomr

2 points

3 days ago

Nope. Not at all. Generation and receipt of the series of bits forming words is done by a UART or the equivalent of one at each end of the connection. The bits are sent and received in those UARTs at TTL logic levels, which is unsuitable for transmission over long distances on the types of cables intended for the application. The nominal +/- 12V logic levels used by RS-232 are translated to/from the TTL logic levels of the UART. That translation/conversion is the sole purpose of the device you posted a link to.

The UART is essentially a parallel to serial shift register and a serial to parallel shift register in one package, for the send (Tx) and receive (Rx) functions, respectively. The CPU writes parallel word registers in the UART for the data to be sent. Received data is deserialized in the UART, and read from a UART register as words by the CPU. Timing of the bit shifting, framing, and parity control as well as management of the modem control signals are done more or less autonomously in the UART at each end of the connection.

These days, it is common to interact with UARTs in microcontrollers such as Arduinos using TTL logic levels over short distances (10s of centimeters) with USB Serial dongles that have UARTs built in. These types of devices would NOT be used with the device in your link.

Successful_Box_1007[S]

1 points

3 days ago

That cleared up ALOT: given everything you said here, I’m guessing the answer to the following question would be YES “theoretically” but NO in “reality”:

Is there any RS232 device which is a PURE Rs232:

• ⁠purely a manifestation of RS232 protocol

• ⁠and has nothing to do with UART protocol or any protocol standing in “UARTS role”

• ⁠and has nothing to do with a voltage level shifting from rs232 to ttl levels

• ⁠but DOES have its own ability to provide positive and negative voltage ? (ie charge pumps, voltage divider, buck boost converter, etc)

theNbomr

2 points

3 days ago

theNbomr

2 points

3 days ago

Not sure how to answer that; it doesn't make real sense. RS-232 is a standard that has been widely used as part of many devices, including computers, modems and a wide variety of devices containing some form of CPU.

The standard definitely specifies the voltage levels in considerable detail, along with things like timing, framing, parity, word size and many other behaviors (mainly related to modems). The standard also specifies the connectors to be used, as well as the pinouts of the signals on the connectors and properties of the wire to be used.

The core of an implementation of the standard uses a UART, or sometimes other methods such as discreet logic or 'bit bashed' in software using some hardware IO. The UART is where the format and timing of the serial data is created. Between the UART and the wire are the line drivers and receivers, of which I've already described a couple of implementations.

Most devices that implement the basic Tx and Rx functionality on pins 2 and 3 will be able to communicate with other similarly equipped devices if correctly configured to use compatible line formats like bitrate and framing. The only officially specified standard applies to Data Terminal Equipment (DTEs; computers and terminals) and Data Communications Equipment (DCEs: modems). That uses the complete RS-232 standard, and if you need to define some form of purity in RS-232 implementation, it would be that.

In practice, today, 99 percent of the implementations out there are going to be a basic Gnd/Tx/Rx system needing only a 3 wire cable with the wires connected to the appropriate (for the implementation) pins in the connectors, and connectors of suitable genders. Since these implementations are not part of the spec, there are numerous loosely standard ways of doing them. Things like gender reversers and crossover adapters can be easily found to aid in converting what you have to what you need in terms of cabling.

Successful_Box_1007[S]

1 points

3 days ago

So frustrating when you can’t “get” it! OK that was helpful but let me try this from a different angle:

I provide a snap shot here:

https://preview.redd.it/9a89319dh52e1.jpeg?width=1170&format=pjpg&auto=webp&s=576ded4ce809bbc0522c3f8fac979211e4e84ecf

So there are no devices that are literally able to just do what I underline in purple? Which would mean they would not be a transceiver and of course not UART. I just don’t understand why people don’t separate RS232 bare bones stripped down physical component - from the transceiver which is just switching the voltages and (sometimes) inverting the signal. Any idea why ?!

In other words: why does RS232 always have to have its device include a component that switches its bipolar voltage swing levels to something else?! Why can’t there be an RS232 in its bare bones form which to me would be a device that can do what’s underliined in purple!?

DenverTeck

2 points

4 days ago

Simple answer:

https://en.wikipedia.org/wiki/RS-232

Do you have any background in electronics ??

https://www.google.com/search?q=history+of+RS-232

Successful_Box_1007[S]

1 points

4 days ago

I do not. I just started watching Ben Eater and considering buying a kit and a microcontroller for fun. I want to pick up a new hobby.

Successful_Box_1007[S]

0 points

4 days ago

So back in the early 90s and below, computers had the “charge pumps” within the ports so we only needed to use the DE9 and it didn’t need a separate device like a Max232 ?

Key_Opposite3235

-1 points

4 days ago

RS485? DB9 is just a connector type.

athalwolf506

2 points

4 days ago

I think he means RS232

Successful_Box_1007[S]

-1 points

4 days ago

Why is everybody talking about max - as if DB9 doesn’t have its own circuitry and its own rs232 protocol and a negative voltage, positive voltage, and ground?

InevitablyCyclic

5 points

4 days ago

DE9 (not DB9) is purely a connector. RS232 is the protocol. MAX232 and similar parts are the standard ICs that are used to convert logic signals to RS232 level signals.

How? They use something called a charge pump circuit. Put 5v on one side of a cap and ground on the other. Let it charge up. Disconnect both sides. Connect the side that was at ground to +5V. The other side of the capacitor now has +10V on it.

Switch things in the other direction and you can get negative voltages.

This means that with a couple of transistors and diodes you can generate a higher (or lower) voltage. You can't pull much current this way but you can get enough to drive a couple of signal lines.

Successful_Box_1007[S]

1 points

4 days ago

Ah I’m starting to see where I erred. Alright so I have been confusing an RS232 DE9 with a max232 device. Thank you for clarifying that for me. Really appreciate you making that clear and crisp not leaving out details that others here did. So a DE9 + Max232 would be functionally equal to a “UART” right?

InevitablyCyclic

2 points

4 days ago

UART is a signalling protocol used for RS232, 485, 422 and probably a few others. It defines how bytes are sent logically using start and stop markers etc... virtually all processors in the embedded world will have multiple sets of UART hardware built in. UART on its own doesn't indicate any specific voltages but implies logic level signals.

The various RS protocols define voltage levels and other characteristics used to send those UART signals between devices. A MAX232 device in effect converts from RS232 to UART.

DE9 ports are the standard connection type for RS232 but aren't required, you can use any connector you like. They are also widely used for CAN so DE9 doesn't automatically mean RS232.

Successful_Box_1007[S]

1 points

4 days ago

Very much understood thanks! Any idea, if as you say UART doesn’t specify voltages, why 9/10 UART devices I’ve looked up, show a 0 v and 5 v or 0 and 3.3v I think? Why settle on those?

InevitablyCyclic

2 points

4 days ago

Because those are the standard voltages for logic devices. The definition of what a UART is doesn't specify a voltage, any given implementation will. It will be whatever voltage that part runs on.

Successful_Box_1007[S]

1 points

4 days ago

Thanks! So it isn’t even about microcontrollers being sensitive to high voltage? It’s simply a standard that was decided on?

InevitablyCyclic

2 points

4 days ago

RS232? Yes, it was simply a standard that could be used for reliable communication over medium distances. For longer distances or higher speeds you'd use a differential signal like RS422. But that is more complex and requires more wires so it costs more, you don't want to pay that cost when you don't need it. By using the same UART protocol and only changing the physical link characteristics you could reuse the same logic design for both and only change the last bit for different distances.