Skip to content

[1.1.x] Add support for 4 new LCDs #7867

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

Merged

Conversation

thinkyhead
Copy link
Member

@thinkyhead thinkyhead commented Oct 6, 2017

Adapted from #7824 by @jmdearras

  • MAKEBOARD_MINI_2_LINE_DISPLAY_1602
  • CR10_STOCKDISPLAY
  • MKS_MINI_12864
  • MKS_12864OLED

Compare to original (working?) changes… 2076b54...9bc8c05

Also includes changes from #7447 supporting the VIKI chip ST7565.

@mmdts
Copy link

mmdts commented Oct 6, 2017

Sorry for the un-researched question, but when is this getting merged?

@thinkyhead thinkyhead force-pushed the bf1_add_some_lcds branch 2 times, most recently from 50cfdc7 to 124f715 Compare October 6, 2017 23:08
@thinkyhead
Copy link
Member Author

@mmdts When it's ready. Maybe today, if it passes testing.

@thinkyhead thinkyhead force-pushed the bf1_add_some_lcds branch 3 times, most recently from a3a7511 to b54cd14 Compare October 6, 2017 23:21
@jmdearras
Copy link
Contributor

MKS_MINI_12864 fails to work, something to do with the re-ordering of code. Suddenly getting ENCODER_PULSES_PER_STEP missing error on minidisplay.

@jmdearras
Copy link
Contributor

define minipanel and see if you get a clean compile.

@thinkyhead
Copy link
Member Author

I moved the conditionals for MINIPANEL to the bottom. See if that helps…?

On another topic, I can see where the u8g(…) pin numbers came from following the link in the configs. But, the pins are assigned to different functions via the changes in pins_RAMPS.h. Those need to be reconciled and sorted out. Different boards will have different pins available and may be hot-pluggable, but the pin names have to be correct.

@thinkyhead thinkyhead force-pushed the bf1_add_some_lcds branch 3 times, most recently from a31c3a2 to 8062151 Compare October 7, 2017 04:32
@thinkyhead
Copy link
Member Author

thinkyhead commented Oct 7, 2017

@jmdearras This should work…

      #if ENABLED(MKS_12864OLED)
        #define LCD_PINS_DC     25 // Set as output on init
        #define LCD_PINS_RS     27 // Pull low for 1s to init
        // DOGM SPI LCD Support
        #define DOGLCD_CS       16
        #define DOGLCD_MOSI     17
        #define DOGLCD_SCK      23
        #define DOGLCD_A0       LCD_PINS_DC
      #else
        #define LCD_PINS_RS     16
        #define LCD_PINS_ENABLE 17
        #define LCD_PINS_D4     23
        #define LCD_PINS_D5     25
        #define LCD_PINS_D6     27
      #endif

      #define LCD_PINS_D7       29

…and…

  // MKS 128x64 (SH1106) OLED I2C LCD
  U8GLIB_SH1106_128X64 u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0);

@thinkyhead thinkyhead force-pushed the bf1_add_some_lcds branch 3 times, most recently from 2dd4292 to e3eafbc Compare October 7, 2017 05:01
@jmdearras
Copy link
Contributor

jmdearras commented Oct 7, 2017 via email

@jmdearras
Copy link
Contributor

pardon my ignorance of GitHub, but can I get a fresh image of this branch so I can test. I am still running into ENCODER_STEPS errors, not declared on minipanel, which MKS_MINI_12864 uses.

@jmdearras
Copy link
Contributor

I found it. MKS_MINI_12864 works fine, but MKS_12864OLED displays OK, but beeps constantly (clk signal)? and the display acts as if the knob is being pushed constantly.

@thinkyhead
Copy link
Member Author

I'll compare the changes I made to your original work and see if I missed some crucial difference. I should be able to catch it pretty quickly, given the relatively small number of changes involved.

@thinkyhead
Copy link
Member Author

thinkyhead commented Oct 7, 2017

@jmdearras I'm assuming that your original PR had the OLED display working… and so I'm looking at the original code to see what differs. But I come up against a bug that would normally cause things to break…

Look at this line and see how it comes before this line.

 #elif ENABLED(MINIPANEL)
   . . .
 #elif ENABLED(MKS_MINI_12864)
   . . .

