SPI (Serial Peripheral Interface)

Thread Starter

mchabib

Joined Jul 20, 2010
5
HI everyone,

I want to transfer a byte from one microcontroller to another using SPI,
i just want to know if the transmitted byte is reversed in the other microcontroller.
 

Thread Starter

mchabib

Joined Jul 20, 2010
5
i'm using a pic18f2331 to transfer data to dspic30f6010, but in the pic18f2331 datasheet : "The SSP consists of a transmit/receive Shift Register (SSPSR) and a buffer register (SSPBUF).The SSPSR shifts the data in and out of the device, MSb first. The SSPBUF holds the data that was written to the SSPSR, until the received data is ready."

in the dspic datasheet: " Data is transmitted out of bit 7 of the SPIxSR for 8-bit operation while it is transmitted and out of bit 15 of the SPIxSR for 16-bit operation. In both modes, data is shifted into bit ‘0’ of the SPIxSR."

Does this mean that the data will be received in the dspic in a reversed way than it is in the pic?
I didn't understand it completely, and it's the only information that i could find concerning transmission, and i read the link you sent me
thank you for your help

 

Papabravo

Joined Feb 24, 2006
21,225
In the usual case SPI data is transmitted MSB first and enters the destination shift register at the LSB. After 8 clocks that original bit is now in the MSB. Same for the data on the reverse path. Some SPI hardware allows you to choose which bit goes first on the wire.
 
Top