HI
now i written the I2c firmware for master and slave depend on pic16f877 from microchip:
about master i see that initiate the connection with start condition and the send slave address i want to talk to it and then read or write some byte of data to it and each time i send i will ACK send by slave .
about slave i will enable interrupt so when the interrupt occurs i will check the address so if it matched then i receive data
my question
1-on the master side : is should each time after i send address and first data byte restart the connection[by do start condition again] or not? [i mean after each byte sent to slave should do start condition again or not]
2- on the slave side : is each time the transmitter send to slave [address or byte] interrupt it or not? i mean that:
for example[the master send 6 byte to slave]
master initiate the connection so send the address to bus so the matched slave reply with ACK, in same time the master send read or write data to slave in same session so after each receiving process by slave , the slave interrupt again or not just one interrupt.
3- how can slave sense the connection is finished?
4- if i have 3 slave and one master so
the address for 3 slave will be 0x02,x04,0x08. if master send 0x02 to bus so the first slave is matched , how can i know it by compare the content of SSPBUF with the value of address or what?
about mismatched slaves what will it do? if it interrupted each time master send to first slave or not?
wait your reply for importance
best regards