You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Max 31856 raw example (oneShot.ino) gives good data on serial monitor.
Loom version prints errors and bad reading.
This is the example code that works:
// Basic example using one-shot measurement.
// The call to readThermocoupleTemperature() is blocking for O(100ms)
#include <Adafruit_MAX31856.h>
// Use software SPI: CS, DI, DO, CLK
//Adafruit_MAX31856 maxthermo = Adafruit_MAX31856(10, 11, 12, 13);
// use hardware SPI, just pass in the CS pin
Adafruit_MAX31856 maxthermo = Adafruit_MAX31856(10);
void setup() {
Serial.begin(115200);
while (!Serial) delay(10);
Serial.println("MAX31856 thermocouple test");
maxthermo.begin();
maxthermo.setThermocoupleType(MAX31856_TCTYPE_K);
Serial.print("Thermocouple type: ");
switch (maxthermo.getThermocoupleType() ) {
case MAX31856_TCTYPE_B: Serial.println("B Type"); break;
case MAX31856_TCTYPE_E: Serial.println("E Type"); break;
case MAX31856_TCTYPE_J: Serial.println("J Type"); break;
case MAX31856_TCTYPE_K: Serial.println("K Type"); break;
case MAX31856_TCTYPE_N: Serial.println("N Type"); break;
case MAX31856_TCTYPE_R: Serial.println("R Type"); break;
case MAX31856_TCTYPE_S: Serial.println("S Type"); break;
case MAX31856_TCTYPE_T: Serial.println("T Type"); break;
case MAX31856_VMODE_G8: Serial.println("Voltage x8 Gain mode"); break;
case MAX31856_VMODE_G32: Serial.println("Voltage x8 Gain mode"); break;
default: Serial.println("Unknown"); break;
}
}
void loop() {
Serial.print("Cold Junction Temp: ");
Serial.println(maxthermo.readCJTemperature());
Serial.print("Thermocouple Temp: ");
Serial.println(maxthermo.readThermocoupleTemperature());
// Check and print any faults
uint8_t fault = maxthermo.readFault();
if (fault) {
if (fault & MAX31856_FAULT_CJRANGE) Serial.println("Cold Junction Range Fault");
if (fault & MAX31856_FAULT_TCRANGE) Serial.println("Thermocouple Range Fault");
if (fault & MAX31856_FAULT_CJHIGH) Serial.println("Cold Junction High Fault");
if (fault & MAX31856_FAULT_CJLOW) Serial.println("Cold Junction Low Fault");
if (fault & MAX31856_FAULT_TCHIGH) Serial.println("Thermocouple High Fault");
if (fault & MAX31856_FAULT_TCLOW) Serial.println("Thermocouple Low Fault");
if (fault & MAX31856_FAULT_OVUV) Serial.println("Over/Under Voltage Fault");
if (fault & MAX31856_FAULT_OPEN) Serial.println("Thermocouple Open Fault");
}
delay(1000);
}
This example in loom does not work:
/**
* Temperature Readings using teh MAX31865 sensor
* Pass in a variable number of arguments to the construct to designate the number of samples and which pin you're using
*
* MANAGER MUST BE INCLUDED FIRST IN ALL CODE
*/
#include <Loom_Manager.h>
#include <Sensors/SPI/Loom_MAX318XX/Loom_MAX31856.h>
Manager manager("Device", 1);
// Reads the temperature
Loom_MAX31856 maxDude(manager);
void setup() {
// Start the serial interface
manager.beginSerial();
// Initialize the manager
manager.initialize();
// Measure the data from the sensors
manager.measure();
// Package the data into JSON
manager.package();
// Print the JSON document to the Serial monitor
manager.display_data();
}
void loop() {
// put your main code here, to run repeatedly:
}
This prints the following:
[Manager] Initializing Modules...
[Manager] ** Setup Complete **
[MAX31856] Cold Junction Range Fault
[MAX31856] Thermocouple Range Fault
[MAX31856] Cold Junction High Fault
[MAX31856] Cold Junction Low Fault
[MAX31856] Thermocouple High Fault
[MAX31856] Thermocouple Low Fault
[MAX31856] Over/Under Voltage Fault
[MAX31856] Thermocouple Open Fault
Elliot found a way to use hardware spi with this chip. This uses less GPIO. can we implement it? But let's first check to ensure there are no strange things with the SD card. SPI functionality. There does seem to be an issue when reading the time period for sampling from the SD card using hardware spy, but it doesn't seem to be an issue. Any use software spy for the max chip.
Describe the bug
Max 31856 raw example (oneShot.ino) gives good data on serial monitor.
Loom version prints errors and bad reading.
This is the example code that works:
This example in loom does not work:
This prints the following:
[Manager] Initializing Modules...
[Manager] ** Setup Complete **
[MAX31856] Cold Junction Range Fault
[MAX31856] Thermocouple Range Fault
[MAX31856] Cold Junction High Fault
[MAX31856] Cold Junction Low Fault
[MAX31856] Thermocouple High Fault
[MAX31856] Thermocouple Low Fault
[MAX31856] Over/Under Voltage Fault
[MAX31856] Thermocouple Open Fault
[Manager] Data Json:
{
"type": "data",
"id": {
"name": "Device",
"instance": 1
},
"contents": [
{
"module": "Packet",
"data": {
"Number": 1
}
},
{
"module": "MAX31856",
"data": {
"Temperature": null
}
}
]
}
The text was updated successfully, but these errors were encountered: