Welcome! Log In Create A New Profile


problem with LCD and encoder mod

Posted by 11Master 
problem with LCD and encoder mod
September 07, 2018 05:03PM
Hello. I'm reading this forum for a while but now I have a problem with a printer mod. I'm talking about: [www.thingiverse.com]
I have made the hardware part some months ago and then I was used Marlin/skynet. Now I'm using v.1.1.9 and I have problems with implement this mod in new marlin.
Can someone tell me generally which part should I change to use 2004 LCD with I2C controler and encoder? I try to understand marlin but it's very hard. I don't wont to destroy the MOBO or something else. I have make some try but with no success, to change something is wors than write it from begining :/
Re: problem with LCD and encoder mod
September 13, 2018 06:00AM
Anyone ?
I don't want whole instruction step by step, only a few tips.

I'm looking for information where to look where I can change:

1)encoder pins x3 Propably in pins_ANET_10.h but how to say marlin about SDA and SCL pins where to change it? At the standard configuration in HD44780 and 2004LCD SDA and SCL are connected to DB6 and DB7.

2)how to enable only 2004LCD+I2C? without preconfigured encoder and other stuff? Conditionals_LCD.h? Better change other LCD config or write my own?

3)Some tips?

I'm only try to understand how it work before making some changes.
Re: problem with LCD and encoder mod
September 13, 2018 10:28PM
Edit: for a better solution, see a few posts below. Details about pins and libraries (in this post and following posts), are still valid, but rather than selecting the LCD_SAINSMART_I2C_2004, see below for a better solution, where you use a #define ANET_ENCODER_LCD

For the LCD to work with I2C, and the PFC8574 I2C I/O-expander, you can select the display: LCD_SAINSMART_I2C_2004

You need to connect the pins of the PFC8574 like this:

#define LCD_I2C_PIN_BL 3
#define LCD_I2C_PIN_EN 2
#define LCD_I2C_PIN_RW 1
#define LCD_I2C_PIN_RS 0
#define LCD_I2C_PIN_D4 4
#define LCD_I2C_PIN_D5 5
#define LCD_I2C_PIN_D6 6
#define LCD_I2C_PIN_D7 7

Then you need to find out if the PFC8574 that you use is actually only a PFC8574, or if it is named PFC8574T, PFC8574A, or PFC8574AT as they each use different base addresses on the I2C bus.
The PFC8574 uses address 0x27

As seen in Conditionals_LCD.h
#define LCD_I2C_TYPE_PCF8575
#define LCD_I2C_ADDRESS 0x27
#define ULTRA_LCD

Edit: This information should work with Marlin 1.1.9

Edited 5 time(s). Last edit at 09/14/2018 01:03AM by MrAlvin.
Re: problem with LCD and encoder mod
September 13, 2018 10:48PM
It seems to me that the "SkyNet 2.3.1 changes" is targeted towards Marlin 1.0.2
so the files found at Thingiverse, can not directly be copied into a Marlin 1.1.9

By following the details from above, about enabling the "LCD_SAINSMART_I2C_2004" option in configuration.h, then the LCD should start working.
Then we just need to get the encoder and buttons to work, Yes?
Re: problem with LCD and encoder mod
September 13, 2018 11:16PM
So, I just hooked up an I2C LCD and tested a compile of Marlin 1.1.9 (using Arduino 1.8.5) - and the LCD is working with the "LCD_SAINSMART_I2C_2004" option enabled.

I did however already have the "Newliquidcrystal_135" LCD library installed.
This library you can find here: [bitbucket.org]

But back to getting the encoder to work........

Edited 1 time(s). Last edit at 09/13/2018 11:17PM by MrAlvin.
Re: problem with LCD and encoder mod
September 14, 2018 12:55AM
For a better suggestion for a solution:

In configuration.h put in a


I file Conditionals_LCD.h replace:






#define LCD_SAINSMART_I2C_2004



in file pins_ANET_10.h replace:
#define LCD_SDSS 28


#define LCD_SDSS 28
#define BTN_EN1 -1
#define BTN_EN2 -1
#define BTN_ENC -1

I believe this was all I changed in a Marlin 1.1.9 download, besides setting the motherboard to be BOARD_ANET_10

I have tested this on a Mega, with I2C LCD, and the encoder on a RD_Smart_Controller, and it works.
For this test to work, I needed to disable the check for the 1284p AVR in pins_ANET_10.h

I have test compiled this for the Sanguino (1284p), and it compiles just fine. So hopefully it will also run just fine.

Either way, I hope these few clues, will get you closer to a working solution

Edit: Well, you do need to change -1 with the right numbers for the pins you decide to connect to the Encoder ;-)

Edited 1 time(s). Last edit at 09/14/2018 12:57AM by MrAlvin.
SOLVED Re: problem with LCD and encoder mod
September 17, 2018 03:54PM
First, thanks for dedicated time; I saw You have edited the posts many times. And even You have prepered the hardware.
I have made the hardware months ago and I have tested it under arduino with success. I know the I2C address (0x27 it is PFC8574T).
The LCD_SAINSMART_I2C_2004 work like You said. The booting is a little bit longer (i was wondering if it is the ...end ) but I save about 20% percent of the mem of the anet MOBO - it's great smiling smiley

But at the end i have a problem: What really "-1" mean "not use"? If I have not declared (or set -1) some pins then they are not visible for marlin?

At the end: Everything work just flawless smiling smiley Thanks again for Your work. I have not make step by step like You wrote but now I understand thet part of marlin and it workssmiling smiley

Edited 1 time(s). Last edit at 09/17/2018 04:03PM by 11Master.
Re: problem with LCD and encoder mod
September 17, 2018 07:10PM
Wll, you foround some inspiration, and it lead to a solution. And solutions... we like smileys with beer
Sorry, only registered users may post in this forum.

Click here to login