Browse Source

Initial SAV MkI (RepRap CloneWars board) integration.

Included support for BT dongle on AT90USB boards.
Added LCD Shift Register LCD control
Included support for RepRap Clone Wars project board (SAV MKI).
fmalpartida 10 years ago
parent
commit
b5a964fcc5

Marlin/BlinkM.cpp → Marlin/BlinkM.__cpp View File


Marlin/BlinkM.h → Marlin/BlinkM.__h View File


+ 24
- 2
Marlin/Configuration.h View File

@@ -22,10 +22,21 @@
22 22
 // This allows the connection of wireless adapters (for instance) to non-default port pins.
23 23
 // Serial port 0 is still used by the Arduino bootloader regardless of this setting.
24 24
 #define SERIAL_PORT 0
25
+//#define SERIAL_PORT 1  // Define serial port 1 for bluetooth configuration in AT90USB configurations
25 26
 
26 27
 // This determines the communication speed of the printer
28
+// This determines the communication speed of the printer
27 29
 #define BAUDRATE 250000
28
-//#define BAUDRATE 115200
30
+
31
+// This enables the serial port associated to the Bluetooth interface
32
+//#define BTENABLED              // Enable BT interface
33
+
34
+
35
+// SERIAL_PORT selects which serial port should be used for communication with the host.
36
+// This allows the connection of wireless adapters (for instance) to non-default port pins.
37
+// Serial port 0 is still used by the Arduino bootloader regardless of this setting.
38
+#define SERIAL_PORT 0
39
+
29 40
 
30 41
 //// The following define selects which electronics board you have. Please choose the one that matches your setup
31 42
 // 10 = Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics"
@@ -54,6 +65,7 @@
54 65
 // 80 = Rumba
55 66
 // 81 = Printrboard (AT90USB1286)
56 67
 // 82 = Brainwave (AT90USB646)
68
+// 83 = SAV Mk-I (AT90USB1286)
57 69
 // 9  = Gen3+
58 70
 // 70 = Megatronics
59 71
 // 701= Megatronics v2.0
@@ -64,7 +76,8 @@
64 76
 // 21 = Elefu Ra Board (v3)
65 77
 
66 78
 #ifndef MOTHERBOARD
67
-#define MOTHERBOARD 7
79
+//[FMC]#define MOTHERBOARD 7
80
+#define MOTHERBOARD 83
68 81
 #endif
69 82
 
70 83
 // Define this to set a custom name for your generic Mendel,
@@ -507,6 +520,15 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
507 520
   #define ULTIPANEL
508 521
 #endif
509 522
 
523
+// Shift register panels
524
+// ---------------------
525
+//#define SR_LCD
526
+#ifdef SR_LCD
527
+   #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
528
+   //#define NEWPANEL
529
+#endif
530
+
531
+
510 532
 #ifdef ULTIPANEL
511 533
 //  #define NEWPANEL  //enable this if you have a click-encoder panel
512 534
   #define SDSUPPORT

+ 1
- 1
Marlin/Configuration_adv.h View File

@@ -163,7 +163,7 @@
163 163
 
164 164
 #ifdef Z_DUAL_STEPPER_DRIVERS && Y_DUAL_STEPPER_DRIVERS
165 165
   #error "You cannot have dual drivers for both Y and Z"
166
-#endif 
166
+#endif
167 167
 
168 168
 // Enable this for dual x-carriage printers. 
169 169
 // A dual x-carriage design has the advantage that the inactive extruder can be parked which

+ 13
- 0
Marlin/Marlin.h View File

@@ -34,6 +34,10 @@
34 34
 # define analogInputToDigitalPin(p) ((p) + A0)
35 35
 #endif
36 36
 
37
+#ifdef AT90USB
38
+#include "HardwareSerial.h"
39
+#endif
40
+
37 41
 #include "MarlinSerial.h"
38 42
 
39 43
 #ifndef cbi
@@ -46,6 +50,15 @@
46 50
 #include "WString.h"
47 51
 
48 52
 #ifdef AT90USB
53
+   #ifdef BTENABLED
54
+         extern HardwareSerial bt;
55
+         #define MYSERIAL bt
56
+   #else
57
+         #define MYSERIAL Serial
58
+   #endif // BTENABLED
59
+#endif
60
+
61
+#ifdef AT90USB
49 62
   #define MYSERIAL Serial
