Comments (16)
I can try to find a matching hardware. (ToDo: Test)
from u8g2.
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.
- The first problem is solved. Problem was the use of wrong I/O lines which might crash the ESP8266
- SPI Mode problem is addressed
from u8g2.
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.
@dratini0 @olikraus this has been fixed in esp8266/Arduino#5948 and released in 2.5.1
from u8g2.
👍
from u8g2.
@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.
Testenvironment: Adafruit ESP8266 board,74HC07 and ST7920 display
from u8g2.
@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.
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.
@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.
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.
@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.
👍
from u8g2.
@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.
Discussion continued at #1186
from u8g2.
Related Issues (20)
- Any news from grayscale? HOT 1
- u8g2 bus control and possible conflict HOT 2
- RaspPi Pico/Arduino IDE: Can't get the library to use other Clock and Data Pins. HOT 4
- Problem with PCF8812 HOT 10
- NodeMCU ESP8266 display not working HOT 2
- Pin mux conflict with RP2040 (Pico) earlephilhower Arduino core HOT 2
- KS0108: Increase reset duration to 5mS HOT 1
- t6963 f Data Hold Time HOT 6
- How to switch to the next page in u8g2 HOT 1
- SPI is Broken on ESP32 S2 mini. (Possibly S2 as well) HOT 1
- Can I use u8g2 with SSD1357 mono mode? HOT 3
- SH1107 128x128 OLED text jumbled around HOT 6
- STM32F4 t6963 interfacing usage HOT 19
- Support for Monochrome Low-Power ST7302 Display HOT 1
- Using ERC240160 in ESP32S3 SPI HW mode does not work HOT 1
- Artefacts using U8G2_SSD1309_128X64_NONAME0_F_4W_SW_SPI OLED Display
- internal compiler error: in type_hash_canon, at tree.c:7158 HOT 1
- U8g2 font size and type HOT 3
- New Version UW ttyp0
- How to print accented characters with U8g2lib in character mode ? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from u8g2.