Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

How to program OLED with STM32

Hi, I am trying to program a 0.91" 32x128 oled using SSD1306 library in Arduino IDE, but when I compile the example sketch for STM32 and upload it, nothing comes on the screen. It did not say where SDA and SCL were so I googled which pins they were and connected it to those. I have the I2C version of the OLED btw

Please tag me @RTX 3090 so I can see your reply

Link to post
Share on other sites

https://www.buydisplay.com/white-2-2-inch-128x32-i2c-oled-display-module-serial-spi-ssd1305

 

This thing? Or something similar to it? If it's something else, link the datasheet.

 

Show the circuit you built. I'm in the process of making a PCB for (among other things) controlling this OLED, and here's the circuit I've built (with a lot of help from the datasheet and some friends):

Spoiler

Screenshot_20201029_072030.png.16b5f5a8e0fed77e80a5c5c556d8de03.png

Keep in mind you should also have pullup resistors on SCL and SDA (I have them controller-side) and need at least 20ma of available current for the 12v line (preferably 28ma).

Quote me to see my reply!

SPECS:

CPU: Xeon X5650 OC'd to 4.2GHz @ 1.35V (courtesy of @XR6)Motherboard: Asus Sabertooth X58 RAM: 4x4GB G.Skill DDR3 1866MHz GPU: Asus RX 570 Strix Storage: WD Blue 1TB and a 128GB Kingston UV400 PSU: EVGA 600B Case: Fractal Design Define C Cooling: H100i V2, be quiet! Pure Wings 2 (two intake, two exhausting through radiator) Monitor: 3x Dell P2210 on a Steelcase Eyesite triple monitor stand Mouse: Logitech G403 Prodigy Wireless Keyboard: It changes, but usually Focus FK-9000 Mousepad: Steelseries QcK XL Headphones:  Sennheiser HD598SE

 

 

 

 

i use arch btw

Link to post
Share on other sites
1 hour ago, Anonymous015 said:

Hi, I am trying to program a 0.91" 32x128 oled using SSD1306 library in Arduino IDE, but when I compile the example sketch for STM32 and upload it, nothing comes on the screen. It did not say where SDA and SCL were so I googled which pins they were and connected it to those. I have the I2C version of the OLED btw

For one, you're not specifying which STM32 MCU you are using: there are hundreds of different STM32 MCUs and they don't all have the same pinout. Secondly, are you sure you are using the right I2C-address? If you are using one of those premade OLED-modules, there's typically solder-pads to choose the address with; writing to the wrong address will obviously not display anything on the display.

Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to post
Share on other sites
6 hours ago, Anonymous015 said:

Hi, I am trying to program a 0.91" 32x128 oled using SSD1306 library in Arduino IDE, but when I compile the example sketch for STM32 and upload it, nothing comes on the screen. It did not say where SDA and SCL were so I googled which pins they were and connected it to those. I have the I2C version of the OLED btw

A common, frustrating, issue is the i2c address. the back of the OLED should have two hexadecimal digits on either side of a resistor. The resistor can be moved around to change the address (if you want to have two independent screens on the same bus or you have another device with a conflicting address). IIRC, the Adafruit library default address is incorrect for the common SSD1306 we all buy from Aliexpress. Try changing the address in your code to the address on the back of your screen closest to the selection resistor.

 

Also it's possible something is wrong with your code so you should post that too.

ASU

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×