Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch.embedded > #27441 > unrolled thread

What is the best communication mechanism with collision detection/avoidance for my topology?

Started byobulesu.t@gmail.com
First post2017-12-02 23:05 -0800
Last post2017-12-07 05:09 -0800
Articles 8 — 8 participants

Back to article view | Back to comp.arch.embedded


Contents

  What is the best communication mechanism with collision detection/avoidance for my topology? obulesu.t@gmail.com - 2017-12-02 23:05 -0800
    Re: What is the best communication mechanism with collision detection/avoidance for my topology? T Obulesu <obulesu.t@gmail.com> - 2017-12-02 23:06 -0800
      Re: What is the best communication mechanism with collision detection/avoidance for my topology? Robert Wessel <robertwessel2@yahoo.com> - 2017-12-03 09:03 -0600
      Re: What is the best communication mechanism with collision detection/avoidance for my topology? pozz <pozzugno@gmail.com> - 2017-12-04 11:57 +0100
      Re: What is the best communication mechanism with collision detection/avoidance for my topology? Jack <jack4747@gmail.com> - 2017-12-04 03:11 -0800
      Re: What is the best communication mechanism with collision detection/avoidance for my topology? Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2017-12-05 21:23 +0100
        Re: What is the best communication mechanism with collision detection/avoidance for my topology? upsidedown@downunder.com - 2017-12-06 11:14 +0200
    Re: What is the best communication mechanism with collision detection/avoidance for my topology? Dave Nadler <drn@nadler.com> - 2017-12-07 05:09 -0800

#27441 — What is the best communication mechanism with collision detection/avoidance for my topology?

Fromobulesu.t@gmail.com
Date2017-12-02 23:05 -0800
SubjectWhat is the best communication mechanism with collision detection/avoidance for my topology?
Message-ID<73413cab-f8f3-4a23-a89d-5996fc23f917@googlegroups.com>
Hello All, Here is my sensor topology.. 


 _____________                        _____________               
|                                    |            |
|         Tx |------------|--------->| Rx         |
|            |            |          |            |
|ATMEGA128   |            |          | ATMEGA8    |
|            |            |          |            |
|         Rx |------------|------|-->| Tx         |
|____________|            |      |   |____________|
                          |      |
                          |      |            _____________               
                          |      |           |            |
                          |      |---------->| Rx         |
                          |      |           |            |
                          |      |           | ATMEGA8    |
                          |      |           |            |
                          |------|---------->| Tx         |
                          |      |           |____________|
                          |      |
                          |      |           _______________               
                          |      |           |              |
                          |      |---------->| Rx           |
                          |      |           |              |
                          |      |           |ATMEGA8       |
                          |      |           |              |
                          |------|---------->| Tx           |
                          |      |           |______________|
                          |      |
                          |      |
                          |      |           _______________               
                          |      |           |              |
                          |      |---------->| Rx           |
                          |                  |              |
                          |                  |ATMEGA8       |
                          |                  |              |
                          |----------------->| Tx           |
                                             |______________|

 
Here, the atmega128 is the main controller and all other atmega8 are connected to the main controller using rs485 cable.

What is the best communication protocol for this to detect and avoid collision.?

I have 20 atmega8 connected in a row..(i.e all the tx pins of atmega8 are connected together and finally connected to the Rx of the main controller) and distance between the any atmega8 or atmega128 is 3 meters....

[toc] | [next] | [standalone]


#27442

