I was using first arduino ported thermistor library in code… so working good but as i added SC16IS740RK-master and loaded code in particle P1. device reset when it try to read thermistor adc. if i put to read thermistor adc at 5 sec then P1 reset at every 5 sec. if 10 sec then every 10 sec.
If i remove “SC16IS740RK-master” library then code working great even if i read adc at every 10ms.
then i replaced arduino ported lib with “photon-thermistor-master” and still same issue. board continuous reset at specific interval.
photon-thermistor-master Lib : here
SC16IS740RK-master Lib: here
How have you got the termistor and sensor board wired?
Do you see any RGB LED signals when the device resets?
Are you running the sample code or your own?
If the latter, showing that code would be useful.
Do you see any RGB LED signals when the device resets?
Ans: Yes. it’s like Hard fault - 1 blink between 2 SOS patterns
Are you running the sample code or your own?
Ans: Right now in my code but also tried with sample code both lib sample code working good separately but if i merge both lib and make on sample code then it not work.
As ScruffR said, providing the code would be much easier than guessing at the problem.
However if you are using a software timer (Timer class), it is not safe to call any SC16IS740 function from the timer callback. You should instead set a flag in the timer callback and do the serial operation from loop.
Or just skip the timer altogether and check the time to check based on millis().
/*
* Project Serialcode
* Description:
* Author:
* Date:
*/
#include "SC16IS740RK.h"
#include "thermistor.h"
// setup() runs once, when the device is first turned on.
SerialLogHandler logHandler;
SC16IS740 extSerial(Wire, 0x4C);
THERMISTOR gxThermistorTh1(A1, 10000, 3984, 1000);
void setup() {
// Put initialization like pinMode and begin functions here.
pinMode(A1, INPUT);
}
// loop() runs over and over again, as quickly as it can execute.
void loop() {
gxThermistorTh1.read();
delay(500);
// The core of your code will likely live here.
}
Also tried with just this simple code still device goes in hard fault - 1 blink between 2 SOS
/*
* Project Serialcode
* Description:
* Author:
* Date:
*/
#include "SC16IS740RK.h"
#include "photon-thermistor.h"
// setup() runs once, when the device is first turned on.
SerialLogHandler logHandler;
SC16IS740 extSerial(Wire, 0x4C);
Thermistor gxnewtherm(A1, 1000, 10000, 25, 3984, 1, 0);
void setup() {
// Put initialization like pinMode and begin functions here.
pinMode(A1, INPUT);
}
// loop() runs over and over again, as quickly as it can execute.
void loop() {
// The core of your code will likely live here.
gxnewtherm.readTempC();
delay(500);
}
This example with “photon-thermistor” library. In this also same issue.
/*
* Project Serialcode
* Description:
* Author:
* Date:
*/
#include "SC16IS740RK.h"
#include "photon-thermistor.h"
// setup() runs once, when the device is first turned on.
SerialLogHandler logHandler;
//SC16IS740 extSerial(Wire, 0x4C); /////////////////////// Commented
Thermistor gxnewtherm(A1, 1000, 10000, 25, 3984, 1, 0);
void setup() {
// Put initialization like pinMode and begin functions here.
pinMode(A1, INPUT);
}
// loop() runs over and over again, as quickly as it can execute.
void loop() {
// The core of your code will likely live here.
gxnewtherm.readTempC();
delay(500);
}