Greetings.
I have a CC2640R2 configured as a single I2C master (on the main processor, not the Sensor Controller) and it is connected to two I2C slaves: a Microchip MCP23017 port expander and an MSP430 programmed to be an I2C slave. Everything works 99.9% of the time, but occasionally, I get a runt (~50ns) SCK pulse instead of the normal (~1us) SCK pulse. The runt pulse shows up in different bit positions, but it always seems to appear in the read portion of the I2C Write/Read transaction.
I have ~4k I2C Pullup resistors and the signals look good on the scope. I read two bytes from the port expander every 20ms in the TIRTOS task context and I'll usually get a failure within a minute or two.
Do you have any idea what might be happening? Could some noise on the SCK line somehow cause an I2C SCK pulse to be stopped early?
Thank you
Scott Wild
PASCO scientific
This is how I configured the I2C channel:
I2C_Params_init( &i2cParams ); i2cParams.transferMode = I2C_MODE_BLOCKING; i2cParams.bitRate = I2C_400kHz; i2cHandle = I2C_open( BOARD_I2C0, &i2cParams );
This is how I read the port expander every 20ms in a task context:
i2cWriteData[0] = 0; i2cTransaction.writeCount = 1; i2cTransaction.writeBuf = i2cWriteData; i2cTransaction.readCount = 2; i2cTransaction.readBuf = i2cReadData; i2cTransaction.slaveAddress = PORT_EXP_SLAVE_ADDR; // 0x20 I2C_transfer( i2cHandle, &i2cTransaction );
This is what I see on the logic analyzer. This is the read portion of the I2C Write/Read transaction. Note the runt SCK pulse on the third bit of the last byte.


