Welcome! Log In Create A New Profile

Advanced

Panel buttons don't work

Posted by leadinglights 
Panel buttons don't work
October 21, 2019 06:03AM
The buttons on my control panel either don's work or are unusabley flaky. Pushing the O.K. button may or may not flash the next menu on but only for about a second. On the single occasion that I was able to make a selection, the encoder seemed to work but the other button 'Back' does not work at all. The 20 character by 4 line LCD HD44780 type display works fine.

This panel works with Repetier firmware in the same printer with the same RAMPS controller.

Can anybody tell me where I may look for the solution to this problem

Marlin version 1.1.9
Printer controller: RAMPS1.4/Arduino Mega2560
Printer: Cartesian
Controls: Encoder ALPS 24 detent with NO push switch
Tactile NO push switch

In file Configuration.H I have selected:-

#define REPRAP_DISCOUNT_SMART_CONTROLLER

In file pins.RAMPS.h I have modified the pins for NEWPANEL and REPRAP_DISCOUNT_SMART_CONTROLLER as below

// LCD Display input pins
	 //
	 #if ENABLED(NEWPANEL)

	   #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
	     #define BTN_BACK		31	// New line **********
	     #define BEEPER_PIN		45	// was 37 **********

	     #if ENABLED(CR10_STOCKDISPLAY)
	       #define BTN_EN1		17
	       #define BTN_EN2		23
	     #else
	       #define BTN_EN1		37	// was 31 **********
	       #define BTN_EN2		35	// was 33 **********
	     #endif

	     #define BTN_ENC		33	// was 35 **********
	   //  #define SD_DETECT_PIN	49
	   //  #define KILL_PIN		41

	     #if ENABLED(BQ_LCD_SMART_CONTROLLER)
	       #define LCD_BACKLIGHT_PIN 39
	     #endif

Thanks for any assistance,

Mike
Re: Panel buttons don't work
October 23, 2019 04:19AM
I came back to looking at this and found the following:-

The back button, assigned pin 31, is floating i.e., the pull up is not set.
The O.K. button, that is the encoder middle button, does have a pull-up and doesn;t show noise on an oscilloscope.
All other connections, the encoder itself, the LCD and SD card work as expected.

Any thoughts, clues, tips or advice?

Mike
Re: Panel buttons don't work
October 23, 2019 05:08AM
re BTN_BACK pull up, give this a go.

in ultralcd.cpp is
  #if ENABLED(NEWPANEL)
    #if BUTTON_EXISTS(EN1)
      SET_INPUT_PULLUP(BTN_EN1);
    #endif
    #if BUTTON_EXISTS(EN2)
      SET_INPUT_PULLUP(BTN_EN2);
    #endif
    #if BUTTON_EXISTS(ENC)
      SET_INPUT_PULLUP(BTN_ENC);
    #endif
add this to the end of the above code
#if BUTTON_EXISTS(BACK)
      SET_INPUT_PULLUP(BTN_BACK);
    #endif


Perhaps the BTN_BACK is always active without the pullup so it immediately returns to the main screen, So it just needs the above fix and you might be sorted.

Edited 4 time(s). Last edit at 10/23/2019 09:47AM by Dust.
Re: Panel buttons don't work
October 23, 2019 01:57PM
Thank you Dust, that worked. It is now solid and subcategories can be selected and return works as expected.

As you asked pre-edit to see the circuit diagram I have put it on [drive.google.com]

Many thanks again,

Mike
Re: Panel buttons don't work
October 23, 2019 07:02PM
I've created an marlin issue for this, so hopefully future versions of marlin will enable the BTN_BACK pull up as it should

https://github.com/MarlinFirmware/Marlin/issues/15652
Sorry, only registered users may post in this forum.

Click here to login