U8g2: ST7920 and ESP8266 HW SPI

Created on 29 Jul 2017  路  12Comments  路  Source: olikraus/u8g2

Hello.

I tried to connect ST7920 128x64 LCD to ESP8266.
When I tried SW SPI is working but slow.
After switch to HW SPI and nothing showed on LCD.

I found a solution that I changed spi_mode in u8x8_st7920_128x64_display_info(u8x8_d_st7920.c) to 0.

#if defined(ESP8266)
  /* spi_mode = */ 0,
#else
  /* spi_mode = */ 3,
#endif

and everything worked.

All 12 comments

I think this is a bug in the esp8266 lib.

That bug still exists, pccr10001's solution worked for me

I posted the problem already:

https://github.com/esp8266/Arduino/issues/2416

From my perspective it does not make sense to fix this in U8g2. Maybe add comments to the issue above and mention, that this does not work for you correctly.

hello guys can you provide the link of library and pin sheme i have the same lcd.

tryied to connect in i2c via MCP23017 on my esp8266 v2 with out result

@olikraus I know this is a bit old issue but does the problem still exists?
I'm planning to use ST7920 with Wemos D1 and I don't know should I stick with this display or should I search for a different display.

I have not heard any news regarding this problem.

@olikraus I've already posted a comment in 2416 issue.
Hopefully, this will be resolved some day.

Hello, i did this change in the u8x8_d_st7920.c in src/clib/u8x8_d_st7920.c and recompile my project but the problem remains.
Do i have to do something else like tell arduino studio to recompile this file?
Thanks in advance.

Nothing needs to be modified, the problem should be fixed in the ESP software. My pull request was included: https://github.com/esp8266/Arduino/pull/5948

See also: https://github.com/olikraus/u8g2/issues/53

Thanks for de quick response.
Should i update the u8g2 and spi libraries? a particular version?
Thanks in advance

You only need to update the ESP8266 environment (which includes SPI lib)

Then i guess iv'e killed my display : (
Thank you anyway!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

WaRZaT picture WaRZaT  路  3Comments

idreamsi picture idreamsi  路  7Comments

13590787364 picture 13590787364  路  3Comments

hauwarea picture hauwarea  路  5Comments

Devilscave picture Devilscave  路  3Comments