Giter Club home page Giter Club logo

Comments (16)

olikraus avatar olikraus commented on May 18, 2024 1

I can try to find a matching hardware. (ToDo: Test)

from u8g2.

olikraus avatar olikraus commented on May 18, 2024 1

I did some tests and can confirm that the fix works: The ST7920 display works without modification of u8g2.

Hardware:

  • Feather HUZZAH ESP8266
  • 74HC07 as 3.3V to 5V level shifter
  • ST7920 display

IDE:

  • Arduino 1.8.4
  • esp8266/Arduino 2.5.1

Test A: Software SPI

U8G2_ST7920_128X64_1_SW_SPI u8g2(U8G2_R0, /* clock=*/ 14, /* data=*/ 13, /* CS=*/ 15, /* reset=*/ 16);

Works as expected

Test B: Hardware SPI (new code)

U8G2_ST7920_128X64_1_HW_SPI u8g2(U8G2_R0, /* CS=*/ 15, /* reset=*/ 16);

Now also works.

Test C: Hardware SPI (new code removed)

Same example as Test B: As expected: Example does not work any more.

U8G2_ST7920_128X64_1_HW_SPI u8g2(U8G2_R0, /* CS=*/ 15, /* reset=*/ 16);

Conclusion: All tests are successfully passed.

from u8g2.

olikraus avatar olikraus commented on May 18, 2024
  1. The first problem is solved. Problem was the use of wrong I/O lines which might crash the ESP8266
  2. SPI Mode problem is addressed

from u8g2.

dratini0 avatar dratini0 commented on May 18, 2024

For anyone else bumping into this again, at the time of writing, a pull request (esp8266/Arduino#2418) has been submitted to esp8266/Arduino, but has not yet been merged. Therefore, point 2 still stands.

from u8g2.

Misiu avatar Misiu commented on May 18, 2024

@dratini0 @olikraus this has been fixed in esp8266/Arduino#5948 and released in 2.5.1

from u8g2.

olikraus avatar olikraus commented on May 18, 2024

👍

from u8g2.

Misiu avatar Misiu commented on May 18, 2024

@olikraus could You test this? I've ordered the display (ST7920 based 128*64) but didn't get it yet so can't help.

from u8g2.

olikraus avatar olikraus commented on May 18, 2024

Testenvironment: Adafruit ESP8266 board,74HC07 and ST7920 display

https://raw.githubusercontent.com/wiki/olikraus/u8g2/img/st7920_esp8266.jpg

from u8g2.

Misiu avatar Misiu commented on May 18, 2024

@olikraus sorry for the noob'ish question, but why do You need 74HC07? Based on what I found I think ST7920 can be directly connected to ESP8266 or Arduino (for example https://www.hackster.io/user0035382/adjusting-clock-on-128x64-monochrome-display-st7920-b9569a).
I'm still waiting for the display I ordered so I'll check that when it arrives, but I don't want to damage it at the start.

If I want to use Hardware SPI (which is the fastest way right?) I must use U8G2_ST7920_128X64_1_HW_SPI u8g2(U8G2_R0, /* CS=*/ 15, /* reset=*/ 16);
but what pins I must connect? I'll be using Wemos D1.

Thanks for the advice 🙂

from u8g2.

olikraus avatar olikraus commented on May 18, 2024

The hackster example makes use of an Arduino Nano, which is a 5V board. The ESP8266 however is a 3.3V board. For a 3.3V board, the maximum output voltage of the GPIO lines are 3.3V (maybe little bit lesser). But a 5V display (the ST7920 operates with 5V logic) expects at least 3.5V to detect a logic high. In other words, whatever the ESP8266 sends, will be read as logic zero. To avoid this we have to do voltage level translation: The maximum output voltage has to be increased. There are many options to do this, but I just looked for an option based on the available parts in my lab. So I took a 74HC07 device which has an open collector output. Together with a 2K resistor for each signal line it is a good 3.3V to 5V level translator.

from u8g2.

Misiu avatar Misiu commented on May 18, 2024

@olikraus and that's why this was a noob'ish question. I know that ESP8266 has 3.3V logic, but I wasn't aware that ST7920 has 5V logic. I've searched a bit, found a tutorial with Arduino and assumed that it will work the same way with ESP.

Thanks for clarification

from u8g2.

olikraus avatar olikraus commented on May 18, 2024

will work the same way with ESP.

Actually, it may work (3.3V is not that far away from 3.5V) but it will not be reliable.

from u8g2.

Misiu avatar Misiu commented on May 18, 2024

@olikraus I'll check that when my display arrives :)
Nevertheless, I'm going to order a couple of level shifters, just in case.

from u8g2.

olikraus avatar olikraus commented on May 18, 2024

👍

from u8g2.

Kroshtandt avatar Kroshtandt commented on May 18, 2024

@olikraus hello, have the same problem with nodemcu and ST7920 spi connection. Display is blank. Do I need to use level converter for that?

from u8g2.

olikraus avatar olikraus commented on May 18, 2024

Discussion continued at #1186

from u8g2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.