-
Notifications
You must be signed in to change notification settings - Fork 35
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
TM1637 - Buttons don't work on esp32 #56
Comments
Hello @ANLCRAW - thanks for taking the effort to find the root cause of your issue and for posting this. The MH-ET LIVE board looks a lot like the D1 mini. I do have the ESP8266 variant of that board, but I don't think I have it with an ESP32. However, I think my TinyPico should suffice for testing this. Can you tell me what version of the Arduino IDE and which version of the ESP32 core you are using? At what clock speed is your ESP32 running? In some tests I ran my ESP8266 at 80MHz and the RP2040 at 133MHz. I can't remember what speed I ran the ESP32 when testing. I'm not sure if 240MHz is the default speed/. I don't know when I can find some time to test this, but I will keep this issue open and post my findings here. Edit: on TM1637 reading keys should be slower than 250Khz (see datasheet p3). For that reason the delay between reading bits should be more than 4us and 5us was chosen. When testing the library on faster processors I did find that good connections and a good power supply were crucial. |
Super thanks for your quick reply. The "MH-ET Live Minikit" resembles a D1 Mini, but I have the "MH-ET Live devKit," which is more like a NodeMCU, though that probably doesn't make much difference. The ESP is an "esp-wroom-32," and to my knowledge, it's running at As I’m typing this, I am removing the espressif esp32 core (https://github.com/espressif/arduino-esp32) and trying the core provided by MHEtLive (https://github.com/MHEtLive/arduino-esp32), hoping that it might make a big difference. I will let you know my findings. The wires between the ESP and the display are no longer than 2 centimeters. The TM1637, buttons, and display are all on a PCB. I hope to find a solution because going from 5ms to 330ms is very noticeable when navigating through the menu. I’ll keep searching. It’s likely not your fantastic library causing the issue but something on my end. I’ve already ordered new TM1637 chips to rule out the possibility that the chips are the problem. |
Thank you for the swift response to my questions. The delay is used at multiple points, so an increase from 5us to 330us will add up. (I assumed you meant to write 330us instead of 330ms (milliseconds) as 330ms would definitely be unworkable). You mention both 240MHz and 80MHz. Was the issue the same when running at the slowest speed? One thing I didn't ask yet is about the color of the leds and the supplied voltage. Most TM16xx chips work fine on 3v3, but I did notice some issues when using blue led display instead of red. The blue leds require higher voltage and may require a level shifter. When I can find the time I'll try to match your setup. Some years ago I made a small TM1637 matrix PCB that allows the addition of three buttons. I used it to make this clock, Before making those PCB's I modified a TM1637 4x8 segment display module into a mini LED&KEY module. I still have plenty TM1637 chips to do some experiments. Your chip may be defective or perhaps just less reliable at higher speeds. On one occasion I had a TM1640 matrix module on the RP2040 which gave random glitches, but only on the RP2040, not on slower processors. I tried everything including analysis with a scope, but couldn't find the issue. Sometime later I tried again, but then also tried another matrix module. Guess what: one module displayed the glitches while the other module worked just fine. In that test it seemed to be a combination of a chip less reliable at higher speed plus iffy breadboard connections. |
Thanks for your library! I’ve been using it with the ATmega328P and costom pcb, but now I'm switching to the ESP32 and after 24 hours of struggling, I discovered that I need to change 'delayMicroseconds(5)' to 'delayMicroseconds(330)' in tm1637.cpp to make the buttons work. Else i get de default display printing of 0x8000 / no buttons / 1111-1111. I'm using de tm16xxButtons_clicks example. Anyone else have experience with this? I'm using a MH-ET LIVE
The text was updated successfully, but these errors were encountered: