Skip to content
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

[BUG] ZONESTAR LCD buttons don't work reliably #27306

Closed
1 task done
Caraffa-git opened this issue Jul 23, 2024 · 2 comments
Closed
1 task done

[BUG] ZONESTAR LCD buttons don't work reliably #27306

Caraffa-git opened this issue Jul 23, 2024 · 2 comments

Comments

@Caraffa-git
Copy link

Caraffa-git commented Jul 23, 2024

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

Buttons on Anet A8 2004 LCD work randomly.

I did modify the LCD so I wouldn't fry ADC with 5V input.

I tried troubleshooting and came to this piece of code in mailinui.cpp:

    static const _stADCKeypadTable_ stADCKeyTable[] PROGMEM = {
      // VALUE_MIN, VALUE_MAX, KEY
      { adc_other_button, HAL_ADC_RANGE, 1 + BLEN_KEYPAD_F1     }, // F1
      { adc_other_button, HAL_ADC_RANGE, 1 + BLEN_KEYPAD_F2     }, // F2
      { adc_other_button, HAL_ADC_RANGE, 1 + BLEN_KEYPAD_F3     }, // F3
      {  ADC_BUTTON_VALUE(ADC_BUTTONS_LEFT_R_PULLDOWN)   - adc_button_tolerance,
         ADC_BUTTON_VALUE(ADC_BUTTONS_LEFT_R_PULLDOWN)   + adc_button_tolerance, 1 + BLEN_KEYPAD_LEFT   }, // LEFT  ( 272 ...  472)
      {  ADC_BUTTON_VALUE(ADC_BUTTONS_RIGHT_R_PULLDOWN)  - adc_button_tolerance,
         ADC_BUTTON_VALUE(ADC_BUTTONS_RIGHT_R_PULLDOWN)  + adc_button_tolerance, 1 + BLEN_KEYPAD_RIGHT  }, // RIGHT (1948 ... 2148)
      {  ADC_BUTTON_VALUE(ADC_BUTTONS_UP_R_PULLDOWN)     - adc_button_tolerance,
         ADC_BUTTON_VALUE(ADC_BUTTONS_UP_R_PULLDOWN)     + adc_button_tolerance, 1 + BLEN_KEYPAD_UP     }, // UP    ( 618 ...  818)
      {  ADC_BUTTON_VALUE(ADC_BUTTONS_DOWN_R_PULLDOWN)   - adc_button_tolerance,
         ADC_BUTTON_VALUE(ADC_BUTTONS_DOWN_R_PULLDOWN)   + adc_button_tolerance, 1 + BLEN_KEYPAD_DOWN   }, // DOWN  (2686 ... 2886)
      {  ADC_BUTTON_VALUE(ADC_BUTTONS_MIDDLE_R_PULLDOWN) - adc_button_tolerance,
         ADC_BUTTON_VALUE(ADC_BUTTONS_MIDDLE_R_PULLDOWN) + adc_button_tolerance, 1 + BLEN_KEYPAD_MIDDLE }, // ENTER (1205 ... 1405)

I noticed that range of this values don't really match measured voltages:

Pin Voltage ADC Value
LEFT 0.301 V 93
RIGHT 1.58 V 490
UP 2.138 V 663
DOWN 0.568 V 176
ENTER 1.00 V 310

ADC Value was calculated as following: read_voltage/3.3 V * 1024

For me it doesn't really make sense because center and up/down buttons are sometimes working. I have to admit that I'm a bit confused and don't know where to look for the problem anymore.

Bug Timeline

23 July 2024

Expected behavior

No response

Actual behavior

No response

Steps to Reproduce

No response

Version of Marlin Firmware

bugfix-2.1.x

Printer model

No response

Electronics

BigTreeTech SKR mini E3 V 3.0

LCD/Controller

Anet 2004 LCD with 5 buttons

Other add-ons

No response

Bed Leveling

None

Your Slicer

None

Host Software

None

Don't forget to include

  • A ZIP file containing your Configuration.h and Configuration_adv.h.

Additional information & file uploads

pins_BTT_SKR_MINI_E3_V3_0.txt
Configuration_adv.txt
Configuration.txt

@Caraffa-git
Copy link
Author

Of course 20 minutes after writing the issue i fixed it. The problem was faulty voltage regulator that wasn't really supplying 3.3V and after pressing a button output voltage could drop even to 2.5V.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants