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