Hi,
I am using ads1292r and i am able to read 9 bytes data in "read continuous mode" .
I am using below code to read 9 bytes data.
NRF_LOG_INFO("=========== ADS1292 ==========");NRF_LOG_FLUSH();
nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;
spi_config.ss_pin = ADS1292_CS_PIN;
spi_config.miso_pin = ADS1292_MISO_PIN;
spi_config.mosi_pin = ADS1292_MOSI_PIN;
spi_config.sck_pin = ADS1292_SCLK_PIN;
spi_config.bit_order = NRF_DRV_SPI_BIT_ORDER_MSB_FIRST;
spi_config.mode = NRF_DRV_SPI_MODE_1;
spi_config.frequency = NRF_DRV_SPI_FREQ_250K;
APP_ERROR_CHECK(nrf_drv_spi_init(&spi, &spi_config, spi_event_handler, NULL));
NRF_LOG_INFO("- SPI initialised");NRF_LOG_FLUSH();
ads1292_Reset();
ads1292_StopReadDataContinuous(); //SDATAC command
ads1292_ReadChipID();
ads1292_Reset();
delay(100);
ads1292_DisableStartPin();
ads1292_EnableStartPin();
ads1292_DisableStartPin();
ads1292_StartDataConvCommand();
ads1292_StopDataConvCommand();
delay(50);
ads1292_StopReadDataContinuous(); // SDATAC command
delay(300);
ads1292_RegWrite(ADS1292_REG_CONFIG1, 0x00); //Set sampling rate to 125 SPS
delay(10);
ads1292_RegWrite(ADS1292_REG_CONFIG2, 0b10100000); //Lead-off comp off, test signal disabled
delay(10);
ads1292_RegWrite(ADS1292_REG_LOFF, 0b00010000); //Lead-off defaults
delay(10);
ads1292_RegWrite(ADS1292_REG_CH1SET, 0b01000000); //Ch 1 enabled, gain 6, connected to electrode in
delay(10);
ads1292_RegWrite(ADS1292_REG_CH2SET, 0b01100000); //Ch 2 enabled, gain 6, connected to electrode in
delay(10);
ads1292_RegWrite(ADS1292_REG_RLDSENS, 0b00101100); //RLD settings: fmod/16, RLD enabled, RLD inputs from Ch2 only
delay(10);
ads1292_RegWrite(ADS1292_REG_LOFFSENS, 0x00); //LOFF settings: all disabled
delay(10);
ads1292_RegWrite(ADS1292_REG_LOFFSTAT, 0x00); //Skip register 8, LOFF Settings default
delay(10);
ads1292_RegWrite(ADS1292_REG_RESP1, 0b11110010); //Respiration: MOD/DEMOD turned only, phase 0
delay(10);
ads1292_RegWrite(ADS1292_REG_RESP2, 0b00000011); //Respiration: Calib OFF, respiration freq defaults
delay(10);
ads1292_StartReadDataContinuous();
delay(10);
ads1292_EnableStartPin();
NRF_LOG_INFO("- ads1292 initialised");NRF_LOG_FLUSH();
NRF_LOG_INFO("==============================");NRF_LOG_FLUSH();
and by using above code i am getting below raw data (9 bytes)...
<info> app: =========== ADS1292 DATA ========== <info> app: 43 30 20 30 20 30 20 36|C0 0 0 6 <info> app: 20 41 35 20 43 38 20 46| A5 C8 F <info> app: 41 20 36 46 20 31 20 |A 6F 1 <info> app: =================================== <info> app: Heart rate : 0 BPM <info> app: =========== ADS1292 DATA ========== <info> app: 43 30 20 30 20 30 20 37|C0 0 0 7 <info> app: 20 39 46 20 42 43 20 46| 9F BC F <info> app: 38 20 44 43 20 34 33 20|8 DC 43 <info> app: =================================== <info> app: Heart rate : 0 BPM <info> app: =========== ADS1292 DATA ========== <info> app: 43 30 20 30 20 30 20 37|C0 0 0 7 <info> app: 20 43 41 20 36 46 20 46| CA 6F F <info> app: 38 20 46 39 20 34 39 20|8 F9 49 <info> app: =================================== <info> app: Heart rate : 0 BPM <info> app: =========== ADS1292 DATA ========== <info> app: 43 30 20 30 20 30 20 36|C0 0 0 6 <info> app: 20 44 37 20 32 31 20 46| D7 21 F <info> app: 41 20 34 44 20 30 20 |A 4D 0 <info> app: ===================================
Now i want to decode RR and Heart Rate data from those 9 bytes. So how can i do that ?
Is there any specific algorithm or any specific conversion to be applied on those 9 bytes ? Please suggest me the valid solution.
Thanks
