Tool/software: TI-RTOS
Hi all,
I integrated I2C capabilities in my SRRDEMO based project using the code I found in "C:\ti\mmwave_sdk_02_00_00_04\packages\ti\drivers\i2c"
It works (partially)...
I call the functions:
I2C_PlatformInit(void)
i2c_open_for_blocking_mode();
I place my handler in a Task, enabled/blocked by a timed semaphore.
I can see the SC and SD signals running in the oscilloscope, when I call the following code
/**********************************
Globals
***********************************/
I2C_Transaction i2cTransaction;
uint8_t I2C_rxData[16];
uint8_t readBuffer[512];
int32_t readBuffPtr;
uint16_t I2C_rxDataLen;
uint8_t I2C_txData[16];
I2C_Handle i2cHandle;
I2C_Params i2cParams;
my_I2C_handler()
{
i2cTransaction.slaveAddress = 0x42;
i2cTransaction.writeBuf = I2C_txData;
i2cTransaction.readBuf = I2C_rxData;
// Address some slave register and read one byte from it
I2C_txData[0] = 0xFD;
i2cTransaction.writeCount = 1;
i2cTransaction.readCount = 1;
retVal = I2C_transfer(i2cHandle, &i2cTransaction);
}
1) In spite of I set the "i2cTransaction.slaveAddress = 0x42", the SD slave address output (as seen in scope) is always 0
2) After the Restart status is sent before reading I only see the reading SD clocks but not the i2cTransaction.slaveAddress resent sequence (not 0 either)
2) When I try "i2cTransaction.writeCount >1" or "i2cTransaction.readCount >1" the driver stops sending its output (crashes?)
Scope snapshot:
SC = CH1, SD = CH2.
CUR1 = Start Condition, CUR2 after 9th Cock where the SlaveAddress was supposed to be inserted...
Following I see the 0XFD written (Correct) then the Restart condition and only the reading clocks without Slave address at all.
Thanks,
Claudio