From 9c0d1832464e4ee7ee8c4c63092ac4337347483b Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Wed, 29 Jan 2020 05:08:14 -0700 Subject: rewrote ADC code to use a continuous lowpass system on all measurements, to eliminate noise and maybe increase precision (thermal code still needs to be rewritten though) --- hwdef-TK_Saber.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hwdef-TK_Saber.h') diff --git a/hwdef-TK_Saber.h b/hwdef-TK_Saber.h index 3f49d30..52ddb4a 100644 --- a/hwdef-TK_Saber.h +++ b/hwdef-TK_Saber.h @@ -23,7 +23,7 @@ #define SWITCH_PIN PB2 // pin 7 #define SWITCH_PCINT PCINT2 // pin 7 pin change interrupt -#define ADC_PRSCL 0x06 // clk/64 (no need to be super fast) +#define ADC_PRSCL 0x07 // clk/128 (no need to be super fast) // average drop across diode on this hardware #define VOLTAGE_FUDGE_FACTOR 5 // add 0.25V -- cgit v1.2.3 From f61beefe38f5118dc816d5ba28d7e41001cfe703 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Thu, 30 Jan 2020 01:18:56 -0700 Subject: switched to a pseudo-rolling-average method to reduce noise, set prescaler back to 64 --- hwdef-TK_Saber.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hwdef-TK_Saber.h') diff --git a/hwdef-TK_Saber.h b/hwdef-TK_Saber.h index 52ddb4a..3f49d30 100644 --- a/hwdef-TK_Saber.h +++ b/hwdef-TK_Saber.h @@ -23,7 +23,7 @@ #define SWITCH_PIN PB2 // pin 7 #define SWITCH_PCINT PCINT2 // pin 7 pin change interrupt -#define ADC_PRSCL 0x07 // clk/128 (no need to be super fast) +#define ADC_PRSCL 0x06 // clk/64 (no need to be super fast) // average drop across diode on this hardware #define VOLTAGE_FUDGE_FACTOR 5 // add 0.25V -- cgit v1.2.3 From 51aae811654a3b73fa10ab449e22a11c858aa2d1 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Fri, 13 Mar 2020 18:04:43 -0600 Subject: went back to slower clk/128 ADC timing --- hwdef-TK_Saber.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hwdef-TK_Saber.h') diff --git a/hwdef-TK_Saber.h b/hwdef-TK_Saber.h index 3f49d30..9458398 100644 --- a/hwdef-TK_Saber.h +++ b/hwdef-TK_Saber.h @@ -23,7 +23,7 @@ #define SWITCH_PIN PB2 // pin 7 #define SWITCH_PCINT PCINT2 // pin 7 pin change interrupt -#define ADC_PRSCL 0x06 // clk/64 (no need to be super fast) +#define ADC_PRSCL 0x07 // clk/128 // average drop across diode on this hardware #define VOLTAGE_FUDGE_FACTOR 5 // add 0.25V -- cgit v1.2.3