Reply by Paul Keinanen July 28, 20092009-07-28
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
Reply by Vladimir Vassilevsky July 28, 20092009-07-28

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
Reply by Rocky July 28, 20092009-07-28
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.
Reply by Meindert Sprang July 28, 20092009-07-28
"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
Reply by Not Really Me July 27, 20092009-07-27
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
Reply by bob July 26, 20092009-07-26
On Fri, 24 Jul 2009 14:41:15 -0500, Vladimir Vassilevsky
<nospam@nowhere.com> wrote:

> > >bob wrote: >> On Thu, 23 Jul 2009 22:49:22 +0300, Paul Keinanen <keinanen@sci.fi> >> wrote: > >> So, I modified the receiver for abs(3V) hysteresis. So, the received >> signal must go higher than 1.5 V and less than -1.5V to change the >> received state, if sitting at 0.0 V ground. This should help noise >> rejection somewhat as well as be able to have some ground differntial >> Voltage between units of at least a few volts. >> >> So far this method is working great, and should pretty much keep the >> RS232 compatibility. Comments are very welcome on this. >> >> I am also using modbus so have a CRC check at the end of the packets >> and the data rate will not be required to be above, say, 56K baud. >> Normally, 19.2 K Baud. > >The hysteresis won't buy you anything but the problems with the receiver >occasionally stuck in the "break" state when the cable is disconnected.
OK, why would the increased hysteresis NOT buy me anything, as far as noise riding on the signal ? Say, a 1V P-P noise level ? Also, say there was a 1 V dc ground difference between the transmitter and receiver. boB
> >What could be useful is the simplest RC lowpass filter upfront the >receiver. Set the RC cutoff frequency at about 1/2 of the bit rate. > > > >Vladimir Vassilevsky >DSP and Mixed Signal Design Consultant >http://www.abvolt.com
Reply by Paul Keinanen July 25, 20092009-07-25
On 24 Jul 2009 14:28:01 -0500, bob <bob@bob.bob> wrote:

> Looks like alll RS-232 transmitters transmit + and - >voltage levels, but hardly any of them xmit higher than +- 6 Volts >these days.
The RS-232 standard was designed in the 1960&#4294967295;s to connect electrotechnical Teletypes (and early VDUs) to a modem and transfer it over existing telephone network to a central computer along with local devices. The modem was usually in the adjacent rack from the computer or Teletype, so the 15 m maximum distance was more than adequate and 20 kbit/s was more than even any baseband modem could carry over telephone wires. Typical current loop constant current sources had an open circuit voltage of 24-60 V and telephone circuit voltages are in the order of 40-60 V range. No wonder that the allowed voltages were so high. The minimum voltage levels are so high, that you could even drive directly some reed relays :-). The power dissipation was not an issue with the low speed, short low capacitance cable connections and since discrete semiconductors and resistors were used, it was easy to dissipate any power losses. The situation is quite different today, quite long cables are often used with a high cable capacitance. At each output transition, the cable capacitance must be charged or discharged through the transmitter to the corresponding supply voltage, in which some energy is dissipated to heat in the transmitter. With the current much higher line speeds used, these transitions occur much more frequently charging and discharging the line capacitance more frequently and hence dissipating a much larger average power in the transmitter. With integrated circuits and even with multiple transmitters on a same chip, the power dissipation would simply kill the chip if driving high capacitive loads at high speed using a high supply voltage. Looking at the situation at the receiver, the important thing is that the transition between -3 V to +3 V at the receiver is fast enough, compared to the line speed used. The transmitter is required to provide sufficient current in this voltage range to charge or discharge the distributed line capacitance. The problem with the cable distributed capacitance and distributed resistance is that the initial transmitter output voltage swing must be larger than +/-3V in order to achieve the +/-3 V voltage swing at the receiver in a realistic (non-infinite) time. Once the voltage at the receiver is outside +/-3 V, there is not much point in feeding large amounts of current into the line capacitance, so it is sufficient to feed the very small current consumed by the high input impedance receiver in the steady state. Clearly, the transmitter supply voltage must be larger than +/-3 V even assuming zero voltage loss switching to charge the cable distributed capacitance through the cable distributed resistance to achieve the +/-3 V swing at the receiver in reasonable time (say t=RC time constant). The +/-6V transmitter voltage swing is a good compromise, allowing at least 20 kbit/s into a low capacitance (<15 m) cable (as required by the RS-232C standard) with a reasonable power dissipation. Paul
Reply by Paul Keinanen July 24, 20092009-07-24
On Fri, 24 Jul 2009 22:31:55 +0200, Heinz-J&#4294967295;rgen Oertel
<hj.oertel@t-online.de> wrote:

>Paul Keinanen wrote: > >> For master applications (such as in CanOpen master) or when high >> (interrupt) latency hardware/OS systems are used, the SJA1000 in >> PeliCan mode with 64 message Rx FIFO is very handy. >> > >64 CAN message FIFO is on my wish list for the next generation stand alone >CAN controller.
Yes, you are right, the RxFIFO on the SJA1000 is only 64 bytes, so it could hold only 5-16 standard format messages. Anyway, this allows up to 0.5 ms interrupt latencies at 1 Mbit/s or 2 ms at 250 kbit/s. Paul
Reply by Paul Keinanen July 24, 20092009-07-24
On Fri, 24 Jul 2009 14:41:15 -0500, Vladimir Vassilevsky
<nospam@nowhere.com> wrote:

> > >bob wrote: >> On Thu, 23 Jul 2009 22:49:22 +0300, Paul Keinanen <keinanen@sci.fi> >> wrote: > >> So, I modified the receiver for abs(3V) hysteresis. So, the received >> signal must go higher than 1.5 V and less than -1.5V to change the >> received state, if sitting at 0.0 V ground. This should help noise >> rejection somewhat as well as be able to have some ground differntial >> Voltage between units of at least a few volts. >> >> So far this method is working great, and should pretty much keep the >> RS232 compatibility. Comments are very welcome on this. >> >> I am also using modbus so have a CRC check at the end of the packets >> and the data rate will not be required to be above, say, 56K baud. >> Normally, 19.2 K Baud. > >The hysteresis won't buy you anything but the problems with the receiver >occasionally stuck in the "break" state when the cable is disconnected.
This can occur only if you disconnect the cable during active data transfer during the space (0) bit. Disconnecting the cable while the transmitter is in the idle (Mark) space does not cause this problem. One way around is to use a pulldown resistor at the input to the negative receiver supply voltage, which takes care of the cable disconnect problem. However, moving the hysteresis levels to say +0.5 V and +3.0V will also solve any problems associated with powered down transmitters.
>What could be useful is the simplest RC lowpass filter upfront the >receiver. Set the RC cutoff frequency at about 1/2 of the bit rate.
This may be usable in synchronous communication, in which each PLLs are used to synchronize the receiver clock at the start of connection or at least long preamble are used in front of a message frame. However, asynchronous communication is quite picky about detecting the leading edge of the start bit, so the signal should have a decent slave rate across the transition area. Thus, I would move the cutoff frequency at least 1-2 octaves higher. Paul
Reply by July 24, 20092009-07-24
Paul Keinanen wrote:

> For master applications (such as in CanOpen master) or when high > (interrupt) latency hardware/OS systems are used, the SJA1000 in > PeliCan mode with 64 message Rx FIFO is very handy. >
64 CAN message FIFO is on my wish list for the next generation stand alone CAN controller. Heinz