Welcome! Log In Create A New Profile

Advanced

Interfacing with the Wanhao i3 LCD

Posted by rgov 
Interfacing with the Wanhao i3 LCD
June 03, 2020 09:07PM
I have a Wanhao Duplicator i3 aka Monoprice Maker Select V2.1, which uses a Melzi controller board. I have successfully installed Marlin to that board, and it functions well.

I'm replacing the Melzi board with a BIGTREETECH SKR V1.4 Turbo and rebuilding Marlin for it. I'm trying to figure out how to interface with the LCD that's built into the i3's control box. Just to emphasize, Marlin worked fine with this LCD when it was attached to the Melzi, using the LCD_FOR_MELZI setting and the Sanguinololu 1.1 pin settings. (I am a novice when it comes to 3d printers and generally electronics.)

My question is how I can configure the EXP pins on the SKR through Marlin to be able to communicate with this LCD.

A commenter on a blog once wrote that he got it to work:

For those who struggles to connect the stock wanhao i3 1.2 LCD display. I got it working by connecting the following pins:
pin 1 LCD CS –> 1.19 EXP 1
pin 2 Encoder B –> 3.25 EXP 2
pin 3 LCD Data –> 1.18 EXP 1
Pin 4 Encoder A–> 3.26 EXP 2
pin 5 LCD SCLK –> 1.20 EXP 1
pin 6 Encoder Button –> 0.28 EXP 1
pin 7 ESTOP –> I dont use that one- so did not try to find it
pin 8 Beeper –> 1.30 EXP 1
Pin 9 5v –> 5V EXP 1
pin 10 GND –> GND EXP 1

LCD pins should like this:
1 2
3 4
5 6
7 8
9 10

There are a couple of things that are impeding my understanding here: Their pin labels for the LCD don't match what's silkscreened on the Melzi. I don't know what display setting they used in their configuration file. They wire the LCD display to both EXP1 and EXP2 and I'm hoping it can be done without making some unholy wiring mess that goes to both. Finally, the pin numbering doesn't comport with what is what is silkscreened on the Melzi and the Pin 1 indicator on the box header.

Here is my own diagram of what is silkscreened and how the cable attaches between the two PCBs:

/**
 *       Melzi                      SKR
 *       _____                     _____
 *  GND |10 9 | 5V             5V |10 9 | GND
 *   A4 | 8 7 | D10/RX1      1.23 | 8 7 | 1.22 
 *   A3 | 6 5   D11/TX1  ->  1.21 | 6 5   1.20 
 *   A2 | 4 3 | D16/SCL      1.19 | 4 3 | 1.18 
 *   A1 | 2 1 | D17/SDA      0.28 | 2 1 | 1.30
 *       -----                     -----
 *                                 EXP1
 */

Note that, for instance, 5V and GND appear to be reversed.

This is what the Wanhao configuration does when you enable the LCD_FOR_MELZI:

      #define LCD_PINS_RS                     17
      #define LCD_PINS_ENABLE                 16
      #define LCD_PINS_D4                     11

      #define BOARD_ST7920_DELAY_1 DELAY_NS(0)
      #define BOARD_ST7920_DELAY_2 DELAY_NS(188)
      #define BOARD_ST7920_DELAY_3 DELAY_NS(0)

Am I able to program the SKR pins to talk to the LCD?

Edited 2 time(s). Last edit at 06/03/2020 09:44PM by rgov.
Re: Interfacing with the Wanhao i3 LCD
June 03, 2020 11:26PM
You have to make up a custom cable. You cannot reprogram what pins are +5v and gnd.
Re: Interfacing with the Wanhao i3 LCD
June 04, 2020 09:13AM
Ok, I can do that, but is there a way to reprogram all the others?
Re: Interfacing with the Wanhao i3 LCD
June 04, 2020 10:39AM
The display has

buzzer (1 pin)
encoder (3 pins)
stop button (1 pin)
All of these can be on any pin, but why reinvent the wheel.
but also has a SPI based lcd so has MOSI/SCK/CS (3 pins)
m fairly sure the the first 2 have to be on the equivalent skr 1.4 pin and cannot be moved. the CS can be any pin

Here are the default pins for a SKR 1.4

