ST7920 LCD 128x64 3 wire SPI using LL on STM32CubeIDE #1841
Replies: 1 comment 1 reply
-
Is Arduino Environment ok for you? Then maybe STM32duino (https://github.com/stm32duino) is an option? This would be the easiest way to bring u8g2 and STM32 CubeMX together. Otherwise: I personally tried to aviod CubeMX: https://github.com/olikraus/stm32g031/blob/main/u8g2_test_8/main.c However in any case, if you want to use u8g2 outside Arduino Enviornment, then you need to create a gpio and delay callback function. An example is here: https://github.com/olikraus/stm32g031/blob/e017b221bc534f08e080d7bd3ded5a41824e8bab/u8g2_test_8/main.c#L54 For CubeMX it will have the same structure, but you probably need calls to CubeMX lib instead of writing directly to registers. Documentation for the gpio and delay function is here: Although this gpio and delay is sufficient, you may want to speed up communication for SPI or I2C. In this case you could also add a custom byte transfer method: https://github.com/olikraus/u8g2/wiki/Porting-to-new-MCU-platform#communication-callback-eg-u8x8_byte_hw_i2c |
Beta Was this translation helpful? Give feedback.
-
HI,
I can find a few examples to help me on this project using HAL but I need to use the LL setup in the CubeMX for the STM32F411RE and the LCD panel ST7920.
Could I get a bit of guidance on how to start this? I tried to setup the MX using half-duplex on PA4 PA5 and PA7. but I don't know how to start the code.
I have to pull the CS (NSS) pin low to select the slave, but that's all I know I can't find any good examples for what I am trying to do.
regards
Gareth
Beta Was this translation helpful? Give feedback.
All reactions