olikraus / u8g2

U8glib library for monochrome displays, version 2
Other
4.91k stars 1.02k forks source link

U8g2 library issue with Arduino nano RP2040 processor #2450

Closed Herwig9820 closed 1 week ago

Herwig9820 commented 1 month ago

Hi, could it be that the U8g2 does not support the Arduino nano RP2040 ?

With a nano 33 IoT, the code below works perfectly. But with the RP2040, I notice that MOSI and CLOCK do not emit anything (I measure a constant 3.3 Volt, with a scope) but the RESET pin constantly emits a waveform, as soon as the U8g2 library is initialized. The pinout of both processors is the same, as far as the used pins are concerned. So in my humble opinion the issue is somewhere in the library. Is that a possibility ?

My code snippet:

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);

    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");
... 
}                         

Thanks for looking into this. Herwig Taveirne

olikraus commented 1 month ago

I don't own this device, but there are several issues and discussions regarding this topic. Did you check the issues here in this project?

Herwig9820 commented 1 month ago

I checked them now. Issue 2073 seems to describe a similar problem.

olikraus commented 2 weeks ago

Not sure how to support here, but did you check some of the already closed issues, like this https://github.com/olikraus/u8g2/issues/1928 or this https://github.com/olikraus/u8g2/issues/2385 ?

Herwig9820 commented 1 week ago

Hi, I'm not going to invest more time in it. Switched back to a nano ESP32 - and your library works perfectly. I'm closing the issue now.