Can we transmit/receive a 16-bit SPI frame using MSP430G2553 device?

Thread Starter

shauns87

Joined Feb 1, 2016
8
I am trying create a source code which can take an input of 16-bit frame from a C function consisting of the command frame and the data frame and transmit it to a slave device.

MSP430G2553 devices are capable of 7-bit and 8-bit data transfer. Is there a way to implement a 16-bit frame transfer? The slave device is NCV78763 from ONSEMI.

Thanks.
 

Papabravo

Joined Feb 24, 2006
21,228
The definition of SPI does not provide for 16 bit frames. If you have control of both devices, master and slave, you can bit-bang anything you want. If one of the devices is using SPI specific hardware then you must figure out how to send your 16-bit frame as two 8-bit frames.
 

Thread Starter

shauns87

Joined Feb 1, 2016
8
Thanks. I am planning to convert the 16-bit frame into two 8 bit frames and then send it one after another with the CS line low. I will pull up the CS line high once both the 8 bit frames are transmitted. After CS line is high - the data transmitted will be transferred from the buffer to the destination register.
 

Papabravo

Joined Feb 24, 2006
21,228
Thanks. I am planning to convert the 16-bit frame into two 8 bit frames and then send it one after another with the CS line low. I will pull up the CS line high once both the 8 bit frames are transmitted. After CS line is high - the data transmitted will be transferred from the buffer to the destination register.
I think that will work just fine. What data will be coming back with each of the transmitted bytes? Anything useful?
 

MrChips

Joined Oct 2, 2009
30,824
Here is what is received from the slave when the master transmit.

Still referring to the picture, at the same time of the exchange, the device replies on the SDO line either with:

• If the previous command was a write and no SPI error had occurred, a copy of the address and data written; in case of previous SPI error, or at power−on−reset (POR), the response will be frame containing with only the msb equals to one;

• If the precedent command was a read, the response frame summarizes the address used and an overall diagnostic check (copy of the main detected errors, see diagnostic section for details).
 
Top