From 97063be85d0f964ba65a2f1ca355d818a5d93ab5 Mon Sep 17 00:00:00 2001 From: Gabriel Hart Date: Tue, 12 Apr 2022 00:05:27 -0500 Subject: Added FUSES section to SP10 Pro for building ELF file with BOD Active fuse setting --- hwdef-Sofirn_SP10-Pro.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hwdef-Sofirn_SP10-Pro.h') diff --git a/hwdef-Sofirn_SP10-Pro.h b/hwdef-Sofirn_SP10-Pro.h index bb10f2f..aea46e1 100644 --- a/hwdef-Sofirn_SP10-Pro.h +++ b/hwdef-Sofirn_SP10-Pro.h @@ -55,7 +55,7 @@ PA1 : Boost Enable #define LED_ENABLE_PORT PORTA_OUT #define USE_VOLTAGE_DIVIDER // use a dedicated pin, not VCC, because VCC input is flattened -#define DUAL_VOLTAGE_FLOOR 20 // for AA/14500 boost drivers, don't indicate low voltage if below this level +#define DUAL_VOLTAGE_FLOOR 21 // for AA/14500 boost drivers, don't indicate low voltage if below this level #define DUAL_VOLTAGE_LOW_LOW 7 // the lower voltage range's danger zone 0.7 volts (NiMH) #define ADMUX_VOLTAGE_DIVIDER ADC_MUXPOS_AIN9_gc // which ADC channel to read -- cgit v1.2.3 From 7d383475d5b7c0edaabce3665dd880425d51a24d Mon Sep 17 00:00:00 2001 From: Gabriel Hart Date: Wed, 13 Apr 2022 10:13:45 -0500 Subject: Created LED_DISABLE_DELAY option and enabled it for SP10 Pro to hopefully eliminate flashes when turning off at certain levels --- 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 aea46e1..7d0d7f5 100644 --- a/hwdef-Sofirn_SP10-Pro.h +++ b/hwdef-Sofirn_SP10-Pro.h @@ -53,6 +53,7 @@ PA1 : Boost Enable #define LED_ENABLE_PIN PIN1_bp #define LED_ENABLE_PORT PORTA_OUT +#define LED_DISABLE_DELAY 4 #define USE_VOLTAGE_DIVIDER // use a dedicated pin, not VCC, because VCC input is flattened #define DUAL_VOLTAGE_FLOOR 21 // for AA/14500 boost drivers, don't indicate low voltage if below this level -- cgit v1.2.3 From 4f6ae9925fefed4694bc87584040edc5426cdd94 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Thu, 14 Apr 2022 20:34:21 -0600 Subject: moved fuses from cfg to hwdef, renamed LED_EN/DISABLE_DELAY to LED_ON/OFF_DELAY (also really should rename LED_* to CH1_* and LED2_* to CH2_*) --- hwdef-Sofirn_SP10-Pro.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'hwdef-Sofirn_SP10-Pro.h') diff --git a/hwdef-Sofirn_SP10-Pro.h b/hwdef-Sofirn_SP10-Pro.h index 7d0d7f5..e47131a 100644 --- a/hwdef-Sofirn_SP10-Pro.h +++ b/hwdef-Sofirn_SP10-Pro.h @@ -53,7 +53,7 @@ PA1 : Boost Enable #define LED_ENABLE_PIN PIN1_bp #define LED_ENABLE_PORT PORTA_OUT -#define LED_DISABLE_DELAY 4 +#define LED_OFF_DELAY 4 #define USE_VOLTAGE_DIVIDER // use a dedicated pin, not VCC, because VCC input is flattened #define DUAL_VOLTAGE_FLOOR 21 // for AA/14500 boost drivers, don't indicate low voltage if below this level @@ -122,4 +122,20 @@ inline void hwdef_setup() { } +// set fuses, these carry over to the ELF file but not the HEX file +// we need this for enabling BOD in Active Mode from the factory. +// settings can be verified / dumped from the ELF file using this +// command: avr-objdump -d -S -j .fuse anduril.elf +FUSES = { + .WDTCFG = FUSE_WDTCFG_DEFAULT, /* Watchdog Configuration */ + .BODCFG = FUSE_ACTIVE0_bm, /* BOD Configuration */ + .OSCCFG = FUSE_OSCCFG_DEFAULT, /* Oscillator Configuration */ + .TCD0CFG = FUSE_TCD0CFG_DEFAULT, /* TCD0 Configuration */ + .SYSCFG0 = FUSE_SYSCFG0_DEFAULT, /* System Configuration 0 */ + .SYSCFG1 = FUSE_SYSCFG1_DEFAULT, /* System Configuration 1 */ + .APPEND = FUSE_APPEND_DEFAULT, /* Application Code Section End */ + .BOOTEND = FUSE_BOOTEND_DEFAULT, /* Boot Section End */ +}; + + #endif -- cgit v1.2.3 From 7ff4a96b1a25ebf6625f327b9d88e9f120ffde46 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Thu, 14 Apr 2022 21:01:05 -0600 Subject: avrdude fails when .fuse section is included, so omit that when copying elf to hex --- hwdef-Sofirn_SP10-Pro.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'hwdef-Sofirn_SP10-Pro.h') diff --git a/hwdef-Sofirn_SP10-Pro.h b/hwdef-Sofirn_SP10-Pro.h index e47131a..eee2f72 100644 --- a/hwdef-Sofirn_SP10-Pro.h +++ b/hwdef-Sofirn_SP10-Pro.h @@ -122,19 +122,19 @@ inline void hwdef_setup() { } -// set fuses, these carry over to the ELF file but not the HEX file +// set fuses, these carry over to the ELF file // we need this for enabling BOD in Active Mode from the factory. // settings can be verified / dumped from the ELF file using this // command: avr-objdump -d -S -j .fuse anduril.elf FUSES = { - .WDTCFG = FUSE_WDTCFG_DEFAULT, /* Watchdog Configuration */ - .BODCFG = FUSE_ACTIVE0_bm, /* BOD Configuration */ - .OSCCFG = FUSE_OSCCFG_DEFAULT, /* Oscillator Configuration */ - .TCD0CFG = FUSE_TCD0CFG_DEFAULT, /* TCD0 Configuration */ - .SYSCFG0 = FUSE_SYSCFG0_DEFAULT, /* System Configuration 0 */ - .SYSCFG1 = FUSE_SYSCFG1_DEFAULT, /* System Configuration 1 */ - .APPEND = FUSE_APPEND_DEFAULT, /* Application Code Section End */ - .BOOTEND = FUSE_BOOTEND_DEFAULT, /* Boot Section End */ + .WDTCFG = FUSE_WDTCFG_DEFAULT, // Watchdog Configuration + .BODCFG = FUSE_ACTIVE0_bm, // BOD Configuration + .OSCCFG = FUSE_OSCCFG_DEFAULT, // Oscillator Configuration + .TCD0CFG = FUSE_TCD0CFG_DEFAULT, // TCD0 Configuration + .SYSCFG0 = FUSE_SYSCFG0_DEFAULT, // System Configuration 0 + .SYSCFG1 = FUSE_SYSCFG1_DEFAULT, // System Configuration 1 + .APPEND = FUSE_APPEND_DEFAULT, // Application Code Section End + .BOOTEND = FUSE_BOOTEND_DEFAULT, // Boot Section End }; -- cgit v1.2.3 From ad92203240b60d1f9a916f5f0625e701d6d4387a Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Thu, 14 Apr 2022 21:27:08 -0600 Subject: sp10-pro: hard reset phase while turning off, fixes shutoff bug without a delay (also, made phase hacks individually selectable) --- hwdef-Sofirn_SP10-Pro.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'hwdef-Sofirn_SP10-Pro.h') diff --git a/hwdef-Sofirn_SP10-Pro.h b/hwdef-Sofirn_SP10-Pro.h index eee2f72..d7c2081 100644 --- a/hwdef-Sofirn_SP10-Pro.h +++ b/hwdef-Sofirn_SP10-Pro.h @@ -49,11 +49,14 @@ PA1 : Boost Enable // PWM parameters of both channels are tied together because they share a counter #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 PWM1_CNT TCA0.SINGLE.CNT // for resetting phase after each TOP adjustment +#define PWM1_PHASE_RESET_OFF // force reset while shutting off +#define PWM1_PHASE_RESET_ON // force reset while turning on +//#define PWM1_PHASE_SYNC // manual sync while changing level #define LED_ENABLE_PIN PIN1_bp #define LED_ENABLE_PORT PORTA_OUT -#define LED_OFF_DELAY 4 +//#define LED_OFF_DELAY 4 // only needed when PWM1_PHASE_RESET_OFF not used #define USE_VOLTAGE_DIVIDER // use a dedicated pin, not VCC, because VCC input is flattened #define DUAL_VOLTAGE_FLOOR 21 // for AA/14500 boost drivers, don't indicate low voltage if below this level -- cgit v1.2.3