RS485 - MODBUS or PROFIBUS or ....

Required +/- 3V receiver voltage? Its TTL transmit and TTL receive, so required receive voltage is Vcc to Gnd.

Alot of microprocessors will run +3.3v or 5V (Microchip, Atmel ...) Go with 5V to reduce noise issues over the 4 foot cable.

Reply to
Rumpelstiltskin
Loading thread data ...

Generally I hear this statement from annal retentive types who like to brow beat others from a remote location over inconsequential references.

Then the argument comes up as to whether the term UART or USART is correct.

Reply to
Rumpelstiltskin

Oh, come on. Differential signaling certainly has it place, however there is no need to overcomplicate the problem. Just to remind you about GPIB, Centronix, IDE/SCSI, SMB.

Vladimir Vassilevsky DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

In a previous post you wrote

You seem to imply that the output from 74HCT07 is some kind of "RS232".

Anyway, I do not understand what sense it would make to swap 7407 (hex open collector non-inverting buffer) with the 7409 (a quad open collector AND gate).

At least use the 7406, which is an open collector inverter. Even if you run the output pull-up resistor to a higher positive voltage, it still does not make the output RS-232 level compliant.

Paul

Reply to
Paul Keinanen

Most likely it is going to be RS-232,

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.

Your original thought to use RS-485 with MODBUS or PROFIBUS is good. Although like some others I would say CAN is also a reasonable choice.

--
Scott
Validated Software
 Click to see the full signature
Reply to
Not Really Me

Until someone later wants to monitor what is happening and connects a TRUE RS232 device and blows your circuits.

Perhaps you like to also refer to resisitance as inverse amps as the difference is 'inconsequential".

They are two DIFFERENT devices one is Asynchronous only the other is synchronous OR asynchronous, depending on hardware and software configuration.

You have obviously never seen/used a synchronous link (which may use various signalling levels or methods on the interlink).

You give a poor impression of your abilities. The sort I normally end up sorting out the mess later from to get things working reliably.

--
Paul Carpenter          | paul@pcserviceselectronics.co.uk
    PC Services
 Click to see the full signature
Reply to
Paul Carpenter

Paul,

I agree that the TTL level signaling is not correct RS-232. However it works just fine with the true RS-232 transceivers. It is handy to use a pair of logic gates to interface an MCU to a COM port for debug or setup purpose.

All RS-232 transceivers that I know of have the input threshold at about

+1.4V, so they accept the TTL level. On the TTL side, you need to clamp the input, so it will take +/- 12V.

However, some of the RS-232 transceivers interpret the line input voltage in the range of +/- 1.5V as "cable disconnected". So they fall into sleep mode and this causes problems with communication. I encountered this problem couple of times with the 3rd party embedded devices; never seen that with PC.

Vladimir Vassilevsky DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

Some employ a -ve threshold and get screwed by some PCs that only 0-some positive voltage often laptops.

Fine but the OP did not mention what his TTL receiver was capable of withstanding, so my point still stands.

Recognising break condition is not unheard of. However MS serial drivers have always had problems, when used in anger, or large data sets of large volumes of data. Analysis of quite a few PPP problems over the years has been down to software drivers for serial ports.

--
Paul Carpenter          | paul@pcserviceselectronics.co.uk
    PC Services
 Click to see the full signature
Reply to
Paul Carpenter

Sounds like the receiver is using a large hysteresis, with the negative going transition well below 0 V.

The practical reason for a threshold well above 0 V is the problems with powered down transmitters. An only or positive going transition threshold at or below 0 V would cause a constant Break (Space) state whenever the external transmitter is powered down. To avoid this, the threshold is usually set above 0 V, giving a Idle (Mark) state, when the transmitter is powered down or disconnected.

Paul

Reply to
Paul Keinanen

Hi, if he does implement CAN bus, what chips do you recommend he use?.

Reply to
Core2Duo

For small systems built around a microcontroller, select one that in addition to the CAN controller also contains the other peripherals required by the final product.

For stand-alone controllers, the Intel SJA1000 and Intel 82527 are the most common. The Intel controller is nice for small systems in which the CAN identifiers can be selected so that the ID filters on the chip can be effectively used.

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.

All these chips have TTL I/O so an external transceiver chip is required for connecting to the actual CAN bus. For normal ISO 11898 CAN bus, the 82C250 is often used (up to 1 Mbit/s). For other bus standards (such as single wire), different transceiver must be used. Before actual CAN transceiver chips were implemented, ordinary RS-485 chips were used, in which the data controlled the Transmit enable pin to drive the bus into dominant state.

Paul

Reply to
Paul Keinanen

unlikely

with

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

Reply to
Meindert Sprang

What ever is cheapest and easiest to implement and will be robust enough for what you want. Quite simple really.

Reply to
The Real Andy

Hmmm... That's an interesting point.

What I have done in my product is to sort of "beef up" the RS232 receive end. Looks like alll RS-232 transmitters transmit + and - voltage levels, but hardly any of them xmit higher than +- 6 Volts these days. And I also noticed the bit about (esentially) TTL voltage levels and 0.5 V hysteresis. BTW, I use the ST232A parts because they pump up to around +- 10 V rather than 6 volts or so.

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.

I did not like to waste another 2 wires with RS485 as well as having to terminate. I have also seen problems with so called RS485 systems at my last job. It wasn't all that reliable, but also, they messed with the implementation by using pullups and pulldowns (to guarantee

+5V at the micro when comm was disconnected) and buildout resistors and R-C terminations, which definitely helped to screw up the workings. OK, I guess at that point is really wasn't RS485.

boB

Reply to
bob

The hysteresis won't buy you anything but the problems with the receiver occasionally stuck in the "break" state when the cable is disconnected.

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

formatting link

Reply to
Vladimir Vassilevsky

64 CAN message FIFO is on my wish list for the next generation stand alone CAN controller.

Heinz

Reply to
Heinz-Jürgen Oertel

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.

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 to
Paul Keinanen

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 to
Paul Keinanen

The RS-232 standard was designed in the 1960´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 (

Reply to
Paul Keinanen

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

Reply to
bob

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.