1
\$\begingroup\$

Since a pre-made I2C C-lib for the SSD1327 does not exist anywhere, I'm trying to create one by hand for the STM32 HAL without much success. It is surprisingly hard to get an OLED-display running on an STM32.

I'm trying to fit the specs in the datasheet to this library by Oliver Van den Eede (couldn't find the original). Of course I understand that the SSD1306 and the SSD1327 are not the same chip.

The datasheet specifies a command table on page 36 which I do not understand: By transmitting 0x15 i can set a column start and end address, but how is this done? Do i have to transmit a command and then some data immediately afterwards? To what do I even set these registers? Chapter 10 explains the concepts in words but fails to provide any concrete numbers, by which I mean that I do get a command to write but not its following content. Where do I start? Is there an alternative documentation?

Running the mentioned library with customized defines can be debugged without problems, the HAL finds the slave-device and sends data, but the display shows nothing. Changes include:

  • Including the right HAL specific to my board (stm32f4xx_hal.h -> stm32u5xx_hal.h)
  • Setting the slave-address to (0x3C << 1)
  • Setting the width to 128 pixels, which is normal for OLEDs with the SSD1327
\$\endgroup\$
3
  • \$\begingroup\$ there's a few Arduino libraries. These are mostly C anyways - that is where I'd be looking. Or simply use the Arduino tools for the STM32 and the problem disappears. At a minimum use Arduino libraries to verify the hardware. If you're hell bent on writing your own code, then read on on how I2C works. That should answer your question. Basically, send a START, ADDR with W,0x15,row,col then STOP. \$\endgroup\$
    – Kartman
    Feb 22, 2022 at 10:52
  • \$\begingroup\$ @Kartman are you sure about this? I tried navigating through the adafruit-libs about this chip and you get lost in inheritances and cpp-lib inclusions \$\endgroup\$ Feb 22, 2022 at 11:32
  • \$\begingroup\$ Regardless of the actual computer language the code is implemented in, the net result has to be the same - the display does not care what the language is. Have you tried PlatformIO and creating an Arduino project for the STM32? \$\endgroup\$
    – Kartman
    Feb 22, 2022 at 11:42

1 Answer 1

1
\$\begingroup\$

Datasheet, page 33:

enter image description here

I think it says you need to send command byte + command parameter byte(s) afterwards if you're in command mode.

Same datasheet, page 26:

enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.