Go Down

Topic: initialize multiple i2c slaves with the same address (Read 2903 times) previous topic - next topic


I want to use 4 quad dacs on 1 i2c bus. The quad dacs are MCP4728 with programmable i2c addresses (http://ww1.microchip.com/downloads/en/DeviceDoc/22187a.pdf)
Is it possible to start with equal addresses on 1 bus and then programm the address of each slave by using a separate LDAC pin, 4 pins, 1 for each dac? Or is it impossible to use the i2c bus with multiple slave with the same address (all slaves will acknowledge on the same time)?


The chips are all initially programmed with the same address having the low order three bits set to 000 in their EEPROM.
You would have to put them on the I2C bus one at a time, program a unique low-order address into the EEPROM for each of them. Then you can use use them all at the same time on the I2C bus.

Don't send me technical questions via Private Message.


What happens if you put the chips on the I2C bus with the same address? Is it impossible to write the addresses one by one for this case?


It is impossible to use more than one device with the same I2C address. I do not know what will go wrong, that depends on the hardware of the chip, but it will go wrong.

I have been reading the datasheet about the LDAC pin. They say that it can be used, but it is not clear to me how it can be used to set the address in EEPROM with a few chips on the same I2C bus.


Sep 04, 2013, 09:53 pm Last Edit: Sep 04, 2013, 10:32 pm by Oldchatterman Reason: 1
Look at figure 5-11 in the datasheet. I know the current address (which is 000 for unprogrammed dac's), so the master can send these bytes. The address changes only for the device where the ldac pin makes a transition from high to low during the negative pulse of the 8th clock of the 2nd byte, which is also controlled by the master. I don't know if the acknowledge bits will interfere with the stream.

I am considering a question to Microchip, but am still looking for the right support channel.


As mentioned in a previous post you need to connect one MCP4728 to the I2C bus one at a time to program the Address.

Also there is a peculiarity that has to do with the LDAC pin and the timing that will make programming difficult. This article will explain details on how to accomplish this http://neuroelec.com/2011/02/soft-i2c-and-programmable-i2c-address/



In my case it must be possible to programm the adresses without the "hassle" of putting jumpers in a certain sequence. I can think of 2 options to eliminate this problem:
1. make it possible to power up the dacs by the MCU
2. use the fixed factory defined address in combination with a multiplexer

Would a 74HC4052 multiplexer be a good solution in this case?


I would try the software described in the link Headroom gave. A multiplexer will probably be just as complicated as trying the software I2C library.
You could use the software I2C library to set the addresses of each device. If the library works, this would be a one-time thing. Then use the regular I2C library (which uses the hardware I2C) for normal use of the chips.

Don't send me technical questions via Private Message.


I tried the software from the link, but was not able to change the address. After removing 3 of 4 dacs I was able to send setpoints to the dac, but still no luck in changing the address. The dac listens to address 0, but when I read the address it responds with address 7. I use An atmega328 on a 8 mHz clock and 3v3 supply. The vdd of the dac is 5v. I don't want to debug the specific address changing sequences for this dac.
What i2c multiplexing options would be a good pick?


Another option would be to use a pca9548:

Any advice?

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131