Bladeren bron

Fix Printrboard with LCD (redo)

Based on #2860 - rebased for RCBugFix
Scott Lahteine 8 jaren geleden
bovenliggende
commit
3a3d358df9
4 gewijzigde bestanden met toevoegingen van 34 en 9 verwijderingen
  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 Bestand weergeven

@@ -631,6 +631,13 @@ void servo_init() {
631 631
  *    • status LEDs
632 632
  */
633 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 641
   setup_killpin();
635 642
   setup_filrunoutpin();
636 643
   setup_powerhold();

+ 18
- 2
Marlin/pins_PRINTRBOARD.h Bestand weergeven

@@ -15,6 +15,9 @@
15 15
 
16 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 21
 #define X_STEP_PIN          0
19 22
 #define X_DIR_PIN           1
20 23
 #define X_ENABLE_PIN       39
@@ -64,7 +67,7 @@
64 67
 ////LCD Pin Setup////
65 68
 
66 69
 #define SDPOWER            -1
67
-#define SDSS                8
70
+#define SDSS               26
68 71
 #define LED_PIN            -1
69 72
 #define PS_ON_PIN          -1
70 73
 #define KILL_PIN           -1
@@ -79,15 +82,29 @@
79 82
 #if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
80 83
   //we have no buzzer installed
81 84
   #define BEEPER_PIN -1
85
+
82 86
   //LCD Pins
83 87
   #if ENABLED(LCD_I2C_PANELOLU2)
84 88
     #define BTN_EN1 27  //RX1 - fastio.h pin mapping 27
85 89
     #define BTN_EN2 26  //TX1 - fastio.h pin mapping 26
86 90
     #define BTN_ENC 43 //A3 - fastio.h pin mapping 43
87 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 96
   #endif // LCD_I2C_PANELOLU2
97
+
89 98
   //not connected to a pin
90 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 108
 #endif // ULTRA_LCD && NEWPANEL
92 109
 
93 110
 #if ENABLED(VIKI2) || ENABLED(miniVIKI)
@@ -104,7 +121,6 @@
104 121
 
105 122
   #define SDSS 45
106 123
   #define SD_DETECT_PIN -1 // FastIO (Manual says 72 I'm not certain cause I can't test)
107
-
108 124
   #if ENABLED(TEMP_STAT_LEDS)
109 125
     #define STAT_LED_RED      12 //Non-FastIO
110 126
     #define STAT_LED_BLUE     10 //Non-FastIO

+ 8
- 6
Marlin/temperature.cpp Bestand weergeven

@@ -887,12 +887,14 @@ void tp_init() {
887 887
     SET_OUTPUT(HEATER_BED_PIN);
888 888
   #endif
889 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 898
     #endif
897 899
   #endif
898 900
 

+ 1
- 1
Marlin/ultralcd.cpp Bestand weergeven

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

Laden…
Annuleren
Opslaan