thanks for the help y'all. When I did the voltage divider it was sitting high, not floating...
Looking back through the Adafruit_MAX31865 library which uses the Adafruit_SPIDevice library, I thought Paul found the problem. But additionally delays in the main code between thermo.readRTD() calls doesn't solve it.
Code:
/**************************************************************************/
/*!
@brief Read the raw 16-bit value from the RTD_REG in one shot mode
@return The raw unsigned 16-bit value, NOT temperature!
*/
/**************************************************************************/
uint16_t Adafruit_MAX31865::readRTD(void) {
clearFault();
enableBias(true);
delay(10);
uint8_t t = readRegister8(MAX31865_CONFIG_REG);
t |= MAX31865_CONFIG_1SHOT;
writeRegister8(MAX31865_CONFIG_REG, t);
delay(65);
uint16_t rtd = readRegister16(MAX31865_RTDMSB_REG);
enableBias(false); // Disable bias current again to reduce selfheating.
// remove fault
rtd >>= 1;
return rtd;
}
it seems the readRegister16 line (shown above) should also have delay after it as it calls this function from Adafruit_SPIDevice (shown below). Regardless adding delays in the main loop should resolve this...
Code:
bool Adafruit_SPIDevice::write_then_read(const uint8_t *write_buffer,
size_t write_len, uint8_t *read_buffer,
size_t read_len, uint8_t sendvalue) {
beginTransactionWithAssertingCS();
// do the writing
#if defined(ARDUINO_ARCH_ESP32)
if (_spi) {
if (write_len > 0) {
_spi->transferBytes(write_buffer, nullptr, write_len);
}
} else
#endif
{
for (size_t i = 0; i < write_len; i++) {
transfer(write_buffer[i]);
}
}
#ifdef DEBUG_SERIAL
DEBUG_SERIAL.print(F("\tSPIDevice Wrote: "));
for (uint16_t i = 0; i < write_len; i++) {
DEBUG_SERIAL.print(F("0x"));
DEBUG_SERIAL.print(write_buffer[i], HEX);
DEBUG_SERIAL.print(F(", "));
if (write_len % 32 == 31) {
DEBUG_SERIAL.println();
}
}
DEBUG_SERIAL.println();
#endif
// do the reading
for (size_t i = 0; i < read_len; i++) {
read_buffer[i] = transfer(sendvalue);
}
#ifdef DEBUG_SERIAL
DEBUG_SERIAL.print(F("\tSPIDevice Read: "));
for (uint16_t i = 0; i < read_len; i++) {
DEBUG_SERIAL.print(F("0x"));
DEBUG_SERIAL.print(read_buffer[i], HEX);
DEBUG_SERIAL.print(F(", "));
if (read_len % 32 == 31) {
DEBUG_SERIAL.println();
}
}
DEBUG_SERIAL.println();
#endif
endTransactionWithDeassertingCS();
return true;
}