Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Main problem: SPI is mode0 not mode3. Also, Artemis @7MHz is actually 7.125MHz.
These changes make ICM examples in SPI mode correctly operate on Artemis. I tested the changes against Artemis and Uno and both work well. I can test other platforms as needed. Let me know what platform you did your SPI testing on.
Here is the pertinent datasheet section:
Here are the SPI modes:
Here is how Logic describes the modes:
To match datasheet, CPHA must be 0 (mode 0 or 2). It is not clear from the datasheet what CPOL needs to be but mode 3 (CPHA = 1) causes the Artemis to check the data on the falling edge of the clock which causes comm to fail.
Artemis running at 7.1xx MHz instead of 7MHz (causes comm to fail):