Hi everyone,
I made a custom PCB with nRF52832, MAX32664, MAX30101 and KX122-1037 to develop a Pulse Oximeter. Both the sensors are connected directly to the sensor hub through SLAVE SCL and SDA. While the sensor hub is connected to nRF52832 through SLAVE SCL/SDA. All the four I2C lines have 4.7kohm pull up resistors.
When I program it (through nRF52-DK) in order to obtain as output only algorithm data (meaning 9 bytes: heart rate 2 bytes, heart confidence 1 byte, oxygen saturation 2 bytes, ...) it properly works and I get the output I want.
When I program it to obtain both algorithm and raw data (27 bytes -> 12 bytes for LEDs raw data, 6 bytes accelerometer raw data, 9 bytes of the algorithm): it does not work anymore. It happens also if I change the algorithm mode, switching to an extended one, where it outputs 14 bytes. So it looks like the problem starts when I try to read more than 9 bytes.
My code is structured as follow (coded in Segger Embedded Studio).
- i program the sensor hub to enter application mode and when reading the mode, i read that it is in application mode (get 0x00 as status byte for response (it indicates that the write transaction is succesful))
- i configure the sensor hub (set output mode to algorithm or raw data or both, set sensor hub interrupt treshold to 0x01, enable AGC, enable sensor hub accelerometer, enable optical module, enable algorithm mode (report 1 or report 2, which is the extended one). and i get 0x00 as status byte for response
- i start a timer elapsing every 100ms to read the FIFO register (when reading the FIFO register I use the default delay of 2ms between writing and reading).
The error I get when reading the FIFO is 0xFF which is ERROR UNKNOWN.
PS. I did not update the firmware of the sensor hub, since my code is working when using nRF52832 and SEN15219, which contains MAX32664 with my same firmware version 1.1.1. and also I have trouble trying to update the firmware.