Reply by Ether Jones December 12, 20062006-12-12
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?
Reply by Neil December 12, 20062006-12-12
Jones wrote:
> Hans-Bernhard Br�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
Reply by Ether Jones December 11, 20062006-12-11
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
Reply by December 11, 20062006-12-11
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
Reply by Jones December 10, 20062006-12-10
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.
Reply by December 10, 20062006-12-10
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)
Reply by Jones December 10, 20062006-12-10
Paul Keinanen wrote:
> On 9 Dec 2006 22:44:06 -0800, cs_posting@hotmail.com wrote: > > >The more challenging part is figuring out how to tri-state the PC's > >RS232 transmit line so that it can listen. You could probably do it > >with some active device (analog FET switch?) controlled by one of the > >status lines. This shouldn't be hard to squeeze into the connector > >shell, but wouldn't be all passives. > > The common (but non-standard) way to allow multiple RS-232 > transmitters on the same line is to connect a diode between the Tx pin > and the common bus (with anode at the Tx pin). The line is actively > driven only to the "0" (space) space, while the internal receiver > resistors pulls the line to Mark ("1") state. With long lines, it > might be a good idea to run a resistor from the common point to -12 V > (e.g. DTR driven inactive) to maintain a stable Mark state.
Thanks Paul. Do you a link to a web site that discusses this approach in a bit more detail, and maybe elaborates on some potential pitfalls to watch out for?
> However, I have no idea, what the LIN character structure is, is it > even asynchronous (start/stop bit) and are the speeds compatible with > what you might find on PCs.
LIN baud rates are between 2 and 20 Kbaud. It is asynchronous. I have since found there are LIN/RS232 converters out there, that you can place between the LIN bus and your PC's RS232 connector. The simpler ones do not do any baud rate translation or any other translation. All they do is take care of the logic level voltage mismatch, and allow you to connect both the TX and RX RS232 signals.
Reply by Jones December 10, 20062006-12-10
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 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."
> - RS-485 and RS-422 are 5V/0V.
RS485 and RS422 are differential signals, and their voltage wrt ground doesn't matter at all so long as it is less than 7 volts. At an RS485 receiver, the voltage differential between the A and B inputs needs to be just 0.2V. If A is a least 0.2V more positive than B, it is a valid logic 0. If B is at least 0,2V more positive than A, it is a valid logic 1.
> Whatever: level translation is easy.
A LIN bus is held at +12V wrt ground by a pullup resistor. The transmitter pulls it to ground to create the opposite logic level. An RS232 input expects to see at least +3V wrt ground for one valid logic level, and -3V wrt ground for the opposite logic level. I'm sure this can be done with the proper electronics, but my original question was whether or not I could just connect the wires. I think the answer is "No".
Reply by Jones December 10, 20062006-12-10
cs_posting@hotmail.com wrote:
> Jones wrote: > > > 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. > > I think you are mis-stating the RS232 spec. Specifically, what you > need to look at are the outputs of each spec relative to the spec for > the detected and allowable inputs for the other.
The RS232 input is expecting to see the voltage go above (+5) and below (-5) ground. The LIN signals are +12V and 0V wrt ground. RS232 will not recognize 0V as a valid "0" or "1". I can't just connect the LIN bus directly to the RS232 input.
> My guess is that > there's a fair chance that part may work, at least in practice if not > in theory.
I don't think so. RS232 will not recognize 0V as a valid logic level.
Reply by Steve at fivetrees December 10, 20062006-12-10
"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. - RS-485 and RS-422 are 5V/0V. - RS-423 is +/-5V. Whatever: level translation is easy. Steve http://www.fivetrees.com