소스 검색

Added support for Elefu RA Board and Elefu Control Panel

kiyoshigawa 11 년 전
부모
커밋
b27a59f41e
4개의 변경된 파일180개의 추가작업 그리고 13개의 파일을 삭제
  1. 21
    4
      Marlin/Configuration.h
  2. 11
    5
      Marlin/Marlin.pde
  3. 129
    0
      Marlin/pins.h
  4. 19
    4
      Marlin/ultralcd_implementation_hitachi_HD44780.h

+ 21
- 4
Marlin/Configuration.h 파일 보기

@@ -46,9 +46,10 @@
46 46
 // 90 = Alpha OMCA board
47 47
 // 91 = Final OMCA board
48 48
 // 301 = Rambo
49
+// 21 = Elefu Ra Board (v3)
49 50
 
50 51
 #ifndef MOTHERBOARD
51
-#define MOTHERBOARD 7
52
+#define MOTHERBOARD 21
52 53
 #endif
53 54
 
54 55
 //// The following define selects which power supply you have. Please choose the one that matches your setup
@@ -84,10 +85,10 @@
84 85
 // 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
85 86
 // 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan) (1k pullup)
86 87
 
87
-#define TEMP_SENSOR_0 -1
88
+#define TEMP_SENSOR_0 1
88 89
 #define TEMP_SENSOR_1 0
89 90
 #define TEMP_SENSOR_2 0
90
-#define TEMP_SENSOR_BED 0
91
+#define TEMP_SENSOR_BED 1
91 92
 
92 93
 // Actual temperature must be close to target for this long before M109 returns success
93 94
 #define TEMP_RESIDENCY_TIME 10	// (seconds)
@@ -338,6 +339,15 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
338 339
 // ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
339 340
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
340 341
 
342
+// The Elefu RA Board Control Panel
343
+// http://www.elefu.com/index.php?route=product/product&product_id=53
344
+// REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARUDINO library folder: http://hmario.home.xs4all.nl/arduino/LiquidCrystal_I2C/LiquidCrystal_I2C.zip
345
+#define RA_CONTROL_PANEL
346
+
347
+// The Elefu TLC5947 RGB Lighting Module
348
+// Uncomment to enable TLC5947 Lighting Modules.
349
+//#define RA_DISCO
350
+
341 351
 //automatic expansion
342 352
 #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
343 353
  #define DOGLCD
@@ -348,7 +358,14 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
348 358
 #if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
349 359
  #define ULTIPANEL
350 360
  #define NEWPANEL
351
-#endif 
361
+#endif
362
+
363
+#if defined(RA_CONTROL_PANEL)
364
+ #define ULTIPANEL
365
+ #define NEWPANEL
366
+ #define LCD_I2C_TYPE_PCA8574
367
+ #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
368
+#endif
352 369
 
353 370
 // Preheat Constants
354 371
 #define PLA_PREHEAT_HOTEND_TEMP 180 

+ 11
- 5
Marlin/Marlin.pde 파일 보기

@@ -34,11 +34,17 @@
34 34
 #include "pins.h"
35 35
 
36 36
 #ifdef ULTRA_LCD
37
-	#ifdef DOGLCD
38
-		#include <U8glib.h> // library for graphics LCD by Oli Kraus (https://code.google.com/p/u8glib/)
39
-	#else
40
-		#include <LiquidCrystal.h> // library for character LCD
41
-	#endif
37
+  #if defined(LCD_I2C_TYPE_PCF8575)
38
+    #include <Wire.h>
39
+    #include <LiquidCrystal_I2C.h>
40
+  #elif defined(LCD_I2C_TYPE_MCP23017) || defined(LCD_I2C_TYPE_MCP23008)
41
+    #include <Wire.h>
42
+    #include <LiquidTWI2.h>
43
+  #elif defined DOGLCD
44
+    #include <U8glib.h> // library for graphics LCD by Oli Kraus (https://code.google.com/p/u8glib/)
45
+  #else
46
+    #include <LiquidCrystal.h> // library for character LCD
47
+  #endif
42 48
 #endif
43 49
 
44 50
 #if DIGIPOTSS_PIN > -1

+ 129
- 0
Marlin/pins.h 파일 보기

@@ -53,6 +53,7 @@
53 53
 
54 54
 #endif /* 99 */
55 55
 
