Hi , i connect 2 pic (16f877a as master - 16f819 as slave) and can sent one byte only to my slave side correctly...
How can i read the second byte on my slave side? the code is but not work!:
master:
slave:
How can i read the second byte on my slave side? the code is but not work!:
master:
Code:
I2C1_Start()
I2C1_Wr(0xD0) the slave code (16f819)
I2C1_Wr(lo(send)) the low part of send word
I2C1_Wr(hi(send)) the high part of send word
I2C1_Stop()
slave:
Code:
if sspstat.D_A = 1 then ' data arrived no address
lo(rxbuffer)= sspbuf read first sent byte
hi(rxbuffer) = sspbuf read second sent byte
j = SSPBUF empty ssbuf
return
else
j = SSPBUF if address arrived empty the SSBUF
return
end if