Skip to content
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

Add support MKS MINI12864 V3 for MKS Robin Nano V2, Nano V3 board #22285

Merged
merged 50 commits into from
Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
5c8f4a5
Merge pull request #1 from MarlinFirmware/bugfix-2.0.x
mks-viva Jul 28, 2020
5d5f4e6
Merge pull request #2 from MarlinFirmware/bugfix-2.0.x
mks-viva Jul 28, 2020
34b9df8
Support MKS SGEN_L V2 board
Jul 28, 2020
a3b0f9d
Update pins_MKS_SGEN_L_V2.h
thinkyhead Jul 29, 2020
bf9ee2e
Update pins_MKS_SGEN_L_V2.h
thinkyhead Jul 29, 2020
2d95919
4K size stated
thinkyhead Jul 29, 2020
4bdaec1
Update pins_MKS_SGEN_L_V2.h
thinkyhead Sep 1, 2020
45d1077
Merge pull request #3 from MarlinFirmware/bugfix-2.0.x
mks-viva Sep 5, 2020
8a8da49
Fix MKS LCD12864A/B display on MKS Robin E3/E3D and MKS SGEN_L
Sep 5, 2020
7dc13be
Merge pull request #4 from MarlinFirmware/bugfix-2.0.x
makerbase-mks Sep 8, 2020
a96c6de
Add support for MKS GEN_L V2.1
Sep 9, 2020
d4bdd00
Merge pull request #5 from MarlinFirmware/bugfix-2.0.x
makerbase-mks Sep 9, 2020
0f9b303
Merge branch 'bugfix-2.0.x' of https://github.com/mks-viva/Marlin int…
Sep 9, 2020
7c622f3
Add support for MKS Gen-L V2.1
Sep 9, 2020
1c8c018
Update pins_MKS_GEN_L_V21.h
makerbase-mks Sep 9, 2020
453f220
Update pins_MKS_GEN_L_V21.h
makerbase-mks Sep 9, 2020
cd14a96
Update MarlinCore.cpp
makerbase-mks Sep 9, 2020
bc5d316
Update Configuration.h
makerbase-mks Sep 9, 2020
07b33a9
Update MarlinCore.cpp
makerbase-mks Sep 9, 2020
4cb7f4a
Update MarlinCore.cpp
thinkyhead Sep 10, 2020
8b08e95
Add Makefile, clean up
thinkyhead Sep 10, 2020
ceb896f
fix Makefile and board file
Sep 16, 2020
aee8e75
Merge pull request #6 from MarlinFirmware/bugfix-2.0.x
makerbase-mks Sep 16, 2020
e323c13
Merge pull request #7 from MarlinFirmware/bugfix-2.0.x
makerbase-mks Sep 17, 2020
2a0f81c
Merge pull request #8 from MarlinFirmware/bugfix-2.0.x
makerbase-mks Sep 21, 2020
ff8a7e2
Fix MKS SGEN_L V2 FAN pins
Sep 21, 2020
fe2f3cd
Update pins_MKS_SGEN_L_V2.h
thinkyhead Sep 22, 2020
ee8db31
Merge pull request #9 from MarlinFirmware/bugfix-2.0.x
mks-viva Oct 14, 2020
a3b7b83
Merge pull request #10 from MarlinFirmware/bugfix-2.0.x
mks-viva Oct 16, 2020
b39f490
Add RGB LED pin define for MKS SGEN_L V2
mks-viva Oct 16, 2020
b7ae0f9
Update pins_MKS_SGEN_L_V2.h
thinkyhead Oct 16, 2020
034dd99
Merge pull request #11 from MarlinFirmware/bugfix-2.0.x
mks-viva Nov 20, 2020
e64c055
Add support for MKS Robin E3/E3D V1.1 motherboard
mks-viva Nov 20, 2020
60a264a
Update Configuration.h
mks-viva Nov 20, 2020
3c8ff62
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into pr/20216
thinkyhead Nov 26, 2020
0657f35
Update pins.h
thinkyhead Nov 26, 2020
0a9b678
Consolidate pins
thinkyhead Nov 26, 2020
9a20663
Tweak comments
thinkyhead Nov 26, 2020
c05e1ce
Update to the latest marlin
mks-viva Jan 22, 2021
8578cb7
Merge pull request #13 from MarlinFirmware/bugfix-2.0.x
mks-viva Jan 22, 2021
ca78c7d
Merge pull request #14 from MarlinFirmware/bugfix-2.0.x
mks-viva Mar 16, 2021
f6aa532
Merge pull request #15 from MarlinFirmware/bugfix-2.0.x
mks-viva Apr 30, 2021
9105b0f
Merge pull request #16 from MarlinFirmware/bugfix-2.0.x
mks-viva Jul 2, 2021
6b3c6e8
MKS Robin Nano V2/V3 support MKS MINI12864 V3
mks-viva Jul 2, 2021
54946ec
MKS Robin E3/E3D has supported MKS MINI12864 V3
mks-viva Jul 2, 2021
9bec460
Update platformio.ini
mks-viva Jul 2, 2021
474ec0b
Update Configuration.h
mks-viva Jul 2, 2021
3d63772
Update stm32f1.ini
mks-viva Jul 2, 2021
f20e156
Update stm32f1.ini
mks-viva Jul 2, 2021
9580e37
Misc fixes
thinkyhead Jul 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -2392,6 +2392,14 @@
//
//#define MKS_MINI_12864

