extruder/config.h

00001 #ifndef _CONFIG_H
00002 #define _CONFIG_H
00003 
00004 #include  "arduino.h"
00005 
00006 // controller index- bus is multidrop after all
00007 #define THIS_CONTROLLER_NUM 0
00008 
00009 //RS485 Interface pins
00010 #define RX_ENABLE_PIN DIO4
00011 #define TX_ENABLE_PIN AIO2
00012 
00013 // Control pins for the A3949 chips
00014 #define H1D DIO7
00015 #define H1E DIO5
00016 #define H2D DIO8
00017 #define H2E DIO6
00018 
00019 // PWM versions of the enable_pins
00020 #define H1E_PWM OCR0B
00021 #define H2E_PWM OCR0A
00022 
00023 //Step/Dir Pins from motherboard to extruder 
00024 //IMPORTANT: Assumes that the step pin is on PCIE0
00025 #define E_STEP_PIN DIO10
00026 #define E_DIR_PIN DIO9
00027 
00028 //Trimpot is on AIO0, pin 23
00029 #define TRIM_POT AIO0
00030 #define TRIM_POT_CHANNEL 0
00031 
00032 //Read analog voltage from thermistor
00033 #define TEMP_PIN AIO3
00034 #define TEMP_PIN_CHANNEL 3
00035 
00036 //Read analog voltage from thermistor
00037 #define TEMP_BED_PIN AIO6
00038 #define TEMP_BED_PIN_CHANNEL 6
00039 
00040 
00041 #define REFERENCE REFERENCE_AVCC
00042 
00043 #define ANALOG_MASK (MASK(TRIM_POT_CHANNEL) | MASK(TEMP_PIN_CHANNEL) | MASK(TEMP_BED_PIN_CHANNEL))
00044 
00045 #define TEMP_THERMISTOR
00046 
00047 #define HEATER_PIN  DIO11
00048 #define BED_PIN   AIO1
00049 #define FAN_PIN   DIO12
00050 
00051 // extruder settings
00052 #define TEMP_HYSTERESIS       20
00053 #define TEMP_RESIDENCY_TIME   60
00054 
00055 #ifdef  DEFINE_TEMP_SENSOR
00056 DEFINE_TEMP_SENSOR(extruder,  TT_THERMISTOR,    TEMP_PIN_CHANNEL)
00057 DEFINE_TEMP_SENSOR(bed,     TT_THERMISTOR,    TEMP_BED_PIN_CHANNEL)
00058 #endif
00059 
00060 #ifdef  DEFINE_HEATER
00061 DEFINE_HEATER(extruder, PORTD, HEATER_PIN, OCR0A)
00062 DEFINE_HEATER(bed,      PORTD, BED_PIN, OCR0B)
00063 #endif
00064 
00065 // list of PWM-able pins and corresponding timers
00066 // timer1 is used for step timing so don't use OC1A/OC1B (DIO9/DIO10)
00067 // OC0A                       DIO6
00068 // OC0B                       DIO5
00069 // OC1A                       DIO9
00070 // OC1B                       DIO10 
00071 // OC2A                       DIO11
00072 // OC2B                       DIO3
00073 
00074 #define TH_COUNT          8
00075 #define PID_SCALE         1024L
00076 
00077 
00078 /*
00079   Motors
00080 */
00081 
00082 #define enable_motors()       do { TCCR0A |= MASK(COM0A1) | MASK(COM0B1); } while (0)
00083 #define disable_motors()      do { TCCR0A &= ~MASK(COM0A1) & ~MASK(COM0B1); } while (0)
00084 
00085 #endif  /* _CONFIG_H */
 All Data Structures Files Functions Variables Defines