I am currently doing a school project to use a MAX 5487 as a digital potentiometer. However, changing the SPI transfer value doesn't change the wiper resistance value at all despite trying both writing to wiper and writing to the NV registers. Is there anything wrong with my code or is the MAX chip not connected properly as the end to end resistance is not the rated value of 10k ohms when I turn it on? Any help is greatly appreciated.
The code is as follows:
Not far ago I had a problem with max1300 (16 bit ADC).
Maybe there is an issue specific to all (or many) MAX ICs.
Check how I resolved my problem below (maybe it will help you as well)
What do you mean by adding 1 line after command transit though? I have already 1 line after the command transmit as you mentioned, or do I specifically add an SPI.transfer(0); ?
Yes it is. You only drive ssPin low when you are communicating with the MAX5487. That's why I queried your choice of driving it low in setup().
If your MAX5487 powers up in an oddball state, then the change in state of the /CS line resets the SPI interface inside the chip to a known state ready to accept data.
In my opinion, the way you have it in your sketch, the first message you send to the MAX5487 may not succeed as /CS is already low at the start of the data.
EDIT: Looking at the MAX5487 datasheet, I think you may need to use SPI mode 3.