FromT Obulesu <obulesu.t@gmail.com>
Date2017-12-02 23:06 -0800
Message-ID<956d06da-01ba-47e8-be4a-479e740a61b7@googlegroups.com>
In reply to#27441
On Sunday, 3 December 2017 12:35:23 UTC+5:30, T Obulesu  wrote:
> Hello All, Here is my sensor topology.. 
> 
> 
>  _____________                        _____________               
> |                                    |            |
> |         Tx |------------|--------->| Rx         |
> |            |            |          |            |
> |ATMEGA128   |            |          | ATMEGA8    |
> |            |            |          |            |
> |         Rx |------------|------|-->| Tx         |
> |____________|            |      |   |____________|
>                           |      |
>                           |      |            _____________               
>                           |      |           |            |
>                           |      |---------->| Rx         |
>                           |      |           |            |
>                           |      |           | ATMEGA8    |
>                           |      |           |            |
>                           |------|---------->| Tx         |
>                           |      |           |____________|
>                           |      |
>                           |      |           _______________               
>                           |      |           |              |
>                           |      |---------->| Rx           |
>                           |      |           |              |
>                           |      |           |ATMEGA8       |
>                           |      |           |              |
>                           |------|---------->| Tx           |
>                           |      |           |______________|
>                           |      |
>                           |      |
>                           |      |           _______________               
>                           |      |           |              |
>                           |      |---------->| Rx           |
>                           |                  |              |
>                           |                  |ATMEGA8       |
>                           |                  |              |
>                           |----------------->| Tx           |
>                                              |______________|
> 
>  
> Here, the atmega128 is the main controller and all other atmega8 are connected to the main controller using rs485 cable.
> 
> What is the best communication protocol for this to detect and avoid collision.?
> 
> I have 20 atmega8 connected in a row..(i.e all the tx pins of atmega8 are connected together and finally connected to the Rx of the main controller) and distance between the any atmega8 or atmega128 is 3 meters....



Hello All, Here is my sensor topology.. 


 _____________                        _____________               
|                                    |            |
|         Tx |------------|--------->| Rx         |
|            |            |          |            |
|ATMEGA128   |            |          | ATMEGA8    |
|            |            |          |            |
|         Rx |------------|------|-->| Tx         |
|____________|            |      |   |____________|
                          |      |
                          |      |            _____________               
                          |      |           |            |
                          |      |---------->| Rx         |
                          |      |           |            |
                          |      |           | ATMEGA8    |
                          |      |           |            |
                          |------|---------->| Tx         |
                          |      |           |____________|
                          |      |
                          |      |           _______________               
                          |      |           |              |
                          |      |---------->| Rx           |
                          |      |           |              |
                          |      |           |ATMEGA8       |
                          |      |           |              |
                          |------|---------->| Tx           |
                          |      |           |______________|
                          |      |
                          |      |
                          |      |           _______________               
                          |      |           |              |
                          |      |---------->| Rx           |
                          |                  |              |
                          |                  |ATMEGA8       |
                          |                  |              |
                          |----------------->| Tx           |
                                             |______________|

 
Here, the atmega128 is the main controller and all other atmega8 are connected to the main controller using rs485 cable.

What is the best communication protocol for this to detect and avoid collision.?

I have 20 atmega8 connected in a row..(i.e all the tx pins of atmega8 are connected together and finally connected to the Rx of the main controller) and distance between the any atmega8 or atmega128 is 3 meters....

[toc] | [prev] | [next] | [standalone]


#27443

FromRobert Wessel <robertwessel2@yahoo.com>
Date2017-12-03 09:03 -0600
Message-ID<pu382dp9bcl6s4lhru9ruc6lv8re8npchl@4ax.com>
In reply to#27442
On Sat, 2 Dec 2017 23:06:51 -0800 (PST), T Obulesu
<obulesu.t@gmail.com> wrote:

