I’m trying to get the qwiic OLED display (128x64) working with the qwiic pro mini. I’ve loaded the example program from the qwiic OLED hookup guide, but the display correctly shows about 1/3 of the left side correctly, the rest of the display is random pixel junk. Using a redboard the same code works correctly with the display. So what is the problem with the qwiic pro mini that can’t run the display?
Do you have ESP32 Dev Module selected when uploading? Arduino Example - SparkFun ESP32 Qwiic Pro Mini Hookup Guide
That board is a little funky, you need to hold GP0 button when uploading
Have you hit reset after upload? Does blink work normally?
Also just to be sure, it is the Pro Mini and not Pro Micro, right? Are you using a qwiic cable?
If all of the above checks out, it might be an issue with how the ESP32 parses the buffer…you can try editing the code to increase its size by adding the line noted below in the setup:
#include <Wire.h>
#include <SparkFun_Qwiic_OLED.h>
QwiicMicroOLED myOLED;
void setup() {
Wire.setBufferSize(256); // ← Must be before Wire.begin()
Wire.begin();
myOLED.begin();
//
}
Finally: it might be worth lowering the wire speed to 100k; alter that line from 400000 to the below (only if none of the above worked!)
Wire.setClock(100000);
I’m using the SparkFun Qwiic Pro Micro - USB-C, SKU: DEV-15795
I’m confused by your reference to the ESP32, this board has an ATmega32U4. Yes I’m using a qwiic cable.
I will try the code changes you suggested and see if that helps, thanks.
That’s because we sell a product that matches the title of the thread; Mini (esp32) vs Micro (ATmega32)
The code changes will be different, instead edit as follows:
You can’t use Wire.setBufferSize() suggested above — must edit Wire.h directly
The AVR Wire library has no runtime API to change the buffer. You have to edit the core library file:
<Arduino install>/hardware/arduino/avr/libraries/Wire/src/Wire.h
Change:
#define BUFFER_LENGTH 32
To:
#define BUFFER_LENGTH 150
Hi @dksmall99 ,
I suspect you are running out of RAM. The OLED library allocates 1024 bytes to store the pixels…
I hope this helps,
Paul
I made the change to the header file, but no change. I suspect I’ll have to get a different processor, thanks for looking into it.
Looking at the compiler output I have the following for the Pro Micro board
Sketch uses 15418 bytes (53%) of program storage space. Maximum is 28672 bytes.
Global variables use 1794 bytes (70%) of dynamic memory, leaving 766 bytes for local variables. Maximum is 2560 bytes.
For the RedBoard, which works I get the following:
Sketch uses 12430 bytes (38%) of program storage space. Maximum is 32256 bytes.
Global variables use 1656 bytes (80%) of dynamic memory, leaving 392 bytes for local variables. Maximum is 2048 bytes.
Low memory available, stability problems may occur.
Assuming that 1024 byte for the display is included with those values, then RAM isn’t the issue.
