HI, I'm using an OLED display and it's working fine with a nano 33 IoT. But with an RP2040, it doesn't: the display stays blank. The OLED display has four data pins, a reset pin, GND and Vcc.
Code snippet:
#include <U8g2lib.h> // OLED library, see https://github.com/olikraus/u8g2
#define U8LOG_WIDTH 16 // 16 characters wide
#define U8LOG_HEIGHT 8 // 8 lines
constexpr int VMA437_OLED_CS_PIN{ 16 }; // OLED chip select pin
constexpr int VMA437_OLED_DC_PIN{ 17 }; // OLED data pin
constexpr int VMA437_OLED_CLK_PIN{ 20 }; // OLED clock pin
constexpr int VMA437_OLED_MOSI_PIN{ 21 }; // OLED MOSI pin
U8X8_SH1106_128X64_NONAME_4W_SW_SPI u8x8_spi(VMA437_OLED_CLK_PIN, VMA437_OLED_MOSI_PIN, VMA437_OLED_CS_PIN, VMA437_OLED_DC_PIN); // SW SPI
U8X8LOG u8x8log_spi; // create U8x8LOG object
uint8_t u8log_buffer_spi[U8LOG_WIDTH * U8LOG_HEIGHT]; // allocate display memory
void setup() {
Serial.begin(115200);
delay(5000);
// initialize OLED displays and set as Justina output stream
// ---------------------------------------------------------
u8x8_spi.begin();
u8x8_spi.setFont(u8x8_font_8x13_1x2_f);
u8x8log_spi.begin(u8x8_spi, U8LOG_WIDTH, U8LOG_HEIGHT, u8log_buffer_spi)
u8x8log_spi.setRedrawMode(0);
u8x8log_spi.println("OLED(SW SPI) OK");
...
}
The pinout of both processor is the same, as far as the needed pins are concerned.
But with the RP2040, I notice that MOSI and CLOCK do not emit anything (I measure 3.3 Volt) but the RESET pin emits a waveform, even when not printing anything to the OLED.
What could be the problem ? Many thanks for helping to solve this mystery.