Host software for the MAX30001 ECG, PACE, biopotential, bioimpedance, R-to-R peak sensor. Hosted on the MAX32630FTHR.
1. Introduction¶
This document describes and defines the protocol between the MAX30001 EvKit System board and the associated MAX30001 GUI that runs on the PC. The protocol is called RPC, Remote Protocol Communications. The GUI is used to configure the MAX30001 sensor and visualize/store the sensed data.
2. RPC Protocol ¶
2.1 RPC Command Overview ¶
RPC Commands are sent from the GUI to the MAX30001 EvKit System.
- RPC Commands follow the following format:
- /<Object name>/<Method name> <Arguments separated by spaces><CR LF>
- All arguments are expressed in hexadecimal format unless otherwise noted.
- The return data is delimited by spaces and are in hexadecimal format unless otherwise noted.
- The return data is terminated by a <CR LF>.
- An example command is: /MAX30001/ReadReg 01: This command reads 1 byte from register address 0x01 from the MAX30001 sensor.
2.2 RPC Command, Response Overview¶
The MAX3001 EvKit System responds to commands with /80 unless otherwise specified.
2.3 RPC Command Details¶
2.3.1 Version Command¶
/System/ReadVer
| This command queries MAX32630 firmware version. An example response to this command is: “Max30001 FW Version 1.0.0 04/13/17”. |
2.3.2 I2C Command¶
/System/WriteRead
| This command enables the user to send an I2C write and read command to the I2C bus on EvKit. A typical usage is to write and read data from the PMIC. |
I2C Commands follow the following format:
| /I2c/WriteRead Instance slaveAddress writeNumber <dataToWrite> readNumber<CR LF> |
The table below provides details for the above parameters:
| Parameter | Description |
| Instance | The I2C instance of Max32630 |
| slaveAddress | Slave address of the device |
| writeNumber | Number of bytes to write |
| dataToWrite | A series of hex values separated by spaces that are to be written |
| readNumber | Number of bytes to read |
For example:
| /I2c/WriteRead 1 A0 3 11 22 33 2 |
This example command performs a write and read operation using I2C instance 1 and slave address A0. It writes the three hex data bytes: 11 22 33 and it request that 2 bytes of data be read. The 2 bytes of data requested will be sent back as a response to this command.
2.3.3 LED Commands¶
The following commands are used to control the LED on the MAX32630FTHR board:
/Led/Blink ms
| This command sets the blinking period for the LED on MAX32630FTHR board in milliseconds. |
/Led/Pattern pattern
| This command sets the blinking pattern for the LED on MAX32630FTHR board. The pattern is based on the zeros and ones of a 32-bit number specified in the “pattern” parameter. |
/Led/Off
| This command turns off the LED on the Max32630FTHR board. |
/Led/On
| This command turns on the LED on the Max32630FTHR board. |
2.3.4 ¶
/SDCard/IsReady
| This command checks the communications to the SD card and the verifies that the file system is ready for read/write operations. |
| The response to this command will be one of the following: |
| | ok | This means that the SD card is ready. |
| | not ok | This means that the SD card is not inserted or communications to the SD card is not working yet. |
/S25FS512/ReadPagesBinary startPage endPage
| This command reads a page from flash, and the response is binary (non-ascii) data. The parameters are described in the following table: |
| Parameter | Description |
| startPage | The starting page to read from |
| endPage | The last page to read from |
2.3.5 Self-Testing Command¶
/Testing/Test_MAX30001
| This command initiates the self-test for the MAX30001; the response is either the string PASS or FAIL followed by detailed results of the test. |
2.3.6 ¶
The following commands are used for configuring a mission and reading/writing data to the SD card:
/Logging/StartMissionDefine
| This command means that a mission is being defined with subsequent commands. |
/Logging/AppendMissionCmd missionString
| This command specifies an RPC command (missionString) that becomes part of a mission. |
/Logging/EndMissionDefine
| This command means that the definition of a mission has been completed. |
/Logging/WriteMission
| This command saves the mission to the SD card. |
/Logging/ReadMission
| This command saves the mission to the SD card. |
/Logging/EraseMission
| This command erase the missions stored on the SD card. |
/Logging/EraseWrittenSectors
| This command erases all the logged data stored on the SD card. |
/Logging/Start
| This command provides the ability to start a data logging session that is stored to the SD card. |
/Logging/StartLoggingFlash
| This command causes the data to be logged to the SD card. |
/Logging/StartLoggingUsb
| This command streams data to USB. (A PC terminal emulator such as TerraTerm can be used.) |
2.3.7 MAX3001 Commands¶
The following commands are used to interface to the MAX30001 chip.
/MAX30001/BIOZ_InitStart En_bioz Openp Openn Calp_sel Caln_sel CG_mode B_fit Rate Ahpf Ext_rbias Gain Dhpf Dlpf Fcgen Cgmon Cgmag Phoff Inapow_mode
| This command enables the BioZ interrupts interrupts and streaming. The streaming response is detailed in section 2.3.8. The table below describes the parameters that are sent with this command. |
| Parameter | Description |
| En_bioz | BIOZ Channel Enable <CNFG_GEN register> |
| Openp | Open the BIP Input Switch <CNFG_BMUX register> |
| Openn | Open the BIN Input Switch <CNFG_BMUX register> |
| Calp_selp | BIP Calibration Selection <CNFG_BMUX register> |
| Calp_seln | BIN Calibration Selection <CNFG_BMUX register> |
| CG_mode | BIOZ Current Generator Mode Selection <CNFG_BMUX register> |
| B_fit | BIOZ FIFO Interrupt Threshold (issues BINT based on number of unread FIFO records) <MNGR_INT register> |
| Rate | BIOZ Data Rate <CNFG_BIOZ register> |
| Ahpf | BIOZ/PACE Channel Analog High Pass Filter Cutoff Frequency and Bypass <CNFG_BIOZ register> |
| Ext_rbias | External Resistor Bias Enable <CNFG_BIOZ register> |
| Gain | BIOZ Channel Gain Setting <CNFG_BIOZ register> |
| Dhpf | BIOZ Channel Digital High Pass Filter Cutoff Frequency <CNFG_BIOZ register> |
| Dlpf | BIOZ Channel Digital Low Pass Filter Cutoff Frequency <CNFG_BIOZ register> |
| Fcgen | BIOZ Current Generator Modulation Frequency <CNFG_BIOZ register> |
| Cgmon | BIOZ Current Generator Monitor <CNFG_BIOZ register> |
| Cgmag | BIOZ Current Generator Magnitude <CNFG_BIOZ register> |
| Phoff | BIOZ Current Generator Modulation Phase Offset <CNFG_BIOZ register> |
| Inapow_mode | BIOZ Channel Instrumentation Amplifier (INA) Power Mode <CNFG_BIOZ Register> |
/MAX30001/CAL_InitStart En_Vcal Vmode Vmag Fcal Thigh Fifty
| This command starts the CAL signal within the MAX30001 device. |
| Parameter | Description |
| En_Vcal | Calibration Source (VCALP and VCALN) Enable |
| Vmode | Calibration Source Mode Selection |
| Vmag | Calibration Source Magnitude Selection (VMAG) |
| Fcal | Calibration Source Frequency Selection (FCAL) |
| Thigh | Calibration Source Time High Selection |
| Fifty | Calibration Source Duty Cycle Mode Selection |
/MAX30001/ECG_InitStart En_ecg Openp Openn Pol Calp_sel Caln_sel E_fit Rate Gain Dhpf Dlpf
| This command enables the ECG interrupts and streaming. The streaming response is detailed in section 2.3.8. |
| Parameter | Description |
| En_ecg | ECG Channel Enable <CNFG_GEN register="" bits> |
| Openp | Open the ECGP Input Switch (most often used for testing and calibration studies) <CNFG_EMUX register="" bits> |
| Openn | Open the ECGN Input Switch (most often used for testing and calibration studies) <CNFG_EMUX register="" bits> |
| Calp_sel | ECGP Calibration Selection <CNFG_EMUX register="" bits> |
| Caln_sel | ECGN Calibration Selection <CNFG_EMUX register="" bits> |
| E_fit | ECG FIFO Interrupt Threshold (issues EINT based on number of unread FIFO records) <CNFG_GEN register="" bits> |
| Clr_rrint | RTOR R Detect Interrupt (RRINT) Clear Behavior <CNFG_GEN register="" bits> |
| Rate | ECG Data Rate |
| Gain | ECG Channel Gain Setting |
| Dhpf | ECG Channel Digital High Pass Filter Cutoff Frequency |
| Dlpf | ECG Channel Digital Low Pass Filter Cutoff Frequency |
/MAX30001/ECGFast_Init Clr_Fast Fast Fast_Th
| This command enables the ECG Fast mode interrupts interrupts and streaming. The streaming response is detailed in section 2.3.8. |
| Parameter | Description |
| Clr_Fast | FAST MODE Interrupt Clear Behavior <MNGR_INT register> |
| Fast | ECG Channel Fast Recovery Mode Selection (ECG High Pass Filter Bypass) <MNGR_DYN register> |
| Fast_Th | Automatic Fast Recovery Threshold |
/MAX30001/Enable_BIOZ_LeadON
| This command enables the BIOZ Lead ON. |
/MAX30001/Enable_ECG_LeadON
| This command enables the ECG LeadON. |
/MAX30001/INT_assignment en_enint_loc en_eovf_loc en_fstint_loc en_dcloffint_loc en_bint_loc en_bovf_loc en_bover_loc en_bundr_loc en_bcgmon_loc en_pint_loc en_povf_loc en_pedge_loc en_lonint_loc en_rrint_loc en_samp_loc intb_Type int2b_Type
| This command allows one to enable the interrupt for the MAX30001. The parameters to this command are described below: |
| Parameter | Description |
| en_enint_loc | ---------------------------------------------- |
| en_eovf_loc | |
| en_fstint_loc | |
| en_dcloffint_loc |
| en_bint_loc | |
| en_bovf_loc | |
| en_bover_loc | |
| en_bundr_loc | All of these arguments can be |
| en_bcgmon_loc | configured to generate an |
| en_pint_loc | interrupt on either INTB or INT2B |
| en_povf_loc | or NONE |
| en_pedge_loc | |
| en_lonint_loc | |
| en_rrint_loc | |
| en_samp_loc | ---------------------------------------------- |
| intb_Type | INTB Port Type (EN_INT Selections). |
| int2b_Type | INT2B Port Type (EN_INT2 Selections) |
/MAX30001/PACE_InitStart En_pace Clr_pedge Pol Gn_diff_off Gain Aout_lbw Aout Dacp Dacn
| This command enables the PACE interrupts and streaming. The streaming response is detailed in section 2.3.8 |
| Parameter | Description |
| En_pace | PACE Channel Enable <CNFG_GEN register> |
| Clr_pedge | PACE Edge Detect Interrupt (PEDGE) Clear Behavior <MNGR_INT register> |
| Pol | PACE Input Polarity Selection <CNFG_PACE register> |
| Gn_diff_off | PACE Differentiator Mode <CNFG_PACE register> |
| Gain | PACE Channel Gain Selection <CNFG_PACE register> |
| Aout_lbw | PACE Analog Output Buffer Bandwidth Mode <CNFG_PACE register> |
| Aout | PACE Single Ended Analog Output Buffer Signal Monitoring Selection <CNFG_PACE register> |
| Dacp (4bits): | PACE Detector Positive Comparator Threshold <CNFG_PACE register> |
| Dacn | PACE Detector Negative Comparator Threshold <CNFG_PACE register> |
/MAX30001/Rbias_FMSTR_Init En_rbias Rbias Rbiasp Rbiasn Fmstr
| This command configures the Rbias of the MAX30001. The parameters to this command are described below: |
| Parameter | Description |
| En_rbias | Enable and Select Resitive Lead Bias Mode |
| Rbias | Resistive Bias Mode Value Selection |
| Rbiasp | Enables Resistive Bias on Positive Input |
| Rbiasn | Enables Resistive Bias on Negative Input |
| Fmstr | Selects Master Clock Frequency |
/MAX30001/Read_LeadON
| This command reads the Lead ON ECG status. The response is either ON or OFF. |
/MAX30001/ReadReg address
| This command site reads data from the MAX30001 register specified by the address. |
/MAX30001/WriteReg address data
| This command site data to the MAX30001 and the parameter description is below: |
| Parameter | Description |
| Address | Register address to write |
| Data | Data to write |
/MAX30001/RtoR_InitStart En_rtor Wndw Gain Pavg Ptsf Hoff Ravg Rhsf Clr_rrint
| This command enables the RtoR interrupts and streaming. The streaming response is detailed in section 2.3.8 |
| Parameter | Description |
| En_rtor | ECG RTOR Detection Enable <RTOR1 register> |
| Wndw | R to R Window Averaging (Window Width = RTOR_WNDW[3:0]*8mS) <RTOR1 register> |
| Gain | R to R Gain (where Gain = 2^RTOR_GAIN[3:0], plus an auto-scale option) <RTOR1 register> |
| Pavg | |
| Ptsf | R to R Peak Averaging Weight Factor <RTOR1 register> |
| Hoff | R to R minimum Hold Off <RTOR2 register> |
| Ravg | R to R Interval Averaging Weight Factor <RTOR2 register> |
| Rhsf | R to R Interval Hold Off Scaling Factor <RTOR2 register> |
| Clr_rrint | RTOR Detect Interrupt Clear behaviour <MNGR_INT register> |
/MAX30001/Start
| This command starts the streaming of the MAX30001 data. The data streamed depends on the previous MAX30001 InitStart RPC commands. Section 2.3.8 describes the streamed response. |
/MAX30001/StartTest
| This command initiates the self-test for the MAX30001; interrupts are verified in this test. |
/MAX30001/Stop
| This command stops the streaming and interrupts of the MAX30001 device. |
/MAX30001/Stop_BIOZ
| This command stops BIOZ streaming and interrupts. |
/MAX30001/Stop_Cal
| This command stops the MAX30001 Cal mode |
/MAX30001/Stop_ECG
| This command stops the ECG streaming and interrupts. |
/MAX30001/Stop_PACE
| This command stops the PACE streaming and interrupts. |
/MAX30001/Stop_RtoR
| This command stops the RtoR streaming and interrupts. |
/MAX30001/WriteReg address data
| This command site data to the MAX30001 and the parameter description is below: |
| Parameter | Description |
| Address | Register address to write |
| Data | Data to write |
2.3.8 MAX3001 Streamed Data Response¶
Streamed Data Packet Responses are periodic messages sent from the MAX30001 Evkit System to the GUI.
The streamed data packet is in the format of:
Packet ID | TimeStamp | Payload Length | PayLoad |
All elements of the streamed data packet are hexadecimal numbers and the stream data packet is terminated with <CR LF>.
| Packet ID Definitions and Associated Payloads |
| Packet ID | Decoded Packet ID | Payload Format corresponding to Packet ID |
| 0x30 | Max30001 ECG | ECG ECG … |
| 0x31 | Max30001 Pace | Pace Pace … |
| 0x32 | Max30001 RtoR | RtoR |
| 0x33 | Max30001 BioZ | BioZ BioZ |
| 0x34 | Max30001 Lead Off DC | |
| 0x35 | Max30001 Lead Off AC | |
| 0x36 | Max30001 BCGMON | |
| 0x37 | Max30001 ACLEADON | |
This is the time stamp associated with this packet.
The Payload Length is the number of fields in the Payload
The Payload is sensor data that is sent according to the Packet ID.
An example response is:
30 11223344 1 1BF
The data for the above response has the following meaning:
- 30 – Signifies that the Packet ID for Max30001 ECG data
- 11223344 – This is the time stamp associated with this packet.
- 1 – Signifies that there is one field in the Payload
- 1BF –This is the measurement data that is returned, 0x1BF