Skip to content

Commit 492cd71

Browse files
author
Miroslav Talasek
committed
spindle working
1 parent 6b7f321 commit 492cd71

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

grbl/cpu_map.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,13 +374,13 @@
374374
#ifdef VARIABLE_SPINDLE
375375

376376
// NOTE: On the 328p, these must be the same as the SPINDLE_ENABLE settings.
377-
#define SPINDLE_PWM_FREQUENCY 10000 // KHz
377+
#define SPINDLE_PWM_FREQUENCY 1 // KHz
378378
#define SPINDLE_PWM_DDR GPIOA
379379
#define SPINDLE_PWM_PORT GPIOA
380380
#define RCC_SPINDLE_PWM_PORT RCC_APB2Periph_GPIOA
381381
#define SPINDLE_PWM_BIT 8
382382
#endif // End of VARIABLE_SPINDLE
383-
#define SPINDLE_PWM_MAX_VALUE 255
383+
#define SPINDLE_PWM_MAX_VALUE 1000
384384
#ifndef SPINDLE_PWM_MIN_VALUE
385385
#define SPINDLE_PWM_MIN_VALUE 1 // Must be greater than zero.
386386
#endif

grbl/defaults.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@
538538
#define DEFAULT_X_MAX_TRAVEL 200.0f // mm NOTE: Must be a positive value.
539539
#define DEFAULT_Y_MAX_TRAVEL 300.0f // mm NOTE: Must be a positive value.
540540
#define DEFAULT_Z_MAX_TRAVEL 90.0f // mm NOTE: Must be a positive value.
541-
#define DEFAULT_SPINDLE_RPM_MAX 100.0f // rpm
541+
#define DEFAULT_SPINDLE_RPM_MAX 9000.0f // rpm
542542
#define DEFAULT_SPINDLE_RPM_MIN 0.0f // rpm
543543
#define DEFAULT_STEP_PULSE_MICROSECONDS 10
544544
#define DEFAULT_STEPPING_INVERT_MASK 0x1f

grbl/spindle_control.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void spindle_init()
7676

7777
timerInitStructure.TIM_Prescaler = F_CPU / 1000000 - 1; // 1000
7878
timerInitStructure.TIM_CounterMode = TIM_CounterMode_Up;
79-
timerInitStructure.TIM_Period = SPINDLE_PWM_MAX_VALUE;
79+
timerInitStructure.TIM_Period = SPINDLE_PWM_MAX_VALUE -1;
8080
timerInitStructure.TIM_ClockDivision = TIM_CKD_DIV1;
8181
timerInitStructure.TIM_RepetitionCounter = 0;
8282
TIM_TimeBaseInit(TIM1, &timerInitStructure);

0 commit comments

Comments
 (0)