Using DS3231 RTC with AD5206 Digipots

I'm working on a project that requires digital potentiometers and an RTC. I have the code for each component working (one sketch for the digipots and one sketch for the RTC).

Doc for the digipot is here: AD5204/AD5206 (Rev.G)

However, when I try to fuse them I'm seeing readouts from the RTC that do not change. I suspect that this is due to an address clash, but I haven't been able to find very much info on how to deconflict them.

Unfortunately I can't upload the code as is, so if anyone needs to see it I'll need to sanitize it before uploading.

what host microcontroller are you using and what RTC?
how have you connected the devices to the microcontroller?
if both devices use SPI you need a separate CS (Chip Select) for each device

Based on the title they are using the DS3231 RTC, I2C Based.

Uploading the code would make it much easier to see what may be happening.

missed that! the AD5206 is SPI so there should be no address clash
agreed - code would be useful, e.g. select “Edit>Copy for forum” then select < CODE/ > and paste the code or text where it says “type or paste code here”

Don't be surprised by the lack of sensible assistance until you do.

I figured, TBH. Just wondered if anyone would have any immediate ideas!
I'll see what I can post.

I believe I have figured it out. The DS3231 uses I2C (2 wire) communication, while the AD5206 uses SPI (3 wire) communication. I'm going to try using a DS1302 RTC instead, which uses SPI.

why should that be a problem?

why should that fix the problem?

what host microcontroller are you using?
upload code?

1 Like

Instead of editing your code to sanitize it, simply create a small sketch that demonstrates the problem. You may even spot the issue yourself as you do this.

1 Like

I have one, don't use the RTC or don't use the digipots and you'll save yourself from uploading the code. :wink:

Obviously it's a joke because you know there are no fortune tellers here and without a code or a schematic, there's little you can do.

1 Like

I don't think you have figured anything out, and buying a new clock module may not fix it. You are already (apparently) aware that the RTC and the AD5206 are riding on completely different buses, so you may now conclude that that there is nothing to suggest that one has anything to do with the other.

You are correct. The tutorials I was using for the DS3231 had it plugged into A4 and A5. I came across a tutorial that had them plugged into the SDA and SCL pins (which are unmarked on the Uno R3 clone that I'm prototyping with). No changes were needed in the code to get it working.

I haven't used I2C very much, mainly SPI so this has been a bit of a learning curve for me, haha!

The SDA and SCL pins are the same as A4 and A5; they are just connected in parallel.
In fact, they are the same pins on the microcontroller, as they perform both functions.
If connecting the SDA and SCL pins works well, then connecting A4 and A5 will necessarily work well too.

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