SPI Behaviour Differences Arduino Mega Due

Hi .. I have been moving an application from the Arduino Mega platform to the Due such that I can avoid the use of a 5V/3.3V conversion requirement which can delay SPI I/O transmissions.
Having set up the Due and having looked at the data transfer, it appears that there is a 1-bit offset between the implementation of the SPI protocol. As such the application continues to work with the Mega but not with the Due.
Has anyone noticed this, and might there be a workaround?
Any suggestions are most welcomed. Thanks

What data item do you want to transfer from DUE-1 (the Master) to DUE-2 (the Slave)?

I am transferring data bi-directionally in bytes
Settings are
MSBFIRST
SPI_MODE0
with SPI clock at 2MHz

although I tried using all the different combinations of clock/phase settings also to see if this helped

... also transfer is not to another Arduino but to an application using an FPGA

I have used the DUE extensivly with SPI devices; LoRa RF, TFT displays, SD cards. Using one at the moment in fact.

Never had a problem.

The issue is that the Mega and the Due appear to behave differently such that there is a 1 clock cycle difference in the data transfer - ie a 1-bit lag. I am trying to determine why I am seeing this.

I also use ATMega328Ps a lot, no problems with them either.

You would assume the SPI library for that Atmel processor is the same as that for the ATMega.

Perhaps you could identify the applications and devices you are using on the DUE that you are having problems with ?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.