Browse Source
Use ADC resolution in AD595/8495 calculation (#17018)
Fixes thermocouple reading on LP1768 (which uses 12-bit resolution).
vanilla_fb_2.0.x
ManuelMcLure
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
Marlin/src/module/temperature.cpp
|
|
@ -1232,8 +1232,8 @@ void Temperature::manage_heater() { |
|
|
|
UNUSED(ms); |
|
|
|
} |
|
|
|
|
|
|
|
#define TEMP_AD595(RAW) ((RAW) * 5.0 * 100.0 / 1024.0 / (OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET) |
|
|
|
#define TEMP_AD8495(RAW) ((RAW) * 6.6 * 100.0 / 1024.0 / (OVERSAMPLENR) * (TEMP_SENSOR_AD8495_GAIN) + TEMP_SENSOR_AD8495_OFFSET) |
|
|
|
#define TEMP_AD595(RAW) ((RAW) * 5.0 * 100.0 / float(HAL_ADC_RANGE) / (OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET) |
|
|
|
#define TEMP_AD8495(RAW) ((RAW) * 6.6 * 100.0 / float(HAL_ADC_RANGE) / (OVERSAMPLENR) * (TEMP_SENSOR_AD8495_GAIN) + TEMP_SENSOR_AD8495_OFFSET) |
|
|
|
|
|
|
|
/**
|
|
|
|
* Bisect search for the range of the 'raw' value, then interpolate |
|
|
|