• √𝛂𝛋𝛆@piefed.worldOP
    link
    fedilink
    English
    arrow-up
    2
    ·
    6 days ago

    It is about like the difference between SPI and I2C serial communications.

    I struggled with that one for a little while. My intuition of serial is more like SPI where there is a dedicated clock structure from a clock source that is separate from the data transmission. Or like with UART serial where the clock baud rate must be known or set in advance to establish communications.

    However, with I2C serial it is only a 2 wire data interface, and the clock is built into the data. That is the main serial communications method used for most analog-world type sensors, like temperature, pressure, real time clocks chips, and many slow types of EEPROM persistent memory. SPI is used for small simple displays in embedded devices, and stuff like the flash memory chip that stores your bootloader on your computer. UART is most often the remote serial terminal access on stuff like your computer and router, though all of these com peripherals have exceptions in use cases.

    The way I2C works is that the data line is always held in a high state with a weak pull up resistor. The devices attached to this data line use NPN transistors to pull the line low. Then the protocol establishes who gets to talk and when and how.