vbnet code
'LE PCF8574
Sub procedure RDP
delay_ms(50)
I2C1_Start
I2C1_Wr(0x41)
I2C1_stop
Delay_MS(50)
End Sub
'ESCREVE PCF8574
Sub procedure wrt
delay_ms(50)
I2C1_Start
I2C1_Wr(0x42)
I2C1_Wr(CC)
I2C1_stop
Delay_MS(50)
End Sub
e este em MikroC não funciona de jeito nenhum. Envio o código de endereço + leitura e ele retorna o que enviei, isto é , 0x41
cpp code
void RDP()
{
delay_ms(50);
I2C1_Start;
I2C1_Wr(0x41);
CCA=I2C1_Rd(0);
I2C1_stop;
delay_ms(50);
}
void WRT()
{
delay_ms(50);
I2C1_Start;
I2C1_Wr(0x42);
I2C1_Wr(CC);
I2C1_stop;
delay_ms(50);
}
Onde estou errando?
A propósito estou usando um PIC18F4620 e o PCF8574 .