Maxim Integrated MAX32664C Quick Start Manual

Page 1
Measuring SpO
and Heart Rate
2
Using MAX32664C – A Quick Start Guide
UG6924; Rev 0; 6/19
Abstract
The MAX32664C is a variant of the MAX32664 sensor-hub family, which is specifically targeted for measurement of SpO
axis accelerometer, it provides the sensor’s raw data, as well as calculated SpO data, to a host device through its I
instructions that enable a user to communicate with the MAX32664C and to calibrate, configure, and receive measurement and monitoring data.
Maxim Integrated Page 1 of 24
and heart rate. Combined with the MAX86141 optical sensor and a 3-
2
or heart-rate
2
2
C slave interface. This document provides step-by-step
Page 2
Table of Contents
Introduction ................................................................................................................................... 4
1 Architecture ................................................................................................................................ 5
1.1 Communicating with MAX32664C ....................................................................................... 6
1.2 Accelerometer ..................................................................................................................... 7
2 Measuring SpO2 on Wrist (WSpO2) .......................................................................................... 8
2.1 Initial Calibration Mode for Final Product ............................................................................ 8
2.2 Raw Data Collection Mode ................................................................................................ 11
2.2.1 Raw Data Collection in Algorithm Mode ..................................................................... 11
2.2.2 Pure Raw Data Collection ........................................................................................... 13
2.3 Algorithm Mode ................................................................................................................. 15
2.3.1 Algorithm Settings and Configurations ....................................................................... 16
3 Measuring Heart-Rate on Wrist (WHRM) ................................................................................ 17
3.1 Setup ................................................................................................................................. 17
3.2 Raw Data Collection Mode ................................................................................................ 17
3.2.1 Raw Data Collection in Algorithm Mode ..................................................................... 17
3.2.2 Pure Raw Data Collection ........................................................................................... 20
3.3 Algorithm Mode ................................................................................................................. 22
3.3.1 Algorithm Settings and Configurations ....................................................................... 23
Revision History .......................................................................................................................... 24
List of Figures
Figure 1. Architecture diagram for health-sensing applications. ................................................... 5
Maxim Integrated Page 2 of 24
Page 3
List of Tables
Table 1. Read Status Byte Value .................................................................................................. 6
Table 2. Host-Side Accelerometer—Sending Data to MAX32664C ............................................. 7
Table 3. Host Commands—WSpO2 in Calibration Mode ............................................................. 9
Table 4. Format of Received Samples—WSpO2 in Calibration/Algorithm Mode ....................... 10
Table 5. Host Commands—WSpO2 Raw Data with Algorithm Mode ......................................... 11
Table 6. Host Commands—WSpO2 Pure Raw Data .................................................................. 13
Table 7. Format of Received Samples—WSpO2 in Pure Raw Mode ......................................... 14
Table 8. Host Commands—WSpO2 Algorithm Mode ................................................................. 15
Table 9. Configurations and Settings—WSpO2 .......................................................................... 16
Table 10. Host Commands—WHRM Raw Data with Algorithm Mode ........................................ 18
Table 11. Format of Received Samples—WHRM in Algorithm Mode......................................... 19
Table 12. Host Commands—WHRM Pure Raw Data ................................................................. 20
Table 13. Format of Received Samples—WHRM in Pure Raw Data Mode ............................... 21
Table 14. Host Commands—WHRM Algorithm Mode ................................................................ 22
Table 15. Configurations and Settings—WHRM ......................................................................... 23
Maxim Integrated Page 3 of 24
Page 4
Introduction
The MAX32664C is a variant of the MAX32664 sensor-hub family that enables users to capture raw data, as well as calculated SpO firmware, drivers, and algorithm that are required to interface with the MAX86141 sensor device
2
through the SPI port. The I
C slave interface is dedicated to establishing communication with a
host microcontroller.
In order to properly capture and calculate the data, this solution requires an accelerometer. The MAX32664C firmware includes the required drivers for the Kionix is wired together with the MAX86141 to the same SPI port. Alternatively, a host-side accelerometer can be used. In this case, the sampled accelerometer data is required to be periodically reported to the MAX32664C by the host microcontroller using commands described in this application note.
This document provides the instructions necessary to create a solution with the MAX32664C based on the MAXREFDES102# reference design.
and heart-rate data. The part is preprogrammed with the
2
®
KX122 accelerometer, which
Kionix is a registered trademark of Kionix, Inc.
Maxim Integrated Page 4 of 24
Page 5
1 Architecture
A typical health-sensing design includes a host microcontroller communicating with the
2
MAX32664C through the I in Application or Bootloader mode through the RSTN and multifunction I/O (MFIO) pins. An MFIO pin is also used in Application mode to interrupt the host for I interfaces to the MAX86141 optical sensor through the SPI bus.
An accelerometer is mandatory for heart-rate monitoring. A KX122 accelerometer can be connected directly to the MAX32664C. Alternatively, an external 3-axis host-side accelerometer can be used. In this case, the host needs to periodically provide accelerometer readings to sensor­hub using the commands provided in this document. For more information, see the MAX32664 User Guide.
C bus. Two GPIO pins are needed to control the reset and the startup
2
C communication. The MAX32664C
Figure 1. Architecture diagram for health-sensing applications.
Maxim Integrated Page 5 of 24
Page 6
1.1 Communicating with MAX32664C
0x00
SUCCESS. The write transaction was successful.
0x01
ERR_UNAVAIL_CMD. Illegal Family Byte and/or Command Byte was used.
0x02
ERR_UNAVAIL_FUNC. This function is not implemented.
0x03
ERR_DATA_FORMAT. Incorrect number of bytes sent for the requested Family Byte.
0x04
ERR_INPUT_VALUE. Illegal configuration value was attempted to be set.
0x05
ERR_TRY_AGAIN. Device is busy. Try again.
bootloader sequence.
0x81
ERR_BTLDR_CHECKSUM. Checksum error while decrypting/checking page data.
0x82
ERR_BTLDR_AUTH. Authorization error.
0x83
ERR_BTLDR_INVALID_APP. Application not valid.
0xFF
ERR_UNKNOWN. Unknown Error.
A host should use the I2C bus to communicate with the MAX32664C (slave) using a series of commands. A generic write command includes the following fields:
Slave_WriteAddress(1 byte)|Command_Family(1 byte)|Command_Index(1 byte)|Value(multiple bytes)
A generic response includes the following fields:
Slave_ReadAddress(1 byte)|Status(1 byte)|Value (multiple bytes)
Slave_WriteAddress and Slave_ReadAddress are set to 0xAA and 0xAB, respectively.
The read status byte is an indicator of success (0x00) or failure as shown in Table 1.
Table 1. Read Status Byte Value
STATUS BYTE
VALUE
DESCRIPTION
0x80
ERR_BTLDR_GENERAL. General error while receiving/flashing a page during the
This document provides examples of commands for establishing communication with the
2
MAX32664B. For a complete list of commands and instructions for the I
C interface, see the
MAX32664 User Guide.
Maxim Integrated Page 6 of 24
Page 7
1.2 Accelerometer
MAX32664
(HEX)
AA 44 04 01 01
Enable host accelerometer.
AB 00
Success
Success; 6 is the
samples in FIFO
Write data to the input FIFO of
integer values for X, Y, Z in milli-g.
Success; sensor hub
The MAX32664C requires accelerometer data to function properly. In particular, SpO2 calculation requires a resting condition, and the algorithm uses accelerometer data to detect excessive motion. In such a condition, computation is paused, and the user is informed with a motion flag. Of course, if the accelerometer is not available, motion detection for WSpO
can be disabled (see
2
Table 9).
For a heart-rate monitor, an accelerometer is mandatory to be able to compensate for the user's motion. Otherwise, the reported heart rate will not be correct during movement.
A sensor hub accelerometer can be integrated through the SPI port of the MAX32664C. In this case, the required driver for KX122 is already included. The user only needs to follow the reference schematics to connect the accelerometer and enable it before starting the algorithm, as described later in this document.
Alternatively, a host-side accelerometer can be used. In this case, the host is required to use a 3­axis accelerometer at 25Hz sampling and must periodically (e.g., once every 100ms–200ms) provide accelerometer samples to the MAX32664C using commands shown in Table 2. Note that this option requires strict timing synchronization between the sampled accelerometer data and PPG samples of 40ms or less.
Table 2. Host-Side Accelerometer—Sending Data to MAX32664C
HOST COMMAND
(HEX)
AA 13 00 04
The following should be executed periodically:
AA 14 00 [Sample 1 values] … [Sample N values]
AA 00 00 Read the sensor hub status. AB 00 00
Read the sensor sample size for the accelerometer. (optional)
sensor hub. Each sample is three 2-byte
DESCRIPTION
RESPONSE
AB 00 06
AB 00 Success
DESCRIPTION
number of bytes per
not busy
Maxim Integrated Page 7 of 24
Page 8
2 Measuring SpO2 on Wrist (WSpO2)
2.1 Initial Calibration Mode for Final Product
Due to variations in the physical design and optical shield of the final product, a calibration procedure is required to be performed once in a controlled environment. This procedure is important to ensure the quality of SpO lab with a reference SpO
device to determine three calibration coefficients: a, b, and c. The
2
details of the calibration procedure are described in the Guidelines for SpO2 Measurement Using the Maxim MAX32664 Sensor Hub application note.
Once three calibrations coefficients are obtained, they need to be loaded to the MAX32664C every time prior to starting the algorithm. But first, they are required to be converted to 32-bit integer format using the following:
- A
- B
- C
= round (105 x a)
int32
= round (105 x b)
int32
= round (105 x c)
int32
For example, the default measured calibration coefficients are:
- a = -16.666666
- b = 8.333333
- c = 100
They are sent to the MAX32664C in integer format after conversion:
- A
- B
- C
= round (105 x a) = 0xFFE69196
int32
= round (105 x b) = 0x000CB735
int32
= round (105 x c) = 0x00989680
int32
The calibration coefficients may be stored in the host flash separately and loaded to the MAX32664C after every reset.
Table 3 shows the sequence of commands for calibration process. Table 4 shows the format of received samples. Typically, R values are needed for calibration process as described in the Guidelines for SpO2 Measurement Using the Maxim MAX32664 Sensor Hub application note.
calculation. This step is typically performed in a standard
2
Maxim Integrated Page 8 of 24
Page 9
Table 3. Host Commands—WSpO2 in Calibration Mode
START ALGORITHM
Host initializes MAX32664C in calibration mode and starts algorithm using following commands:
1.1
AA 10 00 03
Set output mode to sensor + algorithm data
required for calibration).
AB 00
1.2
AA 10 01 05
Set sensor hub interrupt threshold.
AB 00
1.3
AA 44 00* 01 00
Enable analog front-end (AFE) (e.g., MAX86141) * with sensor hub samples.
AB 00
1.4
AA 44 04* 01 00 (if sensor hub
accelerometer is used)
Enable accelerometer with sensor hub or
AB 00
1.5
AA 50 05 02 02
Set WSpO2 in Calibration mode.
AB 00
1.6
Optional: Any command to change the algorithm settings and configurations (Table 9) from default should appear here BEFORE enabling algorithm.
1.7
AA 52 05 01
Enable WSpO2 algorithm.
AB 00
READING SAMPLES
Host reads samples upon receiving MFIO interrupt by MAX32664C (repeated as needed):
2.1
AA 00 00
Read sensor hub status byte:
If DataRdyInt is set, proceed to next step.
AB 00 08
2.2
AA 12 00
Get the number of samples (nn) in the FIFO.
AB 00 nn
2.3
AA 12 01
Read the data stored in the FIFO; nn samples
samples is shown in Table 4.
AB 00
nn_samples
STOP
Host ends the procedure:
3.1
AA 44 00* 00
Disable AFE (e.g., MAX86141).*
AB 00
3.2
AA 44 04* 00
Disable accelerometer.*
AB 00
3.3
AA 52 05 00
Disable WSpO2 algorithm.
AB 00
# HOST COMMAND (HEX) COMMAND DESCRIPTION
(streamed data will include PPG,
accelerometer is used) AA 44 04* 01 01 (if host
accelerometer, and algorithm data. R is
host-side accelerometer.*
Bit 0: Sensor comm error Bits 1 and 2: Reserved Bit 3: FIFO filled to threshold (DataRdyInt) Bit 4: Output FIFO overflow (FifoOutOvrInt) Bit 5: Input FIFO overflow (FifoInOverInt) Bit 6: Sensor hub busy (DevBusy) Bit 7: Reserved
RESPONSE
(HEX)
*Provided indexes are examples for sensors such as the MAX86141 AFE or KX122 accelerometer.
(33 bytes each) will be included. The format of
data_for_
Maxim Integrated Page 9 of 24
Page 10
Table 4. Format of Received Samples—WSpO2 in
NUMBER OF
(MSB FIRST)
3
LED2
3
N/A
9
LED4
3
Red LED counter
15
LED6
3
N/A
20
accelY
2
Two's complement. LSB = 0.001g
24 R 2
10x calculated R value
27
SpO2
2
10x SpO2 %
Calculation progress in % (only in one-shot mode of algorithm)
Low SNR flag
Reported status of algorithm:
Timeout: 3
Calibration/Algorithm Mode
DATA SOURCE
MAX86141 PPG Data (18 Bytes)
Accelerometer (6 Bytes)
SpO2 Algorithm (9 Bytes)
BYTE
INDEX
0 LED1 3 N/A
6 LED3 3 N/A
12 LED5 3 IR LED counter
18 accelX 2 Two's complement. LSB = 0.001g
22 accelZ 2 Two's complement. LSB = 0.001g
26 Confidence 1 Calculated confidence in %
29 % complete 1
30
31 Motion flag 1 Shows excessive motion
32 Status 1
DATA ITEM
BYTES
1 Shows low SNR in measurement
LED adjustment: 0 Computation: 1 Success: 2
DESCRIPTION
Maxim Integrated Page 10 of 24
Page 11
2.2 Raw Data Collection Mode
Host initializes MAX32664C in Algorithm mode with AGC off and starts algorithm using following commands:
1.1
AA 50 05 03 00
Turn off algorithm AGC.
AB 00
1.2
AA 10 00 03
Set output mode to sensor + algorithm data
collection and other fields can be ignored).
AB 00
1.3
AA 10 01 05
Set sensor hub interrupt threshold.
AB 00
1.4
AA 44 00* 01 00
Enable AFE (e.g., MAX86141)* with sensor hub samples.
AB 00
1.5
AA 44 04* 01 00 (if sensor
accelerator is used)
Enable accelerometer with sensor hub or host-side
AB 00
1.6
Optional: Any command to change the algorithm settings and configurations (Table 9) from default should appear here BEFORE enabling algorithm.
1.7
AA 52 05 01
Enable WSpO2 algorithm.
AB 00
Wait for 100ms before sending next command. Any command to change sensor registers should
LED 2 and 3 full range: 124mA
1.8
AA 40 00 24 [7F]
Set MAX86141 LED2 (IR) current to half of full scale. Reduce [7F] if signal is saturated.
AB 00
1.9
AA 40 00 25 [7F]
Set MAX86141 LED3 (red) current to half of full scale. Reduce [7F] if signal is saturated.
AB 00
1.10
AA 40 00 12 18
Set sample rate of MAX86141 to 100Hz with 1 sample averaging.
AB 00
READING
SAMPLES
Host reads samples upon receiving MFIO interrupt by MAX32664C (repeated as needed):
2.1
AA 00 00
Read sensor hub status byte:
Bit 6: Sensor hub busy (DevBusy)
AB 00 08
For hardware testing purposes, the user may choose to start the MAX32664C to collect raw PPG samples. There are two ways to accomplish this, which are detailed as follows.
2.2.1 Raw Data Collection in Algorithm Mode
In Algorithm mode, AGC may be turned off to collect raw PPG data, as seen in the first step in Table 5. In this case, LED currents will not be adjusted automatically; the SpO
measurement
2
algorithm may not converge and should be discarded. Although the algorithm is running, it will not affect the PPG samples. If the reported PPG data is saturated, you can reduce the LED currents, as shown in Table 5. Note that updating the MAX86141 registers should occur AFTER enabling the algorithm and the MAX86141, or they will be overwritten during initialization.
Table 5. Host Commands—WSpO2 Raw Data with Algorithm Mode
#
HOST COMMAND
(HEX)
COMMAND DESCRIPTION
(streamed data will include PPG, accelerometer, and algorithm data. But only PPG and accelerometer data are needed for raw data
RESPONSE
(HEX)
hub accelerator is used) AA 44 04* 01 01 (if host
START ALGORITHM
appear AFTER enabling algorithm or they will be overwritten. By default, WSpO2 algorithm sets following AFE registers:
Sample rate: 25Hz, 1 sample averaging
Integration time: 117μs
ADC 1 and 2 range: 32μA
accelerometer.*
Bit 0: Sensor comm error Bits 1 and 2: Reserved Bit 3: FIFO filled to threshold (DataRdyInt) Bit 4: Output FIFO overflow (FifoOutOvrInt) Bit 5: Input FIFO overflow (FifoInOverInt)
Maxim Integrated Page 11 of 24
Page 12
Bit 7: Reserved If DataRdyInt is set, proceed to next step.
2.2
AA 12 00
Get the number of samples (nn) in the FIFO.
AB 00 nn
2.3
AA 12 01
Read the data stored in the FIFO; nn samples (33
bytes each) will be read. The format of samples is
shown in Table 4.
AB 00
nn_samples
STOP
Host ends the procedure:
3.1
AA 44 00* 00
Disable AFE (e.g., MAX86141).*
AB 00
3.2
AA 44 04* 00
Disable accelerometer.*
AB 00
3.3
AA 52 05 00
Disable WSpO2 algorithm.
AB 00
data_for_
*Provided indexes are examples for sensors such as the MAX86141 AFE or KX122 accelerometer.
Maxim Integrated Page 12 of 24
Page 13
2.2.2 Pure Raw Data Collection
HOST COMMAND
RESPONSE
Host initializes MAX32664C in pure raw data using following commands:
1.1
AA 10 00 01
Set output mode to sensor only.
AB 00
1.2
AA 10 01 05
Set sensor hub interrupt threshold.
AB 00
1.3
AA 44 00* 01 00
Enable AFE (e.g., MAX86141)* with sensor hub samples.
AB 00
1.4
AA 44 04* 01 00 (if sensor
accelerometer is used)
Enable accelerometer with sensor hub or host-side
AB 00
1.5
AA 40 00 12 18
Set sample rate of MAX86141 to 100Hz with 1 sample averaging.
AB 00
1.6
AA 40 00 11 3F
Set MAX86141 to integration time: 117μs and ADC 1/2 range: 32μA.
AB 00
1.7
AA 40 00 23 00
Set MAX86141 LED1 (green) current to 0.
AB 00
1.8
AA 40 00 24 [7F]
Set MAX86141 LED2 (IR) current to half of full scale. Reduce [7F] if signal is saturated.
AB 00
1.9
AA 40 00 25 [7F]
Set MAX86141 LED3 (red) current to half of full scale. Reduce [7F] if signal is saturated.
AB 00
1.10
AA 40 00 2A 3C
Set MAX86141 LEDs 2 and 3 current full range = 124mA.
AB 00
1.11
AA 40 00 20 23
Set MAX86141 LED sequence. LED3 (red) -> LED2 (IR)
AB 00
1.12
AA 40 00 09 7C
Set MAX86141 FIFO interrupt threshold to 124.
AB 00
1.13
AA 40 00 0A 0E
Set MAX86141 FIFO configuration.
AB 00
1.14
AA 40 00 02 86
Set MAX86141 Interrupt configuration.
AB 00
READING SAMPLES
Host reads samples upon receiving MFIO interrupt by MAX32664C (repeated as needed):
2.1
AA 00 00
Read sensor hub status byte:
If DataRdyInt is set, proceed to next step.
AB 00 08
2.2
AA 12 00
Get the number of samples (nn) in the FIFO.
AB 00 nn
2.3
AA 12 01
Read the data stored in the FIFO; nn samples (24
is shown in Table 7.
AB 00
nn_samples
STOP
Host ends the procedure:
3.1
AA 44 00* 00
Disable AFE (e.g., MAX86141).*
AB 00
3.2
AA 44 04* 00
Disable accelerometer.*
AB 00
The host can configure the MAX32664C to work in Raw-Only mode (no algorithm). Table 6 lists the set of commands that are needed to work in this mode. In this case, only LED counters and accelerometer data will be included in the received samples.
Table 6. Host Commands—WSpO2 Pure Raw Data
#
START ALGORITHM
(HEX)
hub accelerometer is used) AA 44 04* 01 01 (if host
COMMAND DESCRIPTION
accelerometer.*
(HEX)
Bit 0: Sensor comm error Bits 1 and 2: Reserved Bit 3: FIFO filled to threshold (DataRdyInt) Bit 4: Output FIFO overflow (FifoOutOvrInt) Bit 5: Input FIFO overflow (FifoInOverInt) Bit 6: Sensor hub busy (DevBusy) Bit 7: Reserved
bytes each) will be included. The format of samples
**Provided indexes are examples for sensors such as the MAX86141 AFE or KX122 accelerometer.
Maxim Integrated Page 13 of 24
data_for_
Page 14
Table 7. Format of Received Samples—WSpO2 in Pure Raw Mode
NUMBER OF
(MSB FIRST)
0
LED1
3
N/A 3 LED2
3
N/A
6
LED3
3
N/A
9
LED4
3
Red LED counter
12
LED5
3
IR LED counter
15
LED6
3
N/A
18
accelX
2
Two's complement. LSB = 0.001g
20
accelY
2
Two's complement. LSB = 0.001g
22
accelZ
2
Two's complement. LSB = 0.001g
DATA SOURCE
MAX86141 PPG Data (18 Bytes)
Accelerometer (6 Bytes)
BYTE
INDEX
DATA
ITEM
BYTES
DESCRIPTION
Maxim Integrated Page 14 of 24
Page 15
2.3 Algorithm Mode
RESPONSE
(HEX)
START ALGORITHM
Host initializes the MAX32664C in Algorithm mode using the following commands:
1.1
AA 50 05 00
This step is ONLY needed if non-default calibration
coefficients are for example only*.
AB 00
1.2
AA 10 00 03
Set output mode to sensor + algorithm data
collection and other fields can be ignored.
AB 00
1.3
AA 10 01 05
Set sensor hub interrupt threshold.
AB 00
1.4
AA 44 00** 01 00
Enable AFE (e.g., MAX86141)** with sensor hub samples.
AB 00
1.5
AA 44 04** 01 00 (if sensor
accelerometer is used)
Enable accelerometer with sensor hub or host-side
AB 00
1.6
AA 50 05 02 [00]
Set algorithm run mode to continuous (default is one-shot [01]). See Table 9.
1.7
Optional: Any command to change the algorithm settings and configurations (Table 9) from default should appear here BEFORE enabling algorithm.
1.8
AA 52 05 01
Enable WSpO2 algorithm.
AB 00
READING SAMPLES
Host reads samples upon receiving MFIO interrupt by MAX32664C (repeated as needed):
2.1
AA 00 00
Read sensor hub status byte:
If DataRdyInt is set, proceed to next step.
AB 00 08
2.2
AA 12 00
Get the number of samples (nn) in the FIFO.
AB 00 nn
2.3
AA 12 01
Read the data stored in the FIFO; nn samples (33
shown in Table 4.
AB 00
nn_samples
STOP
Host ends the procedure:
3.1
AA 44 00* 00
Disable AFE (e.g., MAX86141).*
AB 00
3.2
AA 44 04* 00
Disable accelerometer.*
AB 00
3.3
AA 52 05 00
Disable WSpO2 algorithm.
AB 00
In Algorithm mode, WSpO2 algorithm is enabled to calculate R value, SpO2 and confidence level. AGC is enabled in this mode and algorithm runs in one-shot mode by default. In one-shot mode, the progress is reported as %. You may change it to continuous mode as shown below. If signal quality is low, a LowSNR flag will be set. Excessive motion is also reported with a flag. The sequence of commands is shown in Table 8.
Table 8. Host Commands—WSpO2 Algorithm Mode
# HOST COMMAND (HEX) COMMAND DESCRIPTION
[FFE69196000CB7350098 9680]*
hub accelerometer is used) AA 44 04** 01 01 (if host
coefficients are used to write SpO2 calibration coefficients as derived according to [1]. Provided
(streamed data will include PPG, accelerometer, and algorithm data. But only PPG and accelerometer data are needed for raw data
accelerometer.**
Bit 0: Sensor comm error Bits 1 and 2: Reserved Bit 3: FIFO filled to threshold (DataRdyInt) Bit 4: Output FIFO overflow (FifoOutOvrInt) Bit 5: Input FIFO overflow (FifoInOverInt) Bit 6: Sensor hub busy (DevBusy) Bit 7: Reserved
bytes each) will be read. The format of samples is
*Provided 12-byte calibration data is an example. Actual data should be derived as described in [1].
**Provided indexes are examples for sensors such as the MAX86141 AFE or KX122 accelerometer.
Maxim Integrated Page 15 of 24
data_for_
Page 16
2.3.1 Algorithm Settings and Configurations
DEFAULT
(MSB FIRST)
WSpO2 Calibration Coefficients x
32-bit signed values)
0xFFE69196
00989680
Sampling rate (Hz):
0x01: 25Hz
Algorithm run mode:
calibration as in [1])
AGC enable:
0x01: Enable
Motion detection enable:
0x01: Enable
Motion detection period in seconds (16-bit unsigned)
Accelerometer motion detection
(32-bit signed)
AGC timeout in seconds (8-bit unsigned)
Configure the source of the PPG signal
0x02: PD2 only
The settings shown in Table 9 are available for the WSpO
algorithm. To update the Algorithm
2
settings, make sure to send the appropriate commands BEFORE enabling the algorithm, as shown in Table 8.
Table 9. Configurations and Settings—WSpO2
FAMILY
BYTE
0x50 for write
0x51 for read
ALGORITHM
INDEX
0x05
CONFIGURATION
INDEX
0x00
0x01
0x02
0x03
0x04
0x05
0x06
0x07
DESCRIPTION
100,000 (12 bytes comprised of three
0x00: 100Hz:
0x00: continuous 0x01: one-shot 0x02: calibration (to collect data for
0x00: Disable
0x00: Disable
threshold in milli-g times 100,000
VALUE
000CB735
0x01
0x01
0x01
0x01
0x0002
0x01C9C380
0x1E
Maxim Integrated Page 16 of 24
0x08 WSpO2 algorithm timeout in seconds 0x78
0x09
for the photo detector (PD) 0x01: PD1 only
0x02
Page 17
3 Measuring Heart-Rate on Wrist (WHRM)
3.1 Setup
A typical heart-rate sensing design has two PDs that are located at the same distance from green LED. In this case, PPG signal from both PDs can be used for WHRM calculation.
For other type of PD setups, set the PD configuration from the host accordingly using the commands provided in Table 15 prior to enabling the algorithm.
3.2 Raw Data Collection Mode
For hardware testing purposes, the user may choose to start the MAX32664C to collect raw PPG samples. There are two ways to accomplish this, which are detailed as follows.
3.2.1 Raw Data Collection in Algorithm Mode
In Algorithm mode, automatic exposure control (AEC) and skin contact detection (SCD) may be turned off to collect raw PPG data (steps 1.1 and 1.2 in Table 10). In this case, LED currents will not be adjusted automatically; the heart-rate measurement algorithm may not converge and should be discarded. Although the algorithm is running, it will not affect the PPG samples. If the reported PPG data is saturated, you can reduce the LED currents. Note that updating the MAX86141 registers should occur AFTER enabling the algorithm and the MAX86141, or they will be overwritten during initialization.
Maxim Integrated Page 17 of 24
Page 18
Table 10. Host Commands—WHRM Raw Data with Algorithm Mode
Host initializes the MAX32664C in Algorithm mode with AEC and SCD off and starts algorithm using the following commands:
1.1
AA 50 02 0B 00
Turn off algorithm AEC.
AB 00
1.2
AA 50 02 0C 00
Turn off algorithm SCD.
AB 00
1.3
AA 10 00 03
Set output mode to sensor + algorithm data.
AB 00
1.4
AA 10 01 05
Set sensor hub interrupt threshold.
1.5
AA 44 00* 01 00
Enable AFE (e.g., MAX86141)* with sensor hub samples.
AB 00
1.6
AA 44 04* 01 00 (if sensor
accelerometer is used)
Enable accelerometer with sensor hub or
AB 00
1.7
Optional: Any command to change the algorithm settings and configurations (Table 15) from default should appear here BEFORE enabling algorithm.
1.8
AA 52 02 01
Enable WHRM algorithm.
AB 00
Wait for 100ms before sending next command. Any command to change sensor registers should
LED 1 full range: 124mA
1.9
AA 40 00 23 [7F]
Set the MAX86141 LED1 current to half of full scale. Reduce [7F] if signal is saturated.
AB 00
1.10
AA 40 00 12 18
Set sample rate of the MAX86141 to 100Hz with 1 sample averaging.
AB 00
READING SAMPLES
Host reads samples upon receiving MFIO interrupt by the MAX32664C (repeated as needed):
2.1
AA 00 00
Read sensor hub status byte:
If DataRdyInt is set, proceed to next step.
AB 00 08
2.2
AA 12 00
Get the number of samples (nn) in the FIFO.
AB 00 nn
2.3
AA 12 01
Read the data stored in the FIFO; nn samples
samples is shown in Table 11.
AB 00
nn_samples
STOP
Host ends the procedure:
3.1
AA 44 00* 00
Disable AFE (e.g., MAX86141).*
AB 00
3.2
AA 44 04* 00
Disable accelerometer.*
AB 00
3.3
AA 52 02 00
Disable WHRM algorithm.
AB 00
#
HOST COMMAND
(HEX)
COMMAND DESCRIPTION
RESPONSE
(HEX)
hub accelerometer is used) AA 44 04* 01 01 (if host
appear AFTER enabling algorithm or they will be overwritten.
START ALGORITHM
By default, WHRM sets the following AFE registers:
Sample rate is 100Hz, 4 sample averaging
Integration time: 117μs
ADC 1 and 2 range: 32μA
host-side accelerometer.*
Bit 0: Sensor comm error Bits 1 and 2: Reserved Bit 3: FIFO filled to threshold (DataRdyInt) Bit 4: Output FIFO overflow (FifoOutOvrInt) Bit 5: Input FIFO overflow (FifoInOverInt) Bit 6: Sensor hub busy (DevBusy) Bit 7: Reserved
(30 bytes each) will be read. The format of
*Provided indexes are examples for sensors such as the MAX86141 AFE or KX122 accelerometer.
Maxim Integrated Page 18 of 24
data_for_
Page 19
Table 11. Format of Received Samples—WHRM in Algorithm Mode
NUMBER OF
FIRST)
0
LED1
3
Green 1 counter
3
LED2
3
N/A
6
LED3
3
N/A
9
LED4
3
Green 2 counter
12
LED5
3
N/A
15
LED6
3
N/A
18
accelX
2
Two's complement. LSB = 0.001g
20
accelY
2
Two's complement. LSB = 0.001g
22
accelZ
2
Two's complement. LSB = 0.001g
24
HR 2 10x heart rate
26
Confidence
1
Calculated confidence in %
27
RR 2 10x RR - inter-beat interval in ms
Rhythmic: 5
DATA SOURCE
MAX86141 (18 Bytes)
Accelerometer (6 Bytes)
WHRM Algorithm (6 Bytes)
BYTE
INDEX
29
DATA
ITEM
Activity class
BYTES (MSB
1
DESCRIPTION
Activity class: Rest: 0 Other: 1 Walk: 2 Run: 3 Bike: 4
Maxim Integrated Page 19 of 24
Page 20
3.2.2 Pure Raw Data Collection
HOST COMMAND
(HEX)
RESPONSE
(HEX)
Host initializes the MAX32664C in pure raw data using the following commands:
1.1
AA 10 00 01
Set output mode to sensor only.
AB 00
1.2
AA 10 01 05
Set sensor hub interrupt threshold.
AB 00
1.3
AA 44 00* 01 00
Enable AFE (e.g., MAX86141)* with sensor hub samples.
AB 00
1.4
AA 44 04* 01 00
Enable accelerometer with sensor hub.*
AB 00
1.5
AA 40 00 12 18
Set sample rate of MAX86141 to 100Hz with 1 sample averaging.
AB 00
1.6
AA 40 00 11 3F
Set MAX86141 to integration time: 117μs and ADC 1/2 range: 32μA.
AB 00
1.7
AA 40 00 23 [7F]
Set MAX86141 LED1 current to half of full scale. Reduce [7F] if signal is saturated.
AB 00
1.8
AA 40 00 2A 03
Set MAX86141 LED1 current full range = 124mA.
AB 00
1.9
AA 40 00 20 21
Set MAX86141 LED sequence LED1 (green) -> LED2 (IR)
AB 00
1.10
AA 40 00 09 7C
Set MAX86141 FIFO interrupt threshold to 124.
AB 00
1.11
AA 40 00 0A 0E
Set MAX86141 FIFO configuration.
AB 00
1.12
AA 40 00 02 86
Set MAX86141 interrupt configuration.
AB 00
READING SAMPLES
Host reads samples upon receiving MFIO interrupt by the MAX32664C (repeated as needed):
2.1
AA 00 00
Read sensor hub status byte:
If DataRdyInt is set, proceed to next step.
2.2
AA 12 00
Get the number of samples (nn) in the FIFO
2.3
AA 12 01
Read the data stored in the FIFO; nn samples (24
shown in Table 13.
STOP
Host ends the procedure:
3.1
AA 44 00 * 00
Disable AFE (e.g., MAX86141).*
AB 00
3.2
AA 44 04* 00
Disable accelerometer.
AB 00
The host can configure the MAX32664C to work in Raw-Only mode (no algorithm). Table 12 lists the set of commands that are needed to work in this mode. In this case, only the LED counters and accelerometer data will be included in the received samples.
Table 12. Host Commands—WHRM Pure Raw Data
#
START ALGORITHM
COMMAND DESCRIPTION
Bit 0: Sensor comm error Bits 1 and 2: Reserved Bit 3: FIFO filled to threshold (DataRdyInt) Bit 4: Output FIFO overflow (FifoOutOvrInt) Bit 5: Input FIFO overflow (FifoInOverInt) Bit 6: Sensor hub busy (DevBusy) Bit 7: Reserved
bytes each) will be read. The format of samples is
*Provided indexes are examples for sensors such as the MAX86141 AFE or KX122 accelerometer.
Maxim Integrated Page 20 of 24
Page 21
Table 13. Format of Received Samples—WHRM in Pure Raw Data
NUMBER OF
(MSB FIRST)
3
LED2
3
N/A
9
LED4
3
Green 2 counter
15
LED6
3
N/A
20
accelY
2
Two's complement. LSB = 0.001g
Mode
DATA SOURCE
MAX86141 (18 Bytes)
Accelerometer (6 Bytes)
BYTE
INDEX
0 LED1 3 Green 1 counter
6 LED3 3 N/A
12 LED5 3 N/A
18 accelX 2 Two's complement. LSB = 0.001g
22 accelZ 2 Two's complement. LSB = 0.001g
DATA
ITEM
BYTES
DESCRIPTION
Maxim Integrated Page 21 of 24
Page 22
3.3 Algorithm Mode
HOST COMMAND
(HEX)
RESPONSE
(HEX)
START ALGORITHM
Host initializes the MAX32664C in Algorithm mode and starts algorithm using the following commands:
1.1
AA 10 00 03
Set output mode to sensor + algorithm data.
AB 00
1.2
AA 10 01 05
Set sensor hub interrupt threshold.
1.3
AA 44 00* 01 00
Enable AFE (e.g., MAX86141) * with sensor hub samples.
AB 00
1.4
AA 44 04* 01 00 (if sensor
accelerometer is used)
Enable accelerometer with sensor hub or
AB 00
1.5
Optional: Any command to change the algorithm settings and configurations (Table 15) from
AA 50 02 0F 00 00
1.6
AA 52 02 01
Enable WHRM algorithm.
AB 00
READING SAMPLES
Host reads samples upon receiving MFIO interrupt by MAX32664C (repeat as needed):
2.1
AA 00 00
Read sensor hub status byte:
If DataRdyInt is set, proceed to next step.
AB 00 08
2.2
AA 12 00
Get the number of samples (nn) in the FIFO.
AB 00 nn
2.3
AA 12 01
Read the data stored in the FIFO; nn samples
samples is shown in Table 11.
AB 00 data_for_
STOP
Host ends the procedure:
3.1
AA 44 00* 00
Disable AFE (e.g., MAX86141).*
AB 00
3.2
AA 44 04* 00
Disable accelerometer.*
AB 00
3.3
AA 52 02 00
Disable WHRM algorithm.
AB 00
In this mode, the WHRM algorithm is enabled, and AEC and SCD are on. Heart rate, confidence level, RR value, and activity class are reported. The sequence of commands to run WHRM is listed in Table 14.
Note: To run the algorithm in AGC-only mode (AEC is enabled, but it behaves as AGC), send the additional command shown in step 1.5.
Table 14. Host Commands—WHRM Algorithm Mode
#
COMMAND DESCRIPTION
hub accelerometer is used) AA 44 04* 01 01 (if host
default should appear here BEFORE enabling the algorithm. Example: To run algorithm in AGC-Only mode (no AEC), set motion magnitude threshold to zero:
host-side accelerometer.*
Bit 0: Sensor comm error Bits 1 and 2: Reserved Bit 3: FIFO filled to threshold (DataRdyInt) Bit 4: Output FIFO overflow (FifoOutOvrInt) Bit 5: Input FIFO overflow (FifoInOverInt) Bit 6: Sensor hub busy (DevBusy) Bit 7: Reserved
(30 bytes each) will be read. The format of
*Provided indexes are examples for sensors such as the MAX86141 AFE or KX122 accelerometer.
Maxim Integrated Page 22 of 24
nn_samples
Page 23
3.3.1 Algorithm Settings and Configurations
DEFAULT
(MSB FIRST)
AEC algorithm enable
0x01: Enable
SCD enable
0x01: Enable
Adjusted target PD current
(16-bit unsigned)
SCD debounce window size in samples. (16-bit unsigned)
Motion magnitude threshold in
0.1g. (16-bit unsigned)
Minimum PD current in 0.1mA. (16-bit unsigned)
Configure the source of the
0x03: Both PD1 and PD2
The settings shown in Table 15 are available for WHRM algorithm. To update the algorithm settings, please make sure to send the appropriate commands BEFORE enabling the algorithm, as shown in Table 14.
Table 15. Configurations and Settings—WHRM
FAMILY
BYTE
0x50 for write
0x51 for read
ALGORITHM
INDEX
0x02
CONFIGURATION
INDEX
0x0B
0x0C
0x0D
0x0E
0x0F
0x10
0x11
DESCRIPTION
0x00: Disable
0x00: Disable
period in seconds.
PPG signal for the PD. 0x01: PD1 only 0x02: PD2 only
VALUE
0x01
0x01
0x0708
0x0032
0x0001
0x001E
0x01
Maxim Integrated Page 23 of 24
Page 24
Revision History
REVISION
NUMBER
0 06/19 Initial release
REVISION
DATE
DESCRIPTION
PAGES
CHANGED
©2019 by Maxim Integrated Products, Inc. All rights reserved. Information in this publication concerning the devices, applications, or technology described is intended to suggest possible uses and may be superseded. MAXIM INTEGRATED PRODUCTS, INC. DOES NOT ASSUME LIABILITY FOR OR PROVIDE A REPRESENTATION OF ACCURACY OF THE INFORMATION, DEVICES, OR TECHNOLOGY DESCRIBED IN THIS DOCUMENT. MAXIM ALSO DOES NOT ASSUME LIABILITY FOR INTELLECTUAL PROPERTY INFRINGEMENT RELATED IN ANY MANNER TO USE OF INFORMATION, DEVICES, OR TECHNOLOGY DESCRIBED HEREIN OR OTHERWISE. The information contained within this document has been verified according to the general principles of electrical and mechanical engineering or registered trademarks of Maxim Integrated Products, Inc. All other product or service names are the property of their respective owners.
Maxim Integrated Page 24 of 24
Loading...