QDrives , 01-15-2025, 08:15 PM
The 'math' may be 'easier', but you need resistor which are in defined ranges (E12, E24, E48, E96 or E192).Vin = (ADC_in * Vadc_max * (Rhi+Rlo)/Rlo / ADC_max)And since Vadc_max * (Rhi+Rlo)/Rlo / ADC_max is a constant (usually) and ADC_max is a 2^n, you can multiply with a constant and bit shift for the answer if using integers.