Jump to content
43oh

UTDesign

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. Something like this? The data sheet says that the digipot is write only: 8bit - MSBFirst - CS~ low to enable write - 24MHZ max clock That would be SPI_MODE1 as I understand it, right? And divide by 4 should reduce the 80MHZ CC3200 clock to a 20MHZ which is below the digipot max. #include <SPI.h> const int SS = 8; uint8_t value; void setup() { pinMode(SS, OUTPUT); digitalWrite(SS, HIGH); SPI.setBitOrder(MSBFIRST); SPI.setDataMode(SPI_MODE1); SPI.setClockDivider(SPI_CLOCK_DIV4); SPI.begin(); delay(100); } void loop() { for(value = 0; valu
  2. Hello all, I'm having trouble getting my digital pot to respond to the CC3200. Could someone please take a look at my code and let me know where I'm going wrong? Thanks. DataSheet for the digital pot; http://www.ti.com/product/tpl0501-100 #include <SPI.h> const int SS = 8; uint8_t value; int volts = 0; void setup() { Serial.begin(9600); pinMode(SS, OUTPUT); SPI.begin(); delay(100); } void loop() { for(value = 0; value < 256; value += 20) { digitalWrite(SS, LOW); delay(10); SPI.transfer(value); delay(10); digitalWrite(SS, HIGH); delay(100); } }
×
×
  • Create New...