This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

USCI SPI send 16-bit command

Other Parts Discussed in Thread: MSP430WARE

Pardon the newbie question.. I'm trying to send out a 16-bit SPI command via the USCI via two 8-bit writes, but the slave device keeps telling me it didn't get 16 bits of data.  I'm sure I'm doing something wrong.. my code:

SetSPISlaveSelect(DevAddr); // Chip Select off
USCI_A_SPI_transmitData(SPI_BASE, *(pBuf));
while(USCI_A_SPI_isBusy(SPI_BASE))
	;
pDummy[0] = USCI_A_SPI_receiveData(SPI_BASE);
USCI_A_SPI_transmitData(SPI_BASE, *(pBuf+1));
while(USCI_A_SPI_isBusy(SPI_BASE))
	;
pDummy[1] = USCI_A_SPI_receiveData(SPI_BASE);
SetSPISlaveSelect(SPI_SLAVE_NONE); // Chip Select OFF
nFoo = (pDummy[0] << 8) | pDummy[1];

.. I can see a brief burst on my scope, but the scope is super-cheap and I can't see the individual pulses.  The USCI is in 8-bit mode so it's not just sending out 14 bits.

Am I doing something wrong here?

All help appreciated!

Ed Averill

 

**Attention** This is a public forum