Page 1 of 1

st7920 - 128x64 Blue back light LCD .

Posted: Thu Sep 02, 2021 3:07 pm
by madhavan
hi i am trying to connect st7920 - 128x64 Blue back light LCD with blue pill in SPI mode

U8glib ibrary working with arduino uno but it's become uncomfortable when i turned to duino core .

could you help me to suggest working library for ST7920 -128X64 Blue back light LCD with blue pill in SPI Mode .

i am using the official stm32 duino core

regards,
m

Re: st7920 - 128x64 Blue back light LCD .

Posted: Thu Sep 02, 2021 7:45 pm
by david.prentice
It should work just fine. Start with the SW constructor.
Copy-paste your constructor to your message. Post a photo of the actual wires connecting the BluePill to the ST7920 module.

You can try the HW constructor later. But there is little point in attempting to share multiple devices on the same HW SPI bus. ST7920 does not play cricket.

David.

Re: st7920 - 128x64 Blue back light LCD .

Posted: Sat Sep 04, 2021 2:50 pm
by madhavan
hi ,

U8GLIB_ST7920_128X64_1X u8g(PA5, PA7, PA4); // SPI Com: SCK = en = PA5, MOSI = PA7 = 16, CS = di = PA4

Currently U8glib library is in incompatibleImage

Code: Select all

WARNING: library U8glib claims to run on avr, sam architecture(s) and may be incompatible with your current board which runs on stm32 architecture(s).
[/color]

when i am compiling hello world examples following warning message is coming but compiling without any error .

I could able to upload example sketch and it's working .

some other library's are incompatible not working but this library incompatible and it's working .

as solution it's working but i don't know how take !! your suggestion is welcome .

Re: st7920 - 128x64 Blue back light LCD .

Posted: Sat Sep 04, 2021 4:20 pm
by ag123
ST7920 normally doesn't run on SPI, you'd probably need to check your connections.
https://www.waveshare.com/datasheet/LCD ... ST7920.pdf

Re: st7920 - 128x64 Blue back light LCD .

Posted: Sat Sep 04, 2021 4:55 pm
by TFTLCDCyg
Try the U8g2 library, it seems to me that it is compatible with STM32. Newer versions of this controller chip work over the SPI bus. Just make sure that the pins are located correctly, the pinot nomenclature of the LCD does not follow the SPI standard

Re: st7920 - 128x64 Blue back light LCD .

Posted: Sat Sep 04, 2021 6:18 pm
by david.prentice
Oops. I had misread the Original Poster as having used U8g2lib and not U8glib. U8glib is deprecated nowadays.

Anyway, I ran the U8g2 examples with this constructor on a Nucleo-64:

Code: Select all

U8G2_ST7920_128X64_1_SW_SPI u8g2(U8G2_R0, A2, A1, A0, A5); //setup: PSB=0 (RST, PSB has weak pullup)
then with this on a BluePill:

Code: Select all

U8G2_ST7920_128X64_1_SW_SPI u8g2(U8G2_R0, PA7, PB0, PB1, PB4); //setup: PSB=0 (RST, PSB has weak pullup
This is software SPI you can choose any GPIO pins that take your fancy. STM32 has plenty of SRAM. So you can afford to use the _F_ full buffer constructors.

Although U8glib is no longer supported, I bet that you could use U8glib if that is what you want.
Likewise, you could use a HW SPI constructor if you use the hardware SCK, MOSI pins. Just don't put anything else on the same SPI bus.

U8g2lib is very versatile but relatively slow. Mind you, LCD panels look smeary and horrible if you run them fast,

David.

Re: st7920 - 128x64 Blue back light LCD .

Posted: Sun Sep 05, 2021 2:22 am
by madhavan
hi david, thanks for your in-depth knowledge sharing to us . U8G2 - SW SPI constructor working .