Skip to content

Commit f59b2d7

Browse files
Updated Reset pin config in firmware
Corrected bug in software for RESET pin handling
1 parent ee1f6f7 commit f59b2d7

File tree

242 files changed

+29
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

242 files changed

+29
-11
lines changed

arduino/protocentral_afe44xx_plot/protocentral_afe44xx_plot.ino

+15-7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//
55
// Copyright (c) 2016 ProtoCentral
66
//
7+
// AFE4490 code based on EVM code from Texas Instruments
78
// SpO2 computation based on original code from Maxim Integrated
89
//
910
// This software is licensed under the MIT License(http://opensource.org/licenses/MIT).
@@ -17,6 +18,8 @@
1718
// For information on how to use the HealthyPi, visit https://github.com/Protocentral/afe44xx_Oximeter
1819
/////////////////////////////////////////////////////////////////////////////////////////
1920

21+
/* This code works along with the GUI software in the "gui" folder to visualize the PPG waveforms*/
22+
2023
#include <string.h>
2124
#include <SPI.h>
2225
#include <math.h>
@@ -79,6 +82,9 @@
7982
#define CES_CMDIF_TYPE_DATA 0x02
8083
#define CES_CMDIF_PKT_STOP 0x0B
8184

85+
#define RESET 4 // RESET pin
86+
#define SPISTE 7 // chip select
87+
#define SPIDRDY 2 // data ready pin
8288

8389
//int IRheartsignal[count];
8490
//int Redheartsignal[count];
@@ -93,8 +99,6 @@ double Redac;
9399
double SpOpercentage;
94100
double Ratio;
95101

96-
const int SPISTE = 7; // chip select
97-
const int SPIDRDY = 2; // data ready pin
98102
volatile int drdy_trigger = LOW;
99103

100104
void afe44xxInit (void);
@@ -153,8 +157,6 @@ boolean leadoff_deteted = true;
153157
uint8_t spo2_probe_open = false;
154158
int dec=0;
155159

156-
157-
158160
void setup()
159161
{
160162
Serial.begin(57600);
@@ -163,8 +165,15 @@ void setup()
163165
delay(2000) ; // pause for a moment
164166

165167
SPI.begin();
168+
169+
// configure and set RESET
170+
pinMode (RESET,OUTPUT);//Slave Select
171+
digitalWrite(RESET, LOW);
172+
delay(500);
173+
digitalWrite(RESET, HIGH);
174+
delay(500);
166175

167-
// set the directions
176+
// configure pins
168177
pinMode (SPISTE,OUTPUT);//Slave Select
169178
pinMode (SPIDRDY,INPUT);// data ready
170179

@@ -175,7 +184,7 @@ void setup()
175184
SPI.setDataMode (SPI_MODE0); //Set SPI mode as 0
176185
SPI.setBitOrder (MSBFIRST); //MSB first
177186

178-
// Packet structure
187+
// Packet structure
179188
DataPacketHeader[0] = CES_CMDIF_PKT_START_1; //packet header1 0x0A
180189
DataPacketHeader[1] = CES_CMDIF_PKT_START_2; //packet header2 0xFA
181190
DataPacketHeader[2] = datalen; // data length 10
@@ -185,7 +194,6 @@ void setup()
185194
DataPacketFooter[0] = 0x00;
186195
DataPacketFooter[1] = CES_CMDIF_PKT_STOP;
187196

188-
189197
afe44xxInit ();
190198
Serial.println("intilazition is done");
191199
}

arduino/protocentral_afe44xx_text_only/protocentral_afe44xx_text_only.ino

+14-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//
55
// Copyright (c) 2016 ProtoCentral
66
//
7+
// AFE4490 code based on EVM code from Texas Instruments
78
// SpO2 computation based on original code from Maxim Integrated
89
//
910
// This software is licensed under the MIT License(http://opensource.org/licenses/MIT).
@@ -17,6 +18,8 @@
1718
// For information on how to use the HealthyPi, visit https://github.com/Protocentral/afe44xx_Oximeter
1819
/////////////////////////////////////////////////////////////////////////////////////////
1920

21+
/* This code displays the computed SpO2 value through the Serial port*/
22+
2023
#include <string.h>
2124
#include <SPI.h>
2225
#include <math.h>
@@ -79,6 +82,9 @@
7982
#define CES_CMDIF_TYPE_DATA 0x02
8083
#define CES_CMDIF_PKT_STOP 0x0B
8184

85+
#define RESET 4 // RESET pin
86+
#define SPISTE 7 // chip select
87+
#define SPIDRDY 2 // data ready pin
8288

8389
//int IRheartsignal[count];
8490
//int Redheartsignal[count];
@@ -93,11 +99,8 @@ double Redac;
9399
double SpOpercentage;
94100
double Ratio;
95101

96-
const int SPISTE = 7; // chip select
97-
const int SPIDRDY = 2; // data ready pin
98102
volatile int drdy_trigger = LOW;
99103

100-
101104
void afe44xxInit (void);
102105
void afe44xxWrite (uint8_t address, uint32_t data);
103106
uint32_t afe44xxRead (uint8_t address);
@@ -163,8 +166,15 @@ void setup()
163166
delay(2000) ; // pause for a moment
164167

165168
SPI.begin();
169+
170+
// configure and set RESET
171+
pinMode (RESET,OUTPUT);//Slave Select
172+
digitalWrite(RESET, LOW);
173+
delay(500);
174+
digitalWrite(RESET, HIGH);
175+
delay(500);
166176

167-
// set the directions
177+
// set pin directions
168178
pinMode (SPISTE,OUTPUT);//Slave Select
169179
pinMode (SPIDRDY,INPUT);// data ready
170180

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)