Writing code to control CAT5113 digital potentiometers

Hello. Ive done a bit of searching and can't seem to find an answer. I am trying to understand exactly how to program for these digital potentiometers. Here is a link to the datasheet. www.onsemi.com/pub/Collateral/CAT5113-D.PDF . I've read through the data sheet, but I am still confused on how exactly to program for it. I dont even know what questions to ask really. I am trying to understand the timing diagram I guess. How do I program to go up or down, or to store a position?

From the Arduino, besides power and ground, you need to hook up 3 pins to digital outputs on the Arduino: CS (chip select) INC (increment control) U/D (up/down control)

I'll let the electrical guru's chime in, but I'm pretty sure you'd want a resistor between all three Arduino pins and the pins on the potentiometer.

To increment the slider: 1a. Make sure U/D is pulled HIGH (digitalWrite(UD_PIN, HIGH)) 1b. Make sure INC is pulled HIGH (digitalWrite(INC_PIN, HIGH)) 1c. Make sure CS is pulled HIGH (digitalWrite(CS_PIN, HIGH)) 2. Pull CS LOW (digitalWrite(CS_PIN, LOW)) 3. Wait at least "tCI" (100ns) 4. Pull INC pin LOW (digitalWrite(INC_PIN_LOW))

You have now incremented the value!

To store the result:

  1. Wait at least "tIL" (250ns)
  2. Return INC to HIGH (digitalWrite(INC_PIN, HIGH))
  3. Wait at least "tIC" (1us; I'd probably wait longer :) )
  4. Return CS to HIGH (digitalWrite(CS_PIN, HIGH))

If you don't want to store the value, skip step 6. & 7.

Hope this helps....