Post Go back to editing

AD5142 - SPI modes not consistent


I have some weird behavior while talking to the AD5142 digital pot. I initialize the system (ATMEGA128) with CPHA=1 and CPOL=0, since a temperature sensor needs the CPHA activated and the AD5142 then needs CPOL=0 as per the datasheet.

However the Pot. then is ignoring any commands. If I set the SPI port to CPHA=0 and CPOL=1 the pot seems to be working fine, however my other device won't work. If I now go ahead and set CPHA=1 and CPOL=1 (supposedly it should work according to the datasheet of the AD5142), then both of my devices work. This really threw me off and took me quite some time to figure out.

I someone has an idea why this work, I would love to know that I am not doing anything wrong.

I have a 2nd AD5142 in my circuit. That one only works in CPHA=0 and CPOL=1 mode and cannot be set in the same mode as the first AD5142.

Does anyone have an idea of what's going on here as I am getting closer to my final revision.

Parents Reply Children
No Data