Due to this line it means that the settings for MKS_MINI_12864 are never applied. The pins are set according to MINIPANEL in the original PR. If you check out that commit and build it, and it works, that would be interesting.

git checkout faa1db8 -b bf1_new_lcds_before_updates

This PR corrects for that and allows the pins for MKS_MINI_12864 to be applied. Maybe one or more of them should be the same as its MINIPANEL value.

@jmdearras
Copy link
Contributor

jmdearras commented Oct 7, 2017 via email

@jmdearras
Copy link
Contributor

jmdearras commented Oct 7, 2017 via email

@thinkyhead thinkyhead force-pushed the bf1_add_some_lcds branch 2 times, most recently from 9b09d0e to bda42ed Compare October 9, 2017 01:08
@thinkyhead
Copy link
Member Author

thinkyhead commented Oct 9, 2017

I think this should be working now! The MKS OLED needs to have REPRAP_DISCOUNT_SMART_CONTROLLER pins for the controller input.

https://github.com/thinkyhead/Marlin/tree/bf1_add_some_lcds

@jmdearras
Copy link
Contributor

jmdearras commented Oct 9, 2017 via email

@jmdearras
Copy link
Contributor

jmdearras commented Oct 9, 2017 via email

@jmdearras
Copy link
Contributor

edited sanity check for clean compile:
#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
&& DISABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
&& DISABLED(LCD_FOR_MELZI)
&& DISABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602)
&& DISABLED(MKS_12864OLED)
+ 1
#endif

@thinkyhead thinkyhead merged commit 73c5675 into MarlinFirmware:bugfix-1.1.x Oct 9, 2017
@thinkyhead thinkyhead deleted the bf1_add_some_lcds branch October 9, 2017 23:27
@jneilliii
Copy link
Contributor

I have a question regarding the CR10_STOCKDISPLAY implementation. The board linked to on aliexpress is using EXP3 port on it's board, but my stock lcd is on EXP1. Once I implement CR10_STOCKDISPLAY, which port do I plug into using an EINSYRAMBo main board? I've tried all 3 EXP ports, as well as filing off the key on the ribbon cable and inserting in reverse (others reported this necessary for other main boards with the 2 ribbon cable lcd models). Any help/guidance would be greatly appreciated.

@thinkyhead
Copy link
Member Author

thinkyhead commented Feb 25, 2018

If you haven't implemented it, then how are you "trying" it? Are you using a firmware that is already compiled with support for a graphical display on EXP1?

@jneilliii
Copy link
Contributor

I've compiled marlin bugfix_1.1.x with the option CR10_STOCKDISPLAY uncommented and flashed to einsy board. I assumed that would have given me the support for graphical display using the single ribbon cable on EXP1 since that is what the stock cr-10 came with.

@thinkyhead
Copy link
Member Author

We don't have a pins file for the Einsy RAMBo. You'll have to figure out which pins are which on that board and see how they match up to whatever pins file you're currently using. You'll need the schematic of the board to see where the pins go, and you'll need to know which pins on the ribbon cable are which. We simply don't know any more than you do.

@thinkyhead
Copy link
Member Author

If you read this page you'll be more informed than us: http://manual.prusa3d.com/Guide/2.+Printer+assembly/588

And, if you ask Prusa Research for help in their support forums, you may find more knowledgeable geeks there.

@jneilliii
Copy link
Contributor

Yeah, I grabbed the pins file from ultimachine's github and incorporated that prior to compiling. If I use a reprap_discount _smartcontroller it works fine with an older display using both EXP1 and EXP2. I've already ordered a replacement full graphic display that has both cables, so guess I'll just have to wait for that one.

@thinkyhead
Copy link
Member Author

thinkyhead commented Feb 25, 2018

I'm jumping to conclusions that the Einsy RAMBo is using the same pinouts as previous RAMBo. If you're using the pins_RAMBO.h file then please try replacing the LCD section at the end with this:

