i2c problem when adding external IO controller

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've been working with the I2C bus on an ATmega16/32, writing interface functions to access an IO expander. In isolation, the expander works great. I am able to read from and write to the expander with no problems.

My problem is, I have a pre-existing project which makes use of I2C for a DAC. Without the IO expander connected, the system performs correctly. When I add the expander to the bus, however, the DAC no longer operates correctly. At low voltage levels, it continues to operate, but at higher levels my program enters an infinite loop.

Using a scope to examine the data and clock signals shows that the bus is being returned to its idle state before the controller stops responding. In addition, there is a 5V spike on the data line that is present when the expander is plugged in. When the expander is removed, the spike drops to around 2.5V. I'm operating at 100kHz, so a normal bit has width of 10us. The spike is only 1us in length.

Beyond the aforementioned atmega16, I am using a MCP23008 expander. The pullups on the SCL/SDA lines are 4.7k. Any ideas where the spike on the data line is coming from, and if it could be causing an error?