st7920 - 128x64 Blue back light LCD .

Post here first, or if you can't find a relevant section!
Post Reply
madhavan
Posts: 29
Joined: Fri May 21, 2021 1:22 am

st7920 - 128x64 Blue back light LCD .

Post 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
by david.prentice » Sat Sep 04, 2021 6:18 pm
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.
Go to full post
david.prentice
Posts: 19
Joined: Thu May 14, 2020 8:39 pm
Answers: 1

Re: st7920 - 128x64 Blue back light LCD .

Post 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.
madhavan
Posts: 29
Joined: Fri May 21, 2021 1:22 am

Re: st7920 - 128x64 Blue back light LCD .

Post 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 .
ag123
Posts: 1657
Joined: Thu Dec 19, 2019 5:30 am
Answers: 25

Re: st7920 - 128x64 Blue back light LCD .

Post 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
TFTLCDCyg
Posts: 26
Joined: Tue Jan 07, 2020 9:50 pm
Answers: 1

Re: st7920 - 128x64 Blue back light LCD .

Post 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
david.prentice
Posts: 19
Joined: Thu May 14, 2020 8:39 pm
Answers: 1

Re: st7920 - 128x64 Blue back light LCD .

Post 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.
madhavan
Posts: 29
Joined: Fri May 21, 2021 1:22 am

Re: st7920 - 128x64 Blue back light LCD .

Post by madhavan »

hi david, thanks for your in-depth knowledge sharing to us . U8G2 - SW SPI constructor working .
Post Reply

Return to “General discussion”