canooski 0 Posted November 13, 2015 Share Posted November 13, 2015 I have a Dig Pot the TPL0501 by Texas Instruments that I am trying to control with a micro controller. Link Here: http://www.ti.com/lit/ds/slis136a/slis136a.pdf I have been able to successfully control this with my CC3200 and the output signals look like Photo 1 attatched. I have since decided I want to do this with my MSP432 but I am not able to get it to work. The same code should work for each I assume. The output signals I am getting for the MSP432 are shown in photo 2. I have tried changing the mode but nothing seems to help. Any ideas? My code is listed below: #include <SPI.h> const int SS = 18; uint8_t value = 150; void setup() { pinMode(SS, OUTPUT); SPI.begin(); digitalWrite(SS, HIGH); SPI.setBitOrder(MSBFIRST); SPI.setDataMode(SPI_MODE3); SPI.setClockDivider(SPI_CLOCK_DIV32); } void loop() { digitalPotWrite(value); delay(100); } int digitalPotWrite(int x) { digitalWrite(SS, LOW); SPI.transfer(x); digitalWrite(SS, HIGH); } Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.