56
+
56 57
 /****************************************************************************************
57 58
 * Gen7 v1.1, v1.2, v1.3 pin assignment
58 59
 *
@@ -576,6 +577,131 @@
576 577
 #endif
577 578
 
578 579
 /****************************************************************************************
580
+* Elefu RA Board Pin Assignments
581
+*
582
+****************************************************************************************/
583
+#if MOTHERBOARD == 21
584
+#define	KNOWN_BOARD 1
585
+
586
+#ifndef __AVR_ATmega2560__
587
+ #error Oops!  Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
588
+#endif
589
+
590
+
591
+#define X_STEP_PIN		     49
592
+#define X_DIR_PIN			     13
593
+#define X_ENABLE_PIN		   48
594
+#define X_MIN_PIN			     35
595
+#define X_MAX_PIN			     -1 //34
596
+
597
+#define Y_STEP_PIN         11
598
+#define Y_DIR_PIN          9
599
+#define Y_ENABLE_PIN       12
600
+#define Y_MIN_PIN          33
601
+#define Y_MAX_PIN          -1 //32
602
+
603
+#define Z_STEP_PIN         7
604
+#define Z_DIR_PIN          6
605
+#define Z_ENABLE_PIN       8
606
+#define Z_MIN_PIN          31
607
+#define Z_MAX_PIN          -1 //30
608
+
609
+#define E2_STEP_PIN        43
610
+#define E2_DIR_PIN         47
611
+#define E2_ENABLE_PIN      42
612
+
613
+#define E1_STEP_PIN        18
614
+#define E1_DIR_PIN         19
615
+#define E1_ENABLE_PIN      38
616
+
617
+#define E0_STEP_PIN        40
618
+#define E0_DIR_PIN         41
619
+#define E0_ENABLE_PIN      37
620
+
621
+#define SDPOWER            -1
622
+#define LED_PIN            -1 //Use +12V Aux port for LED Ring
623
+
624
+#define FAN_PIN            16 //5V PWM
625
+
626
+#define PS_ON_PIN          10 //Set to -1 if using a manual switch on the PWRSW Connector
627
+#define SLEEP_WAKE_PIN		 26 //This feature still needs work
628
+
629
+#define HEATER_0_PIN       45	//12V PWM1
630
+#define HEATER_1_PIN       46	//12V PWM2
631
+#define HEATER_2_PIN       17	//12V PWM3
632
+#define HEATER_BED_PIN     44	//DOUBLE 12V PWM
633
+#define TEMP_0_PIN         3	//ANALOG NUMBERING
634
+#define TEMP_1_PIN         2 	//ANALOG NUMBERING
635
+#define TEMP_2_PIN         1 	//ANALOG NUMBERING
636
+#define TEMP_BED_PIN       0	//ANALOG NUMBERING
637
+
638
+#define BEEPER 		         36
639
+
640
+#define KILL_PIN           -1
641
+
642
+// M240  Triggers a camera by emulating a Canon RC-1 Remote
643
+// Data from: http://www.doc-diy.net/photo/rc-1_hacked/
644
+#define PHOTOGRAPH_PIN     29
645
+
646
+#ifdef RA_CONTROL_PANEL
647
+
648
+  #define SDSS             53
649
+  #define SDCARDDETECT     28
650
+
651
+  #define BTN_EN1          14
652
+  #define BTN_EN2          39
653
+  #define BTN_ENC          15  //the click
654
+    
655
+  #define BLEN_C           2
656
+  #define BLEN_B           1
657
+  #define BLEN_A           0
658
+    
659
+  //encoder rotation values
660
+  #define encrot0          0
661
+  #define encrot1          2
662
+  #define encrot2          3
663
+  #define encrot3          1
664
+  
665
+#endif //RA_CONTROL_PANEL
666
+
667
+#ifdef RA_DISCO
668
+  //variables for which pins the TLC5947 is using
669
+  #define TLC_CLOCK_PIN    25
670
+  #define TLC_BLANK_PIN    23
671
+  #define TLC_XLAT_PIN     22
672
+  #define TLC_DATA_PIN     24
673
+
674
+  //We also need to define pin to port number mapping for the 2560 to match the pins listed above. If you change the TLC pins, update this as well per the 2560 datasheet!
675
+  //This currently only works with the RA Board.
676
+  #define TLC_CLOCK_BIT 3 //bit 3 on port A
677
+  #define TLC_CLOCK_PORT &PORTA //bit 3 on port A
678
+  
679
+  #define TLC_BLANK_BIT 1 //bit 1 on port A
680
+  #define TLC_BLANK_PORT &PORTA //bit 1 on port A
681
+
682
+  #define TLC_DATA_BIT 2 //bit 2 on port A
683
+  #define TLC_DATA_PORT &PORTA //bit 2 on port A
684
+
685
+  #define TLC_XLAT_BIT 0 //bit 0 on port A
686
+  #define TLC_XLAT_PORT &PORTA //bit 0 on port A
687
+
688
+  //change this to match your situation. Lots of TLCs takes up the arduino SRAM very quickly, so be careful 
689
+  //Leave it at at least 1 if you have enabled RA_LIGHTING
690
+  //The number of TLC5947 boards chained together for use with the animation, additional ones will repeat the animation on them, but are not individually addressable and mimic those before them. You can leave the default at 2 even if you only have 1 TLC5947 module.
691
+  #define NUM_TLCS 2 
692
+
693
+  //These TRANS_ARRAY values let you change the order the LEDs on the lighting modules will animate for chase functions. 
694
+  //Modify them according to your specific situation.
695
+  //NOTE: the array should be 8 long for every TLC you have. These defaults assume (2) TLCs.
696
+  #define TRANS_ARRAY {0, 1, 2, 3, 4, 5, 6, 7, 15, 14, 13, 12, 11, 10, 9, 8} //forwards
697
+  //#define TRANS_ARRAY {7, 6, 5, 4, 3, 2, 1, 0, 8, 9, 10, 11, 12, 13, 14, 15} //backwards
698
+#endif //RA_LIGHTING
699
+
700
+
701
+#endif /* Ra Board */
702
+
703
+
704
+/****************************************************************************************
579 705
 * Gen6 pin assignment
580 706
 *
581 707
 ****************************************************************************************/
