Browse Source

Merge pull request #3092 from thinkyhead/rc_2860_printrbot_lcd

Fix Printrboard with LCD (redo)
Scott Lahteine 9 years ago
parent
commit
1e20949afb
4 changed files with 34 additions and 9 deletions
  1. 7
    0
      Marlin/Marlin_main.cpp
  2. 18
    2
      Marlin/pins_PRINTRBOARD.h
  3. 8
    6
      Marlin/temperature.cpp
  4. 1
    1
      Marlin/ultralcd.cpp

+ 7
- 0
Marlin/Marlin_main.cpp View File

631
  *    • status LEDs
631
  *    • status LEDs
632
  */
632
  */
633
 void setup() {
633
 void setup() {
634
+
635
+  #ifdef DISABLE_JTAG
636
+    // Disable JTAG on AT90USB chips to free up pins for IO
637
+    MCUCR = 0x80;
638
+    MCUCR = 0x80;
639
+  #endif
640
+
634
   setup_killpin();
641
   setup_killpin();
635
   setup_filrunoutpin();
642
   setup_filrunoutpin();
636
   setup_powerhold();
643
   setup_powerhold();

+ 18
- 2
Marlin/pins_PRINTRBOARD.h View File

15
 
15
 
16
 #define LARGE_FLASH        true
16
 #define LARGE_FLASH        true
17
 
17
 
18
+// Disable JTAG pins so they can be used for the Extrudrboard
19
+#define DISABLE_JTAG       true
20
+
18
 #define X_STEP_PIN          0
21
 #define X_STEP_PIN          0
19
 #define X_DIR_PIN           1
22
 #define X_DIR_PIN           1
20
 #define X_ENABLE_PIN       39
23
 #define X_ENABLE_PIN       39
64
 ////LCD Pin Setup////
67
 ////LCD Pin Setup////
65
 
68
 
66
 #define SDPOWER            -1
69
 #define SDPOWER            -1
67
-#define SDSS                8
70
+#define SDSS               26
68
 #define LED_PIN            -1
71
 #define LED_PIN            -1
69
 #define PS_ON_PIN          -1
72
 #define PS_ON_PIN          -1
70
 #define KILL_PIN           -1
73
 #define KILL_PIN           -1
79
 #if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
82
 #if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
80
   //we have no buzzer installed
83
   //we have no buzzer installed
81
   #define BEEPER_PIN -1
84
   #define BEEPER_PIN -1
85
+
82
   //LCD Pins
86
   //LCD Pins
83
   #if ENABLED(LCD_I2C_PANELOLU2)
87
   #if ENABLED(LCD_I2C_PANELOLU2)
84
     #define BTN_EN1 27  //RX1 - fastio.h pin mapping 27
88
     #define BTN_EN1 27  //RX1 - fastio.h pin mapping 27
85
     #define BTN_EN2 26  //TX1 - fastio.h pin mapping 26
89
     #define BTN_EN2 26  //TX1 - fastio.h pin mapping 26
86
     #define BTN_ENC 43 //A3 - fastio.h pin mapping 43
90
     #define BTN_ENC 43 //A3 - fastio.h pin mapping 43
87
     #define SDSS   40 //use SD card on Panelolu2 (Teensyduino pin mapping)
91
     #define SDSS   40 //use SD card on Panelolu2 (Teensyduino pin mapping)
92
+  #else
93
+    #define BTN_EN1 16
94
+    #define BTN_EN2 17
95
+    #define BTN_ENC 18//the click
88
   #endif // LCD_I2C_PANELOLU2
96
   #endif // LCD_I2C_PANELOLU2
97
+
89
   //not connected to a pin
98
   //not connected to a pin
90
   #define SD_DETECT_PIN -1
99
   #define SD_DETECT_PIN -1
100
+
101
+  #define LCD_PINS_RS 9
102
+  #define LCD_PINS_ENABLE 8
103
+  #define LCD_PINS_D4 7
104
+  #define LCD_PINS_D5 6
105
+  #define LCD_PINS_D6 5
106
+  #define LCD_PINS_D7 4
107
+
91
 #endif // ULTRA_LCD && NEWPANEL
108
 #endif // ULTRA_LCD && NEWPANEL
92
 
109
 
93
 #if ENABLED(VIKI2) || ENABLED(miniVIKI)
110
 #if ENABLED(VIKI2) || ENABLED(miniVIKI)
104
 
121
 
105
   #define SDSS 45
122
   #define SDSS 45
106
   #define SD_DETECT_PIN -1 // FastIO (Manual says 72 I'm not certain cause I can't test)
123
   #define SD_DETECT_PIN -1 // FastIO (Manual says 72 I'm not certain cause I can't test)
107
-
108
   #if ENABLED(TEMP_STAT_LEDS)
124
   #if ENABLED(TEMP_STAT_LEDS)
109
     #define STAT_LED_RED      12 //Non-FastIO
125
     #define STAT_LED_RED      12 //Non-FastIO
110
     #define STAT_LED_BLUE     10 //Non-FastIO
126
     #define STAT_LED_BLUE     10 //Non-FastIO

+ 8
- 6
Marlin/temperature.cpp View File

887
     SET_OUTPUT(HEATER_BED_PIN);
887
     SET_OUTPUT(HEATER_BED_PIN);
888
   #endif
888
   #endif
889
   #if HAS_FAN
889
   #if HAS_FAN
890
-    SET_OUTPUT(FAN_PIN);
891
-    #if ENABLED(FAST_PWM_FAN)
892
-      setPwmFrequency(FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
893
-    #endif
894
-    #if ENABLED(FAN_SOFT_PWM)
895
-      soft_pwm_fan = fanSpeedSoftPwm / 2;
890
+    #if ENABLED(FAST_PWM_FAN) || ENABLED(FAN_SOFT_PWM)
891
+      SET_OUTPUT(FAN_PIN);
892
+      #if ENABLED(FAST_PWM_FAN)
893
+        setPwmFrequency(FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
894
+      #endif
895
+      #if ENABLED(FAN_SOFT_PWM)
896
+        soft_pwm_fan = fanSpeedSoftPwm / 2;
897
+      #endif
896
     #endif
898
     #endif
897
   #endif
899
   #endif
898
 
900
 

+ 1
- 1
Marlin/ultralcd.cpp View File

1584
   #endif//!NEWPANEL
1584
   #endif//!NEWPANEL
1585
 
1585
 
1586
   #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
1586
   #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
1587
-    pinMode(SD_DETECT_PIN, INPUT);
1587
+    SET_INPUT(SD_DETECT_PIN);
1588
     WRITE(SD_DETECT_PIN, HIGH);
1588
     WRITE(SD_DETECT_PIN, HIGH);
1589
     lcd_sd_status = 2; // UNKNOWN
1589
     lcd_sd_status = 2; // UNKNOWN
1590
   #endif
1590
   #endif

Loading…
Cancel
Save