FXOS8700 stops updating value after a while

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FXOS8700 stops updating value after a while

3,009 Views
rens1
Contributor I

hello everyone,

Currently i'm working with the BRKT-STBC-AGM01  BREAKOUT BOARD. Where i'm communicating with a FXOS8700cq chip through I2C with my Atxmega microcontroller.

I have set up the IC to getting only magnetic values on 200Hz samples rate.

But after a while i don't new data from the chip anymore. I thought that it might have been the sleep mode. But i disabled that one. As far as i know. Is there something else that i overlooked?

Hereby my setup code :

        TWI_Write(FXOS8700CQ_SLAVE_ADDR,FXOS_CTRL_REG1,0x00);

        TWI_Write(FXOS8700CQ_SLAVE_ADDR,FXOS_CTRL_REG2,0x09);

        //TWI_Write(FXOS8700CQ_SLAVE_ADDR,FXOS_XYZ_DATA_CFG,0x00);

        TWI_Write(FXOS8700CQ_SLAVE_ADDR,FXOS_M_CTRL_REG1,0x05);

        TWI_Write(FXOS8700CQ_SLAVE_ADDR,FXOS_M_CTRL_REG2,0x49);

        TWI_Write(FXOS8700CQ_SLAVE_ADDR,FXOS_M_CTRL_REG3,0xA0);

        TWI_Write(FXOS8700CQ_SLAVE_ADDR,FXOS_CTRL_REG1,0x15);

Did i forget something with the initialisation?

Thanks in advance,

Labels (1)
0 Kudos
3 Replies

2,080 Views
david_diaz
NXP Employee
NXP Employee

Hello Rens,

Please be aware about the M_CTRL_REG2. You do not need to set the auto-increment mode due to you are using the magnetometer mode only.

You may use the following configuration in order to initialize the FXOS8700QC:

     I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG2, 0x40);          // Reset all registers to POR values, Standby mode

       Delay();        // ~1ms delay

     I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, XYZ_DATA_CFG_REG, 0x00);   // +/-2g range with 0.244mg/LSB  

       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, M_CTRL_REG1, 0x1D);        // Magnetometer mode, max OSR

     I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG2, 0x02);          // High Resolution mode

     I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG1, 0x15);          // ODR = 200Hz, Reduced noise, Active mode  

Please let me know if this configuration helps.

In case it is useful for you, you may refer to the FX0S87OOCQ - Bare metal example project.

https://community.freescale.com/docs/DOC-101073

I hope this information will be useful for you.

If I misunderstood your question or you still have concerns, feel free to let me know.  I will be glad to help.

Have a great day.

David Diaz.

Note: If this post answers your question, please click the Correct Answer button. Thank you!

0 Kudos

2,080 Views
rens1
Contributor I

thank for the reply,

Have been away for a bit. That's why i couldn't reply earlier. But it seems with the setting you send to me. The same problems occurs. After a while it just stops giving new data. And only gives Zero's back from the registers. Could it be i'm missing something or is the chip maybe broken ?

Greetings,

Rens

0 Kudos

2,080 Views
rens1
Contributor I

I just found out that the magnetometer goes in to standby mode at a random moment.

With every sample i take i read that Sysmod register to see if the chip is still active. And there it stated that it had gone into standby mode.

Is there something that i forgot that could cause the chip to go into standby more or could it really be broken? I do have the reset line set to ground.

Greetings,

Rens

