Hi o_o I used my delay function to toggle a GPO & measure with a scope. My delay function was incorrect. I corrected the delay function and confirmed the GPO toggle. Tested the MAG output data again and I am getting this result: 1 measurements with sensible data, then no change. What is interesting is that the ACC data is still responding as expected. It seems that the issue is isolated to the BMM150 part of the BMX160 sensor only. I wanted to check if there was some hidden info in the BMM150's register data to give a clue as to what if happening. I read & print the BMM150 registers before every ACC & MAG data is read. What I saw does not make sense to me. It appears that on the first read of MAG data no longer gives valid data. Here are some of my observations from the BMM150 register printouts: Power Control Bit turns on & off between some reads Self Test turns on & off between some reads Opmode settings fluctuate between some reads (NORMAL & SLEEP modes). FORCED mode, is never detected, eventhough it is setup as such REPXY changes between some reads REPZ changes between some reads Just to check I am not misunderstanding, can the BMM150 registers be read at any time? Just to ensure there isn't something weird with my setup, here is the I2C trace of my latest test setup BMX160 init:
IC2_R: add:68 reg:00 len:01 data: d8
IC2_W: add:68 reg:7e data:b6
bmi160_init:0
IC2_R: add:68 reg:00 len:01 data: d8
chipID:d8
IC2_W: add:68 reg:7e data:19
IC2_R: add:68 reg:6b len:01 data: 00
IC2_W: add:68 reg:6b data:20
IC2_R: add:68 reg:4c len:01 data: 80
IC2_W: add:68 reg:4b data:20
IC2_W: add:68 reg:4c data:83
bmi160_aux_init:0
IC2_W: add:68 reg:4d data:4b
IC2_R: add:68 reg:04 len:08 data: 01 06 3f 07 00 00 07 1a
IC2_W: add:68 reg:4f data:01
IC2_W: add:68 reg:4e data:4b
IC2_W: add:68 reg:4d data:40
IC2_R: add:68 reg:04 len:08 data: 32 05 11 01 79 00 db ff
IC2_W: add:68 reg:4d data:5d
IC2_R: add:68 reg:04 len:08 data: 00 00 00 50 84 00 00 1e
IC2_W: add:68 reg:4d data:62
IC2_R: add:68 reg:04 len:08 data: 00 00 1e 1e 03 00 f2 02
IC2_W: add:68 reg:4d data:68
IC2_R: add:68 reg:04 len:08 data: f2 02 58 56 cd 1a 00 00
IC2_W: add:68 reg:4d data:70
IC2_R: add:68 reg:04 len:08 data: fd 1d ff ff ff ff ff ff
bmm150_init:0
IC2_W: add:68 reg:4d data:40
IC2_R: add:68 reg:04 len:08 data: 32 05 11 01 79 00 db ff
BmmID:32
IC2_R: add:68 reg:40 len:02 data: 28 03
IC2_W: add:68 reg:40 data:27
IC2_W: add:68 reg:41 data:05
IC2_R: add:68 reg:42 len:02 data: 28 00
IC2_W: add:68 reg:42 data:27
IC2_W: add:68 reg:43 data:04
IC2_R: add:68 reg:40 len:01 data: 27
IC2_W: add:68 reg:7e data:11
IC2_R: add:68 reg:02 len:01 data: 80
bmi160_set_sens_conf:0
IC2_W: add:68 reg:4d data:4c
IC2_R: add:68 reg:04 len:08 data: 06 3f 07 00 00 07 1a ff
IC2_W: add:68 reg:4f data:06
IC2_W: add:68 reg:4e data:4c
IC2_W: add:68 reg:4f data:07
IC2_W: add:68 reg:4e data:51
IC2_W: add:68 reg:4f data:1a
IC2_W: add:68 reg:4e data:52
bmm150_set_presetmode:0
IC2_W: add:68 reg:4d data:4c
IC2_R: add:68 reg:04 len:08 data: 06 3f 07 00 00 07 1a ff
IC2_W: add:68 reg:4f data:02
IC2_W: add:68 reg:4e data:4c
bmm150_set_op_mode:0
IC2_W: add:68 reg:4d data:42
IC2_R: add:68 reg:44 len:01 data: 0b
IC2_W: add:68 reg:44 data:07
IC2_R: add:68 reg:4c len:01 data: 83
IC2_W: add:68 reg:4b data:20
IC2_W: add:68 reg:4c data:03
bmi160_config_aux_mode:0 Here are the consequcitve BMM150 register reads ( followed by ACC & MAG data read) Read #1(Power Control Bit=1, Self Test=1, Opmode=Normal): BmmReg:
IC2_W: add:68 reg:4d data:4a
IC2_R: add:68 reg:04 len:08 data: 00 01 06 3f 07 00 00 07
4a: 00
IC2_W: add:68 reg:4d data:4b
IC2_R: add:68 reg:04 len:08 data: 01 06 3f 07 00 00 07 1a
4b: 01
IC2_W: add:68 reg:4d data:4c
IC2_R: add:68 reg:04 len:08 data: 01 06 3f 07 00 00 07 1a
4c: 01
IC2_W: add:68 reg:4d data:4d
IC2_R: add:68 reg:04 len:08 data: 3f 07 00 00 07 1a ff 00
4d: 3f
IC2_W: add:68 reg:4d data:4e
IC2_R: add:68 reg:04 len:08 data: 3f 07 00 00 07 1a ff 00
4e: 3f
IC2_W: add:68 reg:4d data:4f
IC2_R: add:68 reg:04 len:08 data: 00 00 07 1a ff 00 1f b4
4f: 00
IC2_W: add:68 reg:4d data:50
IC2_R: add:68 reg:04 len:08 data: 00 07 1a ff 00 1f b4 43
50: 00
IC2_W: add:68 reg:4d data:51
IC2_R: add:68 reg:04 len:08 data: 00 07 1a ff 00 1f b4 43
51: 00
IC2_W: add:68 reg:4d data:52
IC2_R: add:68 reg:04 len:08 data: 1a ff 00 1f b4 43 00 98
52: 1a
IC2_R: add:68 reg:12 len:06 data: 0f 1c 71 0f 00 fe
IC2_R: add:68 reg:04 len:08 data: 1a ff 00 1f b4 43 00 98
aX=-0.06,aY=0.48,aZ=-0.88 mX=-10.000000,mY=355.000000,mZ=2047.000000 Read #2(Power Control Bit=0, Self Test=0, Opmode=Sleep): BmmReg:
IC2_W: add:68 reg:4d data:4a
IC2_R: add:68 reg:04 len:08 data: 00 01 06 3f 07 00 00 07
4a: 00
IC2_W: add:68 reg:4d data:4b
IC2_R: add:68 reg:04 len:08 data: 00 01 06 3f 07 00 00 07
4b: 00
IC2_W: add:68 reg:4d data:4c
IC2_R: add:68 reg:04 len:08 data: 06 3f 07 00 00 07 1a ff
4c: 06
IC2_W: add:68 reg:4d data:4d
IC2_R: add:68 reg:04 len:08 data: 3f 07 00 00 07 1a ff 00
4d: 3f
IC2_W: add:68 reg:4d data:4e
IC2_R: add:68 reg:04 len:08 data: 3f 07 00 00 07 1a ff 00
4e: 3f
IC2_W: add:68 reg:4d data:4f
IC2_R: add:68 reg:04 len:08 data: 00 00 07 1a ff 00 1f b4
4f: 00
IC2_W: add:68 reg:4d data:50
IC2_R: add:68 reg:04 len:08 data: 00 00 07 1a ff 00 1f b4
50: 00
IC2_W: add:68 reg:4d data:51
IC2_R: add:68 reg:04 len:08 data: 07 1a ff 00 1f b4 43 00
51: 07
IC2_W: add:68 reg:4d data:52
IC2_R: add:68 reg:04 len:08 data: 1a ff 00 1f b4 43 00 98
52: 1a
IC2_R: add:68 reg:12 len:06 data: 1b 1c 81 0f 03 fe
IC2_R: add:68 reg:04 len:08 data: 1a ff 00 1f b4 43 00 98
aX=-0.06,aY=0.48,aZ=-0.88 mX=-10.000000,mY=355.000000,mZ=2047.000000 Read #3(Power Control Bit=0, Self Test=0, Opmode=Normal): BmmReg:
IC2_W: add:68 reg:4d data:4a
IC2_R: add:68 reg:04 len:08 data: 00 01 06 3f 07 00 00 07
4a: 00
IC2_W: add:68 reg:4d data:4b
IC2_R: add:68 reg:04 len:08 data: 00 01 06 3f 07 00 00 07
4b: 00
IC2_W: add:68 reg:4d data:4c
IC2_R: add:68 reg:04 len:08 data: 06 3f 07 00 00 07 1a ff
4c: 06
IC2_W: add:68 reg:4d data:4d
IC2_R: add:68 reg:04 len:08 data: 06 3f 07 00 00 07 1a ff
4d: 06
IC2_W: add:68 reg:4d data:4e
IC2_R: add:68 reg:04 len:08 data: 07 00 00 07 1a ff 00 1f
4e: 07
IC2_W: add:68 reg:4d data:4f
IC2_R: add:68 reg:04 len:08 data: 00 00 07 1a ff 00 1f b4
4f: 00
IC2_W: add:68 reg:4d data:50
IC2_R: add:68 reg:04 len:08 data: 00 00 07 1a ff 00 1f b4
50: 00
IC2_W: add:68 reg:4d data:51
IC2_R: add:68 reg:04 len:08 data: 07 1a ff 00 1f b4 43 00
51: 07
IC2_W: add:68 reg:4d data:52
IC2_R: add:68 reg:04 len:08 data: 1a ff 00 1f b4 43 00 98
52: 1a
IC2_R: add:68 reg:12 len:06 data: 17 1c 7d 0f 0b fe
IC2_R: add:68 reg:04 len:08 data: 1a ff 00 1f b4 43 00 98
aX=-0.06,aY=0.48,aZ=-0.88 mX=-10.000000,mY=355.000000,mZ=2047.000000 I have attached a text file (BMM150_Register_Traces.h) that contains the Setup & BMM150 register traces of multiple consecutive reads. Each read is done at approx. 1second intervals (no intermediate reads eventhough output rate is set to 50Hz). I ran the test code on 2 different PCB's to eliminate the posibility of a hardware fault. Both boards give the same type of result (BMM150 registers changing between reads). Is there a posibility of a hardware failure on both boards? Is there other information I can provide that will give more insight?
... View more