aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-11-27 09:00:32 -0700
committerSelene ToyKeeper2023-11-27 09:00:32 -0700
commitc86ab86da7763e4d88c2c6865f916873af02742d (patch)
tree187f5bd7efe0c9f208a440d660391c4b7dbced2e /hw
parentfixed ADC on attiny85 and related builds (diff)
downloadanduril-c86ab86da7763e4d88c2c6865f916873af02742d.tar.gz
anduril-c86ab86da7763e4d88c2c6865f916873af02742d.tar.bz2
anduril-c86ab86da7763e4d88c2c6865f916873af02742d.zip
fixed ADC on sp10-pro
Diffstat (limited to '')
-rw-r--r--hw/sofirn/sp10-pro/hwdef.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/sofirn/sp10-pro/hwdef.h b/hw/sofirn/sp10-pro/hwdef.h
index 047758b..f220318 100644
--- a/hw/sofirn/sp10-pro/hwdef.h
+++ b/hw/sofirn/sp10-pro/hwdef.h
@@ -66,16 +66,19 @@ enum CHANNEL_MODES {
#define DUAL_VOLTAGE_LOW_LOW (4*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
+#undef voltage_raw2cooked
+#define voltage_raw2cooked mcu_vdivider_raw2cooked
+
// Raw ADC readings at 4.4V and 2.2V
// calibrate the voltage readout here
// estimated / calculated values are:
// (voltage - D1) * (R2/(R2+R1) * 1024 / 1.1)
// Resistors are 300,000 and 100,000
#ifndef ADC_44
-#define ADC_44 1023 // raw value at 4.40V
+#define ADC_44 (4*1023) // raw value at 4.40V
#endif
#ifndef ADC_22
-#define ADC_22 512 // raw value at 2.20V
+#define ADC_22 (4*512) // raw value at 2.20V
#endif
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.