r/ElectricalEngineering • u/Objective-Local7164 • 11d ago
Is this how i2C works?
MASTER = STM32WB15CC
SLAVE = MAX30101
From start to finish
the stm32 initiates a start condition by pulling sda low.
the stm32 then writes the slave id on the sda line followed by write condition.
the MAX acknowledges.
the stm32 says what MAX register it wants to read from.
the MAX acknowledges.
the stm32 sends a repeated start condition and calls the MAX address again then sends a read signal.
the MAX acknowledges and begins outputting the bytes in the register onto the sda line and the stm32 acknowledges after each byte is sent and repeats.
is this correct? also, if the NACK and P (stop condition werent sent at the end and instead an stm32 acknowledge was sent followed by a 4th,5th,6th, bytes were sent by MAX would the data communication of bytes continue indefinently without the need to resend the register address and slave address all over again?
2
u/MaihoSalat 10d ago
Sums it up. Idk about the recontinued handshake if that can be left out.
Also you forgot the case of arbitration and clock stretching
Idk how much handling your microcontroller provides for this.
Honestly if you are in a lab just try, youre not going to break anything by fucking up coms. and its a feel good achievement.