TucsonDon
Member
I am using a PIC18F46K42 as a master and a PIC18F46K22 as a slave. The master calls for an ADC result from the slave, the slave will load the MSB into the buffer and clock it out but the will not load the LSB in the buffer and just clocks the MSB out again.
C:
case PoolTemp:
data = RawPool >> 8;
i2cSend(data);
data = RawPool;
i2cSend(data);
break;
static inline void i2cSend (char data)
{
uint8_t delayCounter = 255;
while (--delayCounter)
{
if (EMPTY == SSP1STATbits.BF)
{
SSP1BUFbits.SSPBUF = data;
SSP1CON1bits.CKP = 1; // release SCL
break;
}
else
{
__delay_us(10);
}
}
}
Last edited: