-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP8266 and HW SPI #53
Comments
|
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. |
@dratini0 @olikraus this has been fixed in esp8266/Arduino#5948 and released in 2.5.1 |
👍 |
@olikraus could You test this? I've ordered the display (ST7920 based 128*64) but didn't get it yet so can't help. |
I can try to find a matching hardware. (ToDo: Test) |
I did some tests and can confirm that the fix works: The ST7920 display works without modification of u8g2. Hardware:
IDE:
Test A: Software SPI
Works as expected Test B: Hardware SPI (new code)
Now also works. Test C: Hardware SPI (new code removed) Same example as Test B: As expected: Example does not work any more.
Conclusion: All tests are successfully passed. |
@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). If I want to use Hardware SPI (which is the fastest way right?) I must use Thanks for the advice 🙂 |
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. |
@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 |
Actually, it may work (3.3V is not that far away from 3.5V) but it will not be reliable. |
@olikraus I'll check that when my display arrives :) |
👍 |
@olikraus hello, have the same problem with nodemcu and ST7920 spi connection. Display is blank. Do I need to use level converter for that? |
Discussion continued at #1186 |
Currently there are two issues
The text was updated successfully, but these errors were encountered: