Open olikraus opened 1 year ago
We also have this 144 x 32 on ST7920 via SW SPI. I've tried to patch in values but have not succeeded yet. I'm looking now on how to rebuild via codebuild, and saw that others also have a need for this new constructor. Thank you!
Is this topic still open? Can you do the testing, if I would do the code build changes?
Yes, we should be able to test for this as needed, thank you!
Unfortunately I managed to use a more conventional LCD module and I don't have a good system to check this with. Sorry.
I have created beta 2.34.20 which includes the constructor U8G2_ST7920_144X32...
It would be great if someone could test this.
You can download the latest U8g2 beta release from here: https://github.com/olikraus/U8g2_Arduino/archive/master.zip Arduino IDE:
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
Tested with several examples but still not working correctly. Let me know what feedback may be helpful. Compiled OK but has same behavior as 160x32 construct it seems. The 144x32 has 18 instead of 20 columns, but other than that they should respond similarly. Here is a code example (tested good): http://baxsie.com/images/forum/Arduino_ST7920_LCD/CFAG14432_SPI_Arduino.zip
Which u8g2 code did you use for testing? How will it look on the display? Any picture of the current u8g2 output?
Arduino IDE 2.1.0 Mega2560 U8g2_2.34.20 using U8G2_ST7920_144X32_F_SW_SPI, results shown for logo, spacetrash, helloworld, and graphicstest. Ready for other testing as needed.
https://github.com/olikraus/u8g2/assets/18092204/a431ea54-f548-469e-a168-2bc811fb2694
Thanks for the pics and video. To me it looks like that there is some noise on the signal lines or some other wiring issue.
The other example which I linked above for your reference works fine, also SW SPI. Here is a video, same setup, just uploaded.
https://github.com/olikraus/u8g2/assets/18092204/8917af37-a31d-483c-8206-1f1dfabab5d6
So HW SPI works, but SW SPI doesn't ?
These examples shown, including the working Crystalfontz one above, are SW SPI. No HW SPI here. Here is a section of their code, including bus timing comments:
//FAST_SPI = 0: The SS pin is high for ~429uS (24-bits) // The clock frequency is ~57KHz // Full graphic update takes ~285mS //FAST_SPI = 1: With no delays, the SS pin is high for ~12uS (24-bits) // The clock frequency is ~2MHz // But that is too fast for the ST7920, so slow it down // with the additional _delay_us(1) calls, which makes: // The SS pin is high for ~39uS (24-bits) // The clock frequency is ~615KHz // Full graphic update takes ~22.5mS
//Software SPI (10-bit transfers, difficult to do using the hardware SPI)
looks very complicated...
There's
getDisplayHeight()
andgetDisplayWidth()
methods; are there correspondingset
methods?Or should I just choose a constructor for a differently geometry, eg. 160 x 32, and restrict my horizontal addresses to 144? Eg.
U8G2_ST7920_160X32_F_6800(rotation, d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc [, reset]) [full framebuffer, size = 640 bytes]
?SORRY newbie error: somehow clicked POST with incomplete subject line. No way to edit subject nor delete post.
Originally posted by @tomjennings in https://github.com/olikraus/u8g2/discussions/2084