Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Best Communication protocol for controlled access systems

Status
Not open for further replies.

Abhilashhegde94

Member level 1
Joined
Apr 19, 2015
Messages
32
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Location
India
Activity points
276
Hi,

I am designing an embedded system which requires 2 or more chips to communicate some data involving PIC18f Series Controller.
For example if we take 3 PIC18F controllers,my design requires that any can become master at any time and it is given that there can be only 1 master at a time,also communicating via either a full duplex or half duplex bus(preferably half duplex as speed is not that much of a criteria here).
For the issue of multiple master collision i have found out that voting could be the best option to decide which controllers gets to be master when.

So basically i need to use a already software defined communication protocol which can implement the following:
1.Voting
2.Change from slave mode to master mode at will
3.Moderate speed
4.Half duplex preferably.
5.With timing to have ARQ.

Can anyone give suggestions as to which would be the best to use(preferably among I2C,UART,SPI).

Also how to use RS485 in PIC controllers
 

With the information give, my choice would be I2C.
SPI can be made to work in a multi-master bus configuration but it can be quite hard to detect collisions.
For UARTs you can have problems with collisions and you often need to use a 9-bit word to include an address flag so that you know when to turn on your Tx line.
I'm not sure what you mean by voting to determine the bus master? Are you proposing separate hardware where each PIC raises a line when it wants to be the master and receives a signal back when it can do so? Or is there an 'arbiter' PIC that does this in software?
RS485 is a hardware protocol that specifies the voltages on the lines. PIC devices work at normal logic levels and so require an interface circuit (normally a chip) to do the level translations. However you will need to ensure that you can tri-state the Tx line on the RS485 side so that you can switch masters. Unfortunately I am not sure if this will work well with I2C (which is really designed for short distance communications while RS485 is designed to drive long wires).
If you are really talking about long distance comms, then why not consider Ethernet as it has multi-master collision detection etc as part of the standard and can use repeaters etc. to really drive the signals a long way. You can get Ethernet chips that can be driven by PIC devices via SPI interfaces.
Susan
 

Hi,

From your mentioned details I2C is preferable communication protocol.

1) It is an a half duplex communication protocol.
2) Can use with low speed 100 KHz (or) high speed 400 Khz
3) It is multi master & multi slave, can switch to sender to listener at any time.
4) Reliable communication
5) open drain configuration
6) Can configure in interrupt (or) polling mode, preferable in poling mode.
 

I2C is a lokal communication bus, and used inside a few meters. If the distance is greater you need a more robust bus, or more hardware to split the bus into sections.

RS485 is defined as a 2-wire half duplex multidrop bus, normally master/slave, and you will meet som problems regarding collisions from a multimaster solution. The transmitting unit(s) can not listen for collisions while transmitting, they will only se their own data. To solve this problem you need to implement a protocol based collision detection. There are several approaches for this, and what you select will depend on the speed and contents you want to send.

RS422 is the corresponding point-to-point variant of the RS485, normally a 4-wire solution.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top