Addressing multiple I2C MCP4725 with Arduino Mega

I am using an Arduino Mega to control 4 Adafruit MCP4725 devices.

DAC1 and DAC2 had the MCP4725A1T-E/CH removed and replaced with MCP4725A0T-E/CH. This is to allow addressing 0x60 and 0x61.

DAC3 and DAC4 are standard Adafruit configuration.

Configuration:

  • DAC1 0x60 (pin 5 address pin is pulled down via 1k ohm to ground)
  • DAC2 0x61 (has internal pullup, external pullup added for clarity)
  • DAC3 0x62 (pin 5 address pin is pulled down via 1k ohm to ground)
  • DAC4 0x63 (has internal pullup, external pullup added for clarity)

I am showing two device inputs below (DAC1 and DAC2). R54 is the A0 pulldown for 0x60 and R55 is the A0 pullup for 0x61.

Arduino and MCP4725 Addressing

Initially, this worked fine. I then swapped the modules (DAC1 and DAC2). Instead of the addressing following the position (control via the pulldown/pullup), it followed the device. Why is this and what can I do to fix this?

I am not familiar with the parts but it appears the jumpers to select the address are on the device. That device has no clue as to where it is at in the system, it just does what it is told and you set an address it will respond to that, even if you put it in a different system on the other side of the globe.

Take a knife and fork an place them on the table. Then swap them, the fork stays a fork, the spoon stays a spoon.

You have only one pin available to set the address. With only one pin available, you have only TWO possible address you can set and those are either 0x60 or 0x61!

if you want to connect and control MORE THAN TWO MCP4725 then my suggestion is for you to get a I2C multiplexer.

hope that helps....

Sherzaad, Thanks for the reply. This turned out to be a schematic problem on my part. I meant to put a net 'note' and accidentally put a net name for A0 and A1. This tied my traces together. I'm surprised this worked at all.

Arduino and MCP4725 Addressing

Here is the addressing scheme; sorry if I wasn't clear

Anyhow the issue is solved

Gilshultz, thanks for the reply. I found my mistake(s) and should have done a better job with board checkout. The fact that it initially worked as expected surprised me.

I would say FAIL (Forward Action In Life) for most of us that is the best way to learn. If you learn something it changes from a mistook to a learning experience.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.