diff --git a/config/board.3drag.h b/config/board.3drag.h index 075618f..08bbbc6 100644 --- a/config/board.3drag.h +++ b/config/board.3drag.h @@ -226,8 +226,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO14, THERMISTOR_BED) for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins. - 1 for using software emulated PWM. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. Using PWM usually gives smoother temperature control but can conflict @@ -238,9 +237,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO14, THERMISTOR_BED) //DEFINE_HEATERS_START // name pin invert pwm max_pwm -DEFINE_HEATER(extruder, DIO10, 0, 2, 100) -DEFINE_HEATER(bed, DIO9, 0, 2, 100) -DEFINE_HEATER(fan, DIO8, 0, 2, 100) +DEFINE_HEATER(extruder, DIO10, 0, 1, 100) +DEFINE_HEATER(bed, DIO9, 0, 1, 100) +DEFINE_HEATER(fan, DIO8, 0, 1, 100) #define HEATER_EXTRUDER HEATER_extruder #define HEATER_BED HEATER_bed diff --git a/config/board.cnc-shield-v3.h b/config/board.cnc-shield-v3.h index 3341d05..de25da1 100644 --- a/config/board.cnc-shield-v3.h +++ b/config/board.cnc-shield-v3.h @@ -226,8 +226,7 @@ DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, AIO3, THERMISTOR_EXTRUDER) for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins. - 1 for using software emulated PWM. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. Using PWM usually gives smoother temperature control but can conflict @@ -238,7 +237,7 @@ DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, AIO3, THERMISTOR_EXTRUDER) //DEFINE_HEATERS_START // name pin invert pwm max_pwm -DEFINE_HEATER(extruder, AIO2, 0, 2, 100) +DEFINE_HEATER(extruder, AIO2, 0, 1, 100) #define HEATER_EXTRUDER HEATER_extruder //DEFINE_HEATERS_END diff --git a/config/board.gen3.h b/config/board.gen3.h index 703a37d..8dba806 100644 --- a/config/board.gen3.h +++ b/config/board.gen3.h @@ -220,7 +220,7 @@ DEFINE_TEMP_SENSOR(noheater, TT_INTERCOM, AIO0, 0) for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 1 for using PWM on a PWM-able pin and on/off on other pins. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. Using PWM usually gives smoother temperature control but can conflict diff --git a/config/board.gen6.h b/config/board.gen6.h index c5d6c6d..4831b44 100644 --- a/config/board.gen6.h +++ b/config/board.gen6.h @@ -221,8 +221,7 @@ DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, AIO5, THERMISTOR_EXTRUDER) for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins. - 1 for using software emulated PWM. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. Using PWM usually gives smoother temperature control but can conflict @@ -233,7 +232,7 @@ DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, AIO5, THERMISTOR_EXTRUDER) //DEFINE_HEATERS_START // name pin invert pwm max_pwm -DEFINE_HEATER(extruder, DIO6, 0, 2, 100) +DEFINE_HEATER(extruder, DIO6, 0, 1, 100) #define HEATER_EXTRUDER HEATER_extruder //DEFINE_HEATERS_END diff --git a/config/board.gen7-arm.h b/config/board.gen7-arm.h index 7742eee..afee8dc 100644 --- a/config/board.gen7-arm.h +++ b/config/board.gen7-arm.h @@ -225,13 +225,14 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, PIO1_0,THERMISTOR_BED) for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - >=2 in Hertz (Hz) on ARM based controllers to set PWM frequency of - this pin's output. Frequency isn't always accurate, Teacup - will choose the closest possible one. FAST_PWM is ignored - on such controllers. Valid range is 2 to 200'000 Hz. - It will force to 1 on none-PWM-able pins. - 1 for using software emulated PWM at 100Hz. - 0 for using on/off on a PWM-able pin, too. + frequency in Hertz (Hz) on ARM based controllers to set PWM frequency of + this pin's output. Frequency isn't always accurate, Teacup + will choose the closest possible one. FAST_PWM is ignored + on such controllers. Valid range is 2 to 200'000 Hz. + 1 on AVR based controllers for using Pulse Width Modulation (PWM) + on a pin supporting it. PWM frequency can be influenced only + somewhat and only globally with FAST_PWM. + 0 for using a PWM-able pin in on/off mode. Using PWM usually gives smoother temperature control but can conflict with slow switches, like solid state relays. A too high frequency can diff --git a/config/board.gen7-v1.1-v1.3.h b/config/board.gen7-v1.1-v1.3.h index c43ee32..3cef5e0 100644 --- a/config/board.gen7-v1.1-v1.3.h +++ b/config/board.gen7-v1.1-v1.3.h @@ -230,11 +230,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO2, THERMISTOR_BED) for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins. - 1 for using software emulated PWM. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. - Using PWM usually gives smoother temperature control but can conflict with slow switches, like solid state relays. PWM frequency can be influenced globally with FAST_PWM, see below. @@ -243,8 +241,8 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO2, THERMISTOR_BED) //DEFINE_HEATERS_START // name pin invert pwm max_pwm -DEFINE_HEATER(extruder, DIO4, 0, 2, 100) -DEFINE_HEATER(bed, DIO3, 0, 2, 100) +DEFINE_HEATER(extruder, DIO4, 0, 1, 100) +DEFINE_HEATER(bed, DIO3, 0, 1, 100) #define HEATER_EXTRUDER HEATER_extruder #define HEATER_BED HEATER_bed diff --git a/config/board.gen7-v1.4.h b/config/board.gen7-v1.4.h index 9dad7f0..81c8b24 100644 --- a/config/board.gen7-v1.4.h +++ b/config/board.gen7-v1.4.h @@ -231,8 +231,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED) for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins. - 1 for using software emulated PWM. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. Using PWM usually gives smoother temperature control but can conflict @@ -243,8 +242,8 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED) //DEFINE_HEATERS_START // name pin invert pwm max_pwm -DEFINE_HEATER(extruder, DIO4, 0, 2, 100) -DEFINE_HEATER(bed, DIO3, 0, 2, 100) +DEFINE_HEATER(extruder, DIO4, 0, 1, 100) +DEFINE_HEATER(bed, DIO3, 0, 1, 100) #define HEATER_EXTRUDER HEATER_extruder #define HEATER_BED HEATER_bed diff --git a/config/board.melzi.h b/config/board.melzi.h index 5c9211b..4d681e7 100644 --- a/config/board.melzi.h +++ b/config/board.melzi.h @@ -230,8 +230,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins. - 1 for using software emulated PWM. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. Using PWM usually gives smoother temperature control but can conflict @@ -242,9 +241,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) //DEFINE_HEATERS_START // name pin invert pwm max_pwm -DEFINE_HEATER(extruder, DIO13, 0, 2, 100) -DEFINE_HEATER(bed, DIO12, 0, 2, 100) -DEFINE_HEATER(fan, DIO4, 0, 1, 100) +DEFINE_HEATER(extruder, DIO13, 0, 1, 100) +DEFINE_HEATER(bed, DIO12, 0, 1, 100) +DEFINE_HEATER(fan, DIO4, 0, 0, 100) #define HEATER_EXTRUDER HEATER_extruder #define HEATER_BED HEATER_bed diff --git a/config/board.nanoheart-v1.0.h b/config/board.nanoheart-v1.0.h index 7cded1b..da83220 100644 --- a/config/board.nanoheart-v1.0.h +++ b/config/board.nanoheart-v1.0.h @@ -228,8 +228,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO7, THERMISTOR_BED) for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins. - 1 for using software emulated PWM. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. Using PWM usually gives smoother temperature control but can conflict @@ -240,8 +239,8 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO7, THERMISTOR_BED) //DEFINE_HEATERS_START // name pin invert pwm max_pwm -DEFINE_HEATER(extruder, DIO11, 0, 2, 100) -DEFINE_HEATER(bed, DIO3, 0, 2, 100) +DEFINE_HEATER(extruder, DIO11, 0, 1, 100) +DEFINE_HEATER(bed, DIO3, 0, 1, 100) #define HEATER_EXTRUDER HEATER_extruder #define HEATER_BED HEATER_bed diff --git a/config/board.pcbscriber.h b/config/board.pcbscriber.h index c37a095..919f09a 100644 --- a/config/board.pcbscriber.h +++ b/config/board.pcbscriber.h @@ -247,8 +247,7 @@ for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins. - 1 for using software emulated PWM. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. Using PWM usually gives smoother temperature control but can conflict diff --git a/config/board.ramps-v1.2.h b/config/board.ramps-v1.2.h index ddb0fbc..3b20dac 100644 --- a/config/board.ramps-v1.2.h +++ b/config/board.ramps-v1.2.h @@ -227,8 +227,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO1, THERMISTOR_BED) for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins. - 1 for using software emulated PWM. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. Using PWM usually gives smoother temperature control but can conflict @@ -239,9 +238,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO1, THERMISTOR_BED) //DEFINE_HEATERS_START // name pin invert pwm max_pwm -DEFINE_HEATER(extruder, DIO10, 0, 2, 100) -DEFINE_HEATER(bed, DIO8, 0, 2, 100) -DEFINE_HEATER(fan, DIO9, 0, 2, 100) +DEFINE_HEATER(extruder, DIO10, 0, 1, 100) +DEFINE_HEATER(bed, DIO8, 0, 1, 100) +DEFINE_HEATER(fan, DIO9, 0, 1, 100) #define HEATER_EXTRUDER HEATER_extruder #define HEATER_BED HEATER_bed diff --git a/config/board.ramps-v1.3.h b/config/board.ramps-v1.3.h index d751d00..313c65e 100644 --- a/config/board.ramps-v1.3.h +++ b/config/board.ramps-v1.3.h @@ -232,8 +232,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO14, THERMISTOR_BED) for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins. - 1 for using software emulated PWM. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. Using PWM usually gives smoother temperature control but can conflict @@ -244,9 +243,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO14, THERMISTOR_BED) //DEFINE_HEATERS_START // name pin invert pwm max_pwm -DEFINE_HEATER(extruder, DIO10, 0, 2, 100) -DEFINE_HEATER(bed, DIO8, 0, 2, 100) -DEFINE_HEATER(fan, DIO9, 0, 2, 100) +DEFINE_HEATER(extruder, DIO10, 0, 1, 100) +DEFINE_HEATER(bed, DIO8, 0, 1, 100) +DEFINE_HEATER(fan, DIO9, 0, 1, 100) #define HEATER_EXTRUDER HEATER_extruder #define HEATER_BED HEATER_bed diff --git a/config/board.rumba.h b/config/board.rumba.h index d215e46..3a438ac 100644 --- a/config/board.rumba.h +++ b/config/board.rumba.h @@ -230,8 +230,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO11, THERMISTOR_BED) for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins. - 1 for using software emulated PWM. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. Using PWM usually gives smoother temperature control but can conflict @@ -242,9 +241,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO11, THERMISTOR_BED) //DEFINE_HEATERS_START // name pin invert pwm max_pwm -DEFINE_HEATER(extruder, DIO2, 0, 2, 100) -DEFINE_HEATER(bed, DIO9, 0, 2, 100) -DEFINE_HEATER(fan, DIO8, 0, 2, 100) +DEFINE_HEATER(extruder, DIO2, 0, 1, 100) +DEFINE_HEATER(bed, DIO9, 0, 1, 100) +DEFINE_HEATER(fan, DIO8, 0, 1, 100) #define HEATER_EXTRUDER HEATER_extruder #define HEATER_BED HEATER_bed diff --git a/config/board.sanguinololu-v1.1.h b/config/board.sanguinololu-v1.1.h index cec1949..f87420f 100644 --- a/config/board.sanguinololu-v1.1.h +++ b/config/board.sanguinololu-v1.1.h @@ -228,8 +228,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins. - 1 for using software emulated PWM. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. Using PWM usually gives smoother temperature control but can conflict @@ -240,8 +239,8 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) //DEFINE_HEATERS_START // name pin invert pwm max_pwm -DEFINE_HEATER(extruder, DIO13, 0, 2, 100) -DEFINE_HEATER(bed, DIO14, 0, 2, 100) +DEFINE_HEATER(extruder, DIO13, 0, 1, 100) +DEFINE_HEATER(bed, DIO14, 0, 1, 100) #define HEATER_EXTRUDER HEATER_extruder #define HEATER_BED HEATER_bed diff --git a/config/board.sanguinololu-v1.2.h b/config/board.sanguinololu-v1.2.h index af4e546..574ba54 100644 --- a/config/board.sanguinololu-v1.2.h +++ b/config/board.sanguinololu-v1.2.h @@ -228,8 +228,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins. - 1 for using software emulated PWM. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. Using PWM usually gives smoother temperature control but can conflict @@ -240,8 +239,8 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) //DEFINE_HEATERS_START // name pin invert pwm max_pwm -DEFINE_HEATER(extruder, DIO12, 0, 2, 100) -DEFINE_HEATER(bed, DIO13, 0, 2, 100) +DEFINE_HEATER(extruder, DIO12, 0, 1, 100) +DEFINE_HEATER(bed, DIO13, 0, 1, 100) #define HEATER_EXTRUDER HEATER_extruder #define HEATER_BED HEATER_bed diff --git a/config/board.sanguish.h b/config/board.sanguish.h index ec90822..60810d0 100644 --- a/config/board.sanguish.h +++ b/config/board.sanguish.h @@ -228,8 +228,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED) for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins. - 1 for using software emulated PWM. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. Using PWM usually gives smoother temperature control but can conflict @@ -240,8 +239,8 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED) //DEFINE_HEATERS_START // name pin invert pwm max_pwm -DEFINE_HEATER(extruder, DIO3, 0, 2, 100) -DEFINE_HEATER(bed, DIO4, 0, 2, 100) +DEFINE_HEATER(extruder, DIO3, 0, 1, 100) +DEFINE_HEATER(bed, DIO4, 0, 1, 100) #define HEATER_EXTRUDER HEATER_extruder #define HEATER_BED HEATER_bed diff --git a/config/board.sinaptec-at328-02.h b/config/board.sinaptec-at328-02.h index 8772d79..538da00 100644 --- a/config/board.sinaptec-at328-02.h +++ b/config/board.sinaptec-at328-02.h @@ -229,8 +229,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins. - 1 for using software emulated PWM. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. Using PWM usually gives smoother temperature control but can conflict @@ -241,9 +240,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) //DEFINE_HEATERS_START // name pin invert pwm max_pwm -DEFINE_HEATER(extruder, DIO3, 0, 2, 100) -DEFINE_HEATER(bed, DIO6, 0, 2, 100) -DEFINE_HEATER(fan, DIO5, 0, 2, 100) +DEFINE_HEATER(extruder, DIO3, 0, 1, 100) +DEFINE_HEATER(bed, DIO6, 0, 1, 100) +DEFINE_HEATER(fan, DIO5, 0, 1, 100) #define HEATER_EXTRUDER HEATER_extruder #define HEATER_BED HEATER_bed diff --git a/config/board.teensy++-v2.0.h b/config/board.teensy++-v2.0.h index 94e7d72..03ceee1 100644 --- a/config/board.teensy++-v2.0.h +++ b/config/board.teensy++-v2.0.h @@ -226,8 +226,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins. - 1 for using software emulated PWM. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. Using PWM usually gives smoother temperature control but can conflict @@ -238,9 +237,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) //DEFINE_HEATERS_START // name pin invert pwm max_pwm -DEFINE_HEATER(extruder, DIO15, 0, 2, 100) -DEFINE_HEATER(bed, DIO14, 0, 2, 100) -DEFINE_HEATER(fan, DIO16, 0, 1, 100) +DEFINE_HEATER(extruder, DIO15, 0, 1, 100) +DEFINE_HEATER(bed, DIO14, 0, 1, 100) +DEFINE_HEATER(fan, DIO16, 0, 0, 100) #define HEATER_EXTRUDER HEATER_extruder #define HEATER_BED HEATER_bed diff --git a/config/board.teensy-v2.0.h b/config/board.teensy-v2.0.h index 772a6bc..d3b1bfe 100644 --- a/config/board.teensy-v2.0.h +++ b/config/board.teensy-v2.0.h @@ -226,8 +226,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED) for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins. - 1 for using software emulated PWM. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. Using PWM usually gives smoother temperature control but can conflict @@ -238,9 +237,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED) //DEFINE_HEATERS_START // name pin invert pwm max_pwm -DEFINE_HEATER(extruder, DIO10, 0, 2, 100) -DEFINE_HEATER(bed, DIO9, 0, 2, 100) -DEFINE_HEATER(fan, DIO8, 0, 1, 100) +DEFINE_HEATER(extruder, DIO10, 0, 1, 100) +DEFINE_HEATER(bed, DIO9, 0, 1, 100) +DEFINE_HEATER(fan, DIO8, 0, 0, 100) #define HEATER_EXTRUDER HEATER_extruder #define HEATER_BED HEATER_bed diff --git a/config/board.tronxy.h b/config/board.tronxy.h index 8409f49..4e88471 100644 --- a/config/board.tronxy.h +++ b/config/board.tronxy.h @@ -228,8 +228,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 2 for using PWM on a PWM-able pin. It will force to 1 on none-PWM-able pins. - 1 for using software emulated PWM. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. Using PWM usually gives smoother temperature control but can conflict @@ -240,9 +239,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) //DEFINE_HEATERS_START // name pin invert pwm max_pwm -DEFINE_HEATER(extruder, DIO13, 0, 2, 100) -DEFINE_HEATER(bed, DIO12, 0, 2, 100) -DEFINE_HEATER(fan, DIO4, 0, 2, 100) +DEFINE_HEATER(extruder, DIO13, 0, 1, 100) +DEFINE_HEATER(bed, DIO12, 0, 1, 100) +DEFINE_HEATER(fan, DIO4, 0, 1, 100) #define HEATER_EXTRUDER HEATER_extruder #define HEATER_BED HEATER_bed diff --git a/configtool/board.generic.h b/configtool/board.generic.h index 5ceb7d3..ec67eb6 100644 --- a/configtool/board.generic.h +++ b/configtool/board.generic.h @@ -222,7 +222,7 @@ for this pin, e.g. for a MOSFET with a driver. Set 'pwm' to ... - 1 for using PWM on a PWM-able pin and on/off on other pins. + 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. 0 for using on/off on a PWM-able pin, too. Using PWM usually gives smoother temperature control but can conflict diff --git a/heater-avr.c b/heater-avr.c index a896baf..9b5ebe4 100644 --- a/heater-avr.c +++ b/heater-avr.c @@ -22,7 +22,7 @@ typedef struct { volatile uint8_t *heater_pwm; ///< pointer to 8-bit PWM register, eg OCR0A (8-bit) or ORC3L (low byte, 16-bit) }; uint8_t masked_pin; ///< heater pin, masked. eg for PB3 enter '1 << 3' here, or 1 << PB3_PIN or similar - + uint16_t max_value; ///< max value for the heater, for PWM in percent * 256 pwm_type_t pwm_type; ///< saves the pwm-type: NO_PWM, SOFTWARE_PWM, HARDWARE_PWM uint8_t invert; ///< Wether the heater pin signal needs to be inverted. @@ -32,7 +32,7 @@ typedef struct { // When pwm == 1 it's software pwm. // pwm == 0 is no pwm at all. // Use this macro only in DEFINE_HEATER_ACTUAL-macros. -#define PWM_TYPE(pwm, pin) (((pwm) >= HARDWARE_PWM) ? ((pin ## _PWM) ? HARDWARE_PWM : SOFTWARE_PWM) : (pwm)) +#define PWM_TYPE(pwm, pin) (((pwm) >= HARDWARE_PWM_START) ? ((pin ## _PWM) ? HARDWARE_PWM : SOFTWARE_PWM) : pwm) #undef DEFINE_HEATER_ACTUAL /// \brief helper macro to fill heater definition struct from config.h @@ -163,7 +163,7 @@ void heater_init() { void do_heater(heater_t index, uint8_t value) { if (index < NUM_HEATERS) { - if (heaters[index].pwm_type >= HARDWARE_PWM) { + if (heaters[index].pwm_type == HARDWARE_PWM) { uint8_t pwm_value; // Remember, we scale, and the timer inverts already. diff --git a/heater-lpc.c b/heater-lpc.c index 71efbf3..13790b4 100644 --- a/heater-lpc.c +++ b/heater-lpc.c @@ -77,7 +77,7 @@ typedef struct { // When pwm == 1 it's software pwm. // pwm == 0 is no pwm at all. // Use this macro only in DEFINE_HEATER_ACTUAL-macros. -#define PWM_TYPE(pwm, pin) (((pwm) >= HARDWARE_PWM) ? ((pin ## _TIMER) ? HARDWARE_PWM : SOFTWARE_PWM) : (pwm)) +#define PWM_TYPE(pwm, pin) (((pwm) >= HARDWARE_PWM_START) ? ((pin ## _TIMER) ? HARDWARE_PWM : SOFTWARE_PWM) : (pwm)) #undef DEFINE_HEATER_ACTUAL #define DEFINE_HEATER_ACTUAL(name, pin, invert, pwm, max_value) \ diff --git a/heater.h b/heater.h index 1d879f0..81d8d69 100644 --- a/heater.h +++ b/heater.h @@ -76,6 +76,9 @@ typedef enum { HARDWARE_PWM = 2 } pwm_type_t; +// Force hardware PWM if available. +#define HARDWARE_PWM_START SOFTWARE_PWM + void heater_init(void); void pid_init(void); diff --git a/testcases/board.regtest-no-endstops.h b/testcases/board.regtest-no-endstops.h index 4bd8a63..986ad3c 100644 --- a/testcases/board.regtest-no-endstops.h +++ b/testcases/board.regtest-no-endstops.h @@ -63,7 +63,7 @@ DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, AIO1, THERMISTOR_EXTRUDER) DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO2, THERMISTOR_BED) -DEFINE_HEATER(extruder, DIO4, 0, 2, 100) +DEFINE_HEATER(extruder, DIO4, 0, 1, 100) DEFINE_HEATER(bed, DIO3, 0, 1, 100) #define HEATER_EXTRUDER HEATER_extruder diff --git a/testcases/config.h.Profiling b/testcases/config.h.Profiling index c9ecb67..e6570a4 100644 --- a/testcases/config.h.Profiling +++ b/testcases/config.h.Profiling @@ -523,7 +523,7 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_EXTRUDER) * signal for this pin, e.g. for a MOSFET with a driver. * * * * Set 'pwm' to ... * -* 1 for using PWM on a PWM-able pin and on/off on other pins. * +* 1 for using hardware PWM on a PWM-able pin and software PWM on other pins. * * 0 for using on/off on a PWM-able pin, too. * * Using PWM usually gives smoother temperature control but can conflict * * with slow switches, like solid state relays. PWM frequency can be * @@ -551,8 +551,8 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_EXTRUDER) // #define HEATER_MAX_ACTIVE // name pin invert pwm -DEFINE_HEATER(extruder, DIO4, 0, 2, 100) -DEFINE_HEATER(bed, DIO3, 0, 2, 100) +DEFINE_HEATER(extruder, DIO4, 0, 1, 100) +DEFINE_HEATER(bed, DIO3, 0, 1, 100) /// and now because the c preprocessor isn't as smart as it could be, /// uncomment the ones you've listed above and comment the rest.