Hi I am trying to send data to a digital pot over spi, but for some reason it is not working.
Here is the code:
#include <msp430.h>
void main(void)
{
volatile unsigned int i;
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P1OUT = 0;
P1DIR |= 0x02;
P1OUT |= 0X02;
P1SEL |= 18; //Selects SPI pins
USICTL0 |= USIPE7 + USIPE6 + USIPE5 + USIMST + USIOE; // Port, SPI master
USICKCTL = USIDIV_4 + USISSEL_2; // /4 SMCLK
USICNT |= USI16B; // init-load counter
USICTL0 &= ~USISWRST; // USI released for operation
P1OUT &= ~0x02; //Set Chip Select for Digital Potentiometer
USISR = 0x1148;
USICNT |= 16;
for (i = 0xFF; i > 0; i--); //Delay
P1OUT |= 0x02;
while(1);
}
It's pretty straight forward.