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.

[PIC] Best bus which can be used for multiple communications between microchip IC's

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
Hey

I am doing a microchip IC based controller project wherein i need to send some info/data from 1 PIC IC ,just for illustration ,lets say IC1 to IC2 and IC3 at a given time and if need be send a new set of info from IC2 to IC1 and IC3 and similarly from IC3 to ICs 2 and 1.
So in other words all the ICs interconnected by a bus are peers .So i would like to ask which Bus Specification is best to be used for this Peer to Peer comm.
I am going for low cost Pic IC like PIC16f series or 18F series so i would be grateful if i could implement the bus either by software or by the use of hardware pre-defined pins.

Thank you
 

What are the required data rates?
For faster communication, you can use the on-board SPI module.
You can also use the I2C bus for slower data rates, but I would prefer the SPI anyday due to the chip-select option. Also, that would help in avoiding the addressing requirement that is present in the I2C.
 

Also, is the communication 1-way or 2-way? (In other words, for each value I send do you need a returned value? 1-way could use a UART to simply send, but 2-way could use SPI for simultaneous send and receive.)
Further, is a response/acknowledgement required or can you just send the data?
Can the communications occur at the same time or can each wait until the "bus" is free of other traffic?
If you want a common bus, then you also need some form of arbitration to detect collisions and determine who waits and who goes ahead.
Susan
 

The communication is 2 way wherein both the IC's must communicate with each other not necessarily simultaneously.
Also a common data bus is important ,the speed specification is not much to be worried(am okay with slow speed too).
A response is required from the recieving end through an acknowledgement(but since it is 2 way->this is implied).
Yes,The communication can wait until the bus is free and then go for send or rx operation.
Also a form of arbitration is required which i presume can be done through polling /reservation etc methods?
I need a proper easy to program data bus which can use all these.

Abhilash
 

How long is the distance between each PIC?

If you have 3 or more PICs one idea could be a looped bus. each PIC has one receiver and one transmitter. PIC1 TX to PIC2 RX, PIC2 TX to PIC3 RX, and PIC3 TX to PIC1 RX. If the normal condition is that all (RX) are connected to (TX) inside the busdriver, and it is possible for each PIC to transmit separately, you can make a very fast, and secure bus. All PICs are listening all the time, and when one transmit a message, it will normally see the same message at its own input, and discard it. If two PICs start transmitting at the same time the messages will be received and retransmitted if not from itself. This way the max latency is 3 messages, for 3 PICx transmitting at exactly the same time.

If you want to have no collisions you may run the data through the PIC, but then you will have a small delay for each PIC in the loop.

You may also use a token based communication. Having a token running around and the loop, and the PICs connecting messages on the token, and picking their own messages off the token when it comes around.

All this my be realised with mostly any type of point to point drivers, like pure logic, RS232, RS422 and so on. All depending on the distance to communicate over,
One thing to be aware of is that using RS485 multidrop comunication without a master slave solution is not adviceable. It is not possible to detect direct colisions from two masters, reading the sent data from the sender side. You then have to make this a security feature in the protocol used.
 

    V

    Points: 2
    Helpful Answer Positive Rating
Looped bus seems to be a good option and use of Token passing is a better way of handling things yes.Thank you for the suggestion.I just need to ask one thing ,can i do looped bus using I2C?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top