linux and rs-485

linux and rs-485

Post by dev » Sat, 02 Aug 2003 11:21:26



hello,

i need to write an application for an arm-linux sbc to interface with
a device over rs-485. it is just point-to-point communication and doesn't
use any of the multipoint communications ability of rs-485.

could anyone pls. tell me where i can find information about linux and
rs-485?

thanks in adavnce,
 Deva Seetharam

 
 
 

linux and rs-485

Post by Ian » Sat, 02 Aug 2003 13:45:10



Quote:>hello,

>i need to write an application for an arm-linux sbc to interface with
>a device over rs-485. it is just point-to-point communication and doesn't
>use any of the multipoint communications ability of rs-485.

>could anyone pls. tell me where i can find information about linux and
>rs-485?

Are we talking two wire (half-duplex) RS-485?  Or have you really got
a 4-wire RS-422 connection?

The difference is that RS-485 typically uses the RTS line to enable
and disable the '485 driver before transmission. '422, which is point
to point, doesn't need this as there is no chance of bus contention.
(Though the '485/'422 driver may require RTS active anyway even if you
are running four-wire).

The only difference between all my standard serial drivers and '485
drivers is that the '485 drivers need timing to ... enable the driver,
pause, send the data, poll or wait for the interrupt to see when the
last byte is loaded into the transmit shift register, wait for a
little more than a character period and then send RTS inactive.

Unfortunately, I have never done this under Linux only other OS's.

(It is a pain but very few UARTs provide an interrupt when the last
chaarcter has been fully sent, most just provide the standard transmit
buffer empty interrupt (and status).  So you have to then have to wait
a little to be sure that the last character has been fully shifted out
before disabling the driver.)

Ian

 
 
 

linux and rs-485

Post by Michael Schnel » Sat, 02 Aug 2003 15:46:57


Quote:> could anyone pls. tell me where i can find information about linux and
> rs-485?

AFAIK, RS-485 is a hardware specification to be used on top of (e.g.)
V-24 (aka asynchronous serial interface). RS-485 can also be used for
synchronous protocols (e.g. HDLC). So I don't understand your question.
Could you rephrase more specific ?
 
 
 

linux and rs-485

Post by Russell Sha » Sat, 02 Aug 2003 12:50:16



> hello,

> i need to write an application for an arm-linux sbc to interface with
> a device over rs-485. it is just point-to-point communication and doesn't
> use any of the multipoint communications ability of rs-485.

> could anyone pls. tell me where i can find information about linux and
> rs-485?


 
 
 

linux and rs-485

Post by Allan Butle » Sun, 03 Aug 2003 02:46:26



> hello,

> i need to write an application for an arm-linux sbc to interface with
> a device over rs-485. it is just point-to-point communication and doesn't
> use any of the multipoint communications ability of rs-485.

        Use the standard serial protocols that are used on rs-232 ports and
you will do just fine.  The RS-485 standard specifies the hardware that is
used and not the communications protocol.  RS-232 is more susceptible to
noise than RS-485 and RS-485 can be used over greater distances than RS-232.
Quote:

> could anyone pls. tell me where i can find information about linux and
> rs-485?

> thanks in adavnce,
>  Deva Seetharam

 
 
 

linux and rs-485

Post by Alex Pavlof » Sun, 03 Aug 2003 06:51:19



Quote:>hello,

>i need to write an application for an arm-linux sbc to interface with
>a device over rs-485. it is just point-to-point communication and doesn't
>use any of the multipoint communications ability of rs-485.

>could anyone pls. tell me where i can find information about linux and
>rs-485?

Get an RS-232 to RS-485 convertor from say, B&B Electronics at
http://www.bb-elec.com/.  Then write code that opens the serial ports
and does serial things like would using RS-232.
--
Alex Pavloff - remove BLAH to email
Software Engineer, Eason Technology
 
 
 

linux and rs-485

Post by Michael W. Cock » Sun, 03 Aug 2003 20:39:23


On Fri, 01 Aug 2003 21:51:19 GMT, Alex Pavloff



>>hello,