//
// LCD / Controller
//
#if ENABLED(ULTRA_LCD)

  #define KILL_PIN          80

  #if ENABLED(CR10_STOCKDISPLAY)
    #define LCD_PINS_RS     74
    #define LCD_PINS_ENABLE 75
    #define LCD_PINS_D4     73
    #define BTN_EN1         71
    #define BTN_EN2         72
    #define BTN_ENC         78
    #define SD_DETECT_PIN   81

    #if DISABLED(NEWPANEL)
      #define BEEPER_PIN    79 // AUX-4
    #endif

  #elif ENABLED(NEWPANEL)

    #define LCD_PINS_RS     70
    #define LCD_PINS_ENABLE 71
    #define LCD_PINS_D4     72
    #define LCD_PINS_D5     73
    #define LCD_PINS_D6     74
    #define LCD_PINS_D7     75

    #if ENABLED(VIKI2) || ENABLED(miniVIKI)
      #define BEEPER_PIN 44
      // NB: Panucatt's Viki 2.0 wiring diagram (v1.2) indicates that the
      //     beeper/buzzer is connected to pin 33; however, the pin used in the
      //     diagram is actually pin 44, so this is correct.

      #define DOGLCD_A0  70
      #define DOGLCD_CS  71
      #define LCD_SCREEN_ROT_180

      #define BTN_EN1 85
      #define BTN_EN2 84
      #define BTN_ENC 83

      #define SD_DETECT_PIN -1 // Pin 72 if using easy adapter board

      #define STAT_LED_RED_PIN 22
      #define STAT_LED_BLUE_PIN 32

    #else // !VIKI2 && !miniVIKI

      #define BEEPER_PIN 79 // AUX-4

      // AUX-2
      #define BTN_EN1 76
      #define BTN_EN2 77
      #define BTN_ENC 78

      #define SD_DETECT_PIN 81

    #endif // !VIKI2 && !miniVIKI

  #else // !NEWPANEL - old style panel with shift register

    // No Beeper added
    #define BEEPER_PIN 33

    // buttons are attached to a shift register
    // Not wired yet
    //#define SHIFT_CLK 38
    //#define SHIFT_LD 42
    //#define SHIFT_OUT 40
    //#define SHIFT_EN 17

    #define LCD_PINS_RS     75
    #define LCD_PINS_ENABLE 17
    #define LCD_PINS_D4     23
    #define LCD_PINS_D5     25
    #define LCD_PINS_D6     27
    #define LCD_PINS_D7     29

  #endif // !NEWPANEL

#endif // ULTRA_LCD

@thinkyhead
Copy link
Member Author

@jneilliii — Good morning! Let me know whether I've worked out the correct pins for the RAMBo display plug. I didn't have a lot to go on, but as far as I can tell these pins should work.

@jneilliii
Copy link
Contributor

I tried your suggestion, but unfortunately did not work for me. The pin_EINSYRAMBO.h file I used to start with can be found in the marlin branch found here. It's an older version of Marlin, but I figured pin assignments for the board would work ok in the latest bugfix branch. Enabling pins_debug this is the output of M43 on that older marlin flashed to the board.

PIN:   0   Port: E0        RXD                         protected
PIN:   1   Port: E1        TXD                         protected
PIN:   2   Port: E4        <unused/unknown>            Input  = 1    TIMER3B   PWM:     0    WGM: 1    COM3B: 0    CS: 3    TCCR3A: 1    TCCR3B: 3    TIMSK3: 0
PIN:   3   Port: E5        HEATER_0_PIN                protected
PIN:   4   Port: G5        HEATER_BED_PIN              protected
PIN:   5   Port: E3        <unused/unknown>            Input  = 0    TIMER3A   PWM:     0    WGM: 1    COM3A: 0    CS: 3    TCCR3A: 1    TCCR3B: 3    TIMSK3: 0
PIN:   6   Port: H3        FAN1_PIN                    protected
PIN:   7   Port: H4        <unused/unknown>            Input  = 0    TIMER4B   PWM:     0    WGM: 1    COM4B: 0    CS: 3    TCCR4A: 1    TCCR4B: 3    TIMSK4: 0
PIN:   8   Port: H5        FAN_PIN                     protected
PIN:   9   Port: H6        BTN_ENC                     Input  = 1    TIMER2B   PWM:     0    WGM: 1    COM2B: 0    CS: 4    TCCR2A: 1    TCCR2B: 4    TIMSK2: 0
.                          CASE_LIGHT_PIN              Input  = 1
.                          SPINDLE_LASER_PWM_PIN       Input  = 1
PIN:  10   Port: B4        <unused/unknown>            Input  = 0    TIMER2A   PWM:     0    WGM: 1    COM2A: 0    CS: 4    TCCR2A: 1    TCCR2B: 4    TIMSK2: 0
PIN:  11   Port: B5        <unused/unknown>            Input  = 1    TIMER1A   PWM:  2000    WGM: 4    COM1A: 0    CS: 2    TCCR1A: 0    TCCR1B: 10    TIMSK1: 2   non-standard PWM mode   compare interrupt enabled
PIN:  12   Port: B6        <unused/unknown>            Input  = 1    TIMER1B   PWM:     0    WGM: 4    COM1B: 0    CS: 2    TCCR1A: 0    TCCR1B: 10    TIMSK1: 2   non-standard PWM mode
PIN:  13   Port: B7        LED_PIN                     Input  = 0    TIMER0A   PWM:     0    WGM: 3    COM0A: 0    CS: 3    TCCR0A: 3    TCCR0B: 3    TIMSK0: 5   overflow interrupt enabled
 .                  TIMER1C is also tied to this pin                  TIMER1C   PWM:     0    WGM: 4    COM1C: 0    CS: 2    TCCR1A: 0    TCCR1B: 10    TIMSK1: 2   non-standard PWM mode
