Adafruit_ILI9341 problems with HW SPI - SERCOM on M0

Hello,

i’ve connected my ILI9341 Display direct to my M0 board.
DC → A1
CS → A4
MOSI → 10 / SERCOM1 PAD2
MISO → 11 / SERCOM1 PAD0
CLK → 12 / SERCOM1 PAD3
RST → 9

so this is my Define:
#define TFT_DC A1
#define TFT_CS A4
#define TFT_MOSI 10
#define TFT_CLK 12
#define TFT_RST 9
#define TFT_MISO 11

Then i tryed the Example “graphicstest” out of the Library.
First i changed to SW SPI and it worked:
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);

Then i Change to HW Sercom SPI with following call (and add SPI.h, wiring_private.h):
SPIClass SPILCD (&sercom1, 11, 12, 10, SPI_PAD_2_SCK_3, SERCOM_RX_PAD_0);
Adafruit_ILI9341 tft = Adafruit_ILI9341(&SPILCD, TFT_DC, TFT_CS, TFT_RST);

and in the Setup() after tft.begin(); i add this:
pinPeripheral(10, PIO_SERCOM);
pinPeripheral(11, PIO_SERCOM);
pinPeripheral(12, PIO_SERCOM);

I also tried to decrese the HW SPI Speed from 10MHz to 1MHz - also to compare the measurements.
Everytime the Screen stays White.

So, now some words about my measurements. I use a Zeroplus Logic Cube with 100MHz Setting.
With SW SPI i get 4 Bytes in one SS Cycle, with HW SPI i only get 2 Bytes.
Whats here wrong? Do i Need to set the SPI in an different mode?

Thanks in advice
rspecht

The Zero or M0 Pro default SPI is on the 3x2 SPI header. Adafruit_ILI9341 will work out of the box on the SPI header. (as will SSD1306, ST7735, ... and any other Adafruit SPI library)

Although you can set up the SERCOM as an SPI on digital 10-13 pins, the Arduino Core does not support it.

David.

But why talks lady ada here about the sercom? Muxing it up | Using ATSAMD21 SERCOM for more SPI, I2C and Serial ports | Adafruit Learning System