SEN-12916 (HMC6343 breakout) Mag reading issue

Our company recently purchased a second sensor SEN-12916 from SparkFun after the testing of the first SEN-12916 with HMC6343 showed promising results. However, upon powering this 2nd unit we immediately observed that all the magnetic readings (x,y,z) are all not updating. The attached file “Serial_Output” shows the rotation of the sensor(along X then along Y axis) with the magnetic readings close to zero change throughout when running the HMC6343_basics.ino. The headings do not make sense for me, however it does change when I rotate the sensor along the Z axis.

Running the same code at the same location on my 1st working sensor would show magnetic values up to the hundreds, and the values would change accordingly when the sensor is rotated. The heading angle also would change correctly when rotating the sensor along the X and Y axis.

I have also attached the EEPROM readings. As a side note after the observation above I did write 0x02 to OP_MODE2 to increase sampling rate from 5Hz to 10Hz and it did work as intended. And that is the only register I have written to.

For the hardware setup I am using an Arduino Nano Every with the SEN-12916’s 3.3V input connected to the Arduino’s 3.3V. The internal pullups are disabled in twi.c of the Wire library since there are external pullup on the SEN-12916 to the SDA and SCL:

// deactivate internal pullups for twi.

digitalWrite(SDA, 0);

digitalWrite(SCL, 0);

I hope you can review this promptly and get back to me on the next step. Thank you in advance.

Serial_Output.txt (2.76 KB)

EEPROM_Readings.txt (414 Bytes)