PIN:  14   Port: J1        BTN_EN1                     Input  = 1
PIN:  15   Port: J0        SD_DETECT_PIN               Input  = 1
PIN:  16   Port: H1        <unused/unknown>            Input  = 0
PIN:  17   Port: H0        <unused/unknown>            Input  = 0
PIN:  18   Port: D3        SPINDLE_LASER_ENABLE_PIN    Input  = 0
PIN:  19   Port: D2        SPINDLE_DIR_PIN             Input  = 0
PIN:  20   Port: D1        SDA                         Input  = 0
PIN:  21   Port: D0        SCL                         Input  = 0
PIN:  22   Port: A0        <unused/unknown>            Input  = 0
PIN:  23   Port: A1        <unused/unknown>            Input  = 0
PIN:  24   Port: A2        <unused/unknown>            Input  = 0
PIN:  25   Port: A3        <unused/unknown>            Input  = 0
PIN:  26   Port: A4        E0_ENABLE_PIN               protected
PIN:  27   Port: A5        Z_ENABLE_PIN                protected
PIN:  28   Port: A6        Y_ENABLE_PIN                protected
PIN:  29   Port: A7        X_ENABLE_PIN                protected
PIN:  30   Port: C7        <unused/unknown>            Input  = 0
PIN:  31   Port: C6        <unused/unknown>            Input  = 0
PIN:  32   Port: C5        KILL_PIN                    Input  = 1
PIN:  33   Port: C4        <unused/unknown>            Input  = 0
PIN:  34   Port: C3        E0_STEP_PIN                 protected
PIN:  35   Port: C2        Z_STEP_PIN                  protected
PIN:  36   Port: C1        Y_STEP_PIN                  protected
PIN:  37   Port: C0        X_STEP_PIN                  protected
PIN:  38   Port: D7        <unused/unknown>            Input  = 0
PIN:  39   Port: G2        Y_CS_PIN                    Output = 1
PIN:  40   Port: G1        <unused/unknown>            Input  = 0
PIN:  41   Port: G0        X_CS_PIN                    Output = 1
PIN:  42   Port: L7        <unused/unknown>            Input  = 0
PIN:  43   Port: L6        E0_DIR_PIN                  protected
PIN:  44   Port: L5        <unused/unknown>            Input  = 0    TIMER5C   PWM:     0    WGM: 1    COM5C: 0    CS: 3    TCCR5A: 1    TCCR5B: 3    TIMSK5: 0
PIN:  45   Port: L4        <unused/unknown>            Input  = 0    TIMER5B   PWM:     0    WGM: 1    COM5B: 0    CS: 3    TCCR5A: 1    TCCR5B: 3    TIMSK5: 0
PIN:  46   Port: L3        <unused/unknown>            Input  = 0    TIMER5A   PWM:     0    WGM: 1    COM5A: 0    CS: 3    TCCR5A: 1    TCCR5B: 3    TIMSK5: 0
PIN:  47   Port: L2        Z_DIR_PIN                   protected
PIN:  48   Port: L1        Y_DIR_PIN                   protected
PIN:  49   Port: L0        X_DIR_PIN                   protected
PIN:  50   Port: B3        AVR_MISO_PIN                Input  = 1
.                          MISO_PIN                    Input  = 1
PIN:  51   Port: B2        AVR_MOSI_PIN                Output = 0
.                          MOSI_PIN                    Output = 0
PIN:  52   Port: B1        AVR_SCK_PIN                 Output = 1
.                          SCK_PIN                     Output = 1
PIN:  53   Port: B0        AVR_SS_PIN                  Output = 1
.                          SS_PIN                      Output = 1
PIN:  54   Port: F0 (A 0)  TEMP_0_PIN                  protected
PIN:  55   Port: F1 (A 1)  TEMP_1_PIN                  Analog in =  1023
PIN:  56   Port: F2 (A 2)  TEMP_BED_PIN                protected
PIN:  57   Port: F3 (A 3)  <unused/unknown>   Analog in =  1023   Input  = 1
PIN:  58   Port: F4 (A 4)  <unused/unknown>   Analog in =   551   Input  = 1
PIN:  59   Port: F5 (A 5)  LCD_PINS_D4                 Output = 0
PIN:  60   Port: F6 (A 6)  <unused/unknown>   Analog in =   979   Input  = 1
PIN:  61   Port: F7 (A 7)  LCD_PINS_ENABLE             Output = 0
PIN:  62   Port: K0 (A 8)  <unused/unknown>   Analog in =   475   Input  = 0
PIN:  63   Port: K1 (A 9)  <unused/unknown>   Analog in =   549   Input  = 1
PIN:  64   Port: K2 (A10)  X_MIN_PIN                   protected
PIN:  65   Port: K3 (A11)  <unused/unknown>   Analog in =     3   Input  = 0
PIN:  66   Port: K4 (A12)  E0_CS_PIN                   Output = 1
PIN:  67   Port: K5 (A13)  Z_CS_PIN                    Output = 1
PIN:  68   Port: K6 (A14)  Z_MIN_PIN                   protected
PIN:  69   Port: K7 (A15)  Y_MIN_PIN                   protected
PIN:  70   Port: G4        LCD_PINS_D5                 Output = 1
PIN:  71   Port: G3        LCD_PINS_D7                 Output = 1
PIN:  72   Port: J2        BTN_EN2                     Input  = 1
PIN:  73   Port: J3        <unused/unknown>            Input  = 0
PIN:  74   Port: J7        <unused/unknown>            Input  = 0
PIN:  75   Port: J4        <unused/unknown>            Input  = 0
PIN:  76   Port: J5        <unused/unknown>            Input  = 0
PIN:  77   Port: J6        SDSS                        Output = 1
PIN:  78   Port: E2        <unused/unknown>            Input  = 0
PIN:  79   Port: E6        <unused/unknown>            Input  = 1
PIN:  80   Port: E7        <unused/unknown>            Input  = 1
PIN:  81   Port: D4        <unused/unknown>            Input  = 0

