Communication, interference,
and how everything fits together
Senses:
All of these are “analog”
From Wikipedia:
“Analog transmission is a method of conveying […] information using a signal which varies in amplitude, phase, or some other property”
Most “common sense” since it can vary
Bus capacitance, stray inductance and resistances, all affect the analog signal massively.
For the communication to be reliable,
we need it to be digital.
From Wikipedia:
The byte is a unit of digital information. It is the smallest addressable unit of memory in many computer architectures.
From Wikipedia:
A bit is the smallest unit of storage. The modern de facto standard of eight bits in a byte permits binary values 0 through 28=255 for one byte. Modern architectures typically use 32- or 64-bit words, built of four or eight bytes.
once again from Wikipedia:
A duplex communication system is a point-to-point system composed of two or more connected parties or devices that can communicate with one another in both directions.
Basically a metronome for digital synchronous circuits.
implementation | data rate | configuration | |
---|---|---|---|
synchronous | simpler | faster | easier |
RX is controlled | no start bit | set 1 baud rate | |
asynchronous | complex | slower | tougher |
RX is unpredictable | need start bit | set 2 baud rates |
multiplexing | interference | power use | |
---|---|---|---|
synchronous | easier | bad | more |
RX is controlled | clock signal can be antenna | clock always on | |
asynchronous | insane | better | less |
RX is unpredictable | data only live when needed, no clock | no clock |
Basically sum of the data and divide it
eg, if the data is 10001100, parity bit is 1:
1R1
2)1+0+0+0+1+1+0+0
TX 🡒 RX
RX 🡐 TX
SDA ⟺ SDA
SCL 🡒 SCL
MOSI 🡒 MOSI
MISO 🡐 MISO
SCK 🡒 SCK
SS 🡒 SS
We don’t really need to know the next few for cup, they are mostly used for other industrial purposes
These are all differential protocols. They usually don’t exist for normal microcontrollers since it’s difficult to implement
D+ ⟺ D+
D- ⟺ D-
Probably no time to do interference separately, it’s boring anyways and it only really occurs for i2c so:
tl;dr, if you need to use i2c (most probably will):
wherever possible (mostly between µC) opt for UART as it’s more stable and the complex hardware implementation is done for us already.
SPI may be preferred but slave mode is not always well implemented in hardware, and software emulation is not that good
But we cannot escape i2c, and it’s not THAT bad anyways, mostly just BNO055’s implementation and wonky pull ups.
I2C | SPI | UART | AIN | PWM | Others |
---|---|---|---|---|---|
TOF | Mouse | µC | Light | Motor | Ultra |
Camera | Camera | RasPi | Neopixel | ||
Color | OpenMV | OpenMV | Color | ||
Compass | Display | ||||
POT |