Welcome! Log In Create A New Profile

Advanced

LCD2004 Keypad LCD - Messages don't show up correctly (Marlin 2.0.x)

Posted by malachik 
LCD2004 Keypad LCD - Messages don't show up correctly (Marlin 2.0.x)
January 31, 2021 06:09PM
Hello all,

First of all, I apologize if this isn't the right place to post about this issue; I'm new to these forums.

I'm using a Melzi 2.0 board from TRONXY on a Prusa i3 clone (Monoprice Maker Select v2). The firmware is just Marlin 2.0.x configured to my printer, where I have "ZONESTAR_LCD" selected as the character LCD.

The problem I'm experiencing is with my 2004 keypad LCD (aka Zonestar LCD, Anet, etc.), the kind with 5 analog buttons. The screen lights up and displays characters/changes the screen when I push buttons, but the only characters it displays are question marks, left arrows, black rectangles, and the occasional Japanese character.

What I think the problem is is something to do with how Marlin sends characters to my LCD.

I am 98% certain I have the pin configurations correct, which are as follows, as written in pins_MELZI_TRONXY.h:

#define LCD_PINS_RS                           28 //RS           28
#define LCD_PINS_ENABLE                       29 //EN           29
#define LCD_PINS_D4                           10 //D4 -> RX1 -> 10                //new settings
#define LCD_PINS_D5                           11 //D5 -> TX1 -> 11     //these pins have been CONFIRMED to work via an Arduino sketch with liquidcrystal.h
#define LCD_PINS_D6                           16 //D6 -> SCL -> 16
#define LCD_PINS_D7                           17 //D7 -> SDA -> 17

What I think I've ruled out so far is the pin configuration. The screen displays "some characters", and it changes during boot and when buttons are pushed. I've also tested my exact setup with basic Arduino sketch using the liquidcrystal library, which seems to be what Marlin uses as well. I can post the sketch if you think that might help, but it really is just a generic liquidcrystal test sketch with the pin configuration above. One bit of behavior I don't really understand is that the M117 GCode command doesn't seem to do anything, even though the printer responds to most other GCode fine. I've also heard that a common issue with these 2004 lcd's is electrical noise, but I'm somewhat sure it's not that either, partially since the behavior seems to constant to be effected by noise, and also because it appears to work flawlessly with the Arduino sketch.

I don't think the keypad pin (ADC_KEYPAD_PIN) has anything to do with this problem, since it responds to button presses. I personally haven't set it to anything, but it appears that Marlin sets it to 1 (that is, analog pin A1) somewhere, which is what I was going to do anyway.

What all of this indicates to me is that the problem is somewhere within Marlin itself, since I've been able to confirm that almost everything else about this works independently.

If anyone has any advice or can point me in the right direction, that would be hugely appreciated!!

Edited 1 time(s). Last edit at 01/31/2021 10:59PM by malachik.
Re: LCD2004 Keypad LCD - Messages don't show up correctly (Marlin 2.0.x)
February 01, 2021 12:26AM
Just wired a LCD2004 to a Sanguinololu 1.3 (same MPU as the melzi)

Even uses the same IO pins

#define LCD_PINS_RS                       28
#define LCD_PINS_ENABLE              29
#define LCD_PINS_D4                       10
#define LCD_PINS_D5                       11
#define LCD_PINS_D6                       16
#define LCD_PINS_D7                       17


Compiled current marlin bugfix 2.0.x

Only changed #define ZONESTAR_LCD and #define MOTHERBOARD BOARD_SANGUINOLOLU_12 in Configuration.h
and default_envs = melzi_optiboot in pltfomio.ini (because I put a optiboot on this board)
Compiled in platform io and uploaded, all absolutely normal


Phorum wont render it... click on link to see image
I can't fault it.


I notice in pins_MELZI_TRONXY.h
#define BTN_EN1                               10
#define BTN_EN2                               11

Did you remove these? or they will interfere with the lcd

Edited 5 time(s). Last edit at 02/01/2021 12:40AM by Dust.
Re: LCD2004 Keypad LCD - Messages don't show up correctly (Marlin 2.0.x)
February 01, 2021 12:54PM
I commented out

//#define BTN_EN1                               10
//#define BTN_EN2                               11

and it works!! I can't believe I didn't see that earlier, thank you so much!
Sorry, only registered users may post in this forum.

Click here to login