X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;f=reprap_mendel_prusa%2Fteacup_firmware%2Fextruder%2Fconfig.h;h=ace2d670537b987c7e8050531c3da68e937c978d;hb=d3c3c6e7915c02cbb522adba40baff52e3fa9fe4;hp=8faa6e82ce0e7039ffd31eef2a638212016c8bfc;hpb=ffef74661d9cf233a7beb0439ba34a30e0a1a4e5;p=svn42.git diff --git a/reprap_mendel_prusa/teacup_firmware/extruder/config.h b/reprap_mendel_prusa/teacup_firmware/extruder/config.h index 8faa6e8..ace2d67 100644 --- a/reprap_mendel_prusa/teacup_firmware/extruder/config.h +++ b/reprap_mendel_prusa/teacup_firmware/extruder/config.h @@ -1,22 +1,22 @@ /* Notice to developers: this file is intentionally included twice. */ /* - CPU clock rate + CPU clock rate */ -#ifndef F_CPU - #define F_CPU 16000000L +#ifndef F_CPU + #define F_CPU 16000000L #endif /* - other fallbacks for the Arduino IDE + other fallbacks for the Arduino IDE */ #define EXTRUDER #define GEN3 -#include "arduino.h" +#include "arduino.h" // controller index- bus is multidrop after all -#define THIS_CONTROLLER_NUM 0 +#define THIS_CONTROLLER_NUM 0 //RS485 Interface pins #define RX_ENABLE_PIN DIO4 @@ -49,56 +49,61 @@ #define TEMP_BED_PIN AIO6 #define TEMP_BED_PIN_CHANNEL 6 +//Read digital temperature from DS18B20 +#define ONEWIRE_PIN DIO2 -#define REFERENCE REFERENCE_AVCC +#define REFERENCE REFERENCE_AVCC -#define TEMP_THERMISTOR +#define TEMP_THERMISTOR +#define TEMP_DS1820 -//~ //original code -//~ #define HEATER_PIN DIO11 -//~ #define BED_PIN AIO1 -//~ #define FAN_PIN DIO12 -// r3: exchange HEATER and BED (we don't have bed right now, and heater-mosfet is shot) -#define BED_PIN DIO11 -#define HEATER_PIN AIO1 -#define FAN_PIN DIO12 +//e.e.: TechZoneRemix Gen3 Extruder Board: +// 12V screw terminal C: DIO12 +// 12V screw terminal B: DIO11 +// 12V screw terminal A: AIO1 -// extruder settings -#define TEMP_HYSTERESIS 5 -#define TEMP_RESIDENCY_TIME 60 +#define HEATER_PIN DIO12 +#define BED_PIN AIO1 +#define FAN_PIN DIO11 -#ifdef DEFINE_TEMP_SENSOR -DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, TEMP_PIN_CHANNEL, THERMISTOR_EXTRUDER) -DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, TEMP_BED_PIN_CHANNEL, THERMISTOR_EXTRUDER) +// extruder settings +#define TEMP_HYSTERESIS 5 +#define TEMP_RESIDENCY_TIME 60 + +#ifdef DEFINE_TEMP_SENSOR +DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, TEMP_PIN_CHANNEL, THERMISTOR_EXTRUDER) +//DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, TEMP_BED_PIN_CHANNEL, THERMISTOR_EXTRUDER) + //9 bits accuracy for faster conversion time +DEFINE_TEMP_SENSOR(bed, TT_DS1820, 0, 12) // dummy temp sensor so analog_mask includes trim pot -DEFINE_TEMP_SENSOR(noheater, TT_THERMISTOR, TRIM_POT_CHANNEL, 0) +DEFINE_TEMP_SENSOR(noheater, TT_THERMISTOR, TRIM_POT_CHANNEL, 0) #endif - -#ifdef DEFINE_HEATER -//~ //original code -//~ DEFINE_HEATER(extruder, DIO11) -//~ DEFINE_HEATER(bed, AIO1) -// r3: exchange HEATER and BED (we don't have bed right now, and heater-mosfet is shot) -DEFINE_HEATER(extruder, AIO1) -DEFINE_HEATER(bed, DIO11) +// DEFINE_HEATER(, , , ) +// fan startup threshold: FANs usually take more power to start spinning than to keep spinning, +// so, below a given pwm value we start the fan with full power and after +// 50ms lower the output to the requested value. +#ifdef DEFINE_HEATER +DEFINE_HEATER(extruder, DIO12, 0, 0) +DEFINE_HEATER(bed, AIO1, 1, 0) +DEFINE_HEATER(fan, DIO11, 0, 150) #endif // list of PWM-able pins and corresponding timers // timer1 is used for step timing so don't use OC1A/OC1B (DIO9/DIO10) -// OC0A DIO6 -// OC0B DIO5 -// OC1A DIO9 -// OC1B DIO10 -// OC2A DIO11 -// OC2B DIO3 +// OC0A DIO6 +// OC0B DIO5 +// OC1A DIO9 +// OC1B DIO10 +// OC2A DIO11 +// OC2B DIO3 -#define TH_COUNT 8 -#define PID_SCALE 1024L +#define TH_COUNT 8 +#define PID_SCALE 1024L /* - Motors + Motors */ -#define enable_motors() do { TCCR0A |= MASK(COM0A1) | MASK(COM0B1); } while (0) -#define disable_motors() do { TCCR0A &= ~MASK(COM0A1) & ~MASK(COM0B1); } while (0) +#define enable_motors() do { TCCR0A |= MASK(COM0A1) | MASK(COM0B1); } while (0) +#define disable_motors() do { TCCR0A &= ~MASK(COM0A1) & ~MASK(COM0B1); } while (0)