Elastic Notes: STM32 + SPI OLED SSD1306 + u8glib + CubeMX

Elastic Notes: STM32 + SPI OLED SSD1306 + u8glib + CubeMX: As I promised, I post info about connection SPI-based display based on SSD1306 controller using STM32 CubeMX. Its connection is even simple...

Comments

  1. Thanks Artyom for your two ssd1306 article...This is exactly what I was looking for !
    It works fine after having drastically reduced the size of the ug8_font_data.c file.

    Chris

    ReplyDelete
  2. Hello, I got your code to work with an STM32F7ZG, so Thanks for you work.

    Output of your Hello example seems to take about 88 ms on my board. I would like to speed that up. I noticed that changing SPI speed from below to 1 MHz to above 6 MHz seems to make almost no difference.

    Can you suggest a way to speed up the writing?

    ReplyDelete
    Replies
    1. Hello! I think you can try to re-write u8g_MicroDelay(void) function. In my code sample, there is a large "safety margin": I use 1ms instead 1 microsecond there. So, you can decrease this value putting empty cycle instead of HAL_Delay(1). Just tune this emty "for" loop to your Sysclock value.

      Delete
  3. I have further questions. My SPI clock is running at 6.75 MHz, and I managed to put a value of zero for both delays and it still runs...so that is curious.

    But over all it still takes 8ms now to update the screen, and it seems like it should be faster. Can you think of something else that is taking time? By the way, to get your code to work I loaded everything from your repository into my project.

    ReplyDelete
    Replies
    1. The last bottleneck on our side is HAL_Delay(1); in U8G_COM_MSG_CHIP_SELECT. Try to remove it. Of course, I doubt that u8glib toggles chip select during refresh, but, anyway, you can try. Also, you can try to make "dirty hack": scale value in u8g_Delay function. I mean, write HAL_Delay(val/10); instead of HAL_Delay(val);

      Delete
    2. So, removed the delay, and now it takes 3-4 ms. Still all seems to run fine without the delays. I plan to switch to a slower board in future, so I will keep them in mind in case I have to put something back. Thanks for your help.

      Delete

Post a Comment

Popular posts from this blog

u8g2 library usage with STM32 MCU

Use PCM5102 with STM32

RFFT in CMSIS DSP. Part 1.