I2C Slave not acknowledging - Timing tolerance problem?

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm working on controlling a PCA9685 LED Driver with an ATTiny84. I'm using Peter Fleury's I2C code, based on Atmel's AVR310 paper, to run I2C in software, since the ATTiny84 doesn't have hardware TWI.

The PCA9685 never acknowledges the I2C start. If I attach my Saleae Logic, it can easily decode the I2C Start, and the address and write bits, but the slave never acknowledges.

Looking closer with an o-scope I see that the Clock and SDA timing seem to be a bit off. I'm attaching a couple images of what I'm seeing with my o-scope.

I've tried looking up the tolerance of I2C timing, but didn't find anything definitive. Anyone know how tight the tolerance is? With a clock of about 18kHz, I'm seeing the clock leading SDA by about 4uSec.

----

If the problem isn't the timing delay, do you experts out there have any other suggestions? I've verified the slave's physical address. I went with the default used in Figure 26 of the PDF for the PCA9685, and am attempting to address 0xAA, but I got so desperate, I looped through every possible address looking for an ACK from the slave, lol. No luck.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

what does the I2C specification state?

from the head SDA is allowed to change when SCL is low. There are certain set-up and hold times specified for that in the specification.
knowing NXP they even have a short explanation of the I2C bus with the timing diagrams included.

It would look nicer if the SDA line did change in the middle of SCL being low, but that is looks and not a killer.

Are you sure you have the right adres send?
that should be easilly checked with the scope. It should correspond with how the adress selector pins are set to what level. See figure 4 on page 7

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's very likely that it's an address issue.
People having problems setting the correct address is very common. Even with devices that only have one or a few different address options. This device looks like it can have a lot more. The confusion happens a lot of times because of the datasheet talking about the, true, 7 bit address but most of the software code uses an 8 bit form.