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
 #define SERIAL_PORT 0
24
 #define SERIAL_PORT 0
25
 
25
 
26
 // This determines the communication speed of the printer
26
 // This determines the communication speed of the printer
27
+// This determines the communication speed of the printer
27
 #define BAUDRATE 250000
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
 //// The following define selects which electronics board you have. Please choose the one that matches your setup
34
 //// The following define selects which electronics board you have. Please choose the one that matches your setup
31
 // 10 = Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics"
35
 // 10 = Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics"
54
 // 80 = Rumba
58
 // 80 = Rumba
55
 // 81 = Printrboard (AT90USB1286)
59
 // 81 = Printrboard (AT90USB1286)
56
 // 82 = Brainwave (AT90USB646)
60
 // 82 = Brainwave (AT90USB646)
61
+// 83 = SAV Mk-I (AT90USB1286)
57
 // 9  = Gen3+
62
 // 9  = Gen3+
58
 // 70 = Megatronics
63
 // 70 = Megatronics
59
 // 701= Megatronics v2.0
64
 // 701= Megatronics v2.0
64
 // 21 = Elefu Ra Board (v3)
69
 // 21 = Elefu Ra Board (v3)
65
 
70
 
66
 #ifndef MOTHERBOARD
71
 #ifndef MOTHERBOARD
67
-#define MOTHERBOARD 7
72
+//#define MOTHERBOARD 7
68
 #endif
73
 #endif
69
 
74
 
70
 // Define this to set a custom name for your generic Mendel,
75
 // Define this to set a custom name for your generic Mendel,
514
   #define ULTIPANEL
519
   #define ULTIPANEL
515
 #endif
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
 #ifdef ULTIPANEL
533
 #ifdef ULTIPANEL
518
 //  #define NEWPANEL  //enable this if you have a click-encoder panel
534
 //  #define NEWPANEL  //enable this if you have a click-encoder panel
519
   #define SDSUPPORT
535
   #define SDSUPPORT

+ 1
- 1
Marlin/Configuration_adv.h View File

163
 
163
 
164
 #ifdef Z_DUAL_STEPPER_DRIVERS && Y_DUAL_STEPPER_DRIVERS
164
 #ifdef Z_DUAL_STEPPER_DRIVERS && Y_DUAL_STEPPER_DRIVERS
165
   #error "You cannot have dual drivers for both Y and Z"
165
   #error "You cannot have dual drivers for both Y and Z"
166
-#endif 
166
+#endif
167
 
167
 
168
 // Enable this for dual x-carriage printers. 
168
 // Enable this for dual x-carriage printers. 
169
 // A dual x-carriage design has the advantage that the inactive extruder can be parked which
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
 # define analogInputToDigitalPin(p) ((p) + A0)
34
 # define analogInputToDigitalPin(p) ((p) + A0)
35
 #endif
35
 #endif
36
 
36
 
37
+#ifdef AT90USB
38
+#include "HardwareSerial.h"
39
+#endif
40
+
37
 #include "MarlinSerial.h"
41
 #include "MarlinSerial.h"
38
 
42
 
39
 #ifndef cbi
43
 #ifndef cbi
46
 #include "WString.h"
50
 #include "WString.h"
47
 
51
 
48
 #ifdef AT90USB
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
 #endif
58
 #endif
53
 
59
 
54
 #define SERIAL_PROTOCOL(x) (MYSERIAL.print(x))
60
 #define SERIAL_PROTOCOL(x) (MYSERIAL.print(x))

+ 6
- 0
Marlin/MarlinSerial.cpp View File

320
 
320
 
321
 #endif // whole file
321
 #endif // whole file
322
 #endif // !AT90USB
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
 extern MarlinSerial MSerial;
181
 extern MarlinSerial MSerial;
182
 #endif // !AT90USB
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
 #endif
189
 #endif

+ 4
- 4
Marlin/Sd2PinMap.h View File

222
 uint8_t const SCL_PIN = 0;  // D0
222
 uint8_t const SCL_PIN = 0;  // D0
223
 
223
 
224
 // SPI port
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
 static const pin_map_t digitalPinMap[] = {
230
 static const pin_map_t digitalPinMap[] = {
231
   {&DDRD, &PIND, &PORTD, 0},  // D0  0
231
   {&DDRD, &PIND, &PORTD, 0},  // D0  0

+ 86
- 0
Marlin/pins.h View File

1549
 
1549
 
1550
 #endif  // MOTHERBOARD == 82 (Brainwave)
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
 * Gen3+ pin assignment
1639
 * Gen3+ pin assignment
1554
 *
1640
 *

+ 16
- 7
Marlin/ultralcd.cpp View File

19
 int absPreheatHPBTemp;
19
 int absPreheatHPBTemp;
20
 int absPreheatFanSpeed;
20
 int absPreheatFanSpeed;
21
 
21
 
22
+#ifdef ULTIPANEL
22
 static float manual_feedrate[] = MANUAL_FEEDRATE;
23
 static float manual_feedrate[] = MANUAL_FEEDRATE;
24
+#endif // ULTIPANEL
25
+
23
 /* !Configuration settings */
26
 /* !Configuration settings */
24
 
27
 
25
 //Function pointer to menu functions.
28
 //Function pointer to menu functions.
992
     WRITE(SHIFT_LD,HIGH);
995
     WRITE(SHIFT_LD,HIGH);
993
   #endif
996
   #endif
994
 #else
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
 #endif//!NEWPANEL
1010
 #endif//!NEWPANEL
1011
+
1003
 #if (SDCARDDETECT > 0)
1012
 #if (SDCARDDETECT > 0)
1004
     WRITE(SDCARDDETECT, HIGH);
1013
     WRITE(SDCARDDETECT, HIGH);
1005
     lcd_oldcardstatus = IS_SD_INSERTED;
1014
     lcd_oldcardstatus = IS_SD_INSERTED;

+ 10
- 1
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

178
     #include <LiquidCrystal_I2C.h>
178
     #include <LiquidCrystal_I2C.h>
179
     #define LCD_CLASS LiquidCrystal_I2C
179
     #define LCD_CLASS LiquidCrystal_I2C
180
     LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_WIDTH, LCD_HEIGHT);
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
 #else
191
 #else
183
   // Standard directly connected LCD implementations
192
   // Standard directly connected LCD implementations
184
   #if LANGUAGE_CHOICE == 6
193
   #if LANGUAGE_CHOICE == 6

Loading…
Cancel
Save