>>i need to write an application for an arm-linux sbc to interface with
>>a device over rs-485. it is just point-to-point communication and doesn't
>>use any of the multipoint communications ability of rs-485.

>>could anyone pls. tell me where i can find information about linux and
>>rs-485?

>Get an RS-232 to RS-485 convertor from say, B&B Electronics at
>http://www.bb-elec.com/.  Then write code that opens the serial ports
>and does serial things like would using RS-232.

But don't try to drive it too fast - those converters take around 1/2
- 3/4 second to switch direction (485 is bidirectional, 232 is uni in
most process control applications.  If you go over around 9600 you'll
run into collisions.  I speak from painful experience.

Mike-

If you're not confused, you're not trying hard enough.
----------------------------------------------------

Please note - Due to the intense volume of spam, we have
installed site-wide spam filters at catherders.com.  If
email from you bounces, try non-HTML, non-encoded,
non-attachments.

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

 
 
 

linux and rs-485

Post by Bernhard Roessman » Mon, 04 Aug 2003 18:23:08


Quote:> But don't try to drive it too fast - those converters take around 1/2
> - 3/4 second to switch direction (485 is bidirectional, 232 is uni in
> most process control applications.  If you go over around 9600 you'll
> run into collisions.  I speak from painful experience.

Using the blue converters from ICP I had no such experiences. We get
nearly 1500m with 115200 baud (specification says only 1200m!) an no
send/receive switching problems.

Regards,

--
Bernhard Roessmann
Don't Fear The Penguins!

 
 
 

linux and rs-485

Post by Michael W. Cock » Mon, 04 Aug 2003 18:50:17


On Sun, 03 Aug 2003 11:23:08 +0200, Bernhard Roessmann


>> But don't try to drive it too fast - those converters take around 1/2
>> - 3/4 second to switch direction (485 is bidirectional, 232 is uni in
>> most process control applications.  If you go over around 9600 you'll
>> run into collisions.  I speak from painful experience.

>Using the blue converters from ICP I had no such experiences. We get
>nearly 1500m with 115200 baud (specification says only 1200m!) an no
>send/receive switching problems.

>Regards,

Not bad!  With the units from Omega Engineering, I had switching
problems at anything over 9600.  Trying to control a million kilowatt
induction heater, switch lag was NOT what I needed.

Mike-

If you're not confused, you're not trying hard enough.
----------------------------------------------------

Please note - Due to the intense volume of spam, we have
installed site-wide spam filters at catherders.com.  If
email from you bounces, try non-HTML, non-encoded,
non-attachments.

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

 
 
 

linux and rs-485

Post by Bernhard Roessman » Tue, 05 Aug 2003 03:20:59


Quote:> Not bad!  With the units from Omega Engineering, I had switching
> problems at anything over 9600.  Trying to control a million kilowatt
> induction heater, switch lag was NOT what I needed.

*LOL* I understand ;-)

But you are right, MOST of these 232-485 converters are VERY bad. Nearly
all we have tested don't comply to their own specification, one of this
damn things inserts so much noise during the send/receive switching that
our embedded device reads sometimes an additionally 0x00 Byte which was
NEVER sent! Another one don't work if we use a virtually necessary 100
Ohms termination resistor (too weak drivers I think).

Regards,

--
Bernhard Roessmann
Don't Fear The Penguins!

 
 
 

linux and rs-485

Post by Ian » Tue, 05 Aug 2003 10:15:06


On Sun, 03 Aug 2003 05:50:17 -0400, Michael W.*e


>>Regards,

>Not bad!  With the units from Omega Engineering, I had switching
>problems at anything over 9600.  Trying to control a million kilowatt
>induction heater, switch lag was NOT what I needed.

A billion watt heater - impressive - how many power stations did it
take to run it?

On the TX/RX switchover lag - this sounds like poor design to me.  Was
it an opto-isolated 232-485 converter?  If so then I can see where the
delay may be introduced but there is no reason why, using good design,
this should be the case (having designed a number of RS485 systems
that use the RTS line to switch between TX and RX in milli-second
time-based protocols).

You certainly can buy 232-485 converter pods that do not suffer
anything like this lag.

Ian

 
 
 

linux and rs-485

Post by Alex Pavlof » Wed, 06 Aug 2003 01:30:21


On Sat, 02 Aug 2003 07:39:23 -0400, Michael W.*e


>But don't try to drive it too fast - those converters take around 1/2
>- 3/4 second to switch direction (485 is bidirectional, 232 is uni in
>most process control applications.  If you go over around 9600 you'll
>run into collisions.  I speak from painful experience.

I haven't seen this with any of the B&B convertors.  Now, there are
about a billion different models of the convertors, of which I have
only used 10 different types or so, so perhaps I haven't encountered
the one that gave you such a painful experience.  
--
Alex Pavloff - remove BLAH to email
Software Engineer, Eason Technology
 
 
 

linux and rs-485

Post by Alex Pavlof » Wed, 06 Aug 2003 01:31:17


On Sun, 03 Aug 2003 20:20:59 +0200, Bernhard Roessmann


>> Not bad!  With the units from Omega Engineering, I had switching
>> problems at anything over 9600.  Trying to control a million kilowatt
>> induction heater, switch lag was NOT what I needed.

>*LOL* I understand ;-)

>But you are right, MOST of these 232-485 converters are VERY bad. Nearly
>all we have tested don't comply to their own specification, one of this
>damn things inserts so much noise during the send/receive switching that
>our embedded device reads sometimes an additionally 0x00 Byte which was
>NEVER sent! Another one don't work if we use a virtually necessary 100
>Ohms termination resistor (too weak drivers I think).

Names!  Brands!  Models numbers!  If a company makes such bad
convertors, their name should be trumpeted out to the masses so that
those of us that like to actually get things done can read, and be
wary.
--
Alex Pavloff - remove BLAH to email
Software Engineer, Eason Technology
 
 
 

linux and rs-485

Post by Holger Peterse » Wed, 06 Aug 2003 03:22:07



>On Sun, 03 Aug 2003 20:20:59 +0200, Bernhard Roessmann

>>> Not bad!  With the units from Omega Engineering, I had switching

                                                           ^^^^^^^^^
Quote:>>> problems

    ^^^^^^^^

Quote:>>damn things inserts so much noise during the send/receive switching that

                                               ^^^^^^^^^^^^^^^^^^^^^^

A _simple_ RS-232 <-> RS4xx Converter should not do any switching.
But, you have to user 4 wires (2 pairs) instead of 3 (RX, TX and GND).

IF someone expects *switching*, this behaviour has to be programmed
in some way; either by RTS *and* obying CTS or by timing-loops or in
any other fashion; but that ist a simple task - ONLY under DOS...
In some other messages some months ago, it was stated, that there is
*no* way (under Linux) to get the 16x50-Status-Bit "transmitter empty"
to get the right moment for direction-switching.

Some people call this a 'protocol issue'.

greetings, Holger

PS: What about using some DOS-programm (DIAGS.exe) to get the non-linux
    specific things working?

 
 
 

linux and rs-485

Post by Bernhard Roessman » Wed, 06 Aug 2003 03:51:56


Quote:> In some other messages some months ago, it was stated, that there is
> *no* way (under Linux) to get the 16x50-Status-Bit "transmitter empty"
> to get the right moment for direction-switching.

What about tcdrain()? The man page says:

int tcdrain(int fd)

tcdrain() waits until all output written to the object referred to by fd
has been transmitted.

--
Bernhard Roessmann
Don't Fear The Penguins!

 
 
 

1. Need RS-485 interface for RS/6000

Need for RS-6000 AIX, micro-channel or RS-232 interface
for RS-485. Anyone know where such a product or some
information can be obtained ?

Thanks...Bob Green

--
Bob Green                               uunet!mrmarx!bg
Mainstream Software Corporation         (617) 894-3399
411 Waverly Oaks Road                   FAX (617) 894-2353
Waltham, Mass    02154  

2. Music CD writing

3. RS-485 protocol

4. Problem with Wireless drivers

5. RS-485

6. Two monitors

7. Rs-485

8. Turtle Beach CD-R

9. RS-485

10. RS-485 driver

11. RS-485 Protocol layer

12. About RS-485

13. 485/Linux