Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

SPI and/or I2C and noise sensitivity

Status
Not open for further replies.

CADDevil

Member level 5
Joined
Jun 26, 2001
Messages
80
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
649
i2c noise

Hello,

I have one question. I have a PID motor controller (18F458) which I want to connect to higher level system.
Because I do not have enough serial ports on the higher level system, I would like to connect the motor unit via I2C or SPI.
Which one is less sensitive to noise ?
 

barny

Member level 1
Joined
Apr 6, 2002
Messages
34
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
415
spi noise sensitivity

CADDevil said:
Hello,

I have one question. I have a PID motor controller (18F458) which I want to connect to higher level system.
Because I do not have enough serial ports on the higher level system, I would like to connect the motor unit via I2C or SPI.
Which one is less sensitive to noise ?
Neither is designed for robustness. SPI is usually implemented in on-chip hardware, with shift registers clocked by the clock signal, though, so would be very susceptible to glitches. I2C in harware would have same sensitivity, but if you use s/w I2C, you could make input routines sample multiple times to confirm transitions, and make it a more robust.

I2C doesn't work easily through simple optocouplers or buffers, because they have bidirectional data lines. Can't remember if same for SPI?

You could improve I2C by using differential buffers (two wires per signal) and making the data unidriectional - so have one pair with data from the master and one (multidrop) pair with data from the slaves. Slaves only enable their buffers when transmitting. Terminate the lines properly.

HTH
barny
 

CADDevil

Member level 5
Joined
Jun 26, 2001
Messages
80
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
649
i2c glitch

SPI does not have bidirectional data, so there should not be a problem with optocouplers.
I understand that RS-485 is much better solution, but the interface chips are expensive.
I think that I will try to use SPI and I will see. After all, the lines will be relatively short (50cm or similar), because the robot is small.
 

mmagnuson

Newbie level 1
Joined
Jul 7, 2012
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,291
Re: i2c glitch

SPI does not have bidirectional data, so there should not be a problem with optocouplers.
I understand that RS-485 is much better solution, but the interface chips are expensive.
I think that I will try to use SPI and I will see. After all, the lines will be relatively short (50cm or similar), because the robot is small.

As you know, I2C was developed for very short runs and as such as the limitation of a total bus capacitance of 400 pF. You may be interested in the dual bidirectional bus driver PCA9600 by NPX (see: http://www.nxp.com/documents/data_sheet/PCA9600.pdf) which isolates the I2C bus capacitance and increase the total bus capacitance to 4000pF. This chip also separates the bidirectional signaling of the I2C buss into a unidirectional TX and RX for the clock and data lines. If only two wires (clock and data) are acceptable the TX and RX pins can be connected together according to the chips documentation.

If you are expecting any level of electrical interference you may want to use differential signaling. The guys over at SJT Bits (sjtbits.com) have created a breakout board that takes standard I2C and creates a differential pair.
(http://sjtbits.com/differential-i2c-shield/)

Hope this helps.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top