0 Kudos
%3CLINGO-SUB%20id%3D%22lingo-sub-512080%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EFXOS8700%20stops%20updating%20value%20after%20a%20while%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-512080%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ehello%20everyone%2C%3C%2FP%3E%3CP%3ECurrently%20i'm%20working%20with%20the%20%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3EBRKT-STBC-AGM01%26nbsp%3B%20BREAKOUT%20BOARD.%20Where%20i'm%20communicating%20with%20a%20FXOS8700cq%20chip%20through%20I2C%20with%20my%20Atxmega%20microcontroller.%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EI%20have%20set%20up%20the%20IC%20to%20getting%20only%20magnetic%20values%20on%20200Hz%20samples%20rate.%3C%2FP%3E%3CP%3EBut%20after%20a%20while%20i%20don't%20new%20data%20from%20the%20chip%20anymore.%20I%20thought%20that%20it%20might%20have%20been%20the%20sleep%20mode.%20But%20i%20disabled%20that%20one.%20As%20far%20as%20i%20know.%20Is%20there%20something%20else%20that%20i%20overlooked%3F%3C%2FP%3E%3CP%3EHereby%20my%20setup%20code%20%3A%3C%2FP%3E%3CPRE%20__default_attr%3D%22c%2B%2B%22%20__jive_macro_name%3D%22code%22%20class%3D%22jive_macro_code%20_jivemacro_uid_14574364661078964%20jive_text_macro%22%20data-renderedposition%3D%22212_50_798_112%22%20jivemacro_uid%3D%22_14574364661078964%22%20modifiedtitle%3D%22true%22%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20TWI_Write(FXOS8700CQ_SLAVE_ADDR%2CFXOS_CTRL_REG1%2C0x00)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20TWI_Write(FXOS8700CQ_SLAVE_ADDR%2CFXOS_CTRL_REG2%2C0x09)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F%2FTWI_Write(FXOS8700CQ_SLAVE_ADDR%2CFXOS_XYZ_DATA_CFG%2C0x00)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20TWI_Write(FXOS8700CQ_SLAVE_ADDR%2CFXOS_M_CTRL_REG1%2C0x05)%3B%20%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20TWI_Write(FXOS8700CQ_SLAVE_ADDR%2CFXOS_M_CTRL_REG2%2C0x49)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20TWI_Write(FXOS8700CQ_SLAVE_ADDR%2CFXOS_M_CTRL_REG3%2C0xA0)%3B%20%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20TWI_Write(FXOS8700CQ_SLAVE_ADDR%2CFXOS_CTRL_REG1%2C0x15)%3B%3C%2FP%3E%3C%2FPRE%3E%3CP%3E%3C%2FP%3E%3CP%3EDid%20i%20forget%20something%20with%20the%20initialisation%3F%3C%2FP%3E%3CP%3EThanks%20in%20advance%2C%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-512080%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EMagnetic%20Sensors%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-512083%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20FXOS8700%20stops%20updating%20value%20after%20a%20while%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-512083%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20just%20found%20out%20that%20the%20magnetometer%20goes%20in%20to%20standby%20mode%20at%20a%20random%20moment.%20%3C%2FP%3E%3CP%3EWith%20every%20sample%20i%20take%20i%20read%20that%20Sysmod%20register%20to%20see%20if%20the%20chip%20is%20still%20active.%20And%20there%20it%20stated%20that%20it%20had%20gone%20into%20standby%20mode.%3C%2FP%3E%3CP%3EIs%20there%20something%20that%20i%20forgot%20that%20could%20cause%20the%20chip%20to%20go%20into%20standby%20more%20or%20could%20it%20really%20be%20broken%3F%20I%20do%20have%20the%20reset%20line%20set%20to%20ground.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EGreetings%2C%3C%2FP%3E%3CP%3ERens%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-512082%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20FXOS8700%20stops%20updating%20value%20after%20a%20while%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-512082%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ethank%20for%20the%20reply%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EHave%20been%20away%20for%20a%20bit.%20That's%20why%20i%20couldn't%20reply%20earlier.%20But%20it%20seems%20with%20the%20setting%20you%20send%20to%20me.%20The%20same%20problems%20%3CSPAN%20lang%3D%22en%22%3Eoccurs.%20After%20a%20while%20it%20just%20stops%20giving%20new%20data.%20And%20only%20gives%20Zero's%20back%20from%20the%20registers.%20Could%20it%20be%20i'm%20missing%20something%20or%20is%20the%20chip%20maybe%20broken%20%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20lang%3D%22en%22%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20lang%3D%22en%22%3EGreetings%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20lang%3D%22en%22%3ERens%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-512081%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20FXOS8700%20stops%20updating%20value%20after%20a%20while%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-512081%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20Rens%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EPlease%20be%20aware%20about%20the%20M_CTRL_REG2.%20You%20do%20not%20need%20to%20set%20the%20auto-increment%20mode%20due%20to%20you%20are%20using%20the%20magnetometer%20mode%20only.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EYou%20may%20use%20the%20following%20configuration%20in%20order%20to%20initialize%20the%20FXOS8700QC%3A%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%208.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS%2C%20CTRL_REG2%2C%200x40)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%208.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Reset%20all%20registers%20to%20POR%20values%2C%20Standby%20mode%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22font-size%3A%208.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3EDelay()%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%208.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20~1ms%20delay%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%208.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS%2C%20XYZ_DATA_CFG_REG%2C%200x00)%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%208.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20%2B%2F-2g%20range%20with%200.244mg%2FLSB%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22font-size%3A%208.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3EI2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS%2C%20M_CTRL_REG1%2C%200x1D)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%208.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Magnetometer%20mode%2C%20max%20OSR%3C%2FSPAN%3E%20%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%208.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS%2C%20CTRL_REG2%2C%200x02)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%208.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20High%20Resolution%20mode%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%208.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS%2C%20CTRL_REG1%2C%200x15)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%208.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20ODR%20%3D%20200Hz%2C%20Reduced%20noise%2C%20Active%20mode%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EPlease%20let%20me%20know%20if%20this%20configuration%20helps.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EIn%20case%20it%20is%20useful%20for%20you%2C%20you%20may%20refer%20to%20the%20FX0S87OOCQ%20-%20Bare%20metal%20example%20project.%3C%2FP%3E%3CP%3E%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-101073%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.freescale.com%2Fdocs%2FDOC-101073%3C%2FA%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EI%20hope%20this%20information%20will%20be%20useful%20for%20you.%3C%2FP%3E%3CP%3EIf%20I%20misunderstood%20your%20question%20or%20you%20still%20have%20concerns%2C%20feel%20free%20to%20let%20me%20know.%26nbsp%3B%20I%20will%20be%20glad%20to%20help.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EHave%20a%20great%20day.%3C%2FP%3E%3CP%3EDavid%20Diaz.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%209.0pt%3B%22%3ENote%3A%20If%20this%20post%20answers%20your%20question%2C%20please%20click%20the%20Correct%20Answer%20button.%20Thank%20you!%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E