50 63
 #else
51 64
   #define MYSERIAL MSerial

+ 6
- 0
Marlin/MarlinSerial.cpp View File

@@ -320,3 +320,9 @@ MarlinSerial MSerial;
320 320
 
321 321
 #endif // whole file
322 322
 #endif // !AT90USB
323
+
324
+// For AT90USB targets use the UART for BT interfacing
325
+#if defined(AT90USB) && defined (BTENABLED)
326
+   HardwareSerial bt;
327
+#endif
328
+

+ 5
- 0
Marlin/MarlinSerial.h View File

@@ -181,4 +181,9 @@ class MarlinSerial //: public Stream
181 181
 extern MarlinSerial MSerial;
182 182
 #endif // !AT90USB
183 183
 
184
+// Use the UART for BT in AT90USB configurations
185
+#if defined(AT90USB) && defined (BTENABLED)
186
+   extern HardwareSerial bt;
187
+#endif
188
+
184 189
 #endif

+ 4
- 4
Marlin/Sd2PinMap.h View File

@@ -222,10 +222,10 @@ uint8_t const SDA_PIN = 1;  // D1
222 222
 uint8_t const SCL_PIN = 0;  // D0
223 223
 
224 224
 // SPI port
225
-uint8_t const SS_PIN = 20;    // B0
226
-uint8_t const MOSI_PIN = 22;  // B2
227
-uint8_t const MISO_PIN = 23;  // B3
228
-uint8_t const SCK_PIN = 21;   // B1
225
+uint8_t const SS_PIN    = 20;    // B0
226
+uint8_t const MOSI_PIN  = 22;    // B2
227
+uint8_t const MISO_PIN  = 23;    // B3
228
+uint8_t const SCK_PIN   = 21;    // B1
229 229
 
