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.