Glitchy clock when using HSPI?
Posted: Sat Jan 23, 2021 2:02 pm
I'm trying to talk to an SD card. I'm using bare-metal programming, not using one of the SDKs. While I've managed to figure out how to set up HSPI to send bytes, the output SCLK signal is incredibly glitchy. See this logic analyser screenshot:
From top to bottom, that's CS, MOSI, SCLK, MISO. You can see that SCLK is displayed as grey blocks, because it's actually oscillating from on to off and back again at about 4MHz. SCLK itself is at about its minimum setting of about 100Hz.
Clearly the HSPI module is mostly working, but I really don't understand what's going on here. I'm using a grey-market D-Duino clone, similar to one of these: https://github.com/lspoplove/D-duino The screen's connected via GPIO4 and 5, so that shouldn't be a factor. Could there simply be something wrong with it? Or have I missed something obvious with the setup? I get the same noise regardless of whether the SD card is attached or not, so the problems not at that end.
Any ideas?
From top to bottom, that's CS, MOSI, SCLK, MISO. You can see that SCLK is displayed as grey blocks, because it's actually oscillating from on to off and back again at about 4MHz. SCLK itself is at about its minimum setting of about 100Hz.
Clearly the HSPI module is mostly working, but I really don't understand what's going on here. I'm using a grey-market D-Duino clone, similar to one of these: https://github.com/lspoplove/D-duino The screen's connected via GPIO4 and 5, so that shouldn't be a factor. Could there simply be something wrong with it? Or have I missed something obvious with the setup? I get the same noise regardless of whether the SD card is attached or not, so the problems not at that end.
Any ideas?