EmbeddedRelated.com
Forums

RS485 - MODBUS or PROFIBUS or ....

Started by eeboarder July 21, 2009
Meindert Sprang wrote:
> "Not Really Me" <scott@validatedQWERTYsoftware.XYZZY.com> wrote in > message news:7cral9F28uaiiU1@mid.individual.net... >> Don't try this with SPI, the distance is too great. I think it is >> unlikely to work over I2C for the same reason, but I have less >> direct experience with that. > > As Vladimir already pointed out: IDE, GPIB and Centronics were also > single-ended at TTL level and all worked fine over at least 2 ft of > flatcable. The SPI cable from my programmer is also 1 ft and I have > never experienced any problems. Looking at the signals with my > oscilloscope does not show any ringing, overshoot or reflection that > matters. > > Meindert
Well, he said 4 ft, so that would be more trouble than 1ft. I did have either a 12 or 20 ft Centronics cable, but that is a slow interface. What speed SPI? We used ADCs ADuC8xx series and had horrible results at 1 ft until we used twisted pairs. It's been a few years but I think it was set for 10Mbps but was still flaky at 250Kb, the lowest speed it had. Only choices were 1M, 10M and 250K. I would still not recommend SPI or I2C for this. It is always better to used something intended for the use that you have and neither of these does. Scott
"Not Really Me" <scott@validatedQWERTYsoftware.XYZZY.com> wrote in message
news:7d5t0gF2amsl4U1@mid.individual.net...
> Well, he said 4 ft, so that would be more trouble than 1ft. I did have > either a 12 or 20 ft Centronics cable, but that is a slow interface. > > What speed SPI?
1.8 MHz.
> We used ADCs ADuC8xx series and had horrible results at 1 > ft until we used twisted pairs. It's been a few years but I think it was > set for 10Mbps but was still flaky at 250Kb, the lowest speed it had.
I think something else must have been wrong. I just ran a 5MHz square wave through 3ft of speaker cable, driven from a 50 Ohm generator. The signal comes out good. Overshoot is 17% and no degradation of risetime (better than 5ns). when terminated with 100 Ohm, the overshoot disappears. The same signal driven from a TTL gate shows 25% overshoot. So with a bit of a decent driver and termination, the OP can get good results with simple single ended terminated wire and a 50 Ohm driver. RS-485 or CAN would be overkill.
> I would still not recommend SPI or I2C for this. It is always better to > used something intended for the use that you have and neither of these
does. And when is something intended for the use? IMO anything that gives a good reliable result. Meindert
On Jul 27, 4:51=A0pm, "Not Really Me"
<sc...@validatedQWERTYsoftware.XYZZY.com> wrote:
> Meindert Sprang wrote: > > "Not Really Me" <sc...@validatedQWERTYsoftware.XYZZY.com> wrote in > > messagenews:7cral9F28uaiiU1@mid.individual.net... > >> Don't try this with SPI, the distance is too great. =A0I think it is > >> unlikely to work over I2C for the same reason, but I have less > >> direct experience with that. > > > As Vladimir already pointed out: IDE, GPIB and Centronics were also > > single-ended at TTL level and all worked fine over at least 2 ft of > > flatcable. The SPI cable from my programmer is also 1 ft and I have > > never experienced any problems. Looking at the signals with my > > oscilloscope does not show any ringing, overshoot or reflection that > > matters. > > > Meindert > > Well, he said 4 ft, so that would be more trouble than 1ft. =A0I did have > either a 12 or 20 ft Centronics cable, but that is a slow interface. > > What speed SPI? =A0We used ADCs ADuC8xx series and had horrible results a=
t 1
> ft until we used twisted pairs. =A0It's been a few years but I think it w=
as
> set for 10Mbps but was still flaky at 250Kb, the lowest speed it had. =A0=
Only
> choices were 1M, 10M and 250K. > > I would still not recommend SPI or I2C for this. =A0It is always better t=
o
> used something intended for the use that you have and neither of these do=
es. The problem is the rate of rise and fall, not the actual clock frequency. If the rise time on the 250kb clock (or data line) is 5nanosec then one is actually looking at 100Mhz timing.

