-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSD1309 128x64 with STM32F103C8 #2558
Comments
I have checked the signals to the display using a logic analyzer. I am sending the following every second:
And measure the following with the logic analyzer: I noticed straight away the DC (data command) line remains low the entire time. It seems u8g2 is not controlling the DC line as it should. I have implemented the DC item into the GPIO & delay callback as follows:
I am able to toggle the DC pin myself using the following in the main loop, and verify on the logic analyzer: Can anyone help? |
I have used a breakpoint to confirm the gpio_and_delay callback function does get called in general (eg by u8x8_d_helper_display_init()) I think I have pretty well confirmed it is a configuration problem with u8g2, but don't know where to start looking to resolve it. |
I have found a workaround that gets the display working correctly:
I found using printf there that u8g2 sends 3 single bytes (commands), followed by 128 bytes (data). However this doesn't really seem to be the correct way to do things |
Turns out I was missing the set DC handler in the byte callback function. |
Thanks for your posts. Always helpful to learn from such porting activities :-) |
I'm attempting to use an STM32F103C8 (mounted on my own custom PCB) with an aliexpress 2.42" SSD1309 128x64 SPI OLED (https://www.aliexpress.com/item/1005007602340232.html).
I think I have got everything setup and working correctly, and the display lights up and works, but whenever I try and draw anything
on the display, all I get is what seems like random pixels.
I am using STM32Cube framework in Platformio / VScode. I am starting with pre-generated code from STM32CubeMX.
I am using hardware SPI1, configured as transmit only master, MSB first, CPOL (polarity) low, CPHA 1 edge, 4.5MBits/s
Here are the callback functions I am using:
The seemingly random pixels are always just about the same whenever I reset the device. If I change what I'm drawing I get a different set of seemingly random pixels.
I have tried both "u8g2_Setup_ssd1309_128x64_noname0_f" and "u8g2_Setup_ssd1309_128x64_noname2_f" with the same result for both.
Does anyone have any clues where to start looking? I have tried everything I can think of.
The only thing I can think is the display SCK / MOSI lines should be 5v logic, and I am using 3.3v logic directly from the STM32. However everything I can find online says that should be correct, and the display is designed for 3.3v signals (although it is powered from 5v).
The text was updated successfully, but these errors were encountered: