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?