diff --git a/Makefile b/Makefile index b2eab6a..36073c0 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ DEVICE = atmega168 CLOCK = 16000000 PROGRAMMER = -c avrisp2 -P usb -OBJECTS = main.o motion_control.o gcode.o spindle_control.o wiring_serial.o serial_protocol.o stepper.o +OBJECTS = main.o motion_control.o gcode.o spindle_control.o wiring_serial.o serial_protocol.o stepper.o FUSES = -U hfuse:w:0xd9:m -U lfuse:w:0x24:m # Tune the lines below only if you know what you are doing: diff --git a/config.h b/config.h index c34171f..f772f37 100644 --- a/config.h +++ b/config.h @@ -23,9 +23,10 @@ #define VERSION "0.5" -#define X_STEPS_PER_MM (94.488188976378*16) -#define Y_STEPS_PER_MM (94.488188976378*16) -#define Z_STEPS_PER_MM (94.488188976378*16) +#define MICROSTEPS 8 +#define X_STEPS_PER_MM (94.488188976378*MICROSTEPS) +#define Y_STEPS_PER_MM (94.488188976378*MICROSTEPS) +#define Z_STEPS_PER_MM (94.488188976378*MICROSTEPS) #define STEP_PULSE_MICROSECONDS 30 @@ -74,12 +75,12 @@ #define LIMIT_MASK ((1<steps_x = labs(steps_x); line->steps_y = labs(steps_y); @@ -83,28 +82,26 @@ void st_buffer_line(int32_t steps_x, int32_t steps_y, int32_t steps_z, uint32_t TIMSK1 |= (1<rate); - counter_x = -(current_line->maximum_steps/2); + counter_x = -(current_line->maximum_steps >> 1); counter_y = counter_x; counter_z = counter_x; iterations = current_line->maximum_steps; @@ -213,7 +210,7 @@ void st_flush() sei(); } -// Configures the prescaler and ceiling of timer 1 to produce the given pace as accurately as possible. +// Configures the prescaler and ceiling of timer 1 to produce the given rate as accurately as possible. void config_step_timer(uint32_t microseconds) { uint32_t ticks = microseconds*TICKS_PER_MICROSECOND;