2 Replies Latest reply on May 27, 2020 5:31 AM by NIFR_4499596

    MAX30001 Overflow error in reading ECG_FIFO with cyble222014

    NIFR_4499596

      Hi everybody,

      i'm working on a project for reading ECG/BioZ from MAX30001. This sensor comunicates with the microcontroller via SPI. I wrote a code to write/ read command to the sensor and everything works well, i can change the settings of the sensor and it replaies correctly, but when I ask reading ECG_FIFO (register 0x21) i get 0x00003F( the ECG_FIFO is a 32 words x 24 bit each sample is made up of 23-6 bit of voltage information , 5-3 bit of ECG data tag and 2-0 Pace data tag. The tags give the information on received sample, in my case 3F mean that the ECG_FIFO and the PACE_FIFO are in overllow, and this happens when microcontroller doesen't read the ECG_FIFO.)

      I try to reset the ECG_FIFO but it always gives me 0x00003F.

      if anyone has worked with this sensor before, please help me.

      I attached the project, with my code.

        • 1. Re: MAX30001 Overflow error in reading ECG_FIFO with cyble222014
          SudheeshK_26

          Hello,

           

          As per my understanding, you are able to read expected data from all registers of MAX30001 except the register 0x21. Please correct me, if I am wrong. To check if there are any issues with SPI transactions, could you please capture logic analyzer trace for a read operation from register 0x21 and any other register from which you are able to read correct data and attach to this thread?

           

          It is not required to control slave select line separately in your code. SPI block will take care of this. Also, before reading received data make sure that the SPI transaction is complete using the API SPI_SpiUartGetRxBufferSize().

          Example:

              SPI_SpiUartWriteTxData(SPI_TX_Buff);

              SPI_SpiUartWriteTxData(per_leggere);

              SPI_SpiUartWriteTxData(per_leggere);

              SPI_SpiUartWriteTxData(per_leggere);

             

              while(SPI_SpiUartGetRxBufferSize() != 4); //4 bytes are sent to slave. wait until 4 bytes are received from slave

           

              SPI_temp_32b[0] = SPI_SpiUartReadRxData();

              SPI_temp_32b[1] = SPI_SpiUartReadRxData();

              SPI_temp_32b[2] = SPI_SpiUartReadRxData();

              SPI_temp_32b[3] = SPI_SpiUartReadRxData();

           

          Thanks and Regards,

          Sudheesh

          • 2. Re: MAX30001 Overflow error in reading ECG_FIFO with cyble222014
            NIFR_4499596

            Hello Sudheesh,

            I think I partially solve my problem in reading, I made a mistake in a write register, so the reading was compromised.

            Now I get some correct data and then the FIFO goes overflow, so I have to reset and re-read the data. I think the solution is use interrupt pin. I'll do some tests today or tomorrow, and I'll let you know if I solve.

            Francesco