Skip to content

Commit

Permalink
🐛 Fix and improve MAX31865 (#23215)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
  • Loading branch information
zeleps and thinkyhead committed Dec 25, 2021
1 parent a6bed22 commit f2ca70e
Show file tree
Hide file tree
Showing 5 changed files with 239 additions and 142 deletions.
9 changes: 9 additions & 0 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,20 @@
* FORCE_HW_SPI: Ignore SCK/MOSI/MISO pins and just use the CS pin & default SPI bus.
* MAX31865_WIRES: Set the number of wires for the probe connected to a MAX31865 board, 2-4. Default: 2
* MAX31865_50HZ: Enable 50Hz filter instead of the default 60Hz.
* MAX31865_USE_READ_ERROR_DETECTION: Detects random read errors from value spikes (a 20°C difference in less than 1sec)
* MAX31865_USE_AUTO_MODE: Faster and more frequent reads than 1-shot, but bias voltage always on, slightly affecting RTD temperature.
* MAX31865_MIN_SAMPLING_TIME_MSEC: in 1-shot mode, the minimum time between subsequent reads. This reduces the effect of bias voltage by leaving the sensor unpowered for longer intervals.
* MAX31865_WIRE_OHMS: In 2-wire configurations, manually set the wire resistance for more accurate readings
*/
//#define TEMP_SENSOR_FORCE_HW_SPI
//#define MAX31865_SENSOR_WIRES_0 2
//#define MAX31865_SENSOR_WIRES_1 2
//#define MAX31865_50HZ_FILTER
//#define MAX31865_USE_READ_ERROR_DETECTION
//#define MAX31865_USE_AUTO_MODE
//#define MAX31865_MIN_SAMPLING_TIME_MSEC 100
//#define MAX31865_WIRE_OHMS_0 0.0f
//#define MAX31865_WIRE_OHMS_1 0.0f

/**
* Hephestos 2 24V heated bed upgrade kit.
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/inc/Conditionals_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@
#ifndef MAX31865_SENSOR_WIRES_0
#define MAX31865_SENSOR_WIRES_0 2
#endif
#ifndef MAX31865_WIRE_OHMS_0
#define MAX31865_WIRE_OHMS_0 0.0f
#endif
#elif TEMP_SENSOR_0 == -3
#define TEMP_SENSOR_0_IS_MAX31855 1
#define TEMP_SENSOR_0_MAX_TC_TMIN -270
Expand Down Expand Up @@ -193,6 +196,9 @@
#ifndef MAX31865_SENSOR_WIRES_1
#define MAX31865_SENSOR_WIRES_1 2
#endif
#ifndef MAX31865_WIRE_OHMS_1
#define MAX31865_WIRE_OHMS_1 0.0f
#endif
#elif TEMP_SENSOR_1 == -3
#define TEMP_SENSOR_1_IS_MAX31855 1
#define TEMP_SENSOR_1_MAX_TC_TMIN -270
Expand Down
Loading

0 comments on commit f2ca70e

Please sign in to comment.