EmbeddedRelated.com
Forums

LIN and RS232

Started by Jones December 9, 2006
Jones wrote:

> "At an RS232 data output, a logic 0 is defined as equal to or more > positive than +5V, and a logic 1 is defined as equal to or more > negative than -5V. ... Because an RS232 receiver may be at the end of > a long cable, by the time the signal reaches the receiver, its voltage > may have attenuated or have noise riding on it. To allow for this, the > minimum required voltages at the receiver are less than at the driver. > An input more positive than +3V is a logic 0. An input more negative > than -3V is a logic 1. The logic level of an input -3V and +3V is > undefined."
"undefined" is where we start getting into the difference between theory and practice. And also the difference between what the RS232 spec requires, and what common parts actually tolerate. For example, without using the response control input, the MC1489 has a VIL typically 0.8 V. Positive 0.8 volts that is. So does the MAX232. Should you depend on this in a product? No. With long cables? No. And it might not work at all, but there is a good chance that it will, most of the time, in a pinch. (I'm pretty sure I remember making do on a project with an MC1489 receiver, which needs no extra power supplies, and simply using a nice 5v CMOS NAND gate in place of a of the MC1488 driver back in the days before the MAX232 was common)
cs_posting@hotmail.com wrote:
> Jones wrote: > > > "At an RS232 data output, a logic 0 is defined as equal to or more > > positive than +5V, and a logic 1 is defined as equal to or more > > negative than -5V. ... Because an RS232 receiver may be at the end of > > a long cable, by the time the signal reaches the receiver, its voltage > > may have attenuated or have noise riding on it. To allow for this, the > > minimum required voltages at the receiver are less than at the driver. > > An input more positive than +3V is a logic 0. An input more negative > > than -3V is a logic 1. The logic level of an input -3V and +3V is > > undefined." > > "undefined" is where we start getting into the difference between > theory and practice. > > And also the difference between what the RS232 spec requires, and what > common parts actually tolerate. > > For example, without using the response control input, the MC1489 has a > VIL typically 0.8 V. Positive 0.8 volts that is. So does the MAX232. > > Should you depend on this in a product? No. With long cables? No. > > And it might not work at all, but there is a good chance that it will, > most of the time, in a pinch.
OK, I understand the point you are making, and it is a good one. But to clarify: whatever I come up with has to work with any device that has RS232. So I have to follow the spec. I have no control over what chip the device may be using.
On 10 Dec, in article
     <1165796049.263067.205980@73g2000cwn.googlegroups.com>
     EtherJones@yahoo.com "Jones" wrote:

>Steve at fivetrees wrote: >> "Jones" <EtherJones@yahoo.com> wrote in message >> news:1165708089.674098.234950@j72g2000cwa.googlegroups.com... >> Hans-Bernhard Br&#4294967295;ker wrote: >> > Jones wrote: >> > > I have an embedded target I am trying to program (MC9S08DZ60 >> > > microcontroller) that has the SCI pins connected to a TJA1020T LIN >> > > transceiver with single-wire output. >> > > >> > > My question is, can I connect this single-wire LIN directly to a pin >> > > (or pins) of the RS232 port on the back of an old DOS PC, and if so, >> > > how? >> > >> > LIN: single wire, bidirectional --> half-duplex >> > >> > RS232: two wires, one per direction --> double simplex, effectively >> > equivalent to full duplex >> > >> > Looks like a pretty solid "no" being the answer to that question to me. >> >> Thanks Hans. I did a little more digging into it and I think the >> answer is indeed "No", but it has more to do with electrical >> characteristics than half/full duplex. LIN signal levels are +12V >> and ground. RS232 are +5V and -5V wrt ground. That's why you can't >> just wire the LIN and the RS232 to each other. >> << >> >> Er, no. >> - RS-232 is +/-12V. > >I was looking at page 123 of Jan Axelson's book "Serial Port Complete" >where it states: > >"At an RS232 data output, a logic 0 is defined as equal to or more >positive than +5V, and a logic 1 is defined as equal to or more >negative than -5V. ... Because an RS232 receiver may be at the end of >a long cable, by the time the signal reaches the receiver, its voltage >may have attenuated or have noise riding on it. To allow for this, the >minimum required voltages at the receiver are less than at the driver. >An input more positive than +3V is a logic 0. An input more negative >than -3V is a logic 1. The logic level of an input -3V and +3V is >undefined."
Hmm. Word of history and caution if you are interfacing to old equipment RS232 has had various revisions which also affected the threshold levels and the conector pinouts for D type connectors was a PTT V24 standard. The connector pinouts I believe got incorporated in Revision D of the EIA RS232 spec. From *memory* RS232 was originally easy to do as +/-12V signals due to drops in drivers from +/-15V rails, however the receiver thresholds over the years has dropped Rev +/- Threshold A 9 B 5 C&D 3 Quite a lot of PCs have the ability to do +5V/0V level detection but this should NOT be relied on. It is sometimes possible to create a driver for SHORT cable runs that drives +5 to +12V and in some cases can use the input weak pulldowns to -12V to get other level. This is NOT a recommended way to do things. This is only useful for SLOW baud rates 0 to approx 2400 baud as then cable and other capacitance comes into play. Considering the easy availability of 232 single chip converters and LIN converters, I would choose the appropriate parts for the job to work under all circumstances (including short circuit and often ESD protection). -- Paul Carpenter | paul@pcserviceselectronics.co.uk <http://www.pcserviceselectronics.co.uk/> PC Services <http://www.gnuh8.org.uk/> GNU H8 & mailing list info <http://www.badweb.org.uk/> For those web sites you hate
Paul Carpenter wrote:
> On 10 Dec, in article > <1165796049.263067.205980@73g2000cwn.googlegroups.com> > EtherJones@yahoo.com "Jones" wrote: > > >Steve at fivetrees wrote: > >> "Jones" <EtherJones@yahoo.com> wrote in message > >> news:1165708089.674098.234950@j72g2000cwa.googlegroups.com... > >> Hans-Bernhard Br=F6ker wrote: > >> > Jones wrote: > >> > > I have an embedded target I am trying to program (MC9S08DZ60 > >> > > microcontroller) that has the SCI pins connected to a TJA1020T LIN > >> > > transceiver with single-wire output. > >> > > > >> > > My question is, can I connect this single-wire LIN directly to a p=
in
> >> > > (or pins) of the RS232 port on the back of an old DOS PC, and if s=
o,
> >> > > how? > >> > > >> > LIN: single wire, bidirectional --> half-duplex > >> > > >> > RS232: two wires, one per direction --> double simplex, effectively > >> > equivalent to full duplex > >> > > >> > Looks like a pretty solid "no" being the answer to that question to =
me.
> >> > >> Thanks Hans. I did a little more digging into it and I think the > >> answer is indeed "No", but it has more to do with electrical > >> characteristics than half/full duplex. LIN signal levels are +12V > >> and ground. RS232 are +5V and -5V wrt ground. That's why you can't > >> just wire the LIN and the RS232 to each other. > >> << > >> > >> Er, no. > >> - RS-232 is +/-12V. > > > >I was looking at page 123 of Jan Axelson's book "Serial Port Complete" > >where it states: > > > >"At an RS232 data output, a logic 0 is defined as equal to or more > >positive than +5V, and a logic 1 is defined as equal to or more > >negative than -5V. ... Because an RS232 receiver may be at the end of > >a long cable, by the time the signal reaches the receiver, its voltage > >may have attenuated or have noise riding on it. To allow for this, the > >minimum required voltages at the receiver are less than at the driver. > >An input more positive than +3V is a logic 0. An input more negative > >than -3V is a logic 1. The logic level of an input -3V and +3V is > >undefined." > > Hmm. Word of history and caution if you are interfacing to old equipment > RS232 has had various revisions which also affected the threshold levels > and the conector pinouts for D type connectors was a PTT V24 standard. > The connector pinouts I believe got incorporated in Revision D of the > EIA RS232 spec. > > From *memory* RS232 was originally easy to do as +/-12V signals > due to drops in drivers from +/-15V rails, however the receiver > thresholds over the years has dropped > > Rev +/- Threshold > A 9 > B 5 > C&D 3 > > Quite a lot of PCs have the ability to do +5V/0V level detection > but this should NOT be relied on. > > It is sometimes possible to create a driver for SHORT cable runs that > drives +5 to +12V and in some cases can use the input weak pulldowns > to -12V to get other level. This is NOT a recommended way to do > things. This is only useful for SLOW baud rates 0 to approx 2400 baud > as then cable and other capacitance comes into play. > > Considering the easy availability of 232 single chip converters > and LIN converters, I would choose the appropriate parts for the > job to work under all circumstances (including short circuit > and often ESD protection).
Thanks Paul. I found the following low-cost converter. It looks like it will do the job: http://masl.to/?H2801495E
Jones wrote:
> Hans-Bernhard Br&#4294967295;ker wrote: >> Jones wrote: >>> I have an embedded target I am trying to program (MC9S08DZ60 >>> microcontroller) that has the SCI pins connected to a TJA1020T LIN >>> transceiver with single-wire output. >>> >>> My question is, can I connect this single-wire LIN directly to a pin >>> (or pins) of the RS232 port on the back of an old DOS PC, and if so, >>> how? >> LIN: single wire, bidirectional --> half-duplex >> >> RS232: two wires, one per direction --> double simplex, effectively >> equivalent to full duplex >> >> Looks like a pretty solid "no" being the answer to that question to me. > > Thanks Hans. I did a little more digging into it and I think the > answer is indeed "No", but it has more to do with electrical > characteristics than half/full duplex. LIN signal levels are +12V > and ground. RS232 are +5V and -5V wrt ground. That's why you can't > just wire the LIN and the RS232 to each other. > > If the RS232 signal voltages were the same as LIN, I could just tie the > RS232 TX and RX together and tie that to the LIN bus, and connect the > grounds. Then write half-duplex software for both sides. After all, > that's what a LIN transceiver is essentially; a receiver and a > transmitter sitting on the same wire (I think?). > > I don't necessarily need the two devices to speak to each other in > LIN-ese. I just need to be able to electrically connect them so I can > write very simple software for both sides to get a little dialog going. > > I'm assuming if I look around enough I'll find a fairly inexpensive > LIN-to-RS232 in-line converter for not much money. If anybody has any > experience with this and could provide a link to a product they have > used successfully, it would be appreciated. >
That would be +12 and -12VDC
Neil wrote:
> Jones wrote: > > Hans-Bernhard Br=F6ker wrote: > >> Jones wrote: > >>> I have an embedded target I am trying to program (MC9S08DZ60 > >>> microcontroller) that has the SCI pins connected to a TJA1020T LIN > >>> transceiver with single-wire output. > >>> > >>> My question is, can I connect this single-wire LIN directly to a pin > >>> (or pins) of the RS232 port on the back of an old DOS PC, and if so, > >>> how? > >> LIN: single wire, bidirectional --> half-duplex > >> > >> RS232: two wires, one per direction --> double simplex, effectively > >> equivalent to full duplex > >> > >> Looks like a pretty solid "no" being the answer to that question to me. > > > > Thanks Hans. I did a little more digging into it and I think the > > answer is indeed "No", but it has more to do with electrical > > characteristics than half/full duplex. LIN signal levels are +12V > > and ground. RS232 are +5V and -5V wrt ground. That's why you can't > > just wire the LIN and the RS232 to each other. > > > > If the RS232 signal voltages were the same as LIN, I could just tie the > > RS232 TX and RX together and tie that to the LIN bus, and connect the > > grounds. Then write half-duplex software for both sides. After all, > > that's what a LIN transceiver is essentially; a receiver and a > > transmitter sitting on the same wire (I think?). > > > > I don't necessarily need the two devices to speak to each other in > > LIN-ese. I just need to be able to electrically connect them so I can > > write very simple software for both sides to get a little dialog going. > > > > I'm assuming if I look around enough I'll find a fairly inexpensive > > LIN-to-RS232 in-line converter for not much money. If anybody has any > > experience with this and could provide a link to a product they have > > used successfully, it would be appreciated. > > > That would be +12 and -12VDC
What does the pronoun "that" refer to in your short reply above?