I am using MightyCore and platformio. My config file looks like this

My fuses are set as:


I have controller running at 16 MHz and SCK frequency is 8 MHz. My display is showing white color and that is it. I know to make it function properly I have to use 1 MHz SPI clocking. If I program CKDIV8 fuse my controller doesn't start. I dunno why, kind of black magic going on there for me. My lack of knowledge is not helpful there.

I tried to use the following tricks:

Setting SPI speed using TFT library

// earlier in main.cpp
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
// later in setup()
tft.setSPISpeed(1000000); // has no effect on SCK

Trying to set it directly via SPI class instance:

// in setup()
SPI.setClockDivider(SPI_CLOCK_DIV128); // no effect

Or statically:

// in setup()
SPIClass::setClockDivider(SPI_CLOCK_DIV128); // still no effect

Also I tried to pass DEFAULT_SPI_FREQ build flag with frequency preset.

I ran out of ideas.

Schematic is here: Schematic

  • 1
    is setSPISpeed after init?
    – Juraj
    Dec 20, 2020 at 6:50
  • "If I program CKDIV8 fuse my controller doesn't start." How are you determining this?
    – timemage
    Dec 20, 2020 at 14:07
  • @Juraj no. It was before. I placed it after and it works now.
    – zoonman
    Dec 20, 2020 at 20:43
  • @timemage I have some pin manipulations later in setup() and they aren't happening.
    – zoonman
    Dec 20, 2020 at 20:44
  • why would you place it before? init initializes SPI and then of course sets the default value.
    – Juraj
    Dec 21, 2020 at 5:52

1 Answer 1


Per this issue setSPISpeed has to be made after initR like this:

  • init initializes SPI and of course sets the default value. you can change it only after that
    – Juraj
    Dec 21, 2020 at 5:53
  • @Juraj I have no idea what was going on in Adafruit engineers head. The display fails to init @ 8 MHz because SPI is too fast for it. It has to be initialized at 1 MHz then it supposed to function properly.
    – zoonman
    Dec 23, 2020 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.