Explorar el Código

Fix and improve FYSETC LCD support (#13767)

Bob Kuhn hace 6 años
padre
commit
81ca5a4cd4

+ 6
- 0
Marlin/Configuration.h Ver fichero

@@ -1910,6 +1910,12 @@
1910 1910
 // https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8
1911 1911
 //
1912 1912
 //#define FYSETC_MINI_12864
1913
+#ifdef FYSETC_MINI_12864
1914
+  #define FYSETC_MINI_12864_REV_1_2              //  types C, D, E & F  back light is monochrome (always on) - discrete RGB signals
1915
+  //#define FYSETC_MINI_12864_REV_2_0            //  types A & B  back light is RGB - requires LED_USER_PRESET_STARTUP - discrete RGB signals
1916
+  //#define FYSETC_MINI_12864_REV_2_1            //  types A & B  back light is RGB - requires LED_USER_PRESET_STARTUP -  RGB
1917
+  //#define FYSETC_MINI_12864_REV_2_1            //  types A & B  back light is RGB - requires LED_USER_PRESET_STARTUP - Neopixel
1918
+#endif
1913 1919
 
1914 1920
 //
1915 1921
 // Factory display for Creality CR-10

+ 40
- 4
Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp Ver fichero

@@ -53,7 +53,7 @@
53 53
 // Public functions
54 54
 // --------------------------------------------------------------------------
55 55
 
56
-#if ENABLED(DUE_SOFTWARE_SPI)
56
+#if EITHER(DUE_SOFTWARE_SPI, FORCE_SOFT_SPI)
57 57
 
58 58
   // --------------------------------------------------------------------------
59 59
   // software SPI
@@ -739,7 +739,42 @@
739 739
     #define SPI_MODE_2_DUE_HW 0
740 740
     #define SPI_MODE_3_DUE_HW 1
741 741
 
742
+    /**
743
+     *  The DUE SPI controller is set up so the upper word of the longword
744
+     *  written to the transmit data register selects which SPI Chip Select
745
+     *  Register is used. This allows different streams to have different SPI
746
+     *  settings.
747
+     *
748
+     *  In practice it's spooky. Some combinations hang the system, while others
749
+     *  upset the peripheral device.
750
+     *
751
+     *  SPI mode should be the same for all streams. The FYSETC_MINI_12864 gets
752
+     *  upset if the clock phase changes after chip select goes active.
753
+     *
754
+     *  SPI_CSR_CSAAT should be set for all streams. If not the WHILE_TX(0)
755
+     *  macro returns immediately which can result in the SPI chip select going
756
+     *  inactive before all the data has been sent.
757
+     *
758
+     *  The TMC2130 library uses SPI0->SPI_CSR[3].
759
+     *
760
+     *  The U8G hardware SPI uses SPI0->SPI_CSR[0]. The system hangs and/or the
761
+     *  FYSETC_MINI_12864 gets upset if lower baud rates are used and the SD card
762
+     *  is inserted or removed.
763
+     *
764
+     *  The SD card uses SPI0->SPI_CSR[3]. Efforts were made to use [1] and [2]
765
+     *  but they all resulted in hangs or garbage on the LCD.
766
+     *
767
+     *  The SPI controlled chip selects are NOT enabled in the GPIO controller.
768
+     *  The application must control the chip select.
769
+     *
770
+     *  All of the above can be avoided by defining FORCE_SOFT_SPI to force the
771
+     *  display to use software SPI.
772
+     *
773
+     */
774
+
742 775
     void spiInit(uint8_t spiRate=6) {  // Default to slowest rate if not specified)
776
+                                       // Also sets U8G SPI rate to 4MHz and the SPI mode to 3
777
+
743 778
       // 8.4 MHz, 4 MHz, 2 MHz, 1 MHz, 0.5 MHz, 0.329 MHz, 0.329 MHz
744 779
       constexpr int spiDivider[] = { 10, 21, 42, 84, 168, 255, 255 };
745 780
       if (spiRate > 6) spiRate = 1;
@@ -760,15 +795,16 @@
760 795
       // TMC2103 compatible setup
761 796
       // Master mode, no fault detection, PCS bits in data written to TDR select CSR register
762 797
       SPI0->SPI_MR = SPI_MR_MSTR | SPI_MR_PS | SPI_MR_MODFDIS;
763
-      // SPI mode 0, 8 Bit data transfer, baud rate
764
-      SPI0->SPI_CSR[3] = SPI_CSR_SCBR(spiDivider[spiRate]) | SPI_CSR_CSAAT | SPI_MODE_0_DUE_HW;  // use same CSR as TMC2130
798
+      // SPI mode 3, 8 Bit data transfer, baud rate
799
+      SPI0->SPI_CSR[3] = SPI_CSR_SCBR(spiDivider[spiRate]) | SPI_CSR_CSAAT | SPI_MODE_3_DUE_HW;  // use same CSR as TMC2130
800
+      SPI0->SPI_CSR[0] = SPI_CSR_SCBR(spiDivider[1]) | SPI_CSR_CSAAT | SPI_MODE_3_DUE_HW;  // U8G default to 4MHz
765 801
     }
766 802
 
767 803
     void spiBegin() { spiInit(); }
768 804
 
769 805
     static uint8_t spiTransfer(uint8_t data) {
770 806
       WHILE_TX(0);
771
-      SPI0->SPI_TDR = (uint32_t)data | 0x00070000UL;  // Add TMC2130 PCS bits to every byte
807
+      SPI0->SPI_TDR = (uint32_t)data | 0x00070000UL;  // Add TMC2130 PCS bits to every byte (use SPI0->SPI_CSR[3])
772 808
       WHILE_TX(0);
773 809
       WHILE_RX(0);
774 810
       return SPI0->SPI_RDR;

+ 5
- 1
Marlin/src/inc/Conditionals_LCD.h Ver fichero

@@ -138,6 +138,8 @@
138 138
 #elif ENABLED(MKS_MINI_12864)
139 139
 
140 140
   #define MINIPANEL
141
+  #define DEFAULT_LCD_CONTRAST 150
142
+  #define LCD_CONTRAST_MAX 255
141 143
 
142 144
 #elif ENABLED(FYSETC_MINI_12864)
143 145
 
@@ -153,7 +155,9 @@
153 155
 #if EITHER(MAKRPANEL, MINIPANEL)
154 156
   #define DOGLCD
155 157
   #define ULTIPANEL
156
-  #define DEFAULT_LCD_CONTRAST 17
158
+  #ifndef DEFAULT_LCD_CONTRAST
159
+    #define DEFAULT_LCD_CONTRAST 17
160
+  #endif
157 161
 #endif
158 162
 
159 163
 #if ENABLED(ULTI_CONTROLLER)

+ 0
- 7
Marlin/src/inc/SanityCheck.h Ver fichero

@@ -1787,13 +1787,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1787 1787
 #endif
1788 1788
 
1789 1789
 /**
1790
- * Fysetc Mini 12864 requirements
1791
- */
1792
-#if ENABLED(FYSETC_MINI_12864) && DISABLED(LED_USER_PRESET_STARTUP)
1793
-  #error "FYSETC_MINI_12864 requires LED_USER_PRESET_STARTUP to enable the backlight on startup."
1794
-#endif
1795
-
1796
-/**
1797 1790
  * Check existing CS pins against enabled TMC SPI drivers.
1798 1791
  */
1799 1792
 #define INVALID_TMC2130(ST) (AXIS_DRIVER_TYPE(ST, TMC2130) && !PIN_EXISTS(ST##_CS))

+ 13
- 0
Marlin/src/lcd/dogm/HAL_LCD_class_defines.h Ver fichero

@@ -94,3 +94,16 @@ public:
94 94
   : U8GLIB(&u8g_dev_tft_320x240_upscale_from_128x64, cs, rs, reset)
95 95
   { }
96 96
 };
97
+
98
+
99
+extern u8g_dev_t u8g_dev_uc1701_mini12864_HAL_2x_sw_spi, u8g_dev_uc1701_mini12864_HAL_2x_hw_spi;
100
+
101
+class U8GLIB_MINI12864_2X_HAL : public U8GLIB {
102
+public:
103
+  U8GLIB_MINI12864_2X_HAL(uint8_t sck, uint8_t mosi, uint8_t cs, uint8_t a0, uint8_t reset = U8G_PIN_NONE)
104
+    : U8GLIB(&u8g_dev_uc1701_mini12864_HAL_2x_sw_spi, sck, mosi, cs, a0, reset)
105
+    { }
106
+  U8GLIB_MINI12864_2X_HAL(uint8_t cs, uint8_t a0, uint8_t reset = U8G_PIN_NONE)
107
+    : U8GLIB(&u8g_dev_uc1701_mini12864_HAL_2x_hw_spi, cs, a0, reset)
108
+    { }
109
+};

+ 38
- 33
Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp Ver fichero

@@ -66,42 +66,47 @@
66 66
 #define PAGE_HEIGHT 8
67 67
 
68 68
 static const uint8_t u8g_dev_uc1701_mini12864_HAL_init_seq[] PROGMEM = {
69
-  U8G_ESC_CS(0),             /* disable chip */
70
-  U8G_ESC_ADR(0),           /* instruction mode */
71
-  U8G_ESC_RST(1),           /* do reset low pulse with (1*16)+2 milliseconds */
72
-  U8G_ESC_CS(1),             /* enable chip */
73
-
74
-  0x0E2,            /* soft reset */
75
-  0x040,    /* set display start line to 0 */
76
-  0x0A0,    /* ADC set to reverse */
77
-  0x0C8,    /* common output mode */
78
-  0x0A6,    /* display normal, bit val 0: LCD pixel off. */
79
-  0x0A2,    /* LCD bias 1/9 */
80
-  0x02F,    /* all power  control circuits on */
81
-  0x0F8,    /* set booster ratio to */
82
-  0x000,    /* 4x */
83
-  0x023,    /* set V0 voltage resistor ratio to large */
84
-  0x081,    /* set contrast */
85
-  0x027,    /* contrast value */
86
-  0x0AC,    /* indicator */
87
-  0x000,    /* disable */
88
-  0x0AF,    /* display on */
89
-
90
-  U8G_ESC_DLY(100),       /* delay 100 ms */
91
-  0x0A5,                    /* display all points, ST7565 */
92
-  U8G_ESC_DLY(100),       /* delay 100 ms */
93
-  U8G_ESC_DLY(100),       /* delay 100 ms */
94
-  0x0A4,                    /* normal display */
95
-  U8G_ESC_CS(0),             /* disable chip */
96
-  U8G_ESC_END                /* end of sequence */
69
+  U8G_ESC_CS(0),              /* disable chip */
70
+  U8G_ESC_ADR(0),             /* instruction mode */
71
+  U8G_ESC_RST(1),             /* do reset low pulse with (1*16)+2 milliseconds */
72
+  U8G_ESC_CS(1),              /* enable chip */
73
+
74
+  0x0E2,                      /* soft reset */
75
+  0x040,                      /* set display start line to 0 */
76
+  0x0A0,                      /* ADC set to reverse */
77
+  0x0C8,                      /* common output mode */
78
+  0x0A6,                      /* display normal, bit val 0: LCD pixel off. */
79
+  0x0A2,                      /* LCD bias 1/9 */
80
+  0x02F,                      /* all power control circuits on */
81
+  0x0F8,                      /* set booster ratio to */
82
+  0x000,                      /* 4x */
83
+  0x023,                      /* set V0 voltage resistor ratio to large */
84
+  0x081,                      /* set contrast */
85
+  0x027,                      /* contrast value */
86
+  0x0AC,                      /* indicator */
87
+  0x000,                      /* disable */
88
+  0x0AF,                      /* display on */
89
+
90
+  U8G_ESC_CS(0),              /* disable chip */
91
+  U8G_ESC_DLY(100),           /* delay 100 ms */
92
+  U8G_ESC_CS(1),              /* enable chip */
93
+
94
+  0x0A5,                      /* display all points, ST7565 */
95
+  U8G_ESC_CS(0),              /* disable chip */
96
+  U8G_ESC_DLY(100),           /* delay 100 ms */
97
+  U8G_ESC_DLY(100),           /* delay 100 ms */
98
+  U8G_ESC_CS(1),              /* enable chip */
99
+  0x0A4,                      /* normal display */
100
+  U8G_ESC_CS(0),              /* disable chip */
101
+  U8G_ESC_END                 /* end of sequence */
97 102
 };
98 103
 
99 104
 static const uint8_t u8g_dev_uc1701_mini12864_HAL_data_start[] PROGMEM = {
100
-  U8G_ESC_ADR(0),           /* instruction mode */
101
-  U8G_ESC_CS(1),             /* enable chip */
102
-  0x010,    /* set upper 4 bit of the col adr to 0 */
103
-  0x000,    /* set lower 4 bit of the col adr to 4  */
104
-  U8G_ESC_END                /* end of sequence */
105
+  U8G_ESC_ADR(0),             /* instruction mode */
106
+  U8G_ESC_CS(1),              /* enable chip */
107
+  0x010,                      /* set upper 4 bit of the col adr to 0 */
108
+  0x000,                      /* set lower 4 bit of the col adr to 4 */
109
+  U8G_ESC_END                 /* end of sequence */
105 110
 };
106 111
 
107 112
 uint8_t u8g_dev_uc1701_mini12864_HAL_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) {

+ 2
- 2
Marlin/src/lcd/dogm/ultralcd_DOGM.h Ver fichero

@@ -111,8 +111,8 @@
111 111
   // The MINIPanel display
112 112
   //#define U8G_CLASS U8GLIB_MINI12864
113 113
   //#define U8G_PARAM DOGLCD_CS, DOGLCD_A0                            // 8 stripes
114
-  #define U8G_CLASS U8GLIB_MINI12864_2X
115
-  #if ENABLED(FYSETC_MINI_12864) && DOGLCD_SCK > 0
114
+  #define U8G_CLASS U8GLIB_MINI12864_2X_HAL
115
+  #if BOTH(FYSETC_MINI_12864, FORCE_SOFT_SPI)
116 116
     #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0   // 4 stripes SW-SPI
117 117
   #else
118 118
     #define U8G_PARAM DOGLCD_CS, DOGLCD_A0                            // 4 stripes HW-SPI

+ 3
- 1
Marlin/src/lcd/ultralcd.cpp Ver fichero

@@ -668,6 +668,7 @@ void MarlinUI::update() {
668 668
 
669 669
   static uint16_t max_display_update_time = 0;
670 670
   static millis_t next_lcd_update_ms;
671
+  millis_t ms = millis();
671 672
 
672 673
   #if HAS_LCD_MENU
673 674
 
@@ -729,11 +730,12 @@ void MarlinUI::update() {
729 730
 
730 731
       refresh();
731 732
       init_lcd(); // May revive the LCD if static electricity killed it
733
+      ms = millis();
734
+      next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL;  // delay LCD update until after SD activity completes
732 735
     }
733 736
 
734 737
   #endif // SDSUPPORT && SD_DETECT_PIN
735 738
 
736
-  const millis_t ms = millis();
737 739
   if (ELAPSED(ms, next_lcd_update_ms)
738 740
     #if HAS_GRAPHICAL_LCD
739 741
       || drawing_screen

+ 34
- 15
Marlin/src/pins/pins_BIGTREE_SKR_V1.3.h Ver fichero

@@ -202,26 +202,45 @@
202 202
     #define SD_DETECT_PIN   P1_31   // (49) (NOT 5V tolerant)
203 203
 
204 204
     #if ENABLED(FYSETC_MINI_12864)
205
-      #define DOGLCD_CS     P1_18 
205
+      #define DOGLCD_CS     P1_18
206 206
       #define DOGLCD_A0     P1_19
207
-      #define LCD_RESET_PIN P1_20
207
+
208 208
       #define LCD_BACKLIGHT_PIN -1
209 209
 
210
-      #define RGB_LED
211
-      #ifndef RGB_LED_R_PIN
212
-        #define RGB_LED_R_PIN P1_21
213
-      #endif
214
-      #ifndef RGB_LED_G_PIN
215
-        #define RGB_LED_G_PIN P1_22
210
+      #define LCD_RESET_PIN P1_20   // Must be high or open for LCD to operate normally.
211
+                                    // Seems to work best if left open.
212
+
213
+      #define FYSETC_MINI_12864_REV_1_2
214
+      //#define FYSETC_MINI_12864_REV_2_0
215
+      //#define FYSETC_MINI_12864_REV_2_1
216
+      #if EITHER(FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0)
217
+        #define RGB_LED
218
+        #ifndef RGB_LED_R_PIN
219
+          #define RGB_LED_R_PIN P1_21
220
+        #endif
221
+        #ifndef RGB_LED_G_PIN
222
+          #define RGB_LED_G_PIN P1_22
223
+        #endif
224
+        #ifndef RGB_LED_B_PIN
225
+          #define RGB_LED_B_PIN P1_23
226
+        #endif
227
+      #elif defined(FYSETC_MINI_12864_REV_2_1)
228
+        #define NEOPIXEL_LED
229
+        #define NEOPIXEL_TYPE   NEO_GRB  // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
230
+        #define NEOPIXEL_PIN    P1_21    // LED driving pin on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba)
231
+        #define NEOPIXEL_PIXELS  3       // Number of LEDs in the strip
232
+        #define NEOPIXEL_IS_SEQUENTIAL   // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
233
+        #define NEOPIXEL_BRIGHTNESS 127  // Initial brightness (0-255)
234
+        #define NEOPIXEL_STARTUP_TEST    // Cycle through colors at startup
235
+      #else
236
+        #error "Either FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0 or FYSETC_MINI_12864_REV_2_1 must be defined"
216 237
       #endif
217
-      #ifndef RGB_LED_B_PIN
218
-        #define RGB_LED_B_PIN P1_23
219
-      #endif
220
-      #ifndef RGB_LED_W_PIN
221
-        #define RGB_LED_W_PIN -1
238
+
239
+      #if !defined(LED_USER_PRESET_STARTUP) && EITHER(FYSETC_MINI_12864_REV_2_0, FYSETC_MINI_12864_REV_2_1)
240
+        #error "LED_USER_PRESET_STARTUP must be enabled when using FYSETC_MINI_12864 REV 2.0 and later"
222 241
       #endif
223 242
 
224
-    #else
243
+    #else // !FYSETC_MINI_12864
225 244
 
226 245
       #if ENABLED(MKS_MINI_12864)
227 246
         #define DOGLCD_CS     P1_21
@@ -234,7 +253,7 @@
234 253
         #define LCD_PINS_D7   P1_23
235 254
       #endif
236 255
 
237
-    #endif // FYSETC_MINI_12864
256
+    #endif // !FYSETC_MINI_12864
238 257
 
239 258
   #endif
240 259
 

+ 34
- 12
Marlin/src/pins/pins_FYSETC_F6_13.h Ver fichero

@@ -28,8 +28,8 @@
28 28
   #error "Oops! Select 'FYSETC F6' in 'Tools > Board.'"
29 29
 #endif
30 30
 
31
-#ifdef SD_DETECT_INVERTED
32
-  #error "SD_DETECT_INVERTED must be disabled for the FYSETC_F6_13 board."
31
+#if ENABLED(SD_DETECT_INVERTED)
32
+  //#error "SD_DETECT_INVERTED must be disabled for the FYSETC_F6_13 board."
33 33
 #endif
34 34
 
35 35
 #define BOARD_NAME "FYSETC F6 1.3"
@@ -190,20 +190,42 @@
190 190
   //
191 191
   #define DOGLCD_A0        16
192 192
   #define DOGLCD_CS        17
193
-  #ifndef RGB_LED_R_PIN
194
-    #define RGB_LED_R_PIN  25
195
-  #endif
196
-  #ifndef RGB_LED_G_PIN
197
-    #define RGB_LED_G_PIN  27
198
-  #endif
199
-  #ifndef RGB_LED_B_PIN
200
-    #define RGB_LED_B_PIN  29
201
-  #endif
202 193
 
203 194
   #define LCD_BACKLIGHT_PIN -1
204
-  #define LCD_RESET_PIN    23
205 195
   #define KILL_PIN         41
206 196
 
197
+  #define LCD_RESET_PIN    23   // Must be high or open for LCD to operate normally.
198
+                                // Seems to work best if left open.
199
+
200
+  #define FYSETC_MINI_12864_REV_1_2
201
+  //#define FYSETC_MINI_12864_REV_2_0
202
+  //#define FYSETC_MINI_12864_REV_2_1
203
+  #if EITHER(FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0)
204
+    #ifndef RGB_LED_R_PIN
205
+      #define RGB_LED_R_PIN 25
206
+    #endif
207
+    #ifndef RGB_LED_G_PIN
208
+      #define RGB_LED_G_PIN 27
209
+    #endif
210
+    #ifndef RGB_LED_B_PIN
211
+      #define RGB_LED_B_PIN 29
212
+    #endif
213
+  #elif defined(FYSETC_MINI_12864_REV_2_1)
214
+    #define NEOPIXEL_LED
215
+    #define NEOPIXEL_TYPE   NEO_GRB  // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
216
+    #define NEOPIXEL_PIN    25       // LED driving pin on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba)
217
+    #define NEOPIXEL_PIXELS  3       // Number of LEDs in the strip
218
+    #define NEOPIXEL_IS_SEQUENTIAL   // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
219
+    #define NEOPIXEL_BRIGHTNESS 127  // Initial brightness (0-255)
220
+    #define NEOPIXEL_STARTUP_TEST    // Cycle through colors at startup
221
+  #else
222
+    #error "Either FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0 or FYSETC_MINI_12864_REV_2_1 must be defined"
223
+  #endif
224
+
225
+  #if !defined(LED_USER_PRESET_STARTUP) && EITHER(FYSETC_MINI_12864_REV_2_0, FYSETC_MINI_12864_REV_2_1)
226
+    #error "LED_USER_PRESET_STARTUP must be enabled when using FYSETC_MINI_12864 REV 2.0 and later"
227
+  #endif
228
+
207 229
 #elif HAS_GRAPHICAL_LCD
208 230
 
209 231
   #define LCD_PINS_RS      16

+ 29
- 8
Marlin/src/pins/pins_RAMPS.h Ver fichero

@@ -526,7 +526,6 @@
526 526
 
527 527
       // From https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8
528 528
       #define BEEPER_PIN        37
529
-      #define LCD_RESET_PIN     23
530 529
 
531 530
       #define DOGLCD_A0         16
532 531
       #define DOGLCD_CS         17
@@ -537,14 +536,36 @@
537 536
 
538 537
       #define SD_DETECT_PIN     49
539 538
 
540
-      #ifndef RGB_LED_R_PIN
541
-        #define RGB_LED_R_PIN   25
542
-      #endif
543
-      #ifndef RGB_LED_G_PIN
544
-        #define RGB_LED_G_PIN   27
539
+      #define LCD_RESET_PIN     23   // Must be high or open for LCD to operate normally.
540
+                                     // Seems to work best if left open.
541
+
542
+      #define FYSETC_MINI_12864_REV_1_2
543
+      //#define FYSETC_MINI_12864_REV_2_0
544
+      //#define FYSETC_MINI_12864_REV_2_1
545
+      #if EITHER(FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0)
546
+        #ifndef RGB_LED_R_PIN
547
+          #define RGB_LED_R_PIN 25
548
+        #endif
549
+        #ifndef RGB_LED_G_PIN
550
+          #define RGB_LED_G_PIN 27
551
+        #endif
552
+        #ifndef RGB_LED_B_PIN
553
+          #define RGB_LED_B_PIN 29
554
+        #endif
555
+      #elif defined(FYSETC_MINI_12864_REV_2_1)
556
+        #define NEOPIXEL_LED
557
+        #define NEOPIXEL_TYPE   NEO_GRB  // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
558
+        #define NEOPIXEL_PIN    25       // LED driving pin on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba)
559
+        #define NEOPIXEL_PIXELS  3       // Number of LEDs in the strip
560
+        #define NEOPIXEL_IS_SEQUENTIAL   // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
561
+        #define NEOPIXEL_BRIGHTNESS 127  // Initial brightness (0-255)
562
+        #define NEOPIXEL_STARTUP_TEST    // Cycle through colors at startup
563
+      #else
564
+        #error "Either FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0 or FYSETC_MINI_12864_REV_2_1 must be defined"
545 565
       #endif
546
-      #ifndef RGB_LED_B_PIN
547
-        #define RGB_LED_B_PIN   29
566
+
567
+      #if !defined(LED_USER_PRESET_STARTUP) && EITHER(FYSETC_MINI_12864_REV_2_0, FYSETC_MINI_12864_REV_2_1)
568
+        #error "LED_USER_PRESET_STARTUP must be enabled when using FYSETC_MINI_12864 REV 2.0 and later"
548 569
       #endif
549 570
 
550 571
     #elif ENABLED(MINIPANEL)

+ 59
- 22
Marlin/src/pins/pins_RAMPS_FD_V1.h Ver fichero

@@ -150,32 +150,71 @@
150 150
   #if ENABLED(NEWPANEL)
151 151
     #define LCD_PINS_RS    16
152 152
     #define LCD_PINS_ENABLE 17
153
-    #define LCD_PINS_D4    23
154
-    #define LCD_PINS_D5    25
155
-    #define LCD_PINS_D6    27
156
-    #define LCD_PINS_D7    29
157 153
   #endif
158 154
 
159 155
   #if ENABLED(FYSETC_MINI_12864)
160 156
     #define DOGLCD_CS      LCD_PINS_ENABLE
161 157
     #define DOGLCD_A0      LCD_PINS_RS
162
-  #elif ENABLED(MINIPANEL)
163
-    #define DOGLCD_CS      25
164
-    #define DOGLCD_A0      27
158
+
159
+    //#define FORCE_SOFT_SPI    // Use this if default of hardware SPI causes problems
160
+
161
+    #define LCD_RESET_PIN  23   // Must be high or open for LCD to operate normally.
162
+                                // Seems to work best if left open.
163
+
164
+    #define FYSETC_MINI_12864_REV_1_2
165
+    //#define FYSETC_MINI_12864_REV_2_0
166
+    //#define FYSETC_MINI_12864_REV_2_1
167
+    #if EITHER(FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0)
168
+      #ifndef RGB_LED_R_PIN
169
+        #define RGB_LED_R_PIN 25
170
+      #endif
171
+      #ifndef RGB_LED_G_PIN
172
+        #define RGB_LED_G_PIN 27
173
+      #endif
174
+      #ifndef RGB_LED_B_PIN
175
+        #define RGB_LED_B_PIN 29
176
+      #endif
177
+    #elif defined(FYSETC_MINI_12864_REV_2_1)
178
+      #define NEOPIXEL_LED
179
+      #define NEOPIXEL_TYPE NEO_GRB    // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
180
+      #define NEOPIXEL_PIN    25       // LED driving pin on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba)
181
+      #define NEOPIXEL_PIXELS  3       // Number of LEDs in the strip
182
+      #define NEOPIXEL_IS_SEQUENTIAL   // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
183
+      #define NEOPIXEL_BRIGHTNESS 127  // Initial brightness (0-255)
184
+      #define NEOPIXEL_STARTUP_TEST    // Cycle through colors at startup
185
+    #else
186
+      #error "Either FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0 or FYSETC_MINI_12864_REV_2_1 must be defined"
187
+    #endif
188
+
189
+    #if !defined(LED_USER_PRESET_STARTUP) && EITHER(FYSETC_MINI_12864_REV_2_0, FYSETC_MINI_12864_REV_2_1)
190
+      #error "LED_USER_PRESET_STARTUP must be enabled when using FYSETC_MINI_12864 REV 2.0 and later"
191
+    #endif
192
+
193
+  #elif ENABLED(NEWPANEL)
194
+
195
+    #define LCD_PINS_D4    23
196
+    #define LCD_PINS_D5    25
197
+    #define LCD_PINS_D6    27
198
+    #define LCD_PINS_D7    29
199
+
200
+    #if ENABLED(MINIPANEL)
201
+      #define DOGLCD_CS    25
202
+      #define DOGLCD_A0    27
203
+    #endif
204
+
165 205
   #endif
166 206
 
167 207
   #if ANY(VIKI2, miniVIKI)
168
-    #define DOGLCD_A0           16
169
-    #define KILL_PIN            51
170
-    #define STAT_LED_BLUE_PIN   29
171
-    #define STAT_LED_RED_PIN    23
172
-    #define DOGLCD_CS           17
173
-    #define DOGLCD_SCK          76   // SCK_PIN   - These are required for DUE Hardware SPI
174
-    #define DOGLCD_MOSI         75   // MOSI_PIN
175
-    #define DOGLCD_MISO         74   // MISO_PIN
208
+    #define DOGLCD_A0      16
209
+    #define KILL_PIN       51
210
+    #define STAT_LED_BLUE_PIN 29
211
+    #define STAT_LED_RED_PIN 23
212
+    #define DOGLCD_CS      17
213
+    #define DOGLCD_SCK     76   // SCK_PIN   - Required for DUE Hardware SPI
214
+    #define DOGLCD_MOSI    75   // MOSI_PIN
215
+    #define DOGLCD_MISO    74   // MISO_PIN
176 216
   #endif
177 217
 
178
-
179 218
 #endif // ULTRA_LCD
180 219
 
181 220
 #if HAS_DRIVER(TMC2208)
@@ -201,10 +240,8 @@
201 240
 //
202 241
 // M3/M4/M5 - Spindle/Laser Control
203 242
 //
204
-#if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENA)
205
-  #if HOTENDS < 3
206
-    #define SPINDLE_LASER_ENA_PIN     45   // Use E2 ENA
207
-    #define SPINDLE_LASER_PWM_PIN     12   // MUST BE HARDWARE PWM
208
-    #define SPINDLE_DIR_PIN           47   // Use E2 DIR
209
-  #endif
243
+#if HOTENDS < 3 && ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENA)
244
+  #define SPINDLE_LASER_ENA_PIN 45   // Use E2 ENA
245
+  #define SPINDLE_LASER_PWM_PIN 12   // MUST BE HARDWARE PWM
246
+  #define SPINDLE_DIR_PIN       47   // Use E2 DIR
210 247
 #endif

+ 1
- 0
Marlin/src/pins/pins_RAMPS_RE_ARM.h Ver fichero

@@ -320,6 +320,7 @@
320 320
       #define DOGLCD_MOSI  P0_18
321 321
       #define DOGLCD_CS    P1_09  // use Ethernet connector for EXP1 cable signals
322 322
       #define DOGLCD_A0    P1_14
323
+      #define FORCE_SOFT_SPI      // required on a Re-ARM system
323 324
     #else
324 325
       #define DOGLCD_CS    P0_26   // (63) J5-3 & AUX-2
325 326
       #define DOGLCD_A0    P2_06   // (59) J3-8 & AUX-2

+ 54
- 20
Marlin/src/pins/pins_RURAMPS4D_11.h Ver fichero

@@ -202,31 +202,24 @@
202 202
 //
203 203
 #if ENABLED(ULTRA_LCD)
204 204
 
205
-  #if EITHER(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER)
206
-
205
+  #if ANY(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER, REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
207 206
     #define BEEPER_PIN      62
208
-
209
-    #define LCD_PINS_RS     63
210
-    #define LCD_PINS_ENABLE 64
211 207
     #define LCD_PINS_D4     48
212 208
     #define LCD_PINS_D5     50
213 209
     #define LCD_PINS_D6     52
214 210
     #define LCD_PINS_D7     53
215
-
216 211
     #define SD_DETECT_PIN   51
212
+  #endif
217 213
 
218
-  #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
214
+  #if EITHER(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER)
219 215
 
220
-    #define BEEPER_PIN      62
216
+    #define LCD_PINS_RS     63
217
+    #define LCD_PINS_ENABLE 64
218
+
219
+  #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
221 220
 
222 221
     #define LCD_PINS_RS     52
223 222
     #define LCD_PINS_ENABLE 53
224
-    #define LCD_PINS_D4     48
225
-    #define LCD_PINS_D5     50
226
-    #define LCD_PINS_D6     52
227
-    #define LCD_PINS_D7     53
228
-
229
-    #define SD_DETECT_PIN   51
230 223
 
231 224
   #elif HAS_SSD1306_OLED_I2C
232 225
 
@@ -234,16 +227,57 @@
234 227
     #define LCD_SDSS        10
235 228
     #define SD_DETECT_PIN   51
236 229
 
230
+  #elif ENABLED(FYSETC_MINI_12864)
231
+
232
+    #define BEEPER_PIN      62
233
+    #define DOGLCD_CS       64
234
+    #define DOGLCD_A0       63
235
+
236
+    //#define FORCE_SOFT_SPI     // Use this if default of hardware SPI causes problems
237
+
238
+    #define LCD_RESET_PIN   48   // Must be high or open for LCD to operate normally.
239
+                                 // Seems to work best if left open.
240
+
241
+    #define FYSETC_MINI_12864_REV_1_2
242
+    //#define FYSETC_MINI_12864_REV_2_0
243
+    //#define FYSETC_MINI_12864_REV_2_1
244
+    #if EITHER(FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0)
245
+      #define RGB_LED
246
+      #ifndef RGB_LED_R_PIN
247
+        #define RGB_LED_R_PIN 50   // D5
248
+      #endif
249
+      #ifndef RGB_LED_G_PIN
250
+        #define RGB_LED_G_PIN 52   // D6
251
+      #endif
252
+      #ifndef RGB_LED_B_PIN
253
+        #define RGB_LED_B_PIN 53   // D7
254
+      #endif
255
+    #elif defined(FYSETC_MINI_12864_REV_2_1)
256
+      #define NEOPIXEL_LED
257
+      #define NEOPIXEL_TYPE   NEO_GRB  // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
258
+      #define NEOPIXEL_PIN  50         // LED driving pin on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba)
259
+      #define NEOPIXEL_PIXELS  3       // Number of LEDs in the strip
260
+      #define NEOPIXEL_IS_SEQUENTIAL   // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
261
+      #define NEOPIXEL_BRIGHTNESS 127  // Initial brightness (0-255)
262
+      #define NEOPIXEL_STARTUP_TEST    // Cycle through colors at startup
263
+    #else
264
+      #error "Either FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0 or FYSETC_MINI_12864_REV_2_1 must be defined"
265
+    #endif
266
+
267
+    #if !defined(LED_USER_PRESET_STARTUP) && EITHER(FYSETC_MINI_12864_REV_2_0, FYSETC_MINI_12864_REV_2_1)
268
+      #error "LED_USER_PRESET_STARTUP must be enabled when using FYSETC_MINI_12864 REV 2.0 and later"
269
+    #endif
270
+
237 271
   #elif ENABLED(SPARK_FULL_GRAPHICS)
238 272
 
239 273
     //http://doku.radds.org/dokumentation/other-electronics/sparklcd/
240 274
     #error "Oops! SPARK_FULL_GRAPHICS not supported with RURAMPS4D."
241
-    //#define LCD_PINS_D4     29//?
242
-    //#define LCD_PINS_ENABLE 27//?
243
-    //#define LCD_PINS_RS     25//?
244
-    //#define BTN_EN1         35//?
245
-    //#define BTN_EN2         33//?
246
-    //#define BTN_ENC         37//?
275
+    //#define LCD_PINS_D4     29   //?
276
+    //#define LCD_PINS_ENABLE 27   //?
277
+    //#define LCD_PINS_RS     25   //?
278
+    //#define BTN_EN1         35   //?
279
+    //#define BTN_EN2         33   //?
280
+    //#define BTN_ENC         37   //?
247 281
 
248 282
   #endif // SPARK_FULL_GRAPHICS
249 283
 

+ 48
- 14
Marlin/src/pins/pins_RURAMPS4D_13.h Ver fichero

@@ -188,31 +188,24 @@
188 188
 //
189 189
 #if ENABLED(ULTRA_LCD)
190 190
 
191
-  #if EITHER(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER)
192
-
191
+  #if ANY(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER, REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
193 192
     #define BEEPER_PIN      62
194
-
195
-    #define LCD_PINS_RS     63
196
-    #define LCD_PINS_ENABLE 64
197 193
     #define LCD_PINS_D4     48
198 194
     #define LCD_PINS_D5     50
199 195
     #define LCD_PINS_D6     52
200 196
     #define LCD_PINS_D7     53
201
-
202 197
     #define SD_DETECT_PIN   51
198
+  #endif
203 199
 
204
-  #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
200
+  #if EITHER(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER)
205 201
 
206
-    #define BEEPER_PIN      62
202
+    #define LCD_PINS_RS     63
203
+    #define LCD_PINS_ENABLE 64
204
+
205
+  #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
207 206
 
208 207
     #define LCD_PINS_RS     52
209 208
     #define LCD_PINS_ENABLE 53
210
-    #define LCD_PINS_D4     48
211
-    #define LCD_PINS_D5     50
212
-    #define LCD_PINS_D6     52
213
-    #define LCD_PINS_D7     53
214
-
215
-    #define SD_DETECT_PIN   51
216 209
 
217 210
   #elif HAS_SSD1306_OLED_I2C
218 211
 
@@ -220,6 +213,47 @@
220 213
     #define LCD_SDSS        10
221 214
     #define SD_DETECT_PIN   51
222 215
 
216
+  #elif ENABLED(FYSETC_MINI_12864)
217
+
218
+    #define BEEPER_PIN      62
219
+    #define DOGLCD_CS       64
220
+    #define DOGLCD_A0       63
221
+
222
+    //#define FORCE_SOFT_SPI     // Use this if default of hardware SPI causes problems
223
+
224
+    #define LCD_RESET_PIN   48   // Must be high or open for LCD to operate normally.
225
+                                 // Seems to work best if left open.
226
+
227
+    #define FYSETC_MINI_12864_REV_1_2
228
+    //#define FYSETC_MINI_12864_REV_2_0
229
+    //#define FYSETC_MINI_12864_REV_2_1
230
+    #if EITHER(FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0)
231
+      #define RGB_LED
232
+      #ifndef RGB_LED_R_PIN
233
+        #define RGB_LED_R_PIN 50   // D5
234
+      #endif
235
+      #ifndef RGB_LED_G_PIN
236
+        #define RGB_LED_G_PIN 52   // D6
237
+      #endif
238
+      #ifndef RGB_LED_B_PIN
239
+        #define RGB_LED_B_PIN 53   // D7
240
+      #endif
241
+    #elif defined(FYSETC_MINI_12864_REV_2_1)
242
+      #define NEOPIXEL_LED
243
+      #define NEOPIXEL_TYPE   NEO_GRB  // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
244
+      #define NEOPIXEL_PIN  50         // LED driving pin on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba)
245
+      #define NEOPIXEL_PIXELS  3       // Number of LEDs in the strip
246
+      #define NEOPIXEL_IS_SEQUENTIAL   // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
247
+      #define NEOPIXEL_BRIGHTNESS 127  // Initial brightness (0-255)
248
+      #define NEOPIXEL_STARTUP_TEST    // Cycle through colors at startup
249
+    #else
250
+      #error "Either FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0 or FYSETC_MINI_12864_REV_2_1 must be defined"
251
+    #endif
252
+
253
+    #if !defined(LED_USER_PRESET_STARTUP) && EITHER(FYSETC_MINI_12864_REV_2_0, FYSETC_MINI_12864_REV_2_1)
254
+      #error "LED_USER_PRESET_STARTUP must be enabled when using FYSETC_MINI_12864 REV 2.0 and later"
255
+    #endif
256
+
223 257
   #elif ENABLED(MKS_MINI_12864)
224 258
 
225 259
     #define ORIG_BEEPER_PIN 62

Loading…
Cancelar
Guardar