I am trying to communicate with the device having internal communication as I2C while externally it has two different pin for Input & Output along with a separate pin for Clock. Here is the link.
I am using SPI to communicate with this device. But I am unable to generate START/STOP condition to communicate with I2C device.
Can I get some suggestion to overcome this issue ???
I am using C Coding.
I Tried Bit Banging as follow
Dont know if any logical error.
Here is the Start Condition I m trying to implement :
bool generateStartSeq()
{
SPI1STATbits.SPIEN = 0; // disable SPI port
// SPI1CON1bits.DISSCK = 1; // Internal SPIx clock is enabled
// SPI1STATbits.SPIEN = 1; // enable SPI port, clear status
AD1PCFG = 0xFFFF; // Convert IO pin to Digital
TRISFbits.TRISF6 = 0; // Configure RF6 pin as output;
TRISFbits.TRISF8 = 0; // Configure RF8 pin as output;
LATFbits.LATF6 = 1; // Make RF6 pin high
LATFbits.LATF8 = 1;
Nop;
Nop;
Nop;
Nop;
Nop;
LATFbits.LATF8 = 0;
// writeSPI1(0xFF); // SDO send data High
//
// Nop;
// Nop;
// Nop;
// Nop;
// Nop;
//
// writeSPI1(0x00);
SPI1Init();
return true;
}
Any suggestion will really help me to correct the logic.