Browse Source

Merge pull request #640 from fmalpartida/SAV-MkI

Added support for BT on AT90USB devices, corrected LCD bug, added new board and LCD
ErikZalm 11 years ago
parent
commit
59b96e323e

+ 18
- 2
Marlin/Configuration.h View File

@@ -24,8 +24,12 @@
24 24
 #define SERIAL_PORT 0
25 25
 
26 26
 // This determines the communication speed of the printer
27
+// This determines the communication speed of the printer
27 28
 #define BAUDRATE 250000
28
-//#define BAUDRATE 115200
29
+
30
+// This enables the serial port associated to the Bluetooth interface
31
+//#define BTENABLED              // Enable BT interface on AT90USB devices
32
+
29 33
 
30 34
 //// The following define selects which electronics board you have. Please choose the one that matches your setup
31 35
 // 10 = Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics"
@@ -54,6 +58,7 @@
54 58
 // 80 = Rumba
55 59
 // 81 = Printrboard (AT90USB1286)
56 60
 // 82 = Brainwave (AT90USB646)
61
+// 83 = SAV Mk-I (AT90USB1286)
57 62
 // 9  = Gen3+
58 63
 // 70 = Megatronics
59 64
 // 701= Megatronics v2.0
@@ -64,7 +69,7 @@
64 69
 // 21 = Elefu Ra Board (v3)
65 70
 
66 71
 #ifndef MOTHERBOARD
67
-#define MOTHERBOARD 7
72
+//#define MOTHERBOARD 7
68 73
 #endif
69 74
 
70 75
 // Define this to set a custom name for your generic Mendel,
@@ -514,6 +519,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
514 519
   #define ULTIPANEL
515 520
 #endif
516 521
 
522
+// Shift register panels
523
+// ---------------------
524
+// 2 wire Non-latching LCD SR from:
525
+// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection 
526
+//#define SR_LCD
527
+#ifdef SR_LCD
528
+   #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
529
+   //#define NEWPANEL
530
+#endif
531
+
532
+
517 533
 #ifdef ULTIPANEL
518 534
 //  #define NEWPANEL  //enable this if you have a click-encoder panel
519 535
   #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

+ 9
- 3
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,9 +50,11 @@
46 50
 #include "WString.h"
47 51
 
48 52
 #ifdef AT90USB
49
-  #define MYSERIAL Serial
50
-#else
51
-  #define MYSERIAL MSerial
53
+   #ifdef BTENABLED
54
+         #define MYSERIAL bt
55
+   #else
56
+         #define MYSERIAL Serial
57
+   #endif // BTENABLED
52 58
 #endif
53 59
 
54 60
 #define SERIAL_PROTOCOL(x) (MYSERIAL.print(x))

+ 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

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

+ 16
- 7
Marlin/ultralcd.cpp View File

@@ -19,7 +19,10 @@ int absPreheatHotendTemp;
19 19
 int absPreheatHPBTemp;
20 20
 int absPreheatFanSpeed;
21 21
 
22
+#ifdef ULTIPANEL
22 23
 static float manual_feedrate[] = MANUAL_FEEDRATE;
24
+#endif // ULTIPANEL
25
+
23 26
 /* !Configuration settings */
24 27
 
25 28
 //Function pointer to menu functions.
@@ -992,14 +995,20 @@ void lcd_init()
992 995
     WRITE(SHIFT_LD,HIGH);
993 996
   #endif
994 997
 #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);
998
+  #ifdef SR_LCD_2W_NL
999
+     pinMode (SR_DATA_PIN, OUTPUT);
1000
+     pinMode (SR_CLK_PIN, OUTPUT);
1001
+  #else
1002
+     pinMode(SHIFT_CLK,OUTPUT);
1003
+     pinMode(SHIFT_LD,OUTPUT);
1004
+     pinMode(SHIFT_EN,OUTPUT);
1005
+     pinMode(SHIFT_OUT,INPUT);
1006
+     WRITE(SHIFT_OUT,HIGH);
1007
+     WRITE(SHIFT_LD,HIGH); 
1008
+     WRITE(SHIFT_EN,LOW);
1009
+   #endif // SR_LCD_2W_NL    
1002 1010
 #endif//!NEWPANEL
1011
+
1003 1012
 #if (SDCARDDETECT > 0)
1004 1013
     WRITE(SDCARDDETECT, HIGH);
1005 1014
     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