diff options
-rw-r--r-- | src/Movement/StepperDrivers/TMC22xx.cpp | 3 | ||||
-rw-r--r-- | src/Movement/StepperDrivers/TMC2660.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/Movement/StepperDrivers/TMC22xx.cpp b/src/Movement/StepperDrivers/TMC22xx.cpp index 147b7914..3ebdd5b6 100644 --- a/src/Movement/StepperDrivers/TMC22xx.cpp +++ b/src/Movement/StepperDrivers/TMC22xx.cpp @@ -889,7 +889,8 @@ void TmcDriverState::UpdateRegister(size_t regIndex, uint32_t regVal) noexcept // Calculate the chopper control register and flag it for sending void TmcDriverState::UpdateChopConfRegister() noexcept { - UpdateRegister(WriteChopConf, (enabled) ? configuredChopConfReg : configuredChopConfReg & ~CHOPCONF_TOFF_MASK); + // It's critical that CHOPCONF_VSENSE_HIGH is always set, so we or-it in here just in case + UpdateRegister(WriteChopConf, ((enabled) ? configuredChopConfReg : configuredChopConfReg & ~CHOPCONF_TOFF_MASK) | CHOPCONF_VSENSE_HIGH); } #if RESET_MICROSTEP_COUNTERS_AT_INIT diff --git a/src/Movement/StepperDrivers/TMC2660.cpp b/src/Movement/StepperDrivers/TMC2660.cpp index 8bc88313..7a6e93dc 100644 --- a/src/Movement/StepperDrivers/TMC2660.cpp +++ b/src/Movement/StepperDrivers/TMC2660.cpp @@ -635,7 +635,8 @@ void TmcDriverState::Enable(bool en) noexcept void TmcDriverState::UpdateChopConfRegister() noexcept { - registers[ChopperControl] = (enabled) ? configuredChopConfReg : (configuredChopConfReg & ~TMC_CHOPCONF_TOFF_MASK); + // It's critical that TMC_DRVCONF_VSENSE is always set, so we or-it in here just in case + registers[ChopperControl] = ((enabled) ? configuredChopConfReg : (configuredChopConfReg & ~TMC_CHOPCONF_TOFF_MASK)) | TMC_DRVCONF_VSENSE; registersToUpdate |= (1u << ChopperControl); } |