From 3ab0110af192cf7746dadbcf5966bd125b49860f Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sat, 6 Nov 2021 02:20:34 -0600 Subject: greatly smoothed out SP10 ramp, and configured defaults also fixed random ramp stuttering, by adding phase-reset register to hwdef (though it still has a brief stutter sometimes while ramping down across the channel boundary, at least it always seems to be smooth while going up now) --- hwdef-Sofirn_SP10-Pro.h | 1 + 1 file changed, 1 insertion(+) (limited to 'hwdef-Sofirn_SP10-Pro.h') diff --git a/hwdef-Sofirn_SP10-Pro.h b/hwdef-Sofirn_SP10-Pro.h index 5ed716d..3cd405c 100644 --- a/hwdef-Sofirn_SP10-Pro.h +++ b/hwdef-Sofirn_SP10-Pro.h @@ -38,6 +38,7 @@ PA1 : Boost Enable #ifndef PWM1_PIN #define PWM1_PIN PB5 #define PWM1_LVL TCA0.SINGLE.CMP2 // PB5 is Alternate MUX for TCA Compare 2 +#define PWM1_CNT TCA0.SINGLE.CNT // for resetting phase after each TOP adjustment #endif // Big channel -- cgit v1.2.3 From 396fc623c7dce04fcd0a9afc9e777bb06b766a34 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sat, 13 Nov 2021 05:35:01 -0700 Subject: fixed SP10 ramp flickering properly, using double-buffered registers instead of my janky forced phase-reset workaround (gchart found the solution but couldn't reproduce the issue, so I tried his method and confirmed it seems to be fixed) --- hwdef-Sofirn_SP10-Pro.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'hwdef-Sofirn_SP10-Pro.h') diff --git a/hwdef-Sofirn_SP10-Pro.h b/hwdef-Sofirn_SP10-Pro.h index 3cd405c..bb10f2f 100644 --- a/hwdef-Sofirn_SP10-Pro.h +++ b/hwdef-Sofirn_SP10-Pro.h @@ -37,18 +37,19 @@ PA1 : Boost Enable // Small channel #ifndef PWM1_PIN #define PWM1_PIN PB5 -#define PWM1_LVL TCA0.SINGLE.CMP2 // PB5 is Alternate MUX for TCA Compare 2 -#define PWM1_CNT TCA0.SINGLE.CNT // for resetting phase after each TOP adjustment +#define PWM1_LVL TCA0.SINGLE.CMP2BUF // PB5 is Alternate MUX for TCA Compare 2 #endif // Big channel #ifndef PWM2_PIN #define PWM2_PIN PB0 -#define PWM2_LVL TCA0.SINGLE.CMP0 // PB0 is TCA Compare 0 +#define PWM2_LVL TCA0.SINGLE.CMP0BUF // PB0 is TCA Compare 0 #endif // PWM parameters of both channels are tied together because they share a counter -#define PWM1_TOP TCA0.SINGLE.PER // holds the TOP value for for variable-resolution PWM +#define PWM1_TOP TCA0.SINGLE.PERBUF // holds the TOP value for for variable-resolution PWM +// not necessary when double-buffered "BUF" registers are used +//#define PWM1_CNT TCA0.SINGLE.CNT // for resetting phase after each TOP adjustment #define LED_ENABLE_PIN PIN1_bp #define LED_ENABLE_PORT PORTA_OUT -- cgit v1.2.3