SPI Reading issue at MISO in Arduino due

Hello everybody,

Am using Arduino Due for my application. Am using SPI communication. To make it simple, my application want to send byte of data from MOSI through series of shift registers and to receive the same in MISO.
So when i send a byte in MOSI, then i will receive the byte stored in the last register in MISO. consider SR3 is the last register whose output is connected to MISO and SR2 last before register whose output is connected to input of SR3. It has SR2:10000011 and SR3:10000001. So if i send a byte from MOSI, then i should get 10000001 at MISO, but i get 11000000. The 1 in MSB is coming from last bit of SR2. I think SPI is sampling data in falling edge instead of in rising edge. i have tried in all possible SPI modes,changing clock polarity and clock phase ,to sample in rising edge, but nothing works out.

Am using SPI library which came from Arduino IDE.

For setting SPI : SPI.beginTransaction(SPISettings(500000, LSBFIRST, SPI_MODE0));

For transferring data: incomingbyte = SPI.transfer(0x00);

i have attached application overview and signal image.

could anyone help me out to solve this problem.

ParthibanV:
So when i send a byte in MOSI, then i will receive the byte stored in the last register in MISO.

You need to post a link to the datasheet that describes how the SPI system you are communicating with works.

My guess is that the Arduino SPI system is working as intended.

...R

Thanks Robin.

i found out the issue. SPI is starting sampling at Second leading edge instead from first leading edge.
For Clock phase-leading edge and clock polarity 0, is there any way to make SPI module to start sampling the data from first clock at MISO?

Could anyone help me regarding this.

I had a similar issue. DUE SPI MISO shifting bits. I was using a manual SS and doing an SPI.begin();
I fixed the issue by using SPI.begin(10);
IDE 1.6.11, SAM firmware 1.6.9