>On Sunday, 3 December 2017 12:35:23 UTC+5:30, T Obulesu  wrote:
>> Hello All, Here is my sensor topology.. 
>> 
>> 
>>  _____________                        _____________               
>> |                                    |            |
>> |         Tx |------------|--------->| Rx         |
>> |            |            |          |            |
>> |ATMEGA128   |            |          | ATMEGA8    |
>> |            |            |          |            |
>> |         Rx |------------|------|-->| Tx         |
>> |____________|            |      |   |____________|
>>                           |      |
>>                           |      |            _____________               
>>                           |      |           |            |
>>                           |      |---------->| Rx         |
>>                           |      |           |            |
>>                           |      |           | ATMEGA8    |
>>                           |      |           |            |
>>                           |------|---------->| Tx         |
>>                           |      |           |____________|
>>                           |      |
>>                           |      |           _______________               
>>                           |      |           |              |
>>                           |      |---------->| Rx           |
>>                           |      |           |              |
>>                           |      |           |ATMEGA8       |
>>                           |      |           |              |
>>                           |------|---------->| Tx           |
>>                           |      |           |______________|
>>                           |      |
>>                           |      |
>>                           |      |           _______________               
>>                           |      |           |              |
>>                           |      |---------->| Rx           |
>>                           |                  |              |
>>                           |                  |ATMEGA8       |
>>                           |                  |              |
>>                           |----------------->| Tx           |
>>                                              |______________|
>> 
>>  
>> Here, the atmega128 is the main controller and all other atmega8 are connected to the main controller using rs485 cable.
>> 
>> What is the best communication protocol for this to detect and avoid collision.?
>> 
>> I have 20 atmega8 connected in a row..(i.e all the tx pins of atmega8 are connected together and finally connected to the Rx of the main controller) and distance between the any atmega8 or atmega128 is 3 meters....
>
>
>
>Hello All, Here is my sensor topology.. 
>
>
> _____________                        _____________               
>|                                    |            |
>|         Tx |------------|--------->| Rx         |
>|            |            |          |            |
>|ATMEGA128   |            |          | ATMEGA8    |
>|            |            |          |            |
>|         Rx |------------|------|-->| Tx         |
>|____________|            |      |   |____________|
>                          |      |
>                          |      |            _____________               
>                          |      |           |            |
>                          |      |---------->| Rx         |
>                          |      |           |            |
>                          |      |           | ATMEGA8    |
>                          |      |           |            |
>                          |------|---------->| Tx         |
>                          |      |           |____________|
>                          |      |
>                          |      |           _______________               
>                          |      |           |              |
>                          |      |---------->| Rx           |
>                          |      |           |              |
>                          |      |           |ATMEGA8       |
>                          |      |           |              |
>                          |------|---------->| Tx           |
>                          |      |           |______________|
>                          |      |
>                          |      |
>                          |      |           _______________               
>                          |      |           |              |
>                          |      |---------->| Rx           |
>                          |                  |              |
>                          |                  |ATMEGA8       |
>                          |                  |              |
>                          |----------------->| Tx           |
>                                             |______________|
>
> 
>Here, the atmega128 is the main controller and all other atmega8 are connected to the main controller using rs485 cable.
>
>What is the best communication protocol for this to detect and avoid collision.?
>
>I have 20 atmega8 connected in a row..(i.e all the tx pins of atmega8 are connected together and finally connected to the Rx of the main controller) and distance between the any atmega8 or atmega128 is 3 meters....


"Best" is dependent on your requirements.  Start with a simple
approach that's easy to understand and implement:  Have the master
poll all the slaves in a loop.  If that has issues you find
unacceptable, perhaps load on the master, latency on the polls, power
consumption due to excessive polls (especially if the actual data rate
is very low), then consider other schemes, all of which will be
considerably more complex.

There's no real possibility in your scheme for collision detection,
since the slaves cannot talk to each other, so they couldn't even pass
a token around, so a non-polled scheme would have to depend on the
detection of failed transmissions.  A sufficiently robust packet
structure and check sum would allow the master to discard any garbled
transmissions, and a lack of an ack could cause a slave to retransmit
after a timeout and a random delay.

If the data rates are really low, you could consider a slotted
approach, where each slave has a slot where it's free to transmit.
That would require synchronized clocks (or a clock distributed in some
way, that *could* be a periodic transmission from the master - and
then enough clock synchronization so that all the slaves can stay in
their slots), and that messages are limited to those that fit into the
slot.

[toc] | [prev] | [next] | [standalone]


#27444

Frompozz <pozzugno@gmail.com>
Date2017-12-04 11:57 +0100
Message-ID<p039nj$ug9$1@dont-email.me>
In reply to#27442
Il 03/12/2017 08:06, T Obulesu ha scritto:
> Here, the atmega128 is the main controller and all other atmega8 are connected to the main controller using rs485 cable.
> 
> What is the best communication protocol for this to detect and avoid collision.?
> 
> I have 20 atmega8 connected in a row..(i.e all the tx pins of atmega8 are connected together and finally connected to the Rx of the main controller) and distance between the any atmega8 or atmega128 is 3 meters....
> 

