Other Parts Discussed in Thread: ADS1292
Hi,
When I tried to use the function ""ECG_SENSOR_ADS1292R.getAds1292EcgAndRespirationSamples()"", the ESP32 is going on a reboot, it seems it is entering into mathematical invalid condition. can you help here.
Regards,
Nitin
#include "protocentralAds1292r.h" #include "SPI.h" #define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" //creating the service UUID #define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8" //creating the characteristics UUID #define ESP32_V_SPI_CS_PIN 5 #define ADS1292R_PWRDN_PIN 27 #define ADS1292R_START_PIN 15 #define ADS292R_DATAREADY_PIN 22 char Reg_read_data; bool data_available; #define LED_BUILTIN 2 //pin with LED to turn on when BT connected ads1292OutputValues* ADS1292RegValues; ads1292r ECG_SENSOR_ADS1292R; /*------------------------Setup or main function.---------------------------*/ void setup() { pinMode(ESP32_V_SPI_CS_PIN,OUTPUT); pinMode(ADS1292R_PWRDN_PIN,OUTPUT); pinMode(ADS1292R_START_PIN,OUTPUT); pinMode(ADS292R_DATAREADY_PIN,INPUT); digitalWrite(ESP32_V_SPI_CS_PIN,LOW); digitalWrite(ADS1292R_PWRDN_PIN,LOW); digitalWrite(ADS1292R_START_PIN,HIGH); SPI.begin(); Serial.begin(9600); // define the baud rate of ESP32 Serial.println("Starting BLE work!"); /*-------------------------------------------------------------------------------------------*/ /*-------------Setting up the Sensor------------------------*/ ECG_SENSOR_ADS1292R.ads1292Reset(ADS1292R_PWRDN_PIN); delay(1000); ECG_SENSOR_ADS1292R.ads1292Init(ESP32_V_SPI_CS_PIN,ADS1292R_PWRDN_PIN,ADS1292R_START_PIN); delay(1000); Serial.println("ECG sensor initialised."); data_available = ECG_SENSOR_ADS1292R.getAds1292EcgAndRespirationSamples(ADS292R_DATAREADY_PIN,ESP32_V_SPI_CS_PIN,ADS1292RegValues); data_available=true; if (data_available==true){ Serial.print("The data is ready"); } ECG_SENSOR_ADS1292R.ads1292Reset(ADS1292R_PWRDN_PIN); //For Debug purpose only. //Reading the Chip ID // pinMode(ESP32_V_SPI_CS_PIN,OUTPUT); // pinMode(ADS1292R_PWRDN_PIN,OUTPUT); // pinMode(ADS1292R_START_PIN,OUTPUT); // digitalWrite(ESP32_V_SPI_CS_PIN,LOW); // digitalWrite(ADS1292R_PWRDN_PIN,LOW); // ECG_SENSOR_ADS1292R.ads1292RegRead(ESP32_V_SPI_CS_PIN,ADS1292R_PWRDN_PIN,ADS1292_REG_ID,Reg_read_data); // Serial.println("CHIP ID is:"); // Serial.println(Reg_read_data,HEX); }
ECG sensor initialised. Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled. Core 1 register dump: PC : 0x400d0e24 PS : 0x00060730 A0 : 0x800d0ceb A1 : 0x3ffb1f60 A2 : 0x3ffbfeac A3 : 0xff800000 A4 : 0x3ffbfecc A5 : 0x00000000 A6 : 0x00000009 A7 : 0x00000000 A8 : 0x80000000 A9 : 0x3ffbfebc A10 : 0x00000003 A11 : 0x00000001 A12 : 0x3ffbfeb0 A13 : 0x3ffbfeb8 A14 : 0x3ffbfed0 A15 : 0x00000000 SAR : 0x0000001b EXCCAUSE: 0x0000001d EXCVADDR: 0x00000000 LBEG : 0x400d0d94 LEND : 0x400d0db9 LCOUNT : 0x00000000 ELF file SHA256: 0000000000000000 Backtrace: 0x400d0e24:0x3ffb1f60 0x400d0ce8:0x3ffb1f80 0x400d1fd2:0x3ffb1fb0 0x40086189:0x3ffb1fd0 Rebooting... D⸮ ⸮ ]q⸮⸮ ⸮⸮⸮h⸮Starting BLE work!
C0 0 0 80 0 0 80 0 0