/**
 *              _____                                             _____
 *          NC | · · | GND                                    5V | · · | GND
 *       RESET | · · | 1.31(SD_DETECT)             (LCD_D7) 1.23 | · · | 1.22 (LCD_D6)
 *  (MOSI)0.18 | · · | 3.25(BTN_EN2)               (LCD_D5) 1.21 | · · | 1.20 (LCD_D4)
 * (SD_SS)0.16 | · · | 3.26(BTN_EN1)               (LCD_RS) 1.19 | · · | 1.18 (LCD_EN)
 *   (SCK)0.15 | · · | 0.17(MISO)                 (BTN_ENC) 0.28 | · · | 1.30 (BEEPER)
 *              -----                                             -----
 *              EXP2                                              EXP1
 */

So your probably going to be using

/**
 *              _____                                             _____
 *          NC | · · | GND                                    5V | x x | GND
 *       RESET | x · | 1.31(SD_DETECT)             (LCD_D7) 1.23 | · · | 1.22 (LCD_D6)
 *  (MOSI)0.18 | x x | 3.25(BTN_EN2)               (LCD_D5) 1.21 | · · | 1.20 (LCD_D4)
 * (SD_SS)0.16 | · x | 3.26(BTN_EN1)               (LCD_RS) 1.19 | · x | 1.18 (LCD_EN)
 *   (SCK)0.15 | x · | 0.17(MISO)                 (BTN_ENC) 0.28 | x x | 1.30 (BEEPER)
 *              -----                                             -----
 *              EXP2                                              EXP1
 */



There is insufficient information in your melzi diagram to determine all that you need.

Your diagram and the blog post disagree as to which are SCK and MOSI

You need to verify as much as you can on the LCD (meter on continuity, find out where they all go)

I cannot find a circuit diagram on this display.

Edited 1 time(s). Last edit at 06/04/2020 11:00AM by Dust.
Re: Interfacing with the Wanhao i3 LCD
June 04, 2020 06:32PM
Thanks Dust. The display itself seems to be a ST7920, and I was able to confirm that pins 1, 3, 5 connect to the SPI pins on the display, and pins 10 and 9 are GND and VCC respectively. I am thinking now that I've fried something considering that I cannot get the display to show any message if I connect it to an Arduino.
Re: Interfacing with the Wanhao i3 LCD
February 10, 2021 05:35PM
THANKS for the help, i where able to figure the connection out and test and get working smiling smiley

    /** Melzi V4 12864 display pinout
     *                   _____
     *              GRN | 1 2 | 5V
     *             Buzz | 3 4 | e-Stop
     *  Encoder ENC-EN1 | 5 6   Display D4
     *  Encoder ENC     | 7 8 | Display Enable
     *  Encoder ENC-EN2 | 9 10| Display RS
     *                   -----
     *                    EXP1
     */



If u Configure Marlin to use CR10_STOCKDISPLAY
by uncommenting #define CR10_STOCKDISPLAY in Configuration.h
then the EXP1 port will be configured as followering


    /** SKR 1.4 EXP1
     *                   _____
     *              5V  | 1 2 | GRN
     *    Display Enable| 3 4 | Display RS
     *    Display D4    | 5 6   Encoder ENC 
     *                  | 7 8 | Encoder ENC-EN2
     *  Encoder ENC-EN1 | 9 10| Buzz 
     *                   -----
     *                    EXP1
     */


The Cable config will be

Display		SKR
1 ------------>	2
2 ------------> 1
3 ------------>	10
4 ------------>	NC (Not Connected)
5 ------------>	9
6 ------------>	5
7 ------------>	6
8 ------------>	3
9 ------------>	8
10 ----------->	4


i Can varify this work smiling smiley

OBS Be carefull of pins 1 and 2 as that are flipped, and you will run the chance of burning your display if 1 go to 1 !!! (aka DONT try to use a normal cable!!!)
OBS , i needed to remove LIGHTWEIGHT_UI by commenting out this line // #define LIGHTWEIGHT_UI in configuration_adv.h
otherwise i could not compile/build

Edited 1 time(s). Last edit at 02/10/2021 05:37PM by JacobIpsen.
Attachments:
open | download - IMG_20210210_233007.jpg (394.9 KB)
open | download - IMG_20210210_232954.jpg (274.8 KB)
Sorry, only registered users may post in this forum.

Click here to login