u8g2
u8g2 copied to clipboard
ST7920 128x32 Support
As the title says, does this lib support the ST7920 LCD display in a resolution of 128x32? It has a 7-pin header. https://www.aliexpress.com/item/1005004110848636.html
Can you check, whether the U8G2_ST7920_128X64_1_SW_SPI or U8G2_ST7920_128X64_1_HW_SPI constructor works?
Ok, I used this constructor U8G2_ST7920_128X64_1_SW_SPI and Uno. Connection as on U8G2_ST7920_128X64_1_SW_SPI u8g2(U8G2_R0, /* clock=/ 13, / data=/ 11, / CS=/ 10, / reset=*/ 8); I tried HelloWorld and ContrastTest sketches but got nothing.
However, one of the buyers has written that the pinout on the display is NOT good. At the bottom, there are marks 1 and 7 on the sides of the header. How to check it out? Any suggestions?
On my display, I have this header labeled with 1 at the bottom and 7 at the top.
Firstly, I connected it like this: 7 - 5V 6 - pin 8 5 - pin 13 4 - pin 11 3 - pin 10 2 - 5V 1 - GND
Later, when I read the comments, I used a multimeter to check the pattern from the header, and those two 7-tail pads. The pattern is not the same. The pattern is like this: Header - pads 1 - 1 2 - 5 3 - 6 4 - 7 5 - 2 6 - 3 7 - 4
I tried it connected according to these 7-tail pads, the second pattern, but still nothing. Not a blink.
Not sure did I burned the display while the first connection, hope not.
Can you suggest to me what to try?
Further investigation I found that the BL LED is ok. And the pinout of the table from the seller's page is a GARBAGE.
The GND is on pin 5 of the header, and the BL (3.3V) is on pin 1 of the header. The backlight LED is working on 3.3V. Two done, five to go.
Guys I use these display's. they are labels ZXM12832C1 this constructor works #include <U8g2lib.h> U8G2_ST7920_144X32_F_SW_SPI u8g2(U8G2_R2, SCLK , MOSI, CS, RST);
pinouts are as follows (square pin is pin 1)
- BL +VE 5V
- /CS
- MOSI
- Clock
- ground (0V)
- VDD (3.3V)
- /Reset
Oliver This is the one i use it works (just a bit weird when the screen is upside down needs an offset)
U8G2_ST7920_144X32_F_SW_SPI u8g2(U8G2_R2, SCLK , MOSI, CS, RST);
I will try and let you know, as soon as I get back home. This is nice news.
I think another pending issue is to create the correct constructor for this display... I just added this to the latest milestone so that I don't miss this.
Edit: Typo fixed
Thanks. . I have also lookd another issue cant remember the number on this display and corrected the electricals as the chinese data is way wrong ...SSent from my Galaxy -------- Original message --------From: olikraus @.> Date: 23/11/2023 14:51 (GMT+00:00) To: olikraus/u8g2 @.> Cc: xygax @.>, Manual @.> Subject: Re: [olikraus/u8g2] ST7920 128x32 Support (Issue #2241) I think anothe rending issue is to create the correct constructor for this display... I just added this to the latest milestone so that I don't miss this.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>
@xygax
I used the constructor you provided and got something
Obviously not what I expected.
This is a Hello World example U8G2_ST7920_144X32_F_SW_SPI u8g2(U8G2_R2, 13 , 11, 10, 8);
Two things... One ..... set the rotation to R0 and it will work but upside down Two. Set the origin to 20.x and that will be the difference between 128 the display size and 144 the constructor size SteveSent from my Galaxy -------- Original message --------From: Dejan Petrović @.> Date: 23/11/2023 21:15 (GMT+00:00) To: olikraus/u8g2 @.> Cc: xygax @.>, Mention @.> Subject: Re: [olikraus/u8g2] ST7920 128x32 Support (Issue #2241) @xygax I used the constructor you provided and got something
Obviously not what I expected. This is a Hello World example U8G2_ST7920_144X32_F_SW_SPI u8g2(U8G2_R2, 13 , 11, 10, 8);
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>
Origin to... what?
look at the constructor ...... it has R2..... that is use the screen upside down make that R0 you will get your example code working...
or leave the constructor and display my clock
void LCD_Clock(void) {
u8g2.clearBuffer(); // clear the internal memory u8g2.setFont (u8g2_font_maniac_te); // 1 lines 22 point //u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font u8g2.setCursor(19, 28); //was 4.28 but moved due to constructor size 144 u8g2.print(Timeload); // write something to the internal memory timeload is my string xx:xx:xx u8g2.sendBuffer(); // transfer internal memory to the display }
I know about the rotation, but thought there is a tweak to fix the screen resolution difference. Now I see you just moved it a side.
Not yet.. its on Oliver's list so i just correct it manually by the difference in the actual screen size and the constructor size difference in size is 16 px so zero is 16 if upside down.
ah... yeah... too less time for u8g2 at the moment :-p
Hi All I have added the 128x32 constructor. Not sure about the left side offset... Constructor prefix is U8G2_ST7920_128X32_ in the new beta release 2.35.8
Maybe someone can execute FlipMode.ino example (See example menu in Arduino IDE or here). The flip mode test example will cycle through eight modes. In all modes there must be a solid frame next to the border of the display.
You can download the latest U8g2 beta release from here: https://github.com/olikraus/U8g2_Arduino/archive/master.zip Arduino IDE:
- Remove the existing U8g2_Arduino library (https://stackoverflow.com/questions/16752806/how-do-i-remove-a-library-from-the-arduino-environment)
- Install the U8g2_Arduino Zip file via Arduino IDE, add zip library menu (https://www.arduino.cc/en/Guide/Libraries).
PlatformIO:
platformio.ini
(https://docs.platformio.org/en/latest/projectconf/section_env_library.html#lib-deps) should include
lib_deps =
u8g2=https://github.com/olikraus/U8g2_Arduino/archive/master.zip
I have a unit on my desk will do it today.SSent from my Galaxy -------- Original message --------From: olikraus @.> Date: 02/12/2023 23:12 (GMT+00:00) To: olikraus/u8g2 @.> Cc: xygax @.>, Mention @.> Subject: Re: [olikraus/u8g2] ST7920 128x32 Support (Issue #2241) Hi All I have added the 128x32 constructor. Not sure about the left side offset... Constructor prefix is U8G2_ST7920_128X32_ in the new beta release 2.35.8 Maybe someone can execute FlipMode.ino example (See example menu in Arduino IDE or here). The flip mode test example will cycle through eight modes. In all modes there must be a solid frame next to the border of the display. You can download the latest U8g2 beta release from here: https://github.com/olikraus/U8g2_Arduino/archive/master.zip Arduino IDE:
Remove the existing U8g2_Arduino library (https://stackoverflow.com/questions/16752806/how-do-i-remove-a-library-from-the-arduino-environment) Install the U8g2_Arduino Zip file via Arduino IDE, add zip library menu (https://www.arduino.cc/en/Guide/Libraries).
PlatformIO: platformio.ini (https://docs.platformio.org/en/latest/projectconf/section_env_library.html#lib-deps) should include lib_deps = u8g2=https://github.com/olikraus/U8g2_Arduino/archive/master.zip
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>
Seems to be fine according to @xygax