Browse Source

Fixing Rigidbot LCD Panel Support

Ruwan J Egoda Gamage 9 years ago
parent
commit
5eeea2f611

+ 1
- 1
Marlin/cardreader.cpp View File

@@ -196,7 +196,7 @@ void CardReader::initsd() {
196 196
   if (root.isOpen()) root.close();
197 197
 
198 198
   #if ENABLED(SDEXTRASLOW)
199
-    #define SPI_SPEED SPI_QUARTER_SPEED
199
+    #define SPI_SPEED SPI_SIXTEENTH_SPEED
200 200
   #elif ENABLED(SDSLOW)
201 201
     #define SPI_SPEED SPI_HALF_SPEED
202 202
   #else

+ 8
- 3
Marlin/example_configurations/RigidBot/Configuration.h View File

@@ -219,6 +219,11 @@ Here are some standard links for getting your machine calibrated:
219 219
   //#define  DEFAULT_Ki 0.85
220 220
   //#define  DEFAULT_Kd 245
221 221
 
222
+  // E3D w/ rigidbot cartridge
223
+  //#define  DEFAULT_Kp 16.30
224
+  //#define  DEFAULT_Ki 0.95
225
+  //#define  DEFAULT_Kd 69.69
226
+
222 227
 #endif // PIDTEMP
223 228
 
224 229
 //===========================================================================
@@ -611,7 +616,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
611 616
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
612 617
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
613 618
 //define this to enable EEPROM support
614
-//#define EEPROM_SETTINGS
619
+#define EEPROM_SETTINGS
615 620
 
616 621
 #if ENABLED(EEPROM_SETTINGS)
617 622
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
@@ -651,10 +656,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
651 656
 
652 657
 //#define ULTRA_LCD  //general LCD support, also 16x2
653 658
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
654
-//#define SDSUPPORT // Enable SD Card Support in Hardware Console
659
+#define SDSUPPORT // Enable SD Card Support in Hardware Console
655 660
 // Changed behaviour! If you need SDSUPPORT uncomment it!
656 661
 //#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
657
-//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
662
+#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
658 663
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
659 664
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
660 665
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking

+ 4
- 4
Marlin/example_configurations/RigidBot/Configuration_adv.h View File

@@ -279,9 +279,9 @@
279 279
 //=============================Additional Features===========================
280 280
 //===========================================================================
281 281
 
282
-#define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
283
-#define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
284
-#define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
282
+//#define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
283
+//#define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
284
+//#define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
285 285
 
286 286
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
287 287
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
@@ -414,7 +414,7 @@ const unsigned int dropsegments = 5; //everything with less than this number of
414 414
 
415 415
 //The ASCII buffer for receiving from the serial:
416 416
 #define MAX_CMD_SIZE 96
417
-#define BUFSIZE 4
417
+#define BUFSIZE 8
418 418
 
419 419
 // Bad Serial-connections can miss a received command by sending an 'ok'
420 420
 // Therefore some clients abort after 30 seconds in a timeout.

+ 16
- 15
Marlin/pins_RIGIDBOARD.h View File

@@ -5,7 +5,10 @@
5 5
 #include "pins_RAMPS_13.h"
6 6
 
7 7
 #if ENABLED(Z_MIN_PROBE_ENDSTOP)
8
-  #define Z_MIN_PROBE_PIN  19
8
+  #undef Z_MAX_PIN
9
+  #define Z_MAX_PIN -1
10
+  #undef Z_MIN_PROBE_PIN
11
+  #define Z_MIN_PROBE_PIN  19    // Z-MAX pin J14 End Stops
9 12
 #endif
10 13
 
11 14
 #undef HEATER_0_PIN
@@ -25,24 +28,22 @@
25 28
   #undef BEEPER_PIN
26 29
   #define BEEPER_PIN -1
27 30
 
28
-  #undef SD_DETECT_PIN
29
-  #define SD_DETECT_PIN 22
30
-
31
-  // Extra button definitions, substitute for EN1 / EN2
32
-  #define BTN_UP  37 // BTN_EN1
33
-  #define BTN_DWN 35 // BTN_EN2
34
-  #define BTN_LFT 33
35
-  #define BTN_RT  32
36
-
37
-  // Marlin can respond to UP/DOWN by default
38
-  // #undef  BTN_EN1
39
-  // #undef  BTN_EN2
40
-  //#define BTN_EN1 -1
41
-  //#define BTN_EN2 -1
31
+  // Direction buttons
32
+  #define BTN_UP           37
33
+  #define BTN_DWN          35
34
+  #define BTN_LFT          33
35
+  #define BTN_RT           32
42 36
 
37
+  // 'R' button
43 38
   #undef  BTN_ENC
44 39
   #define BTN_ENC 31
45 40
 
41
+  // Disable encoder
42
+  #undef  BTN_EN1
43
+  #define BTN_EN1 -1
44
+  #undef  BTN_EN2
45
+  #define BTN_EN2 -1
46
+
46 47
   #undef  SD_DETECT_PIN
47 48
   #define SD_DETECT_PIN 22
48 49
 

+ 45
- 6
Marlin/ultralcd.cpp View File

@@ -218,6 +218,9 @@ static void lcd_status_screen();
218 218
   #if ENABLED(REPRAPWORLD_KEYPAD)
219 219
     volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
220 220
   #endif
221
+  #if ENABLED(RIGIDBOT_PANEL)
222
+    volatile millis_t next_fake_encoder_update_ms;
223
+  #endif
221 224
 
222 225
   #if ENABLED(LCD_HAS_SLOW_BUTTONS)
223 226
     volatile uint8_t slow_buttons; // Bits of the pressed buttons.
@@ -1524,11 +1527,15 @@ void lcd_init() {
1524 1527
   lcd_implementation_init();
1525 1528
 
1526 1529
   #if ENABLED(NEWPANEL)
1530
+    #if BTN_EN1 > 0
1531
+      SET_INPUT(BTN_EN1);
1532
+      WRITE(BTN_EN1, HIGH);
1533
+    #endif
1527 1534
 
1528
-    SET_INPUT(BTN_EN1);
1529
-    SET_INPUT(BTN_EN2);
1530
-    WRITE(BTN_EN1, HIGH);
1531
-    WRITE(BTN_EN2, HIGH);
1535
+    #if BTN_EN2 > 0
1536
+      SET_INPUT(BTN_EN2);
1537
+      WRITE(BTN_EN2, HIGH);
1538
+    #endif
1532 1539
 
1533 1540
     #if BTN_ENC > 0
1534 1541
       SET_INPUT(BTN_ENC);
@@ -1543,6 +1550,14 @@ void lcd_init() {
1543 1550
       WRITE(SHIFT_LD, HIGH);
1544 1551
     #endif
1545 1552
 
1553
+    #ifdef RIGIDBOT_PANEL
1554
+      pinMode(BTN_UP,INPUT);
1555
+      pinMode(BTN_DWN,INPUT);
1556
+      pinMode(BTN_LFT,INPUT);
1557
+      pinMode(BTN_RT,INPUT);
1558
+      next_fake_encoder_update_ms = 0;
1559
+    #endif
1560
+
1546 1561
   #else  // Not NEWPANEL
1547 1562
 
1548 1563
     #if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register
@@ -1843,8 +1858,32 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
1843 1858
   void lcd_buttons_update() {
1844 1859
     #if ENABLED(NEWPANEL)
1845 1860
       uint8_t newbutton = 0;
1846
-      if (READ(BTN_EN1) == 0) newbutton |= EN_A;
1847
-      if (READ(BTN_EN2) == 0) newbutton |= EN_B;
1861
+      #if BTN_EN1 > 0
1862
+        if (READ(BTN_EN1) == 0) newbutton |= EN_A;
1863
+      #endif
1864
+      #if BTN_EN2 > 0
1865
+        if (READ(BTN_EN2) == 0) newbutton |= EN_B;
1866
+      #endif
1867
+      #if ENABLED(RIGIDBOT_PANEL)
1868
+        if (millis() > next_fake_encoder_update_ms && READ(BTN_UP) == 0) {
1869
+          encoderDiff = -1 * ENCODER_STEPS_PER_MENU_ITEM;
1870
+          next_fake_encoder_update_ms = millis() + 300;
1871
+        }
1872
+        if (millis() > next_fake_encoder_update_ms && READ(BTN_DWN) == 0) {
1873
+          encoderDiff = ENCODER_STEPS_PER_MENU_ITEM;
1874
+          next_fake_encoder_update_ms = millis() + 300;
1875
+        }
1876
+        if (millis() > next_fake_encoder_update_ms && READ(BTN_LFT) == 0) {
1877
+          encoderDiff = -1 * ENCODER_PULSES_PER_STEP;
1878
+          next_fake_encoder_update_ms = millis() + 300;
1879
+        }
1880
+        if (millis() > next_fake_encoder_update_ms && READ(BTN_RT) == 0) {
1881
+          encoderDiff = ENCODER_PULSES_PER_STEP;
1882
+          next_fake_encoder_update_ms = millis() + 300;
1883
+        }
1884
+      #endif
1885
+
1886
+
1848 1887
       #if BTN_ENC > 0
1849 1888
         if (millis() > next_button_update_ms && READ(BTN_ENC) == 0) newbutton |= EN_C;
1850 1889
       #endif

+ 3
- 0
Marlin/ultralcd.h View File

@@ -41,6 +41,9 @@
41 41
     #if ENABLED(REPRAPWORLD_KEYPAD)
42 42
       extern volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
43 43
     #endif
44
+    #if ENABLED(RIGIDBOT_PANEL)
45
+      extern volatile millis_t next_fake_encoder_update_ms;
46
+    #endif
44 47
   #else
45 48
     FORCE_INLINE void lcd_buttons_update() {}
46 49
   #endif

Loading…
Cancel
Save