//
// MKS MINI12864 V3 use YSETC_MINI_12864_2_1's method, Type A/B. NeoPixel RGB Backlight
//
//#define MKS_MINI_12864_V3
#if ENABLED(MKS_MINI_12864_V3)
#define FYSETC_MINI_12864_2_1
#endif

//
// MKS LCD12864A/B with graphic controller and SD support. Follows MKS_MINI_12864 pinout.
// https://www.aliexpress.com/item/33018110072.html
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32F1/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#error "SERIAL_STATS_DROPPED_RX is not supported on the STM32F1 platform."
#endif

#if ENABLED(NEOPIXEL_LED)
#if ENABLED(NEOPIXEL_LED) && DISABLED(MKS_MINI_12864_V3)
#error "NEOPIXEL_LED (Adafruit NeoPixel) is not supported for HAL/STM32F1. Comment out this line to proceed at your own risk!"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Neopixel is now working with HAL/STM32F1, that is news to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, maybe I told you earlier, my latest test situation.

  1. In pins_MKS_ROBIN_E3_common.h fix pin
#elif ENABLED(MKS_MINI_12864_V3)    
    #define DOGLCD_CS                       PA4
    #define DOGLCD_A0                       PA5
    #define LCD_PINS_DC                     DOGLCD_A0
    #define LCD_BACKLIGHT_PIN               -1
    #define LCD_RESET_PIN                   PA6
    #define NEOPIXEL_PIN                    PA7
    #define DOGLCD_MOSI                     PB15
    #define DOGLCD_SCK                      PB13
    #define FORCE_SOFT_SPI
  1. I has test it and display is ok on E3 board, but there is a bug .
    A. If i have enable #define FORCE_SOFT_SPI, the lcd blacklight's color is can be change by lcd, but read card by lcd and it will display stuck
    B. If i have disenable #define FORCE_SOFT_SPI, the lcd blacklight's color is can not be change by lcd, but read card by lcd is OK

#endif

Expand Down
6 changes: 5 additions & 1 deletion Marlin/src/lcd/dogm/marlinui_DOGM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ U8G_CLASS u8g;

void MarlinUI::set_contrast(const int16_t value) {
contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX);
u8g.setContrast(contrast);
#if ENABLED(MKS_MINI_12864_V3)
u8g.setContrast(255);
#else
u8g.setContrast(contrast);
#endif
}

#endif
Expand Down
11 changes: 11 additions & 0 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,17 @@
#define DOGLCD_SCK PB13
#define DOGLCD_MOSI PB15

#elif ENABLED(MKS_MINI_12864_V3)
#define ENABLE_SPI3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, theoretically, you could attach a FYSETC MINI 12864 v2.1 and it would also work?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that is the case, then this might as well just be #elif ENABLED(FYSETC_MINI_12864_2_1).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, theoretically, you could attach a FYSETC MINI 12864 v2.1 and it would also work?

// MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor)
#if ENABLED(FYSETC_GENERIC_12864_1_1)

#define LCD_BACKLIGHT_PIN               27
#define LCD_RESET_PIN                   23
#define DOGLCD_A0                       16
#define DOGLCD_CS                       17
#define DOGLCD_SCK                      PB13
#define DOGLCD_MOSI                     PB15
#define SDSS                            53
#define BTN_EN1                           31
#define BTN_EN2                           33
#define BTN_ENC                           35
#define BEEPER_PIN                        37
#define SD_DETECT_PIN                     49

But I still have a blue screen

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, theoretically, you could attach a FYSETC MINI 12864 v2.1 and it would also work?

// MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor)
#if ENABLED(FYSETC_GENERIC_12864_1_1)

#define LCD_BACKLIGHT_PIN               27
#define LCD_RESET_PIN                   23
#define DOGLCD_A0                       16
#define DOGLCD_CS                       17
#define DOGLCD_SCK                      PB13
#define DOGLCD_MOSI                     PB15
#define SDSS                            53
#define BTN_EN1                           31
#define BTN_EN2                           33
#define BTN_ENC                           35
#define BEEPER_PIN                        37
#define SD_DETECT_PIN                     49

But I still have a blue screen

