SPI on Arduino Zero? #1655
-
I'm trying to find a solution to setting SPI #define's for the M0+ Arduino Zero? They seem to be set in HW within the SPI Lib and are not # definable as such. In the case of the Std Zero the SPI is on the ICSP port (PortB) Cheers |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Assuming it is this board, pinout here: |
Beta Was this translation helpful? Give feedback.
-
I have found the answer :) Sets the #defines for the existing hw SPI on the ICSP header Pity they didn't publish that in the Zero tech specs Long version Quite a read, however there are solutions to set the SPI to other available pins Eg 11, 12, 13 and indeed other comms can be re tasked as required if available. Bit of mucking about needed. Cheers |
Beta Was this translation helpful? Give feedback.
I have found the answer :)
Long read....
Short version
#define TFT_SCLK 24
#define TFT_MISO 22
#define TFT_MOSI 23
Sets the #defines for the existing hw SPI on the ICSP header
So it now works with TFT_eSPI
Pity they didn't publish that in the Zero tech specs
Long version
See:
https://learn.adafruit.com/using-atsamd21-sercom-to-add-more-spi-i2c-serial-ports?view=all
Quite a read, however there are solutions to set the SPI to other available pins Eg 11, 12, 13 and indeed other comms can be re tasked as required if available. Bit of mucking about needed.
Cheers
MrGreg