@@ -1645,3 +1771,6 @@
1645 1771
                         _E0_PINS _E1_PINS _E2_PINS             \
1646 1772
                         analogInputToDigitalPin(TEMP_0_PIN), analogInputToDigitalPin(TEMP_1_PIN), analogInputToDigitalPin(TEMP_2_PIN), analogInputToDigitalPin(TEMP_BED_PIN) }
1647 1773
 #endif
1774
+
1775
+
1776
+

+ 19
- 4
Marlin/ultralcd_implementation_hitachi_HD44780.h 파일 보기

@@ -10,8 +10,13 @@
10 10
 #include "LiquidCrystalRus.h"
11 11
 #define LCD_CLASS LiquidCrystalRus
12 12
 #else
13
-#include <LiquidCrystal.h>
14
-#define LCD_CLASS LiquidCrystal
13
+  #ifdef  LCD_I2C_TYPE_PCA8574
14
+    #include <LiquidCrystal_I2C.h>
15
+    #define LCD_CLASS LiquidCrystal_I2C
16
+  #else
17
+    #include <LiquidCrystal.h>
18
+    #define LCD_CLASS LiquidCrystal
19
+  #endif
15 20
 #endif
16 21
 
17 22
 /* Custom characters defined in the first 8 characters of the LCD */
@@ -25,7 +30,12 @@
25 30
 #define LCD_STR_CLOCK       "\x07"
26 31
 #define LCD_STR_ARROW_RIGHT "\x7E"  /* from the default character set */
27 32
 
28
-LCD_CLASS lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5,LCD_PINS_D6,LCD_PINS_D7);  //RS,Enable,D4,D5,D6,D7
33
+#ifdef LCD_I2C_TYPE_PCA8574
34
+  LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_WIDTH, LCD_HEIGHT);
35
+#else
36
+  LCD_CLASS lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5,LCD_PINS_D6,LCD_PINS_D7);  //RS,Enable,D4,D5,D6,D7
37
+#endif
38
+
29 39
 static void lcd_implementation_init()
30 40
 {
31 41
     byte bedTemp[8] =
@@ -111,7 +121,12 @@ static void lcd_implementation_init()
111 121
         B00000,
112 122
         B00000
113 123
     }; //thanks Sonny Mounicou
114
-    lcd.begin(LCD_WIDTH, LCD_HEIGHT);
124
+    #ifdef LCD_I2C_TYPE_PCA8574
125
+      lcd.init();
126
+      lcd.backlight();
127
+    #else
128
+      lcd.begin(LCD_WIDTH, LCD_HEIGHT);
129
+    #endif
115 130
     lcd.createChar(LCD_STR_BEDTEMP[0], bedTemp);
116 131
     lcd.createChar(LCD_STR_DEGREE[0], degree);
117 132
     lcd.createChar(LCD_STR_THERMOMETER[0], thermometer);

Loading…
취소
저장