3 ms·
I've used I2C and CAN. I2C is electrically far more fragile than CAN. CAN is robust against all sorts of electrical faults. While you might not be able to tran
by SAI_Peregrinus 6y ago
I've used I2C and CAN.
I2C is electrically far more fragile than CAN. CAN is robust against all sorts of electrical faults. While you might not be able to transmit data, you won't fry the controller, and once the fault is removed it comes back.
I2C is often more tolerant of unexpected traffic on the bus. There are far too many ECUs that will put a vehicle into limp mode (limit speed drastically) if they detect unexpected CAN traffic, even traffic not directed to them. Protocol-wise I2C is significantly simpler to get right.
- StavrosK 6y agoThat's a very useful analysis, thanks!
- DoingIsLearning 6y agoTo add to this, I2C is more common between a controller and 'slaves' which are architecturally simpler, for instance single output sensors often have I2C as their comms interface. CAN is really meant for distributed embedded systems where you are having to implement full blown communication between equally complex nodes. CAN is indeed much more robust both at a physical layer with a differential line and at a transfer layer with all sorts of error detection and mitigation mechanisms.
- StavrosK 6y agoI see, thanks. I'm asking mostly from a model airplane perspective, where you have a receiver, GPS, mag, transmitter, etc. Right now they use UART, with only the mag using I2C, but CAN sounds like a better solution, especially given the amount of electrical noise you get from the motors/servos.
- tonyarkles 6y agoIt doesn't have wide adoption yet, but it's coming! https://uavcan.org/ https://uavcan.org/
- StavrosK 6y agoOooh, that's very exciting! Worth it just for the standardized connectors, pinouts are such a mess right now, no two of them are the same.
- moftz 6y agoYou could go for a realism factor and adopt MIL-STD-1553 or ARINC 429.
- HeyLaughingBoy 6y agoNo LOL, but that made me giggle.