i2c can't get a valid acknowledgment

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

hi,

 

I am working with atxmega128a1u and AD5934 module through the i2c interface. My problem is that I can write a byte on the line properly, but I can't get a valid acknowledgment. When the last bit is 0, the line remains 0, but when the last bit is 1, I get a pulse lower than 3.3V but not 0! (2.6V roughly). Plus, I use a 10K pull-up resistor for SDA and SCL line.

The image of scope has been attached.

 

I appreciate any help in advance.

Regards,

Milad

Attachment(s): 

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

10k is a bit low for the pull-up. 2k2 is usually suggested.

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

A picture and/or schematic is worth 1k words! 

I would take a look at the common ground connection between the two devices....

 

Jim

 

 

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

Somehow I get the idea that your atXmega output is configured as push-pull.

his means you have a short circuit on your I2C bus during the "ack" pulse.

miladsh52 wrote:
When the last bit is 0, the line remains 0
This also suggests that. the master has not released the SDA line, as it should have.

Normally there are some strange intermediate (non-logic) levels or a short glitch on the SDA line in the time between the master releasing the SDA and the slave generating the ACK pulse.

 

ki0bk wrote:
A picture and/or schematic is worth 1k words!
Indeed.

I do not see any RC effect on the rising flank. This also suggests a totem pole output.

 

An easy way to check this is to put a small resistor (100 Ohm or so) in the SDA line between the Xmega and the AD5934.

Does the voltage level of the Ack pulse change significantly?

 

What kind of software lib are you using on the Xmega for I2C? Homebrew / standard / tested ?

Paul van der Hoeven.
Bunch of old projects with AVR's:
http://www.hoevendesign.com

Last Edited: Wed. Feb 7, 2018 - 04:11 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

Thanks for your replies.

The schematic of the circuit has been attached. PC1 and PC0 have been connected to the Xmega. Plus, the digital and analog ground has connected together.

 

I've written my code in Atmel studio which it uses ASF. The config of lines is:

ioport_configure_pin(SDI, IOPORT_DIR_OUTPUT | IOPORT_PULL_UP);

ioport_configure_pin(SCLK, IOPORT_DIR_OUTPUT | IOPORT_PULL_UP);

 

Regards, 

Milad

Attachment(s): 

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

The port pins should be configured as inputs, no pull-ups (totem mode). Basically leave them in the default state they enter after reset.