SPI at 24Mhz not work.


Changing the line 45

#define SPI_MIN_CLOCK_DIVIDER (uint8_t)(1 + ((F_CPU - 1) / 24000000))

SPI, really work at 24Mhz.
Verified with the oscilloscope.

The signals are also very beautiful.

But the dialogue does not work, the devices do not work.
The TFT and the SD card

There may be another problem SD in the library?


That looks like Mode 2 or 3 with SPI clock = 1 when not active.
Maybe you need Mode 0, or 1, with SPI clock = 0 when not active.

But i only have changed the Speed, not the mode.
At 12Mhz work, at 24Mhz not work.

My doubt is on the Arduino libraries.

Could be a device problem then. I've only used SPI at 8 MHz with SD card, never tried a TFT. Check their datasheets.

RAIO RA8876M declare 50Mhz on datasheet.

And SD card, using SdFat libray and the command
sd.begin(12, SD_SCK_MHZ(24) );