You can try to add '#define FORCE_SOFT_SPI' in pin define,
image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made some progress after '#define FORCE_SOFT_SPI' now the blue screen is shown with a white rectangle...
IMG_1149

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#if ENABLED(FYSETC_GENERIC_12864_1_1)

#define DOGLCD_CS                       PA4
#define DOGLCD_A0                       PA5
#define LCD_PINS_DC                     DOGLCD_A0
#define LCD_BACKLIGHT_PIN               -1
#define LCD_RESET_PIN                   PA6
#define NEOPIXEL_PIN                    PA7
#define DOGLCD_MOSI                     PB15
#define DOGLCD_SCK                      PB13
#define FORCE_SOFT_SPI

All OK!!! THANKSSSSS

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The next challenge is to make the SD work, when I try to read the screen it freezes ...

Copy link
Contributor Author

@mks-viva mks-viva Jul 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The next challenge is to make the SD work, when I try to read the screen it freezes ...

I have the same problem in my test.
@rhapsodyv
image
Any ideas? I think it is SPI influence, because PA7 (Neopixel pin) is SPI1, and SD is use SPI2

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SD is detected on the screen it shows the correct message but nevertheless when you enter it remains blocked, I think that if the SD we put it in MKS it does the same.

#define DOGLCD_CS PA4
#define DOGLCD_A0 PA5
#define LCD_PINS_DC DOGLCD_A0
#define LCD_BACKLIGHT_PIN -1
#define LCD_RESET_PIN PA6
#define NEOPIXEL_PIN PA7
#define DOGLCD_MOSI PB15
#define DOGLCD_SCK PB13

#else

#define LCD_PINS_D4 PA6
Expand Down
39 changes: 33 additions & 6 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,19 @@
#define SDCARD_CONNECTION ONBOARD
#endif

#define SDIO_SUPPORT
#define SDIO_CLOCK 4500000 // 4.5 MHz
#define SD_DETECT_PIN PD12
#define ONBOARD_SD_CS_PIN PC11
#if SD_CONNECTION_IS(ONBOARD)
#define SDIO_SUPPORT
#define SDIO_CLOCK 4500000 // 4.5 MHz
#define SD_DETECT_PIN PD12
#define ONBOARD_SD_CS_PIN PC11
#elif SD_CONNECTION_IS(LCD)
#define ENABLE_SPI1
#define SDSS PE10
#define SD_SCK_PIN PA5
#define SD_MISO_PIN PA6
#define SD_MOSI_PIN PA7
#define SD_DETECT_PIN PE12
#endif

//
// LCD / Controller
Expand Down Expand Up @@ -291,8 +300,13 @@
#endif

#if HAS_WIRED_LCD && !HAS_SPI_TFT

// NON TFT Displays
#define BEEPER_PIN PC5
#define BTN_ENC PE13
#define LCD_PINS_ENABLE PD13
#define LCD_PINS_RS PC6
#define BTN_EN1 PE8
#define BTN_EN2 PE11
#define LCD_BACKLIGHT_PIN -1

#if ENABLED(MKS_MINI_12864)

Expand All @@ -318,6 +332,19 @@
#ifndef BEEPER_PIN
#define BEEPER_PIN -1
#endif

#elif ENABLED(MKS_MINI_12864_V3)
#define DOGLCD_CS PD13
#define DOGLCD_A0 PC6
#define LCD_PINS_DC DOGLCD_A0
#define LCD_BACKLIGHT_PIN -1
#define LCD_RESET_PIN PE14
#define NEOPIXEL_PIN PE15
#define DOGLCD_MOSI PA7
#define DOGLCD_SCK PA5
#if SD_CONNECTION_IS(ONBOARD)
#define FORCE_SOFT_SPI
#endif

#else // !MKS_MINI_12864

Expand Down
13 changes: 13 additions & 0 deletions Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,19 @@
// Required for MKS_MINI_12864 with this board
//#define MKS_LCD12864B
//#undef SHOW_BOOTSCREEN

#elif ENABLED(MKS_MINI_12864_V3)
#define DOGLCD_CS PD13
#define DOGLCD_A0 PC6
#define LCD_PINS_DC DOGLCD_A0
#define LCD_BACKLIGHT_PIN -1
#define LCD_RESET_PIN PE14
#define NEOPIXEL_PIN PE15
#define DOGLCD_MOSI PA7
#define DOGLCD_SCK PA5
#if SD_CONNECTION_IS(ONBOARD)
#define FORCE_SOFT_SPI
#endif

#else // !MKS_MINI_12864

Expand Down
1 change: 1 addition & 0 deletions ini/stm32f1.ini
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ debug_tool = stlink
extra_scripts = ${common_STM32F103RC.extra_scripts}
buildroot/share/PlatformIO/scripts/mks_encrypt.py


#
# Creality (STM32F103RET6)
#
Expand Down