Browse Source

Merge pull request #479 from MStohn/thermocouple

BUGFIXES for temperature.cpp / add RUMBA thermocouple support
ErikZalm 12 years ago
parent
commit
86405cdd11
2 changed files with 57 additions and 12 deletions
  1. 48
    9
      Marlin/pins.h
  2. 9
    3
      Marlin/temperature.cpp

+ 48
- 9
Marlin/pins.h View File

@@ -1053,17 +1053,56 @@
1053 1053
 #define PS_ON_PIN          45
1054 1054
 #define KILL_PIN           46
1055 1055
 
1056
-#define HEATER_0_PIN       2    // EXTRUDER 1
1057
-#define HEATER_1_PIN       3    // EXTRUDER 2
1058
-#define HEATER_2_PIN       6    // EXTRUDER 3
1056
+#if (TEMP_SENSOR_0==0)
1057
+ #define TEMP_0_PIN         -1
1058
+ #define HEATER_0_PIN       -1
1059
+#else
1060
+ #define HEATER_0_PIN        2    // EXTRUDER 1
1061
+ #if (TEMP_SENSOR_0==-1)
1062
+  #define TEMP_0_PIN         6    // ANALOG NUMBERING - connector *K1* on RUMBA thermocouple ADD ON is used
1063
+ #else
1064
+  #define TEMP_0_PIN         15   // ANALOG NUMBERING - default connector for thermistor *T0* on rumba board is used
1065
+ #endif
1066
+#endif 
1067
+
1068
+#if (TEMP_SENSOR_1==0)
1069
+ #define TEMP_1_PIN         -1
1070
+ #define HEATER_1_PIN       -1
1071
+#else
1072
+ #define HEATER_1_PIN        3    // EXTRUDER 2
1073
+ #if (TEMP_SENSOR_1==-1)
1074
+  #define TEMP_1_PIN         5    // ANALOG NUMBERING - connector *K2* on RUMBA thermocouple ADD ON is used
1075
+ #else
1076
+  #define TEMP_1_PIN         14   // ANALOG NUMBERING - default connector for thermistor *T1* on rumba board is used
1077
+ #endif
1078
+#endif
1079
+
1080
+#if (TEMP_SENSOR_2==0)
1081
+ #define TEMP_2_PIN         -1
1082
+ #define HEATER_2_PIN       -1
1083
+#else
1084
+ #define HEATER_2_PIN        6    // EXTRUDER 3
1085
+ #if (TEMP_SENSOR_2==-1)
1086
+  #define TEMP_2_PIN         7    // ANALOG NUMBERING - connector *K3* on RUMBA thermocouple ADD ON is used <-- this can not be used when TEMP_SENSOR_BED is defined as thermocouple
1087
+ #else
1088
+  #define TEMP_2_PIN         13   // ANALOG NUMBERING - default connector for thermistor *T2* on rumba board is used
1089
+ #endif
1090
+#endif
1091
+
1092
+//optional for extruder 4 or chamber: #define TEMP_X_PIN         12   // ANALOG NUMBERING - default connector for thermistor *T3* on rumba board is used
1059 1093
 //optional FAN1 can be used as 4th heater output: #define HEATER_3_PIN       8    // EXTRUDER 4
1060
-#define HEATER_BED_PIN     9    // BED
1061 1094
 
1062
-#define TEMP_0_PIN         15   // ANALOG NUMBERING
1063
-#define TEMP_1_PIN         14   // ANALOG NUMBERING
1064
-#define TEMP_2_PIN         13   // ANALOG NUMBERING
1065
-//optional for extruder 4 or chamber: #define TEMP_2_PIN         12   // ANALOG NUMBERING
1066
-#define TEMP_BED_PIN       11   // ANALOG NUMBERING
1095
+#if (TEMP_SENSOR_BED==0)
1096
+ #define TEMP_BED_PIN       -1
1097
+ #define HEATER_BED_PIN     -1
1098
+#else
1099
+ #define HEATER_BED_PIN      9    // BED
1100
+ #if (TEMP_SENSOR_BED==-1)
1101
+  #define TEMP_BED_PIN       7    // ANALOG NUMBERING - connector *K3* on RUMBA thermocouple ADD ON is used <-- this can not be used when TEMP_SENSOR_2 is defined as thermocouple
1102
+ #else
1103
+  #define TEMP_BED_PIN       11   // ANALOG NUMBERING - default connector for thermistor *THB* on rumba board is used
1104
+ #endif
1105
+#endif
1067 1106
 
1068 1107
 #define SDPOWER            -1
1069 1108
 #define SDSS               53

+ 9
- 3
Marlin/temperature.cpp View File

@@ -571,6 +571,12 @@ static void updateTemperaturesFromRawValues()
571 571
 
572 572
 void tp_init()
573 573
 {
574
+#if (MOTHERBOARD == 80) && ((TEMP_SENSOR_0==-1)||(TEMP_SENSOR_1==-1)||(TEMP_SENSOR_2==-1)||(TEMP_SENSOR_BED==-1))
575
+  //disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector
576
+  MCUCR=(1<<JTD); 
577
+  MCUCR=(1<<JTD);
578
+#endif
579
+  
574 580
   // Finish init of mult extruder arrays 
575 581
   for(int e = 0; e < EXTRUDERS; e++) {
576 582
     // populate with the first value 
@@ -647,7 +653,7 @@ void tp_init()
647 653
     #if TEMP_2_PIN < 8
648 654
        DIDR0 |= 1 << TEMP_2_PIN; 
649 655
     #else
650
-       DIDR2 = 1<<(TEMP_2_PIN - 8); 
656
+       DIDR2 |= 1<<(TEMP_2_PIN - 8); 
651 657
     #endif
652 658
   #endif
653 659
   #if (TEMP_BED_PIN > -1)
@@ -689,7 +695,7 @@ void tp_init()
689 695
 
690 696
 #if (EXTRUDERS > 1) && defined(HEATER_1_MINTEMP)
691 697
   minttemp[1] = HEATER_1_MINTEMP;
692
-  while(analog2temp(minttemp_raw[1], 1) > HEATER_1_MINTEMP) {
698
+  while(analog2temp(minttemp_raw[1], 1) < HEATER_1_MINTEMP) {
693 699
 #if HEATER_1_RAW_LO_TEMP < HEATER_1_RAW_HI_TEMP
694 700
     minttemp_raw[1] += OVERSAMPLENR;
695 701
 #else
@@ -710,7 +716,7 @@ void tp_init()
710 716
 
711 717
 #if (EXTRUDERS > 2) && defined(HEATER_2_MINTEMP)
712 718
   minttemp[2] = HEATER_2_MINTEMP;
713
-  while(analog2temp(minttemp_raw[2], 2) > HEATER_2_MINTEMP) {
719
+  while(analog2temp(minttemp_raw[2], 2) < HEATER_2_MINTEMP) {
714 720
 #if HEATER_2_RAW_LO_TEMP < HEATER_2_RAW_HI_TEMP
715 721
     minttemp_raw[2] += OVERSAMPLENR;
716 722
 #else

Loading…
Cancel
Save