From 376121d29257fb0688dd7fac129f8fbc594876d1 Mon Sep 17 00:00:00 2001 From: Laine Walker-Avina Date: Sun, 5 Feb 2012 16:29:25 -0800 Subject: Add pin definition for the Printrboard Rev B --- Sprinter/pins.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/Sprinter/pins.h b/Sprinter/pins.h index fbe6a6e..83186bb 100644 --- a/Sprinter/pins.h +++ b/Sprinter/pins.h @@ -743,6 +743,62 @@ #endif +/**************************************************************************************** +* Printrboard Rev. B pin assingments (ATMEGA90USB1286) +* Requires the Teensyduino software with Teensy2.0++ selected in arduino IDE! +* See http://reprap.org/wiki/Printrboard for more info +****************************************************************************************/ +#if MOTHERBOARD == 9 +#define MOTHERBOARD 9 +#define KNOWN_BOARD 1 + + +#define X_STEP_PIN 0 +#define X_DIR_PIN 1 +#define X_ENABLE_PIN 39 +#define X_MIN_PIN 35 +#define X_MAX_PIN -1 + +#define Y_STEP_PIN 2 +#define Y_DIR_PIN 3 +#define Y_ENABLE_PIN 38 +#define Y_MIN_PIN 8 +#define Y_MAX_PIN -1 + +#define Z_STEP_PIN 4 +#define Z_DIR_PIN 5 +#define Z_ENABLE_PIN 23 +#define Z_MIN_PIN 36 +#define Z_MAX_PIN -1 + +#define E_STEP_PIN 6 +#define E_DIR_PIN 7 +#define E_ENABLE_PIN 19 + + + +#define HEATER_0_PIN 21 // Extruder +#define HEATER_1_PIN 20 // Bed +#define FAN_PIN 22 // Fan + +#define TEMP_0_PIN 1 // Extruder +#define TEMP_1_PIN 0 // Bed + +#define SDPOWER -1 +#define SDSS 26 +#define LED_PIN -1 +#define PS_ON_PIN -1 +#define KILL_PIN -1 + +#ifndef SDSUPPORT +// these pins are defined in the SD library if building with SD support + #define SCK_PIN 9 + #define MISO_PIN 11 + #define MOSI_PIN 10 +#endif + +#endif + #ifndef KNOWN_BOARD #error Unknown MOTHERBOARD value in configuration.h #endif -- cgit v1.2.1 From e2e9fb45fa36cc9fe2be50b9133f1e17d00d015b Mon Sep 17 00:00:00 2001 From: Vyacheslav Kononenko Date: Mon, 13 Feb 2012 13:51:43 -0500 Subject: changed homing function to not conflict with min_software_endstops/max_software_endstops --- Sprinter/Sprinter.pde | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde index e3126b8..0462c95 100644 --- a/Sprinter/Sprinter.pde +++ b/Sprinter/Sprinter.pde @@ -583,16 +583,17 @@ inline void process_commands() if((home_all_axis) || (code_seen(axis_codes[0]))) { if ((X_MIN_PIN > -1 && X_HOME_DIR==-1) || (X_MAX_PIN > -1 && X_HOME_DIR==1)){ - current_position[0] = 0; - destination[0] = 1.5 * X_MAX_LENGTH * X_HOME_DIR; + current_position[0] = -1.5 * X_MAX_LENGTH * X_HOME_DIR; + destination[0] = 0; feedrate = homing_feedrate[0]; prepare_move(); - current_position[0] = 0; - destination[0] = -5 * X_HOME_DIR; + current_position[0] = 5 * X_HOME_DIR; + destination[0] = 0; prepare_move(); - destination[0] = 10 * X_HOME_DIR; + current_position[0] = -10 * X_HOME_DIR; + destination[0] = 0; prepare_move(); current_position[0] = (X_HOME_DIR == -1) ? 0 : X_MAX_LENGTH; @@ -603,16 +604,18 @@ inline void process_commands() if((home_all_axis) || (code_seen(axis_codes[1]))) { if ((Y_MIN_PIN > -1 && Y_HOME_DIR==-1) || (Y_MAX_PIN > -1 && Y_HOME_DIR==1)){ - current_position[1] = 0; - destination[1] = 1.5 * Y_MAX_LENGTH * Y_HOME_DIR; + current_position[1] = -1.5 * Y_MAX_LENGTH * Y_HOME_DIR; + destination[1] = 0; + feedrate = homing_feedrate[1]; prepare_move(); - current_position[1] = 0; - destination[1] = -5 * Y_HOME_DIR; + current_position[1] = 5 * Y_HOME_DIR; + destination[1] = 0; prepare_move(); - destination[1] = 10 * Y_HOME_DIR; + current_position[1] = -10 * Y_HOME_DIR; + destination[1] = 0; prepare_move(); current_position[1] = (Y_HOME_DIR == -1) ? 0 : Y_MAX_LENGTH; @@ -623,16 +626,17 @@ inline void process_commands() if((home_all_axis) || (code_seen(axis_codes[2]))) { if ((Z_MIN_PIN > -1 && Z_HOME_DIR==-1) || (Z_MAX_PIN > -1 && Z_HOME_DIR==1)){ - current_position[2] = 0; - destination[2] = 1.5 * Z_MAX_LENGTH * Z_HOME_DIR; + current_position[2] = -1.5 * Z_MAX_LENGTH * Z_HOME_DIR; + destination[2] = 0; feedrate = homing_feedrate[2]; prepare_move(); - current_position[2] = 0; - destination[2] = -2 * Z_HOME_DIR; + current_position[2] = 2 * Z_HOME_DIR; + destination[2] = 0; prepare_move(); - destination[2] = 10 * Z_HOME_DIR; + current_position[2] = -5 * Z_HOME_DIR; + destination[2] = 0; prepare_move(); current_position[2] = (Z_HOME_DIR == -1) ? 0 : Z_MAX_LENGTH; -- cgit v1.2.1 From 0028f59531a269f6740832c31f2f05f9cb2e40e3 Mon Sep 17 00:00:00 2001 From: Michael Moon Date: Wed, 22 Feb 2012 21:51:45 +1100 Subject: fix applet/core.a: not found --- Sprinter/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprinter/Makefile b/Sprinter/Makefile index 639cf1b..de3223d 100644 --- a/Sprinter/Makefile +++ b/Sprinter/Makefile @@ -199,7 +199,7 @@ extcoff: $(TARGET).elf $(NM) -n $< > $@ # Link: create ELF output file from library. -applet/$(TARGET).elf: applet/core.a applet/$(TARGET).cpp +applet/$(TARGET).elf: applet/$(TARGET).cpp applet/core.a $(CC) $(ALL_CFLAGS) -Wl,--gc-sections -o $@ applet/$(TARGET).cpp -L. applet/core.a $(LDFLAGS) applet/core.a: $(OBJ) -- cgit v1.2.1 From d85e549549bbb01092df783c21752ac7583c45ce Mon Sep 17 00:00:00 2001 From: Joachim Schleicher Date: Thu, 23 Feb 2012 21:47:20 +0100 Subject: fix comment mode. Closes #140. If a line starts with ';', it is ignored but comment_mode is reset. A ';' inside a line ignores just the portion following the ';' character. The beginning of the line is still interpreted. Probably a similar fix is necessary for the SDSUPPORT part; I cannot test that part without an SD-shield. --- Sprinter/Sprinter.pde | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde index 0462c95..c35258a 100644 --- a/Sprinter/Sprinter.pde +++ b/Sprinter/Sprinter.pde @@ -414,9 +414,11 @@ inline void get_command() serial_char = Serial.read(); if(serial_char == '\n' || serial_char == '\r' || serial_char == ':' || serial_count >= (MAX_CMD_SIZE - 1) ) { - if(!serial_count) return; //if empty line + if(!serial_count) { //if empty line + comment_mode = false; // for new command + return; + } cmdbuffer[bufindw][serial_count] = 0; //terminate string - if(!comment_mode){ fromsd[bufindw] = false; if(strstr(cmdbuffer[bufindw], "N") != NULL) { @@ -488,7 +490,6 @@ inline void get_command() bufindw = (bufindw + 1)%BUFSIZE; buflen += 1; - } comment_mode = false; //for new command serial_count = 0; //clear buffer } -- cgit v1.2.1 From bd10b8f6eef3676ca4dee3fc024bb9b64e192b63 Mon Sep 17 00:00:00 2001 From: lincomatic Date: Sat, 17 Mar 2012 21:31:46 -0700 Subject: Make fastio & Arduino pin numbering consistent for AT90USB128x --- Sprinter/fastio.h | 653 +++++++++++++++++++++++++++++++++++++++++++++++++++++- Sprinter/pins.h | 90 ++++---- 2 files changed, 695 insertions(+), 48 deletions(-) diff --git a/Sprinter/fastio.h b/Sprinter/fastio.h index 6b5572a..7b15390 100644 --- a/Sprinter/fastio.h +++ b/Sprinter/fastio.h @@ -1904,7 +1904,7 @@ pins #endif -#if defined (__AVR_AT90USB1287__) || defined (__AVR_AT90USB1286__) +#if defined (__AVR_AT90USB646__) // SPI #define SCK DIO9 #define MISO DIO11 @@ -2551,6 +2551,657 @@ pins #define PF7_DDR DDRF #endif +#if defined (__AVR_AT90USB1287__) || defined (__AVR_AT90USB1286__) +// SPI +#define SCK DIO9 +#define MISO DIO11 +#define MOSI DIO10 +#define SS DIO8 + +// change for your board +#define DEBUG_LED DIO31 /* led D5 red */ + +/* +pins +*/ +#define DIO0_PIN PIND0 +#define DIO0_RPORT PIND +#define DIO0_WPORT PORTD +#define DIO0_PWM NULL +#define DIO0_DDR DDRD + +#define DIO1_PIN PIND1 +#define DIO1_RPORT PIND +#define DIO1_WPORT PORTD +#define DIO1_PWM NULL +#define DIO1_DDR DDRD + +#define DIO2_PIN PIND2 +#define DIO2_RPORT PIND +#define DIO2_WPORT PORTD +#define DIO2_PWM NULL +#define DIO2_DDR DDRD + +#define DIO3_PIN PIND3 +#define DIO3_RPORT PIND +#define DIO3_WPORT PORTD +#define DIO3_PWM NULL +#define DIO3_DDR DDRD + +#define DIO4_PIN PIND4 +#define DIO4_RPORT PIND +#define DIO4_WPORT PORTD +#define DIO4_PWM NULL +#define DIO4_DDR DDRD + +#define DIO5_PIN PIND5 +#define DIO5_RPORT PIND +#define DIO5_WPORT PORTD +#define DIO5_PWM NULL +#define DIO5_DDR DDRD + +#define DIO6_PIN PIND6 +#define DIO6_RPORT PIND +#define DIO6_WPORT PORTD +#define DIO6_PWM NULL +#define DIO6_DDR DDRD + +#define DIO7_PIN PIND7 +#define DIO7_RPORT PIND +#define DIO7_WPORT PORTD +#define DIO7_PWM NULL +#define DIO7_DDR DDRD + +#define DIO8_PIN PINE0 +#define DIO8_RPORT PINE +#define DIO8_WPORT PORTE +#define DIO8_PWM NULL +#define DIO8_DDR DDRE + +#define DIO9_PIN PINE1 +#define DIO9_RPORT PINE +#define DIO9_WPORT PORTE +#define DIO9_PWM NULL +#define DIO9_DDR DDRE + +#define DIO10_PIN PINC0 +#define DIO10_RPORT PINC +#define DIO10_WPORT PORTC +#define DIO10_PWM NULL +#define DIO10_DDR DDRC + +#define DIO11_PIN PINC1 +#define DIO11_RPORT PINC +#define DIO11_WPORT PORTC +#define DIO11_PWM NULL +#define DIO11_DDR DDRC + +#define DIO12_PIN PINC2 +#define DIO12_RPORT PINC +#define DIO12_WPORT PORTC +#define DIO12_PWM NULL +#define DIO12_DDR DDRC + +#define DIO13_PIN PINC3 +#define DIO13_RPORT PINC +#define DIO13_WPORT PORTC +#define DIO13_PWM NULL +#define DIO13_DDR DDRC + +#define DIO14_PIN PINC4 +#define DIO14_RPORT PINC +#define DIO14_WPORT PORTC +#define DIO14_PWM NULL +#define DIO14_DDR DDRC + +#define DIO15_PIN PINC5 +#define DIO15_RPORT PINC +#define DIO15_WPORT PORTC +#define DIO15_PWM NULL +#define DIO15_DDR DDRC + +#define DIO16_PIN PINC6 +#define DIO16_RPORT PINC +#define DIO16_WPORT PORTC +#define DIO16_PWM NULL +#define DIO16_DDR DDRC + +#define DIO17_PIN PINC7 +#define DIO17_RPORT PINC +#define DIO17_WPORT PORTC +#define DIO17_PWM NULL +#define DIO17_DDR DDRC + +#define DIO18_PIN PINE6 +#define DIO18_RPORT PINE +#define DIO18_WPORT PORTE +#define DIO18_PWM NULL +#define DIO18_DDR DDRE + +#define DIO19_PIN PINE7 +#define DIO19_RPORT PINE +#define DIO19_WPORT PORTE +#define DIO19_PWM NULL +#define DIO19_DDR DDRE + +#define DIO20_PIN PINB0 +#define DIO20_RPORT PINB +#define DIO20_WPORT PORTB +#define DIO20_PWM NULL +#define DIO20_DDR DDRB + +#define DIO21_PIN PINB1 +#define DIO21_RPORT PINB +#define DIO21_WPORT PORTB +#define DIO21_PWM NULL +#define DIO21_DDR DDRB + +#define DIO22_PIN PINB2 +#define DIO22_RPORT PINB +#define DIO22_WPORT PORTB +#define DIO22_PWM NULL +#define DIO22_DDR DDRB + +#define DIO23_PIN PINB3 +#define DIO23_RPORT PINB +#define DIO23_WPORT PORTB +#define DIO23_PWM NULL +#define DIO23_DDR DDRB + +#define DIO24_PIN PINB4 +#define DIO24_RPORT PINB +#define DIO24_WPORT PORTB +#define DIO24_PWM NULL +#define DIO24_DDR DDRB + +#define DIO25_PIN PINB5 +#define DIO25_RPORT PINB +#define DIO25_WPORT PORTB +#define DIO25_PWM NULL +#define DIO25_DDR DDRB + +#define DIO26_PIN PINB6 +#define DIO26_RPORT PINB +#define DIO26_WPORT PORTB +#define DIO26_PWM NULL +#define DIO26_DDR DDRB + +#define DIO27_PIN PINB7 +#define DIO27_RPORT PINB +#define DIO27_WPORT PORTB +#define DIO27_PWM NULL +#define DIO27_DDR DDRB + +#define DIO28_PIN PINA0 +#define DIO28_RPORT PINA +#define DIO28_WPORT PORTA +#define DIO28_PWM NULL +#define DIO28_DDR DDRA + +#define DIO29_PIN PINA1 +#define DIO29_RPORT PINA +#define DIO29_WPORT PORTA +#define DIO29_PWM NULL +#define DIO29_DDR DDRA + +#define DIO30_PIN PINA2 +#define DIO30_RPORT PINA +#define DIO30_WPORT PORTA +#define DIO30_PWM NULL +#define DIO30_DDR DDRA + +#define DIO31_PIN PINA3 +#define DIO31_RPORT PINA +#define DIO31_WPORT PORTA +#define DIO31_PWM NULL +#define DIO31_DDR DDRA + + +#define DIO32_PIN PINA4 +#define DIO32_RPORT PINA +#define DIO32_WPORT PORTA +#define DIO32_PWM NULL +#define DIO32_DDR DDRA + +#define DIO33_PIN PINA5 +#define DIO33_RPORT PINA +#define DIO33_WPORT PORTA +#define DIO33_PWM NULL +#define DIO33_DDR DDRA + +#define DIO34_PIN PINA6 +#define DIO34_RPORT PINA +#define DIO34_WPORT PORTA +#define DIO34_PWM NULL +#define DIO34_DDR DDRA + +#define DIO35_PIN PINA7 +#define DIO35_RPORT PINA +#define DIO35_WPORT PORTA +#define DIO35_PWM NULL +#define DIO35_DDR DDRA + +#define DIO36_PIN PINE4 +#define DIO36_RPORT PINE +#define DIO36_WPORT PORTE +#define DIO36_PWM NULL +#define DIO36_DDR DDRE + +#define DIO37_PIN PINE5 +#define DIO37_RPORT PINE +#define DIO37_WPORT PORTE +#define DIO37_PWM NULL +#define DIO37_DDR DDRE + +#define DIO38_PIN PINF0 +#define DIO38_RPORT PINF +#define DIO38_WPORT PORTF +#define DIO38_PWM NULL +#define DIO38_DDR DDRF + +#define DIO39_PIN PINF1 +#define DIO39_RPORT PINF +#define DIO39_WPORT PORTF +#define DIO39_PWM NULL +#define DIO39_DDR DDRF + +#define DIO40_PIN PINF2 +#define DIO40_RPORT PINF +#define DIO40_WPORT PORTF +#define DIO40_PWM NULL +#define DIO40_DDR DDRF + +#define DIO41_PIN PINF3 +#define DIO41_RPORT PINF +#define DIO41_WPORT PORTF +#define DIO41_PWM NULL +#define DIO41_DDR DDRF + +#define DIO42_PIN PINF4 +#define DIO42_RPORT PINF +#define DIO42_WPORT PORTF +#define DIO42_PWM NULL +#define DIO42_DDR DDRF + +#define DIO43_PIN PINF5 +#define DIO43_RPORT PINF +#define DIO43_WPORT PORTF +#define DIO43_PWM NULL +#define DIO43_DDR DDRF + +#define DIO44_PIN PINF6 +#define DIO44_RPORT PINF +#define DIO44_WPORT PORTF +#define DIO44_PWM NULL +#define DIO44_DDR DDRF + +#define DIO45_PIN PINF7 +#define DIO45_RPORT PINF +#define DIO45_WPORT PORTF +#define DIO45_PWM NULL +#define DIO45_DDR DDRF + +#define AIO0_PIN PINF0 +#define AIO0_RPORT PINF +#define AIO0_WPORT PORTF +#define AIO0_PWM NULL +#define AIO0_DDR DDRF + +#define AIO1_PIN PINF1 +#define AIO1_RPORT PINF +#define AIO1_WPORT PORTF +#define AIO1_PWM NULL +#define AIO1_DDR DDRF + +#define AIO2_PIN PINF2 +#define AIO2_RPORT PINF +#define AIO2_WPORT PORTF +#define AIO2_PWM NULL +#define AIO2_DDR DDRF + +#define AIO3_PIN PINF3 +#define AIO3_RPORT PINF +#define AIO3_WPORT PORTF +#define AIO3_PWM NULL +#define AIO3_DDR DDRF + +#define AIO4_PIN PINF4 +#define AIO4_RPORT PINF +#define AIO4_WPORT PORTF +#define AIO4_PWM NULL +#define AIO4_DDR DDRF + +#define AIO5_PIN PINF5 +#define AIO5_RPORT PINF +#define AIO5_WPORT PORTF +#define AIO5_PWM NULL +#define AIO5_DDR DDRF + +#define AIO6_PIN PINF6 +#define AIO6_RPORT PINF +#define AIO6_WPORT PORTF +#define AIO6_PWM NULL +#define AIO6_DDR DDRF + +#define AIO7_PIN PINF7 +#define AIO7_RPORT PINF +#define AIO7_WPORT PORTF +#define AIO7_PWM NULL +#define AIO7_DDR DDRF + +//-- Begin not supported by Teensyduino +//-- don't use Arduino functions on these pins pinMode/digitalWrite/etc +#define DIO46_PIN PINE2 +#define DIO46_RPORT PINE +#define DIO46_WPORT PORTE +#define DIO46_PWM NULL +#define DIO46_DDR DDRE + +#define DIO47_PIN PINE3 +#define DIO47_RPORT PINE +#define DIO47_WPORT PORTE +#define DIO47_PWM NULL +#define DIO47_DDR DDRE +//-- end not supported by Teensyduino + + + +#undef PA0 +#define PA0_PIN PINA0 +#define PA0_RPORT PINA +#define PA0_WPORT PORTA +#define PA0_PWM NULL +#define PA0_DDR DDRA +#undef PA1 +#define PA1_PIN PINA1 +#define PA1_RPORT PINA +#define PA1_WPORT PORTA +#define PA1_PWM NULL +#define PA1_DDR DDRA +#undef PA2 +#define PA2_PIN PINA2 +#define PA2_RPORT PINA +#define PA2_WPORT PORTA +#define PA2_PWM NULL +#define PA2_DDR DDRA +#undef PA3 +#define PA3_PIN PINA3 +#define PA3_RPORT PINA +#define PA3_WPORT PORTA +#define PA3_PWM NULL +#define PA3_DDR DDRA +#undef PA4 +#define PA4_PIN PINA4 +#define PA4_RPORT PINA +#define PA4_WPORT PORTA +#define PA4_PWM NULL +#define PA4_DDR DDRA +#undef PA5 +#define PA5_PIN PINA5 +#define PA5_RPORT PINA +#define PA5_WPORT PORTA +#define PA5_PWM NULL +#define PA5_DDR DDRA +#undef PA6 +#define PA6_PIN PINA6 +#define PA6_RPORT PINA +#define PA6_WPORT PORTA +#define PA6_PWM NULL +#define PA6_DDR DDRA +#undef PA7 +#define PA7_PIN PINA7 +#define PA7_RPORT PINA +#define PA7_WPORT PORTA +#define PA7_PWM NULL +#define PA7_DDR DDRA + +#undef PB0 +#define PB0_PIN PINB0 +#define PB0_RPORT PINB +#define PB0_WPORT PORTB +#define PB0_PWM NULL +#define PB0_DDR DDRB +#undef PB1 +#define PB1_PIN PINB1 +#define PB1_RPORT PINB +#define PB1_WPORT PORTB +#define PB1_PWM NULL +#define PB1_DDR DDRB +#undef PB2 +#define PB2_PIN PINB2 +#define PB2_RPORT PINB +#define PB2_WPORT PORTB +#define PB2_PWM NULL +#define PB2_DDR DDRB +#undef PB3 +#define PB3_PIN PINB3 +#define PB3_RPORT PINB +#define PB3_WPORT PORTB +#define PB3_PWM NULL +#define PB3_DDR DDRB +#undef PB4 +#define PB4_PIN PINB4 +#define PB4_RPORT PINB +#define PB4_WPORT PORTB +#define PB4_PWM NULL +#define PB4_DDR DDRB +#undef PB5 +#define PB5_PIN PINB5 +#define PB5_RPORT PINB +#define PB5_WPORT PORTB +#define PB5_PWM NULL +#define PB5_DDR DDRB +#undef PB6 +#define PB6_PIN PINB6 +#define PB6_RPORT PINB +#define PB6_WPORT PORTB +#define PB6_PWM NULL +#define PB6_DDR DDRB +#undef PB7 +#define PB7_PIN PINB7 +#define PB7_RPORT PINB +#define PB7_WPORT PORTB +#define PB7_PWM NULL +#define PB7_DDR DDRB + +#undef PC0 +#define PC0_PIN PINC0 +#define PC0_RPORT PINC +#define PC0_WPORT PORTC +#define PC0_PWM NULL +#define PC0_DDR DDRC +#undef PC1 +#define PC1_PIN PINC1 +#define PC1_RPORT PINC +#define PC1_WPORT PORTC +#define PC1_PWM NULL +#define PC1_DDR DDRC +#undef PC2 +#define PC2_PIN PINC2 +#define PC2_RPORT PINC +#define PC2_WPORT PORTC +#define PC2_PWM NULL +#define PC2_DDR DDRC +#undef PC3 +#define PC3_PIN PINC3 +#define PC3_RPORT PINC +#define PC3_WPORT PORTC +#define PC3_PWM NULL +#define PC3_DDR DDRC +#undef PC4 +#define PC4_PIN PINC4 +#define PC4_RPORT PINC +#define PC4_WPORT PORTC +#define PC4_PWM NULL +#define PC4_DDR DDRC +#undef PC5 +#define PC5_PIN PINC5 +#define PC5_RPORT PINC +#define PC5_WPORT PORTC +#define PC5_PWM NULL +#define PC5_DDR DDRC +#undef PC6 +#define PC6_PIN PINC6 +#define PC6_RPORT PINC +#define PC6_WPORT PORTC +#define PC6_PWM NULL +#define PC6_DDR DDRC +#undef PC7 +#define PC7_PIN PINC7 +#define PC7_RPORT PINC +#define PC7_WPORT PORTC +#define PC7_PWM NULL +#define PC7_DDR DDRC + +#undef PD0 +#define PD0_PIN PIND0 +#define PD0_RPORT PIND +#define PD0_WPORT PORTD +#define PD0_PWM NULL +#define PD0_DDR DDRD +#undef PD1 +#define PD1_PIN PIND1 +#define PD1_RPORT PIND +#define PD1_WPORT PORTD +#define PD1_PWM NULL +#define PD1_DDR DDRD +#undef PD2 +#define PD2_PIN PIND2 +#define PD2_RPORT PIND +#define PD2_WPORT PORTD +#define PD2_PWM NULL +#define PD2_DDR DDRD +#undef PD3 +#define PD3_PIN PIND3 +#define PD3_RPORT PIND +#define PD3_WPORT PORTD +#define PD3_PWM NULL +#define PD3_DDR DDRD +#undef PD4 +#define PD4_PIN PIND4 +#define PD4_RPORT PIND +#define PD4_WPORT PORTD +#define PD4_PWM NULL +#define PD4_DDR DDRD +#undef PD5 +#define PD5_PIN PIND5 +#define PD5_RPORT PIND +#define PD5_WPORT PORTD +#define PD5_PWM NULL +#define PD5_DDR DDRD +#undef PD6 +#define PD6_PIN PIND6 +#define PD6_RPORT PIND +#define PD6_WPORT PORTD +#define PD6_PWM NULL +#define PD6_DDR DDRD +#undef PD7 +#define PD7_PIN PIND7 +#define PD7_RPORT PIND +#define PD7_WPORT PORTD +#define PD7_PWM NULL +#define PD7_DDR DDRD + +#undef PE0 +#define PE0_PIN PINE0 +#define PE0_RPORT PINE +#define PE0_WPORT PORTE +#define PE0_PWM NULL +#define PE0_DDR DDRE +#undef PE1 +#define PE1_PIN PINE1 +#define PE1_RPORT PINE +#define PE1_WPORT PORTE +#define PE1_PWM NULL +#define PE1_DDR DDRE +#undef PE2 +#define PE2_PIN PINE2 +#define PE2_RPORT PINE +#define PE2_WPORT PORTE +#define PE2_PWM NULL +#define PE2_DDR DDRE +#undef PE3 +#define PE3_PIN PINE3 +#define PE3_RPORT PINE +#define PE3_WPORT PORTE +#define PE3_PWM NULL +#define PE3_DDR DDRE +#undef PE4 +#define PE4_PIN PINE4 +#define PE4_RPORT PINE +#define PE4_WPORT PORTE +#define PE4_PWM NULL +#define PE4_DDR DDRE +#undef PE5 +#define PE5_PIN PINE5 +#define PE5_RPORT PINE +#define PE5_WPORT PORTE +#define PE5_PWM NULL +#define PE5_DDR DDRE +#undef PE6 +#define PE6_PIN PINE6 +#define PE6_RPORT PINE +#define PE6_WPORT PORTE +#define PE6_PWM NULL +#define PE6_DDR DDRE +#undef PE7 +#define PE7_PIN PINE7 +#define PE7_RPORT PINE +#define PE7_WPORT PORTE +#define PE7_PWM NULL +#define PE7_DDR DDRE + +#undef PF0 +#define PF0_PIN PINF0 +#define PF0_RPORT PINF +#define PF0_WPORT PORTF +#define PF0_PWM NULL +#define PF0_DDR DDRF +#undef PF1 +#define PF1_PIN PINF1 +#define PF1_RPORT PINF +#define PF1_WPORT PORTF +#define PF1_PWM NULL +#define PF1_DDR DDRF +#undef PF2 +#define PF2_PIN PINF2 +#define PF2_RPORT PINF +#define PF2_WPORT PORTF +#define PF2_PWM NULL +#define PF2_DDR DDRF +#undef PF3 +#define PF3_PIN PINF3 +#define PF3_RPORT PINF +#define PF3_WPORT PORTF +#define PF3_PWM NULL +#define PF3_DDR DDRF +#undef PF4 +#define PF4_PIN PINF4 +#define PF4_RPORT PINF +#define PF4_WPORT PORTF +#define PF4_PWM NULL +#define PF4_DDR DDRF +#undef PF5 +#define PF5_PIN PINF5 +#define PF5_RPORT PINF +#define PF5_WPORT PORTF +#define PF5_PWM NULL +#define PF5_DDR DDRF +#undef PF6 +#define PF6_PIN PINF6 +#define PF6_RPORT PINF +#define PF6_WPORT PORTF +#define PF6_PWM NULL +#define PF6_DDR DDRF +#undef PF7 +#define PF7_PIN PINF7 +#define PF7_RPORT PINF +#define PF7_WPORT PORTF +#define PF7_PWM NULL +#define PF7_DDR DDRF +#endif + + #ifndef DIO0_PIN #error pins for this chip not defined in arduino.h! If you write an appropriate pin definition and have this firmware work on your chip, please submit a pull request #endif diff --git a/Sprinter/pins.h b/Sprinter/pins.h index 83186bb..d036610 100644 --- a/Sprinter/pins.h +++ b/Sprinter/pins.h @@ -696,39 +696,37 @@ #define KNOWN_BOARD 1 -#define X_STEP_PIN 0 -#define X_DIR_PIN 1 -#define X_ENABLE_PIN 39 -#define X_MIN_PIN 13 +#define X_STEP_PIN 28 +#define X_DIR_PIN 29 +#define X_ENABLE_PIN 19 +#define X_MIN_PIN 25 #define X_MAX_PIN -1 -#define Y_STEP_PIN 2 -#define Y_DIR_PIN 3 -#define Y_ENABLE_PIN 38 -#define Y_MIN_PIN 14 +#define Y_STEP_PIN 30 +#define Y_DIR_PIN 31 +#define Y_ENABLE_PIN 26 +#define Y_MIN_PIN 20 #define Y_MAX_PIN -1 -#define Z_STEP_PIN 4 -#define Z_DIR_PIN 5 -#define Z_ENABLE_PIN 23 -#define Z_MIN_PIN 15 +#define Z_STEP_PIN 32 +#define Z_DIR_PIN 33 +#define Z_ENABLE_PIN 17 +#define Z_MIN_PIN 27 #define Z_MAX_PIN -1 -#define E_STEP_PIN 6 -#define E_DIR_PIN 7 -#define E_ENABLE_PIN 19 - +#define E_STEP_PIN 34 +#define E_DIR_PIN 35 +#define E_ENABLE_PIN 13 - -#define HEATER_0_PIN 21 // Extruder -#define HEATER_1_PIN 20 // Bed -#define FAN_PIN 22 // Fan +#define HEATER_0_PIN 15 // Extruder +#define HEATER_1_PIN 14 // Bed +#define FAN_PIN 16 // Fan #define TEMP_0_PIN 7 // Extruder #define TEMP_1_PIN 6 // Bed #define SDPOWER -1 -#define SDSS 8 +#define SDSS 20 #define LED_PIN -1 #define PS_ON_PIN -1 #define KILL_PIN -1 @@ -736,9 +734,9 @@ #ifndef SDSUPPORT // these pins are defined in the SD library if building with SD support - #define SCK_PIN 9 - #define MISO_PIN 11 - #define MOSI_PIN 10 + #define SCK_PIN 21 + #define MISO_PIN 22 + #define MOSI_PIN 23 #endif #endif @@ -753,48 +751,46 @@ #define KNOWN_BOARD 1 -#define X_STEP_PIN 0 -#define X_DIR_PIN 1 -#define X_ENABLE_PIN 39 -#define X_MIN_PIN 35 +#define X_STEP_PIN 28 +#define X_DIR_PIN 29 +#define X_ENABLE_PIN 19 +#define X_MIN_PIN 47 #define X_MAX_PIN -1 -#define Y_STEP_PIN 2 -#define Y_DIR_PIN 3 -#define Y_ENABLE_PIN 38 -#define Y_MIN_PIN 8 +#define Y_STEP_PIN 30 +#define Y_DIR_PIN 31 +#define Y_ENABLE_PIN 18 +#define Y_MIN_PIN 20 #define Y_MAX_PIN -1 -#define Z_STEP_PIN 4 -#define Z_DIR_PIN 5 -#define Z_ENABLE_PIN 23 +#define Z_STEP_PIN 32 +#define Z_DIR_PIN 33 +#define Z_ENABLE_PIN 17 #define Z_MIN_PIN 36 #define Z_MAX_PIN -1 -#define E_STEP_PIN 6 -#define E_DIR_PIN 7 -#define E_ENABLE_PIN 19 - - +#define E_STEP_PIN 34 +#define E_DIR_PIN 35 +#define E_ENABLE_PIN 13 -#define HEATER_0_PIN 21 // Extruder -#define HEATER_1_PIN 20 // Bed -#define FAN_PIN 22 // Fan +#define HEATER_0_PIN 15 // Extruder +#define HEATER_1_PIN 14 // Bed +#define FAN_PIN 16 // Fan #define TEMP_0_PIN 1 // Extruder #define TEMP_1_PIN 0 // Bed #define SDPOWER -1 -#define SDSS 26 +#define SDSS 2 #define LED_PIN -1 #define PS_ON_PIN -1 #define KILL_PIN -1 #ifndef SDSUPPORT // these pins are defined in the SD library if building with SD support - #define SCK_PIN 9 - #define MISO_PIN 11 - #define MOSI_PIN 10 + #define SCK_PIN 21 + #define MISO_PIN 22 + #define MOSI_PIN 23 #endif #endif -- cgit v1.2.1 From 8147df6ae0763df962dfda3505d44765916168e3 Mon Sep 17 00:00:00 2001 From: midopple Date: Mon, 19 Mar 2012 18:53:06 +0100 Subject: Fixes virtual endstops when using mixed physical endstop positions. Thanks to ticking --- Sprinter/Sprinter.pde | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde index 706910f..9de3d48 100644 --- a/Sprinter/Sprinter.pde +++ b/Sprinter/Sprinter.pde @@ -252,6 +252,8 @@ bool relative_mode = false; //Determines Absolute or Relative Coordinates //bool relative_mode_e = false; //Determines Absolute or Relative E Codes while in Absolute Coordinates mode. E is always relative in Relative Coordinates mode. //long timediff = 0; +bool is_homing = false; + //experimental feedrate calc //float d = 0; //float axis_diff[NUM_AXIS] = {0, 0, 0, 0}; @@ -1059,6 +1061,7 @@ FORCE_INLINE void process_commands() destination[i] = current_position[i]; } feedrate = 0; + is_homing = true; home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2]))); @@ -1164,6 +1167,7 @@ FORCE_INLINE void process_commands() enable_endstops(false); #endif + is_homing = false; feedrate = saved_feedrate; feedmultiply = saved_feedmultiply; @@ -1764,20 +1768,22 @@ void prepare_move() { long help_feedrate = 0; - if (min_software_endstops) - { - if (destination[X_AXIS] < 0) destination[X_AXIS] = 0.0; - if (destination[Y_AXIS] < 0) destination[Y_AXIS] = 0.0; - if (destination[Z_AXIS] < 0) destination[Z_AXIS] = 0.0; - } + if(!is_homing){ + if (min_software_endstops) + { + if (destination[X_AXIS] < 0) destination[X_AXIS] = 0.0; + if (destination[Y_AXIS] < 0) destination[Y_AXIS] = 0.0; + if (destination[Z_AXIS] < 0) destination[Z_AXIS] = 0.0; + } - if (max_software_endstops) - { - if (destination[X_AXIS] > X_MAX_LENGTH) destination[X_AXIS] = X_MAX_LENGTH; - if (destination[Y_AXIS] > Y_MAX_LENGTH) destination[Y_AXIS] = Y_MAX_LENGTH; - if (destination[Z_AXIS] > Z_MAX_LENGTH) destination[Z_AXIS] = Z_MAX_LENGTH; + if (max_software_endstops) + { + if (destination[X_AXIS] > X_MAX_LENGTH) destination[X_AXIS] = X_MAX_LENGTH; + if (destination[Y_AXIS] > Y_MAX_LENGTH) destination[Y_AXIS] = Y_MAX_LENGTH; + if (destination[Z_AXIS] > Z_MAX_LENGTH) destination[Z_AXIS] = Z_MAX_LENGTH; + } } - + help_feedrate = ((long)feedrate*(long)feedmultiply); plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], help_feedrate/6000.0); -- cgit v1.2.1