From 69af392554718a14cceef2d9271a6b461dac58a4 Mon Sep 17 00:00:00 2001 From: Erik van der Zalm Date: Sun, 17 Nov 2013 13:29:02 +0100 Subject: [PATCH] Added HEATERS_PARALLEL (Request from reifsnyderb) This allows a hot end with two heaters and a FET for each heater. This is useful if the FET is not capable of heating two heaters. --- Marlin/Configuration_adv.h | 7 +++++++ Marlin/temperature.cpp | 16 +++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 246eb3252e..103bb538f0 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -365,6 +365,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st #define PS_ON_ASLEEP LOW #endif +// Control heater 0 and heater 1 in parallel. +#define HEATERS_PARALLEL + //=========================================================================== //=============================Buffers ============================ //=========================================================================== @@ -418,6 +421,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1" #endif +#if EXTRUDERS > 1 && defined HEATERS_PARALLEL + #error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1" +#endif + #if TEMP_SENSOR_0 > 0 #define THERMISTORHEATER_0 TEMP_SENSOR_0 #define HEATER_0_USES_THERMISTOR diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index decab104d5..651a816752 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1040,7 +1040,7 @@ ISR(TIMER0_COMPB_vect) static unsigned char temp_state = 0; static unsigned char pwm_count = (1 << SOFT_PWM_SCALE); static unsigned char soft_pwm_0; - #if EXTRUDERS > 1 + #if (EXTRUDERS > 1) || defined(HEATERS_PARALLEL) static unsigned char soft_pwm_1; #endif #if EXTRUDERS > 2 @@ -1052,7 +1052,12 @@ ISR(TIMER0_COMPB_vect) if(pwm_count == 0){ soft_pwm_0 = soft_pwm[0]; - if(soft_pwm_0 > 0) WRITE(HEATER_0_PIN,1); + if(soft_pwm_0 > 0) { + WRITE(HEATER_0_PIN,1); + #ifdef HEATERS_PARALLEL + WRITE(HEATER_1_PIN,1); + #endif + } #if EXTRUDERS > 1 soft_pwm_1 = soft_pwm[1]; if(soft_pwm_1 > 0) WRITE(HEATER_1_PIN,1); @@ -1070,7 +1075,12 @@ ISR(TIMER0_COMPB_vect) if(soft_pwm_fan > 0) WRITE(FAN_PIN,1); #endif } - if(soft_pwm_0 <= pwm_count) WRITE(HEATER_0_PIN,0); + if(soft_pwm_0 <= pwm_count) { + WRITE(HEATER_0_PIN,0); + #ifdef HEATERS_PARALLEL + WRITE(HEATER_1_PIN,0); + #endif + } #if EXTRUDERS > 1 if(soft_pwm_1 <= pwm_count) WRITE(HEATER_1_PIN,0); #endif