Is IIC (I2C) suitable in ths case?

Status
Not open for further replies.

UroBoros

Advanced Member level 2
Joined
May 5, 2004
Messages
642
Helped
19
Reputation
38
Reaction score
8
Trophy points
1,298
Location
Cochin - India
Activity points
6,463
I need to communicate from a PIC to a series of Boards of same type. That is 12 boards of the same type will be in my product. I need to collect data from all these boards. So 12 exactly similar boards will be stacked on top and I am planning to connect all together by IIC to a Master PIC. The slave boards will be having small PIC micro as slave implemented by bit banging. That is my plan.
Is IIC ok when we are using wires to connect between PCBs like this?.
If not what else? RS485?

Please
 

Hello!

It depends on the data rate. I2C is very handy because you need only 3 wires,
but the data rate is low, either 100 or 400 kbps.
What bitrate do you need?

Dora.
 
I can work with low speed because no "urgent" data I am transmitting. I have to regularly collect data from my 12 slaves in a round robin fashion. I will(Master) call first slave, collect his response, then call second one and so on.
By three wires I think you have included ground also.
100kbps is Ok for me. But can it be safe to use between PCBs?

Roy Thomas
 
Last edited by a moderator:

Hi,
100kbps is Ok for me. But can it be safe to use between PCBs?

Depends how far apart your boards are, thought you said they were being stacked on top of each other ?
If so standard cable should be fine, for more than a few cm then shielded cable would be better.


What is the link to that dev board, one you have or thinking of getting ?
 
Thanks. My PCBs will be closer. Then ordinary cable or shield wire can be used.
I am thinking about the PIC MCUs to be used as these slaves. I need 10bit ADC plus MSSP or at least SSP module to handle the job.
16F676 is having 10 bit adc and low cost, but then I need to derive the IIC routines through bit banging.
16F72 is having SSP but only 8 bit ADC.
So thinking about a solution.

Roy Thomas

This link is me!
 
Last edited by a moderator:

In my Area Generally 18Series is not that much available. But Can arrange.13K22 seems a good choice. let me see.
Thanks for the suggestion.
Roy Thomas

I run the company and I am the Engineer!(Tough Job!!)
 
Last edited by a moderator:


One issue you may encounter with I2C is the functional limits of capacitive loading, which is set forth by the I2C/SMBbus standards at 400pF.

The typical capacitive load for a PIC18s I/O pins is 50pF, therefore it would not be difficult to exceed the allowable maximum of 400pF.


An alternative solution would be to implement a CAN bus, which offers up to 1 Mbps data rates.

There are several PIC18s which offer CAN as built-in peripheral module and there are add-on peripheral devices which interface with SPI available as well.

BigDog
 

CAN peripheral ICs with SPI interface I have used. MCP2551 and MCP2515. But the use of that pair in every slave will increase the cost considerably. Let me check the option of CAN built in ICs. But cost will be a problem there also.
Or I can Use RS485. The interfacing hardware chip is very cheap. Most of the controllers will be having a serial port. So software no issue.
All this complications can be avaioded if IIC can be implemented even at low speeds.

Thanks
Roy Thomas
 
Last edited by a moderator:

The limitation of I2C is in part due to the maximum allowable rise time of 1000ns (1us), which is used to calculate the appropriate pullup resistors.

There are I2C multiplexers available to disperse capacitive loads over several branches.

Both CAN and RS-485 also efficiently handle the inter-microcontroller communication protocols, while I2C will require some "roll your own" techniques.

BigDog
 
Hi,

Was not aware of the capacitance effect of I2C that BigDog mentions.

However as I2C basically meets your needs and you only need 12 slaves then why not use a chip with 2 mssp modules, which should handle the 300pf load produced from 6 boards on each channel; or have I missed another important point ??

There are 80 18F chips that have two and 30 of them run at 5v.
https://www.microchip.com/ParamChartSearch/params.aspx?branchID=1004&mid=10&lang=en&pageId=74
 
If that "Maths" is correct ,it means that even if in the same PCB we cannot connect more than 8 PIC slaves together in a IIC bus?
Is That correct?
 

If that "Maths" is correct ,it means that even if in the same PCB we cannot connect more than 8 PIC slaves together in a IIC bus?
Is That correct?

Yes and No.

While the math is not entirely correct, other capacitive loading would in fact limit the number of PIC slaves to less than eight and would certainly limit the I2C speed to Standard Mode (100kHz).

The Capacitive Loading of the I2C Bus (Cbus), not only includes the capacitive load of the I2C Master I/O Pin and the capacitive load of each I2C Slave, but the capacitive load of the I2C Bus Wire/Trace/Connector and any other Stray Capacitance.

Reference: Microchip Appnote AN1028 - Recommended Usage of Microchip I2C™ Serial EEPROM Devices

However I should point out, the typical capacitive load of an I2C device is in the 10-20pF range, not the 50pF of PIC18F I/O pin.


As I indicated before, one major limiting factor is the maximum rise time limit of:

1000ns (1us) - Standard Mode (100 kHz)
300ns - Fast Mode (400 kHz)

Another is the maximum current load of the output transistor:

Typically 3mA

And yet another is Supply Voltage (Vcc).

These three factors combine to functional limit Capacitive Loads as well as limit the values of the Pullup Resistor:




Therefore, while utilizing the I2C to connect two or three boards may function as expected, successfully connecting six boards together is highly doubtful.


With all this being said, the issue of capacitive loading is not insurmountable. There are numerous devices available to allow the I2C to function properly well above the 400pF Capacitive Load Limits, I2C multiplexers, buffers, repeaters, etc. However, as expected these devices can significantly increase the cost of the design.


I believe after all things are consider, the CAN bus will be shown as the better solution for your design, offering a better performance to cost benefit ratio.


The following are excellent reference material for the designing of an extended I2C bus and the relevant issues:





**broken link removed**

Microchip Appnote AN1028 Recommended Usage of Microchip I2C™ Serial EEPROM Devices

BigDog
 
Thanks bigdogguru for the very informative post.
IIC option closed.
You really saved lot of my time. My plan was to make three boards IIC (One master two slaves) on General PCB by hookup wire and test the IIC software. Then I would have designed the PCB and then only make 6 or 8 slaves to do testing. So that I will discover this problem only at a later stage.
Thanks a lot.

So my next option is RS485. reason- cheap hardware needed which can go with my PIC18 serial port
SN75176B -this is very cheap here. I have used it before in a circuit, One master One slave, But almost 50 meters apart.

Will this arrangement seems ok in a 10 node RS485 network contained in a enclosure.
May I know why you prefer and suggest CAN over RS485?

CAN is comparatively costly and off course the last option!
Thanks a lot
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…