Searching \ for 'collision detection' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=collision+detection
Search entire site for: 'collision detection'.

Truncated match.
PICList Thread
'collision detection'
1997\04\08@085646 by Antonio Almeida

flavicon
face
Hello,
       I am building a PIC network and i pretend to use RS485 chips. I
will use the built in UART to drive them but i need a way to detect
collisions and network idle state, what i think i should do it's when i
send a byte from the UART, or pretend to send it, i monitor the line with
another pin (neither TX or RX) looking for diferent bits. Something link
this:

---
  |       -------          Is this ok or am i forgeting something. I
Tx|----->|       |--       never used RS485 chips before, they go down
  |      | RS485 |         when more then one drive the line?
Rx|<--+--|       |--
  |   |   -------
  |<--
  |
---

Antonio Almeida

1997\04\08@093154 by Kieran Sullivan

flavicon
face
RS485 uses 3 or 4 lines for control. In addition to the TX and RX lines you have TXenable and RXEnable. You can normally connect TXenable and RXEnable together because they use opposite logic. To be able to detect collisions, you will have to provide separate lines for TXEnable and RXEnable so you can transmit a bit and receive at the same time to check if the bit you put on the RS485 lines is there or if there is another device trying to transmit a different bit at the same time. With RS485 I don't think you have to bother with waiting for idle time on the bus, just go ahead and transmit, if you detect a collision, just wait a short time then re-try. If two devices transmit at the same time, only one of them will see a collision (I think its the one that tries to send a 0 when the other is trying to send a 1). While both devices are sending the same logic state, no collision will be detectable. The only problem I am having with all this is making sure that all TX are synchronised. I think it should be possible to have one device on the bus send a sync packet, and have all the other devices take timing from that, though I havent tried this yet.

Another approach might be to only use master/slave access to the bus. Only allow one master to request information from a slave. A slave can only transmit when it is replying to a command from the master.


Kieran sullivan


----------
From:   Antonio Almeida[SMTP:spam_OUTdeec352TakeThisOuTspamTOM.FE.UP.PT]
Sent:   08 April 1997 14:55
To:     .....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU
Subject:        collision detection

Hello,
       I am building a PIC network and i pretend to use RS485 chips. I
will use the built in UART to drive them but i need a way to detect
collisions and network idle state, what i think i should do it's when i
send a byte from the UART, or pretend to send it, i monitor the line with
another pin (neither TX or RX) looking for diferent bits. Something link
this:

---
  |       -------          Is this ok or am i forgeting something. I
Tx|----->|       |--       never used RS485 chips before, they go down
  |      | RS485 |         when more then one drive the line?
Rx|<--+--|       |--
  |   |   -------
  |<--
  |
---

Antonio Almeida

1997\04\08@113612 by Byron A Jeff

face picon face
{Quote hidden}

Antonio,

This is a tough tough job. Unless you have some ultra high bandwith
requirements, I'd think twice about the collision detection route.

A couple of alternatives:

1) primary-secondary: The primary controller controls the bus. Secondaries
can only speak when spoken to. The primary can grant the secondary the
RS485 bus temporarily so that it can communicate. IEEE 488 is an example
of this scheme IIRC.

2) Token passing: Formulate a logical ring where a token is passed from
node to node. When a node has the token it has the bus and can send data
where it wants. Once the node is finished it passes the token to the next
node.

3) TDM: Time division multiplexing. Treat the line as a bus where everyone
has a seat. For each frame everyone can fill their own seat with data.
Requires a timer for each node so they'll know where their seat is relative
to the beginning of the frame.

Most collision detection schemes operate in hardware. Software solution are
tough and littered with race conditions.

Just my opinion.

BAJ

1997\04\09@025150 by Mike Smith

flavicon
face
> From: Antonio Almeida <deec352spamKILLspamTOM.FE.UP.PT>
> To: .....PICLISTKILLspamspam.....MITVMA.MIT.EDU
> Subject: collision detection
> Date: Tuesday, 8 April 1997 23:25
>
> Hello,
>         I am building a PIC network and i pretend to use RS485 chips. I
> will use the built in UART to drive them but i need a way to detect
> collisions and network idle state, what i think i should do it's when i
> send a byte from the UART, or pretend to send it, i monitor the line with
> another pin (neither TX or RX) looking for diferent bits. Something link
> this:
>

If you used one of the manchester coded systems, you could use DC offset to
indicate collision. (note - this necessitates building your own serial data
stream with manchester bits in it - not too hard - there's some reasonable
comms books out there that indicate how.  I think ethernet uses a variant
of this.)

MikeS

1997\04\09@095802 by Tom Handley

picon face
re: PIC Network and Collision Detect

  Antonio, I don't know what your design requirements are but I would
take a hard look at a Master/Slave protocol. Implementing
collision-detection in software can be very difficult as well as consume
a lot of CPU time.

  - Tom

{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 1997 , 1998 only
- Today
- New search...