230 230
 static const pin_map_t digitalPinMap[] = {
231 231
   {&DDRD, &PIND, &PORTD, 0},  // D0  0

+ 86
- 0
Marlin/pins.h View File

@@ -1541,6 +1541,92 @@
1541 1541
 
1542 1542
 #endif  // MOTHERBOARD == 82 (Brainwave)
1543 1543
 
1544
+//
1545
+// SAV Mk-I
1546
+// -----------------------------------------------------------------------------------
1547
+/****************************************************************************************
1548
+* SAV MkI pin assignments (AT90USB1286)
1549
+* Requires the Teensyduino software with Teensy++ 2.0 selected in Arduino IDE!
1550
+  http://www.pjrc.com/teensy/teensyduino.html
1551
+   RepRap Clone Wars project board.
1552
+****************************************************************************************/
1553
+#if MOTHERBOARD == 83  // SAV Mk-I
1554
+#define KNOWN_BOARD 1
1555
+#define AT90USB 1286  // Disable MarlinSerial etc.
1556
+
1557
+#ifndef __AVR_AT90USB1286__
1558
+#error Oops!  Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu.
1559
+#endif
1560
+
1561
+#define LARGE_FLASH        true
1562
+
1563
+
1564
+#define X_STEP_PIN         0
1565
+#define X_DIR_PIN          1
1566
+#define X_ENABLE_PIN       39
1567
+
1568
+#define Y_STEP_PIN         2
1569
+#define Y_DIR_PIN          3
1570
+#define Y_ENABLE_PIN       38
1571
+
1572
+#define Z_STEP_PIN         4
1573
+#define Z_DIR_PIN          5
1574
+#define Z_ENABLE_PIN       23
1575
+
1576
+#define E0_STEP_PIN         6
1577
+#define E0_DIR_PIN          7
1578
+#define E0_ENABLE_PIN       19
1579
+
1580
+#define HEATER_0_PIN       21  // Extruder
1581
+#define HEATER_1_PIN       -1
1582
+#define HEATER_2_PIN       -1
1583
+#define HEATER_BED_PIN     20  // Bed
1584
+#define FAN_PIN            16  // Fan   -- from Teensyduino environment.
1585
+                               // For the fan and Teensyduino uses a different pin mapping.
1586
+
1587
+  #define X_STOP_PIN         13
1588
+  #define Y_STOP_PIN         14
1589
+  #define Z_STOP_PIN         15
1590
+  #define TEMP_0_PIN          7  // Extruder / Analog pin numbering
1591
+  #define TEMP_BED_PIN        6  // Bed / Analog pin numbering
1592
+
1593
+#define TEMP_1_PIN         -1
1594
+#define TEMP_2_PIN         -1
1595
+
1596
+#define SDPOWER            -1
1597
+#define SDSS               20  // PB0 - 8 in marlin env.
1598
+#define LED_PIN            -1
1599
+#define PS_ON_PIN          -1
1600
+#define KILL_PIN           -1
1601
+#define ALARM_PIN          -1
1602
+#define SDCARDDETECT       -1
1603
+
1604
+
1605
+#ifndef SDSUPPORT
1606
+   // these pins are defined in the SD library if building with SD support
1607
+  #define SCK_PIN          9
1608
+  #define MISO_PIN         11
1609
+  #define MOSI_PIN         10
1610
+#endif
1611
+
1612
+#define BEEPER             -1
1613
+#define LCD_PINS_RS        -1
1614
+#define LCD_PINS_ENABLE    -1
1615
+#define LCD_PINS_D4        -1
1616
+#define LCD_PINS_D5        -1
1617
+#define LCD_PINS_D6        -1
1618
+#define LCD_PINS_D7        -1
1619
+#define BTN_EN1            -1
1620
+#define BTN_EN2            -1
1621
+#define BTN_ENC            -1
1622
+
1623
+// For LCD SHIFT register LCD
1624
+#define SR_DATA_PIN         0
1625
+#define SR_CLK_PIN          1
1626
+
1627
+#endif  // MOTHERBOARD == 83
1628
+
1629
+
1544 1630
 /****************************************************************************************
1545 1631
 * Gen3+ pin assignment
1546 1632
 *

+ 13
- 7
Marlin/ultralcd.cpp View File

@@ -992,14 +992,20 @@ void lcd_init()
992 992
     WRITE(SHIFT_LD,HIGH);
993 993
   #endif
994 994
 #else
995
-    pinMode(SHIFT_CLK,OUTPUT);
996
-    pinMode(SHIFT_LD,OUTPUT);
997
-    pinMode(SHIFT_EN,OUTPUT);
998
-    pinMode(SHIFT_OUT,INPUT);
999
-    WRITE(SHIFT_OUT,HIGH);
1000
-    WRITE(SHIFT_LD,HIGH); 
1001
-    WRITE(SHIFT_EN,LOW);
995
+  #ifdef SR_LCD_2W_NL
996
+     pinMode (SR_DATA_PIN, OUTPUT);
997
+     pinMode (SR_CLK_PIN, OUTPUT);
998
+  #else
999
+     pinMode(SHIFT_CLK,OUTPUT);
1000
+     pinMode(SHIFT_LD,OUTPUT);
1001
+     pinMode(SHIFT_EN,OUTPUT);
1002
+     pinMode(SHIFT_OUT,INPUT);
1003
+     WRITE(SHIFT_OUT,HIGH);
1004
+     WRITE(SHIFT_LD,HIGH); 
1005
+     WRITE(SHIFT_EN,LOW);
1006
+   #endif // SR_LCD_2W_NL    
1002 1007
 #endif//!NEWPANEL
1008
+
1003 1009
 #if (SDCARDDETECT > 0)
1004 1010
     WRITE(SDCARDDETECT, HIGH);
1005 1011
     lcd_oldcardstatus = IS_SD_INSERTED;

+ 10
- 1
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

@@ -178,7 +178,16 @@ extern volatile uint16_t buttons;  //an extended version of the last checked but
178 178
     #include <LiquidCrystal_I2C.h>
179 179
     #define LCD_CLASS LiquidCrystal_I2C
180 180
     LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_WIDTH, LCD_HEIGHT);
181
-  
181
+    
182
+// 2 wire Non-latching LCD SR from:
183
+// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection 
184
+#elif defined(SR_LCD_2W_NL)
185
+   
186
+  #include <LCD.h>
187
+  #include <LiquidCrystal_SR.h>
188
+  #define LCD_CLASS LiquidCrystal_SR
189
+  LCD_CLASS lcd(SR_DATA_PIN, SR_CLK_PIN);
190
+
182 191
 #else
183 192
   // Standard directly connected LCD implementations
184 193
   #if LANGUAGE_CHOICE == 6

Loading…
Cancel
Save