@jneilliii
Copy link
Contributor

jneilliii commented Feb 26, 2018

Also, ultimachine is very good about documenting their boards. You can find the electronigs diagram here. I just don't understand how to interpret it correctly. I think the problem here is the single ribbon full graphic controller from creality is not documented on it's pinout.

@thinkyhead
Copy link
Member Author

Ok, for the pins_EINSY_RAMBO.h file, the reassignment for CR-10 stock display gives us this:

//
// LCD / Controller
//
#if ENABLED(ULTRA_LCD)

  #define KILL_PIN         32

  #if ENABLED(NEWPANEL)

    #if ENABLED(CR10_STOCKDISPLAY)
      #define LCD_PINS_RS     85
      #define LCD_PINS_ENABLE 71
      #define LCD_PINS_D4     70
      #define BTN_EN1         61
      #define BTN_EN2         59
    #else
      #define LCD_PINS_RS     82
      #define LCD_PINS_ENABLE 61
      #define LCD_PINS_D4     59
      #define LCD_PINS_D5     70
      #define LCD_PINS_D6     85
      #define LCD_PINS_D7     71
      #define BTN_EN1         14
      #define BTN_EN2         72
    #endif

    // Beeper on AUX-4
    #define BEEPER_PIN     84

    // buttons are directly attached using AUX-2
    #define BTN_ENC         9  // the click

    #define SD_DETECT_PIN  15

  #endif // NEWPANEL
#endif // ULTRA_LCD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants