I am using a MSP430G2231 to communicate with a TLC5947 LED driver (24 channel, 12-bit grayscale control). I am using the SPI register in 16-bit mode, and writing 0x0C to the count register (USICNT) to shift out the 12 bits. The issue I am running into is that the first set of bits that I shift out over SPI has an extra bit. There is an extra clock pulse with MOSI held high, even if MOSI was previously low. This only occurs on the first SPI transfer of the program, then SPI functions without error for the remainder of the program. (Below is my code in it's simplest form. Also, this problem occurs without fail, and is observed when the MSP430 is connect only to an oscilloscope)
The TLC5947 will ignore anything past the last 288 bits that it received (they are essentially shifted out the other side of the TLC5947's shift register), so I have been able to run a workaround by sending an extra byte over SPI prior to the body of my program loop, but I would very much like to figure this out as I have other projects in mind that are a little more sensitive to SPI traffic.
WDTCTL = WDTPW + WDTHOLD;
USICTL0 |= USIPE6 + USIPE5 + USIMST + USIOE;
USICTL1 |= USICKPH + USIIE;
USICKCTL = USIDIV_0 + USISSEL_2;
USICNT = USI16B;
USICTL0 &= ~USISWRST;
USISRL |= 0xFFFF;
USICNT = 0x0C; // 13 bits are sent, firs bit is high regardless of USISRL
USISRL |= 0xFFFF;
USICNT = 0x0C; // 12 bits sent, all correct