I am having an issue using the I2C interface on a CC2640.
My peripheral is NAK'ing a transaction and I think it is due to the "low" levels on SCL and SDA not be low enough.
I know that SCL can be pulled to very close to 0.0V as one of the I2C peripherals requires that SCL be pulled low for > 39 ms to "wake" it.
I do this by "requesting" the I2C peripheral via the semaphore mutex, closing the I2C driver, pulling the SCL line low for about 45 ms, then releasing the pin and restarting the I2C driver. The SCL line drops to a few millivolts when pulled low.
Here is a code snippet where I do this:
if(bspI2cReserve() == true) {
bspI2cClose();
// Gain access to the pin
hI2CPin = PIN_open(&pinI2CState, myBoardI2CPinTable);
if(hI2CPin != 0) {
// Drive SCL pin low
PIN_setOutputValue(hI2CPin, Board_I2C0_SCL0, 0);
// Now wait for PERIPHERAL_WAKE_TIME_MS
delay_ms(PERIPHERAL_SCL_LOW_TIME_MS);
// Release SCL to go high
PIN_setOutputValue(hI2CPin, Board_I2C0_SCL0, 1);
// Give up the pin
PIN_close(hI2CPin);
// Release the I2C
bspI2cDeselect();
// Delay for Wake-up time
delay_ms(PERIPHERAL_WAKE_TIME_MS);
bspI2cInit(I2C_100kHz);
success= true;
} else {
success = false;
}
} else {
success= false;
}
After this, I can perform I2C transactions, where the timing and high/low periods look correct, but the logic low levels are around 1.1 v (above the '0' threshold).
I see that the I2C driver initializes the pins deep in the driver (in I2CCC26XX_initIO in I2CCC26XX.c). Is there some way to set the drive strength higher?
Am I missing a step when initializing the driver?
Thanks!