Hi, any help on my problem would be GREATLY appreciated!
I have adapted the SparkFun Arduino lib for the MAX30101 to the Infineon PSoC 5LP platform. I’d be happy to send my code to anyone, upon request. Of course, it seems broken at the moment!
The I2C bus appears to be wiggling the pins perfectly. Readback of the Chip ID reg is consistently correct (at 0x15), but the other reg values make no sense. Here’s some info on what I’ve seen (below). As an example, reg 0x08 returns 0xF right after power-up and soft reset. It should return 0. And then, even after it should have gotten configured to different values, it still returns 0xF. All of the other regs (except for Chip ID) return 0, except for the FIFO data, which returns 2.
I tried putting a 2.2K ohm in parallel pull-up on SDA line to ensure that it is not getting too close to the rising edge of SCL. No change. The waveforms look perfect to me – my writes are getting ACKed, and my reads are (at least in the case of Chip ID Reg) coming back correctly.
The one oddity is that the INT line is stuck at about 2 V. I guess it’s normal, since the chip works on 1.8 V supply, and it should be pulled-up (and I’m not enabling INTs)?
Here’s the deets:
Return
Value CODE
=== =========================================================================
F result = _i2cPort_read_register_8bits( MAX30105_ADDRESS, 0x08 ); // FIFO config
byte power_level = 0x1F;
byte sample_average = 4;
byte led_mode = 3;
int sample_rate = 200;
int pulse_width = 69;
int adc_range = 16384;
setup(power_level, sample_average, led_mode, sample_rate, pulse_width, adc_range);
0 result = _i2cPort_read_register_8bits( MAX30105_ADDRESS, 0x00 ); // interrupt status 1
0 result = _i2cPort_read_register_8bits( MAX30105_ADDRESS, 0x01 ); // interrupt status 2
0 result = _i2cPort_read_register_8bits( MAX30105_ADDRESS, 0x02 ); // interrupt enable 1
0 result = _i2cPort_read_register_8bits( MAX30105_ADDRESS, 0x03 ); // interrupt enable 2
0 result = _i2cPort_read_register_8bits( MAX30105_ADDRESS, 0x04 ); // FIFO write ptr
0 result = _i2cPort_read_register_8bits( MAX30105_ADDRESS, 0x05 ); // overflow counter
0 result = _i2cPort_read_register_8bits( MAX30105_ADDRESS, 0x06 ); // FIFO read ptr
2 result = _i2cPort_read_register_8bits( MAX30105_ADDRESS, 0x07 ); // FIFO data reg
F result = _i2cPort_read_register_8bits( MAX30105_ADDRESS, 0x08 ); // FIFO config
0 result = _i2cPort_read_register_8bits( MAX30105_ADDRESS, 0x09 ); // Mode config
0 result = _i2cPort_read_register_8bits( MAX30105_ADDRESS, 0x0A ); // Sp02 config
0 result = _i2cPort_read_register_8bits( MAX30105_ADDRESS, 0x0C ); // LED pulse ampl
0 result = _i2cPort_read_register_8bits( MAX30105_ADDRESS, 0x0D ); // LED pulse ampl
0 result = _i2cPort_read_register_8bits( MAX30105_ADDRESS, 0x0E ); // LED pulse ampl
0 result = _i2cPort_read_register_8bits( MAX30105_ADDRESS, 0x0F ); // LED pulse ampl
0 result = _i2cPort_read_register_8bits( MAX30105_ADDRESS, 0x10 ); // Multi-LED mode ctl
0 result = _i2cPort_read_register_8bits( MAX30105_ADDRESS, 0x11 ); // Multi-LED mode ctl
15 result = _i2cPort_read_register_8bits( MAX30105_ADDRESS, 0xFF ); // Chip ID