Hi, I am pretty much a beginner with MSP430 coding and would like some advice (both general or specific would be appreciated) about my coding project. I want to program this digital potentiometer http://datasheet.octopart.com/MAX5386LATE%2B-Maxim-datasheet-8528562.pdf (read only pages 8 and 9- shouldn't be hard) using my MSP430g2231.
So basically I need to enable writing by driving CS to low, connect the MSP430 clock signal to the CLK pin of the digital potentiometer, write in 9 bits to the DIN pin and then drive CS back to high.
However, for my project I want to change the resistance every...say, 30 seconds and do so periodically. For example I want to start it at 3 ohms then go to 30 ohms then 300 ohms then 3 kOhms and then back to 3 Ohms and all over again.
1) So should I just have a main loop and then use an interrupt timer that counts up and resets once it hits the end of the 4th resistance segment?
2) How do I program the MSP430 so I can access the external microcrystal controlled clock signal (I soldered it on already)? By access I mean have it output from one of the pins so I can connect it to the digital potentiometer?
3) Any other concerns or things I should keep in mind?
All advice is welcome,
Thanks!!