Im using stm32 bluepill im trying to use OLED 128x32 i have tried libraries but nothing is working,same OLED worked with Adruino Mega.
If anyone knows what might be the issue please let me know[SOLVED]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-27 4:34 AM
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-28 5:49 AM
Hello, I had the same problem. While debugging i found that device was not getting initialized because I2C status flag was stuck on "BUSY" and i couldn't found why.
Temporary solution is to use STM32 Cube IDE instead of Cube MX. Everything worked fine for me in CubeIDE.
Also, if i copy-paste i2c.c and i2c.h file from Cube IDE folder to Cube MX folder, then Cube MX also works properly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-27 4:54 AM
You probably have an error.
hth
KnarfB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-27 6:14 AM
I've tried many many libraries but no luck. The screen remains blank. No response.
But the same screen works with arduino. So i know connections are fine, only problem with coding.
Here are the libraries that I've tried
- https://github.com/vookimedlo/stm32-ssd1306
- https://github.com/GolinskiyKonstantin/STM32_Lib_OLED_SSD1306_I2C_SPI
- https://www.youtube.com/watch?v=ruDyTsmVls4
- https://www.youtube.com/watch?v=Mt6U30Yxrr8
I've also tried changing the address from 0x78 to 0x77 and 0x3C but no luck.
I do not get error in any of them but the screen remains blank.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-27 6:29 AM
Hello,
Do you have pull-up resistors on the I²C lines ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-27 6:31 AM
No i have connected them directly, i will try using pull up resistor and let you know
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-27 7:50 AM
Hello @Mike_ST​ i tried with pull-up resistors 4.7k but still no response from oled display.
It works fine in all the videos on youtube even without pull-up resistor.
Can you suggest any other trouble shoot?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-27 8:21 AM
>It works fine in all the videos on youtube even without pull-up resistor.
In theory, I²C lines needs pull-up resistors, whatever the videos are showing.
They might have used internal pull-up resistors, but in some cases this is not enough.
> Can you suggest any other trouble shoot?
Check the I²C signal with a scope, and check that it is running at 100KHz.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-27 8:26 AM
>>I've also tried changing the address from 0x78 to 0x77 and 0x3C but no luck.
What address is working on the Arduino?
Typically the ST side wants (addr << 1), where as Arduino wants (addr)
Does the STM32 HAL side I2C code indicate the address was acknowledged, or not?
Any error status reported via the HAL commands?
Show a wiring diagram of the pins you're using, and what connects to what.
Make sure you're properly initializing the pins.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-28 5:49 AM
Hello, I had the same problem. While debugging i found that device was not getting initialized because I2C status flag was stuck on "BUSY" and i couldn't found why.
Temporary solution is to use STM32 Cube IDE instead of Cube MX. Everything worked fine for me in CubeIDE.
Also, if i copy-paste i2c.c and i2c.h file from Cube IDE folder to Cube MX folder, then Cube MX also works properly