Do you use only a "rs485 cable" (and I don't know what it is) or do you 
have RS485 transceivers? Because connecting more TX lines together isn't 
a good thing.

It isn't the same topology, (it is related to a more common two-wires 
RS485 bus)... recently I encountered the uLan[1] project. It seems 
interesting.

I couldn't understand the collision detection/avoidance mechanism.

[1] http://ulan.sourceforge.net/index.php

[toc] | [prev] | [next] | [standalone]


#27445

FromJack <jack4747@gmail.com>
Date2017-12-04 03:11 -0800
Message-ID<c7be14ba-fc3b-4a20-af4a-d20182d4a3e9@googlegroups.com>
In reply to#27442
Il giorno domenica 3 dicembre 2017 08:06:56 UTC+1, T Obulesu ha scritto:

> What is the best communication protocol for this to detect and avoid collision.?
> 
> I have 20 atmega8 connected in a row..(i.e all the tx pins of atmega8 are connected together and finally connected to the Rx of the main controller) and distance between the any atmega8 or atmega128 is 3 meters....

If yyou don't need something very fast or realtime, a master-slave protocol (for example modbus) is easy to implement and you don't have collision.

Bye Jack

[toc] | [prev] | [next] | [standalone]


#27447

FromHans-Bernhard Bröker <HBBroeker@t-online.de>
Date2017-12-05 21:23 +0100
Message-ID<f8odigFff45U1@mid.dfncis.de>
In reply to#27442
Am 03.12.2017 um 08:06 schrieb T Obulesu:


>  _____________                        _____________
> |                                    |            |
> |         Tx |------------|--------->| Rx         |
> |            |            |          |            |
> |ATMEGA128   |            |          | ATMEGA8    |
> |            |            |          |            |
> |         Rx |------------|------|-->| Tx         |
> |____________|            |      |   |____________|
>                           |      |
>                           |      |            _____________
>                           |      |           |            |
>                           |      |---------->| Rx         |
>                           |      |           |            |
>                           |      |           | ATMEGA8    |
>                           |      |           |            |
>                           |------|---------->| Tx         |
>                           |      |           |____________|
[...]

That topology, as shown, it broken.   You've connected your master Tx to 
one slave Rx, but also several slave Tx'es.  And vice versa.  I'll 
assume you really meant

+------------+                         +------------+
|         Tx |>------------------*---->| Rx         |
|            |                   |     |            |
|ATMEGA128   |                   |     | ATMEGA8    |
|            |                   |     |            |
|         Rx |<-----------*------|----<| Tx         |
|____________|            |      |     +------------+
                           |      |
                           |      |     +------------+
                           |      *---->| Rx         |
                           |      |     |            |
                           |      |     | ATMEGA8    |
                           |      |     |            |
                           *------|----<| Tx         |
                           |      |     +------------+
                           .      .
[etc.]

> Here, the atmega128 is the main controller and all other atmega8 are connected to the main controller using rs485 cable.

The type of cable is much less relevant than you probably think.  The 
real question is what kind of line interfaces (a.k.a. transceivers) 
you're using on those lines.  Let's assume they're RS485 transceivers.

> What is the best communication protocol for this to detect and avoid collision.?

None, because with this kind of topology, there really shouldn't be any 
collisions in the first place, so nothing to detect or avoid.  You have 
a master controller, so how about letting it actually be the controlling 
master of the bus?

The topology you described practically begs for a query-response 
protocol: master tells all slaves who is to talk next, and optionally 
what it's to talk about.  The addressed device (master itself, or one 
slave) then talks; all others only listen.  Repeat until the cows come home.

Collisions are what you get if there's not one master, but many of them. 
  That's when you really need collision mitigation techniques.  If 
that's where you really want to go, fell free to google CSMA/CA and 
CSMA/CR and the protocols mentioned in connection with those.  One good 
choice might then be CAN --- and it would save you half the wiring, too.

[toc] | [prev] | [next] | [standalone]


#27450

Fromupsidedown@downunder.com
Date2017-12-06 11:14 +0200
Message-ID<0obf2d11ohvhj009anedjdaadh0feplgqi@4ax.com>
In reply to#27447
On Tue, 5 Dec 2017 21:23:41 +0100, Hans-Bernhard Bröker
<HBBroeker@t-online.de> wrote:

>Am 03.12.2017 um 08:06 schrieb T Obulesu:
>
>
>>  _____________                        _____________
>> |                                    |            |
>> |         Tx |------------|--------->| Rx         |
>> |            |            |          |            |
>> |ATMEGA128   |            |          | ATMEGA8    |
>> |            |            |          |            |
>> |         Rx |------------|------|-->| Tx         |
>> |____________|            |      |   |____________|
>>                           |      |
>>                           |      |            _____________
>>                           |      |           |            |
>>                           |      |---------->| Rx         |
>>                           |      |           |            |
>>                           |      |           | ATMEGA8    |
>>                           |      |           |            |
>>                           |------|---------->| Tx         |
>>                           |      |           |____________|
>[...]
>
>That topology, as shown, it broken.   You've connected your master Tx to 
>one slave Rx, but also several slave Tx'es.  And vice versa.  I'll 
>assume you really meant
>
>+------------+                         +------------+
>|         Tx |>------------------*---->| Rx         |
>|            |                   |     |            |
>|ATMEGA128   |                   |     | ATMEGA8    |
>|            |                   |     |            |
>|         Rx |<-----------*------|----<| Tx         |
>|____________|            |      |     +------------+
>                           |      |
>                           |      |     +------------+
>                           |      *---->| Rx         |
>                           |      |     |            |
>                           |      |     | ATMEGA8    |
>                           |      |     |            |
>                           *------|----<| Tx         |
>                           |      |     +------------+
>                           .      .
>[etc.]
>
>> Here, the atmega128 is the main controller and all other atmega8 are connected to the main controller using rs485 cable.


This corrected form is essentially 4 wire RS-485 style communication,
in which all Rxs are always active, the master Tx is always active,
but one slave Tx only is active, all others are in three state.

>The type of cable is much less relevant than you probably think.  The 
>real question is what kind of line interfaces (a.k.a. transceivers) 
>you're using on those lines.  Let's assume they're RS485 transceivers.
>
>> What is the best communication protocol for this to detect and avoid collision.?
>
>None, because with this kind of topology, there really shouldn't be any 
>collisions in the first place, so nothing to detect or avoid.  You have 
>a master controller, so how about letting it actually be the controlling 
>master of the bus?
>
>The topology you described practically begs for a query-response 
>protocol: master tells all slaves who is to talk next, and optionally 
>what it's to talk about.  The addressed device (master itself, or one 
>slave) then talks; all others only listen.  Repeat until the cows come home.
>
>Collisions are what you get if there's not one master, but many of them. 
>  That's when you really need collision mitigation techniques. 

Or use a "master" token, passing token from one master to the next
master when the first has done its job.

> If 
>that's where you really want to go, fell free to google CSMA/CA and 
>CSMA/CR and the protocols mentioned in connection with those.  One good 
>choice might then be CAN --- and it would save you half the wiring, too.

Was 3 m the total network size or the distance between each node ? In
the first case, even open collector TTL could be used, but the power
should be delivered from the master in the same cable. There should be
no ground connections at the slaves to avoid TTL ground potential
problems.

To save in wiring, use a similar topology as 2 wire RS-485. Just add
an NPN transistor at each Tx pin in the network, connect collectors
together and a common pull-up to +5 V. Connect each Rx pin to the
collector of the corresponding collector (i.e. the low end of the
pull-up resistor. 

Make sure you have a echo-cancel routine to avoid hearing your own
transmissions. It is also a good idea to use a protocol, in which the
request and response messages are different so tat the inactive slaves
know, if there is a master request or a reply from an other slave on
the line.

[toc] | [prev] | [next] | [standalone]


#27452

FromDave Nadler <drn@nadler.com>
Date2017-12-07 05:09 -0800
Message-ID<a4643070-4224-48ea-9a8b-9a6d719c2882@googlegroups.com>
In reply to#27441
Old and venerable... http://bfy.tw/FRQl
All the info you need ;-)
Best Regards, Dave

[toc] | [prev] | [standalone]


Back to top | Article view | comp.arch.embedded


csiph-web