Electronic – I2C slave not ACK’ing quickly enough

i2cmicrocontrollertiming

I am programming a microcontroller to talk with a slave device via I2C. My I2C transactions always get NACK'd, but I believe the slave is ACK'ing the transaction, just a little bit too late and my microcontroller thinks it's a NACK. Please correct me if I'm wrong.

Here is a trace of the transaction.

I2c Trace

The slave drives SDA low at the end to ACK the transaction. But my I2C library always reports it a NACK. Further more, the slave keeps SDA low since their isn't a 9th clock pulse, and my I2C peripheral gets stuck trying to finish the stop condition.

My I2C library is a reliable one from manufacturer that I've used many times successfully with different devices. I'm thinking the slave is just a bit too slow with the ACK.

The current trace is at 100 KHz but I've tried at 10KHz and it does the same thing. Any suggestions to solve this?

More details:

  • slave: AMS AS3955

  • master: Silicon labs EFM32 Pearl

Update

I bit banged the I2C operation in question and added the 9th clock cycle. The same problem occurs. After the operation, I disconnect SDA and measure it on the microcontroller side and slave side. Micro-SDA is high (correct) but slave-SDA is pulled low still. So it seems this may be more of an issue with the slave device than an I2C issue, right?

enter image description here

Update 2

See my posted answer.

Best Answer

Turns out my I2C slave doesn't support I2C.

The AMS AS3955 is configured as a SPI or I2C device at factory time. My device is a SPI one and I didn't notice.

Thanks for the discussions!