======================PROTOCOLS_I2C======================== I2C bus developed by Valvo/Philips as two wire two way serial bus One IC will assume the roll of a Master and will take over the line. The Other ICs will assume the roll of a Slave and will recieve the masters signal. ___ _____ ______ ___.. ___ ____ \|/ / A7 \/ A6 \/ ACK\ /|\ |__/______/\______/\___.. ..___ ...\___| DATA 4u 4.7u _____ ___ ___ ___ __. .._ ____ | /|\ | /|\ | /|\ | /|\ | | |___| |___| |___| |___| |___| CLOCK 0) Both clock and data high (open/free) 1) Master starts by pulling data low while clock high a) failing edge + data high =slaves read address 2) Master now controls clock a) Masters lowers clock after 4us b) Master tries to raise clock. i) if Clock stays down , yield to other master c) Data is to be read at rising clock edge. 3) Master first sends out address and read write mode bit. a) First 7 bits are a slave's address b) Last bit @ 0 means slave will read 4) After each byte, Master expects a acknowledge. a) Master lets the data line go high. b) Slave that receives single pulls data line low on falling edge. c) Abort with stop condition if no acknowledge 5) Then the Master sends data bytes 6) After last ackn, Master goes high while clock is high a) Clock goes high then in 4.7us the data goes high. 7) Wait at least 4.7us for next cycle __ ____________________ ____________________________ |ST|A7|A6|A5|A4|A3|A2|A1|RW|AK|D7|D6|D5|D4|D3|D2|D1|D0|AK| |__|__|__|__|__|__|__|__|__| |__|__|__|__|__|__|__|__| |. ___________________________ _______________________ . ^ | | | | SLAVE /|\|__| SLAVE |__| READS ADDRESS | ^ READS DATA ^ IS IT MINE? 0=SLAVE /|\ /|\ WILL READ |DATA RECEIVER ACKNOWLEDGE |