Meindert Sprang wrote:

> "Not Really Me" <scott@validatedQWERTYsoftware.XYZZY.com> wrote in message > news:7d5t0gF2amsl4U1@mid.individual.net... > >>Well, he said 4 ft, so that would be more trouble than 1ft. I did have >>either a 12 or 20 ft Centronics cable, but that is a slow interface. >> >>What speed SPI? > > > 1.8 MHz. > > >>We used ADCs ADuC8xx series and had horrible results at 1 >>ft until we used twisted pairs. It's been a few years but I think it was >>set for 10Mbps but was still flaky at 250Kb, the lowest speed it had. > > > I think something else must have been wrong. I just ran a 5MHz square wave > through 3ft of speaker cable, driven from a 50 Ohm generator. The signal > comes out good. Overshoot is 17% and no degradation of risetime (better than > 5ns). when terminated with 100 Ohm, the overshoot disappears. The same > signal driven from a TTL gate shows 25% overshoot. > > So with a bit of a decent driver and termination, the OP can get good > results with simple single ended terminated wire and a 50 Ohm driver. RS-485 > or CAN would be overkill.
You are correct. I have the Altera Byteblaster on the 10 ft cable. Doing the SPI both directions by bit banging at ~1.5 MHz. No problem.
> >>I would still not recommend SPI or I2C for this. It is always better to >>used something intended for the use that you have and neither of these > does. > > And when is something intended for the use? IMO anything that gives a good > reliable result.
It depends. Once I was surprised to see the remote sensor with the Dallas 1-wire interface operating OK over ~15m of the twisted pair; however I've also seen the I2C not working on the same PCB with the SMPS because of the problematic layout. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
On Mon, 27 Jul 2009 08:51:56 -0600, "Not Really Me"
<scott@validatedQWERTYsoftware.XYZZY.com> wrote:

>Meindert Sprang wrote: >> "Not Really Me" <scott@validatedQWERTYsoftware.XYZZY.com> wrote in >> message news:7cral9F28uaiiU1@mid.individual.net... >>> Don't try this with SPI, the distance is too great. I think it is >>> unlikely to work over I2C for the same reason, but I have less >>> direct experience with that. >> >> As Vladimir already pointed out: IDE, GPIB and Centronics were also >> single-ended at TTL level and all worked fine over at least 2 ft of >> flatcable. The SPI cable from my programmer is also 1 ft and I have >> never experienced any problems. Looking at the signals with my >> oscilloscope does not show any ringing, overshoot or reflection that >> matters.
Typically in flat cable busses every other connector carries some signal and every other conductor is connected to a signal ground. With a signal ground on both sides of the signal conductor, there is a well defined characteristic impedance on the line (unless there are metallic surfaces close to the cable), so it is possible to build a matched system with no over/undershots. However, any external magnetic or electric field can induce noise to the connection, since the signal and ground wires are not twisted around each other that would cancel some of the induced noise. The construction also requires that no other DC or mains frequency currents are flowing in the signal ground conductors. In some cases this has required strapping together the frames of the CPU and the disk cabinet with 5-10 cm wide copper braids :-) in order to avoid problem caused by potential differences in the mains neutral wiring.
>What speed SPI? We used ADCs ADuC8xx series and had horrible results at 1 >ft until we used twisted pairs. It's been a few years but I think it was >set for 10Mbps but was still flaky at 250Kb, the lowest speed it had. Only >choices were 1M, 10M and 250K.
While the input and output pins are labeled as "TTL compatible" on most modern digital chips, have you actually looked at the input and output pin characteristics for input and output impedance and how well it matches the characteristic impedance of the flat cable (typically slightly below 100 ohms) ? Paul