SPI Display with the Submodule

Hi!

We have a Daisy Seed controlling a display (TFT LCD with an ST7789 chip) using SPI. That works flawlessly with this C++ code:


#include "daisy_seed.h"

#include "daisysp.h"

// ...

static DaisySeed hw;

static SpiHandle spiHandle;

static GPIO tftCS, dc, reset, backlight;

// ...

int main() {

hw.Init();

hw.StartAudio(AudioCallback);

SpiHandle::Config spiConf;

spiConf.periph = SpiHandle::Config::Peripheral::SPI_1;

spiConf.mode = SpiHandle::Config::Mode::MASTER;

spiConf.direction = SpiHandle::Config::Direction::TWO_LINES_TX_ONLY;

spiConf.nss = SpiHandle::Config::NSS::SOFT;

spiConf.pin_config.sclk = seed::D8;

spiConf.pin_config.mosi = seed::D10;

spiConf.baud_prescaler = SpiHandle::Config::BaudPrescaler::PS_2;

spiConf.datasize = 8;

tftCS.Init(daisy::seed::D7, GPIO::Mode::OUTPUT);

dc.Init(daisy::seed::D1, GPIO::Mode::OUTPUT);

reset.Init(daisy::seed::D2, GPIO::Mode::OUTPUT);

backlight.Init(daisy::seed::D3, GPIO::Mode::OUTPUT);

spiHandle.Init(spiConf);

tftCS.Write(true);

backlight.Write(true);

// ...

}

Now we are trying to do the same thing with a Submodule. We wired it up, tried the following code, but when we connect it to USB or Eurorack power, the screen goes black after a short moment.


#include "daisy_patch_sm.h"

#include "daisysp.h"

// ...

static DaisyPatchSM hw;

static SpiHandle spiHandle;

static GPIO tftCS, dc, reset, backlight;

// ...

int main() {

hw.Init();

hw.StartAudio(AudioCallback);

SpiHandle::Config spiConf;

spiConf.periph = SpiHandle::Config::Peripheral::SPI_1;

spiConf.mode = SpiHandle::Config::Mode::MASTER;

spiConf.direction = SpiHandle::Config::Direction::TWO_LINES_TX_ONLY;

spiConf.nss = SpiHandle::Config::NSS::SOFT;

spiConf.pin_config.sclk = daisy::patch_sm::DaisyPatchSM::D10;

spiConf.pin_config.mosi = daisy::patch_sm::DaisyPatchSM::D9;

spiConf.baud_prescaler = SpiHandle::Config::BaudPrescaler::PS_2;

spiConf.datasize = 8;

tftCS.Init(daisy::patch_sm::DaisyPatchSM::D1, GPIO::Mode::OUTPUT);

dc.Init(daisy::patch_sm::DaisyPatchSM::D8, GPIO::Mode::OUTPUT);

reset.Init(daisy::patch_sm::DaisyPatchSM::D7, GPIO::Mode::OUTPUT);

backlight.Init(daisy::patch_sm::DaisyPatchSM::D6, GPIO::Mode::OUTPUT);

spiHandle.Init(spiConf);

tftCS.Write(true);

backlight.Write(true);

// ...

}

I noticed that when I unplug the backlight wire, the screen goes white again.

Does anyone have an idea what we could be missing here?

Update: I think it crashes at spiHandle.Init(spiConf). When I put hw.SetLed(true); before it, the LED goes on, when I put it after it, it doesn’t.

Anyone any idea?

Update 2: I figured out I have to use SPI_2 instead. It doesn’t crash anymore, but nothing shows up on the screen.

When I compare the signals for every pin on the display for the Seed and the Submodule, I noticed that the signal on the MOSI / SDA pins seem different: for the Submodule it doesn’t quite go to 0.


Could this be the issue?

On the Submodule pinout it says that pin D9 also can be used as ADC_11. Could this have to do with it?

… it was just a broken Submodule.