FXOS8700 magnetic interrupt

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

FXOS8700 magnetic interrupt

7,691 Views
diken
Contributor I

I am trying to configure the FXOS8700CQR in magnetic threshold interrupt mode. I am using SPI to communicate witth the sensor.

Whenever a magnet is in the vicinity of the sensor, the programmed magnetic threshold values is supposed to trigger an interrupt.

When the data is streaming I can clearly see the spikes on the signal passing the programmed threshold.

The interrupt pin does not go high however. I checked with a scope.

I don't see the magnetic interrupts happening.The problem is that the magnetic interrupts in the ISR are not triggered.

Even if I trigger them manually by the shaking the unit I cannot clear them. Pin stays always high.

Is there any application note with regard to the magnetic threshold interrupt specifically. (not the vector magnitude)?


void FXOS8700CQ_ConfigMagTHS(void){    
MAG_RST_HIGH();                         // Hard Reset , RST active HIGH   
__delay_ms(5);    
MAG_RST_LOW();                             
__delay_ms(1);                          

FXOS8700CQ_WriteByte(CTRL_REG2, SMOD_LOW_NOISE|SLPE_MASK|MOD_LOW_NOISE);      // Low noise, low power, auto-sleep mode enabled
FXOS8700CQ_WriteByte(CTRL_REG3, IPOL_MASK);                     // Active HIGH on INT, push-pull mode   
 FXOS8700CQ_WriteByte(CTRL_REG4, 0x00 );                         // No interrupt enabled here    
FXOS8700CQ_WriteByte(CTRL_REG5, 0x00 );                         // No interrupt routed to pin 2
FXOS8700CQ_WriteByte(ASLP_COUNT, 0x05);                         // 20 ms -  if not interrupt is asserted in 20 ms the system will go back to sleep mode
FXOS8700CQ_WriteByte(M_CTRL_REG1, M_ACAL_MASK| M_OSR_50_HZ | M_HMS0_MASK);     //  automatic calibration,  one shot magnetic reset, only mag active  
FXOS8700CQ_WriteByte(M_CTRL_REG2, M_MAXMIN_DIS_MASK | M_MAXMIN_DIS_THS_MASK | M_MAXMIN_RST_MASK | RST_DISABLED);        //Magnetic min/max enabled    
FXOS8700CQ_WriteByte(M_CTRL_REG3, M_ASLP_OSR_100_HZ | M_THS_XYZ_MASK | M_ST_Z_MASK | M_ST_XY_MASK);        // all updated when THS ISR happens       

FXOS8700CQ_WriteByte(M_THS_CFG, M_THS_ELE | M_THS_OAE | M_THS_WAKE_EN | M_THS_ZEFE | M_THS_YEFE | M_THS_XEFE| M_THS_WAKE_EN | M_THS_INT_EN );  //M_INT_threshold on INT2 pin  OR INT of all axes for threshold, latch disabled.

uint16_t magThreshold = 0x200;                               //counts;    
uint8_t magThresholdHi = (magThreshold & 0xFF00) >> 8;    
uint8_t magThresholdLo = magThreshold & 0xFF;    
FXOS8700CQ_WriteByte(M_THS_Z_MSB, magThresholdHi);        // Debounce countered cleared to zero when threshold is not longer true    
FXOS8700CQ_WriteByte(M_THS_Z_LSB, magThresholdLo);    
    
magThreshold = 0x200;                               //counts;    
magThresholdHi = (magThreshold & 0xFF00) >> 8;   
magThresholdLo = magThreshold & 0xFF;   
FXOS8700CQ_WriteByte(M_THS_X_MSB, magThresholdHi);        // Debounce countered cleared to zero when threshold is not longer true    
FXOS8700CQ_WriteByte(M_THS_X_LSB, magThresholdLo);    
 
magThreshold = 0x200;                               //counts;    
magThresholdHi = (magThreshold & 0xFF00) >> 8;   
magThresholdLo = magThreshold & 0xFF;   
FXOS8700CQ_WriteByte(M_THS_Y_MSB, magThresholdHi);        // Debounce countered cleared to zero when threshold is not longer true    
FXOS8700CQ_WriteByte(M_THS_Y_LSB, magThresholdLo);    
    
FXOS8700CQ_WriteByte(M_THS_COUNT, 1); //debounce sample counts required before a magnetic threshold event is triggered, depends on ODR 
FXOS8700CQ_WriteByte(CTRL_REG1, ASLP_RATE_20MS | DATA_RATE_100HZ |LNOISE_MASK );     // in sleep mode data rate 50Hz, awake ODR = 100Hz, low noise mode, in standby
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

The code above is executed between:

FXOS8700CQ_StandbyMode();
...

FXOS8700CQ_ActiveMode();

On the interrupt I try to clear the interrupt and in the main () function I try to print the source but I don't see anything at all.

void  _INTInterrupt(void){    
MagTHSEvent = 1;   
magintsrc = FXOS8700CQ_ReadByte(M_INT_SRC);            
 //Read interrupt source to clear int    
srcmag = FXOS8700CQ_ReadByte(M_THS_SRC);   
magintsrc = FXOS8700CQ_ReadByte(M_INT_SRC);            
 //Read interrupt source to clear int

    ..... //Clear the INT interrupt flag 
}
Labels (1)
0 Kudos
8 Replies

6,710 Views
chipmc
Contributor I

@diken or @TomasVaverka 

I am looking to do a similar thing - count cars and I have some FXOS8700OS devices on-hand.  Is there an example of using the hardware interrupt for magnetic threshold detection I could use as a staring point?  

 

Thanks, Chip

0 Kudos

5,925 Views
alexmv24
Contributor I

Hello, were you able to carry out your project, I have a similar project, could you help me?

0 Kudos

7,105 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi,

I will try to reproduce your settings and get back to you soon. At first glance everything seems to be correct. Can you please try to test the magnetometer threshold function without using the sleep mode?

Best regards,

Tomas

0 Kudos

7,105 Views
diken
Contributor I

Hi Tomas,

I already tried disabling the sleep mode with the same results.

The sleep mode functionality is needed however since this is  a long term solution where you can't easily replace the batteries.

I also tried changing the threshold on z axis. Still the same issue.

When a magnetic object (ex headphone) is in the vicinity all 3 axis are above 100 counts.

As it stands right now the magnetometer streams data correctly however the interrupt functionality is not responsive and does not change as per spec even if taking into account the debouncing counter (M_THS_COUNT)

Regards,

Di

0 Kudos

7,105 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Di,

I have just done a simple test using the following settings (without the sleep mode) and it works well as you can see on the picture below.

void FXOS8700CQ_Init (void)
{
       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, M_THS_X_MSB_REG, 0x00); // Threshold value MSB  
       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, M_THS_X_LSB_REG, 0x80); // Threshold value LSB  
       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, M_THS_CFG_REG, 0xCB); // Event flag latch enabled, logic OR of enabled axes, only X-axis enabled, threshold interrupt enabled and routed to INT1 
       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, M_THS_COUNT_REG, 0x0A); // 100ms at 100Hz ODR and magnetometer mode only 
       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, M_CTRL_REG1, 0x1D); // Max OSR, only magnetometer is active 
       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG3, 0x00); // Push-pull, active low interrupt 
       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG1, 0x19); // ODR = 100Hz, Active mode       
}
void PORTD_IRQHandler()
{
       PORTD_PCR4 |= PORT_PCR_ISF_MASK; // Clear the interrupt flag 
       M_Ths_Source = I2C_ReadRegister(FXOS8700CQ_I2C_ADDRESS, M_THS_SRC_REG); // Read the M_THS_SRC register to clear the SRC_M_THS flag in the M_INT_SRC register and deassert the INT1 pin
}

Mag threshold.JPG

Can you please try to reproduce it?

Meanwhile I will try to implement the sleep mode.

Best regards,

Tomas

0 Kudos

7,105 Views
diken
Contributor I

Hi Tomas,

I implemented thefirst snippet without the asleep configuration and indeed it works.

The issue is with the 

M_THS_COUNT_REG

which determines the debouncing interval. Specifically the interrupt triggers very late with regards to the project requirements. Initially this was set to 1.

Would this sensor work, assuming you have to track very fast moving object such as cars. (transient magnetic fields)?

The datasheet suggests the minimum time is 20ms but from experimental results the delay is much larger than that.

Best,

Di

0 Kudos

7,105 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Di,

The time step used by the debounce counter depends on the chosen ODR and m_hms[1:0] bits.

pastedImage_17.png

So the only way to reduce the time step is to increase the ODR and eventually use only the magnetometer (m_hms[1:0] = 0b01).

Best regards,

Tomas

0 Kudos

7,105 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Di,

I successfully implemented the sleep mode, here is my code:

void FXOS8700CQ_Init (void)
{      
       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, M_THS_X_MSB_REG, 0x00); // Threshold value MSB  
       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, M_THS_X_LSB_REG, 0x80); // Threshold value LSB  
       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, M_THS_CFG_REG, 0xCF); // Event flag latch enabled, logic OR of enabled axes, only X-axis enabled, wake on magnetic threshold event, threshold interrupt enabled and routed to INT1 
       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, M_THS_COUNT_REG, 0x0A); // 100ms at 100Hz ODR and magnetometer mode only 
       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, M_CTRL_REG1, 0x1D); // Max OSR, only magnetometer is active 
       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG3, 0x00); // Push-pull, active low interrupt 
       
       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG2, 0x04); // Auto-sleep mode enabled       
       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, ASLP_COUNT_REG, 0x06);  // Auto-sleep counter set to 1.92s (6 x 0.32s = 1.92s) 
       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG4, 0x80); // Auto-sleep/wake interrupt enabled
       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG5, 0x80); // Route auto-sleep/wake interrupt to INT1
       
       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG1, 0x19); // ODR = 100Hz, Active mode
} 
      

void PORTD_IRQHandler()
{
       PORTD_PCR4 |= PORT_PCR_ISF_MASK; // Clear the interrupt flag 
       Int_Flag = 1; 
}

while(1)
{
    if (Int_Flag)
    {
        Int_Flag = 0;
                    
        Int_Source = I2C_ReadRegister(FXOS8700CQ_I2C_ADDRESS, M_INT_SRC_REG);
        if (Int_Source & 0x04)  // Magnetic threshold event detected?
        {
            M_Ths_Src = I2C_ReadRegister(FXOS8700CQ_I2C_ADDRESS, M_THS_SRC_REG); // Read the M_THS_SRC register to clear the SRC_M_THS flag in the M_INT_SRC register and deassert the INT1 pin
            Event_Counter++;
        }
                    
        Int_Source = I2C_ReadRegister(FXOS8700CQ_I2C_ADDRESS, INT_SOURCE_REG);
        if (Int_Source & 0x80)  // Auto-sleep/wake interrupt?
        {
            Sysmod = I2C_ReadRegister(FXOS8700CQ_I2C_ADDRESS, SYSMOD_REG);
        }                   
     }
}

I hope it will help you.

Best regards,

Tomas

0 Kudos
%3CLINGO-SUB%20id%3D%22lingo-sub-705818%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EFXOS8700%20magnetic%20interrupt%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-705818%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20am%20trying%20to%20configure%20the%20FXOS8700CQR%20in%20magnetic%20threshold%20interrupt%20mode.%20I%20am%20using%20SPI%20to%20communicate%20witth%20the%20sensor.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EWhenever%20a%20magnet%20is%20in%20the%20vicinity%20of%20the%20sensor%2C%20the%20programmed%20magnetic%20threshold%20values%20is%20supposed%20to%20trigger%20an%20interrupt.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EWhen%20the%20data%20is%20streaming%20I%20can%20clearly%20see%20the%20spikes%20on%20the%20signal%20passing%20the%20programmed%20threshold.%3C%2FP%3E%3CP%3EThe%20interrupt%20pin%20does%20not%20go%20high%20however.%20I%20checked%20with%20a%20scope.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EI%20don't%20see%20the%20magnetic%20interrupts%20happening.The%20problem%20is%20that%20the%20magnetic%20interrupts%20in%20the%20ISR%20are%20not%20triggered.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EEven%20if%20I%20trigger%20them%20manually%20by%20the%20shaking%20the%20unit%20I%20cannot%20clear%20them.%20Pin%20stays%20always%20high.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EIs%20there%20any%20application%20note%20with%20regard%20to%20the%20magnetic%20threshold%20interrupt%20specifically.%20(not%20the%20vector%20magnitude)%3F%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CPRE%20class%3D%22language-c%20line-numbers%22%3E%3CCODE%3E%0A%3CSPAN%20class%3D%22keyword%20token%22%3Evoid%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_ConfigMagTHS%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22keyword%20token%22%3Evoid%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%7B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0A%3CSPAN%20class%3D%22token%20function%22%3EMAG_RST_HIGH%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Hard%20Reset%20%2C%20RST%20active%20HIGH%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22token%20function%22%3E__delay_ms%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22number%20token%22%3E5%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0A%3CSPAN%20class%3D%22token%20function%22%3EMAG_RST_LOW%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0A%3CSPAN%20class%3D%22token%20function%22%3E__delay_ms%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22number%20token%22%3E1%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0A%0A%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_WriteByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3ECTRL_REG2%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20SMOD_LOW_NOISE%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3ESLPE_MASK%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3EMOD_LOW_NOISE%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Low%20noise%2C%20low%20power%2C%20auto-sleep%20mode%20enabled%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_WriteByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3ECTRL_REG3%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20IPOL_MASK%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Active%20HIGH%20on%20INT%2C%20push-pull%20mode%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%0A%20%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_WriteByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3ECTRL_REG4%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x00%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20No%20interrupt%20enabled%20here%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_WriteByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3ECTRL_REG5%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x00%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20No%20interrupt%20routed%20to%20pin%202%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_WriteByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EASLP_COUNT%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x05%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%2020%20ms%20-%26nbsp%3B%20if%20not%20interrupt%20is%20asserted%20in%2020%20ms%20the%20system%20will%20go%20back%20to%20sleep%20mode%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_WriteByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EM_CTRL_REG1%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20M_ACAL_MASK%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3E%20M_OSR_50_HZ%20%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3E%20M_HMS0_MASK%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%26nbsp%3B%20automatic%20calibration%2C%26nbsp%3B%20one%20shot%20magnetic%20reset%2C%20only%20mag%20active%26nbsp%3B%20%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_WriteByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EM_CTRL_REG2%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20M_MAXMIN_DIS_MASK%20%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3E%20M_MAXMIN_DIS_THS_MASK%20%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3E%20M_MAXMIN_RST_MASK%20%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3E%20RST_DISABLED%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2FMagnetic%20min%2Fmax%20enabled%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_WriteByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EM_CTRL_REG3%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20M_ASLP_OSR_100_HZ%20%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3E%20M_THS_XYZ_MASK%20%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3E%20M_ST_Z_MASK%20%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3E%20M_ST_XY_MASK%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20all%20updated%20when%20THS%20ISR%20happens%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%0A%0A%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_WriteByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EM_THS_CFG%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20M_THS_ELE%20%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3E%20M_THS_OAE%20%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3E%20M_THS_WAKE_EN%20%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3E%20M_THS_ZEFE%20%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3E%20M_THS_YEFE%20%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3E%20M_THS_XEFE%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3E%20M_THS_WAKE_EN%20%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3E%20M_THS_INT_EN%20%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2FM_INT_threshold%20on%20INT2%20pin%26nbsp%3B%20OR%20INT%20of%20all%20axes%20for%20threshold%2C%20latch%20disabled.%3C%2FSPAN%3E%0A%0Auint16_t%20magThreshold%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x200%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2Fcounts%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%0Auint8_t%20magThresholdHi%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EmagThreshold%20%3CSPAN%20class%3D%22operator%20token%22%3E%26amp%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0xFF00%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22operator%20token%22%3E%26gt%3B%26gt%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E8%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0Auint8_t%20magThresholdLo%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20magThreshold%20%3CSPAN%20class%3D%22operator%20token%22%3E%26amp%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0xFF%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0A%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_WriteByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EM_THS_Z_MSB%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20magThresholdHi%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Debounce%20countered%20cleared%20to%20zero%20when%20threshold%20is%20not%20longer%20true%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_WriteByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EM_THS_Z_LSB%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20magThresholdLo%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0AmagThreshold%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x200%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2Fcounts%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%0AmagThresholdHi%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EmagThreshold%20%3CSPAN%20class%3D%22operator%20token%22%3E%26amp%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0xFF00%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22operator%20token%22%3E%26gt%3B%26gt%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E8%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%20%0AmagThresholdLo%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20magThreshold%20%3CSPAN%20class%3D%22operator%20token%22%3E%26amp%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0xFF%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%20%0A%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_WriteByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EM_THS_X_MSB%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20magThresholdHi%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Debounce%20countered%20cleared%20to%20zero%20when%20threshold%20is%20not%20longer%20true%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_WriteByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EM_THS_X_LSB%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20magThresholdLo%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0A%20%0AmagThreshold%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x200%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2Fcounts%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%0AmagThresholdHi%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EmagThreshold%20%3CSPAN%20class%3D%22operator%20token%22%3E%26amp%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0xFF00%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22operator%20token%22%3E%26gt%3B%26gt%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E8%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%20%0AmagThresholdLo%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20magThreshold%20%3CSPAN%20class%3D%22operator%20token%22%3E%26amp%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0xFF%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%20%0A%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_WriteByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EM_THS_Y_MSB%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20magThresholdHi%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Debounce%20countered%20cleared%20to%20zero%20when%20threshold%20is%20not%20longer%20true%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_WriteByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EM_THS_Y_LSB%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20magThresholdLo%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0A%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_WriteByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EM_THS_COUNT%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E1%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2Fdebounce%20sample%20counts%20required%20before%20a%20magnetic%20threshold%20event%20is%20triggered%2C%20depends%20on%20ODR%20%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_WriteByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3ECTRL_REG1%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20ASLP_RATE_20MS%20%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3E%20DATA_RATE_100HZ%20%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3ELNOISE_MASK%20%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20in%20sleep%20mode%20data%20rate%2050Hz%2C%20awake%20ODR%20%3D%20100Hz%2C%20low%20noise%20mode%2C%20in%20standby%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22punctuation%20token%22%3E%7D%3C%2FSPAN%3E%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%E2%80%8D%3CSPAN%20class%3D%22line-numbers-rows%22%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EThe%20code%20above%20is%20executed%20between%3A%3C%2FP%3E%3CPRE%20class%3D%22language-c%20line-numbers%22%3E%3CCODE%3E%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_StandbyMode%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22punctuation%20token%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E.%3C%2FSPAN%3E%0A%0A%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_ActiveMode%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22line-numbers-rows%22%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EOn%20the%20interrupt%20I%20try%20to%20clear%20the%20interrupt%20and%20in%20the%20main%20()%20function%20I%20try%20to%20print%20the%20source%20but%20I%20don't%20see%20anything%20at%20all.%3C%2FP%3E%3CPRE%20class%3D%22language-c%20line-numbers%22%3E%3CCODE%3E%3CSPAN%20class%3D%22keyword%20token%22%3Evoid%3C%2FSPAN%3E%26nbsp%3B%20%3CSPAN%20class%3D%22token%20function%22%3E_INTInterrupt%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22keyword%20token%22%3Evoid%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%7B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0AMagTHSEvent%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E1%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%20%0Amagintsrc%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_ReadByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EM_INT_SRC%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0A%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2FRead%20interrupt%20source%20to%20clear%20int%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%0Asrcmag%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_ReadByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EM_THS_SRC%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%20%0Amagintsrc%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22token%20function%22%3EFXOS8700CQ_ReadByte%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EM_INT_SRC%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0A%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2FRead%20interrupt%20source%20to%20clear%20int%3C%2FSPAN%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22punctuation%20token%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E.%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2FClear%20the%20INT%20interrupt%20flag%20%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22punctuation%20token%22%3E%7D%3C%2FSPAN%3E%3CSPAN%20class%3D%22line-numbers-rows%22%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-705818%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-1666675%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20FXOS8700%20magnetic%20interrupt%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1666675%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%20were%20you%20able%20to%20carry%20out%20your%20project%2C%20I%20have%20a%20similar%20project%2C%20could%20you%20help%20me%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1504118%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20FXOS8700%20magnetic%20interrupt%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1504118%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F113286%22%20target%3D%22_blank%22%3E%40diken%3C%2FA%3E%26nbsp%3Bor%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F12216%22%20target%3D%22_blank%22%3E%40TomasVaverka%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20looking%20to%20do%20a%20similar%20thing%20-%20count%20cars%20and%20I%20have%20some%20FXOS8700OS%20devices%20on-hand.%20%26nbsp%3BIs%20there%20an%20example%20of%20using%20the%20hardware%20interrupt%20for%20magnetic%20threshold%20detection%20I%20could%20use%20as%20a%20staring%20point%3F%20%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThanks%2C%20Chip%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-705824%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20FXOS8700%20magnetic%20interrupt%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-705824%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Di%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EThe%20time%20step%20used%20by%20the%20debounce%20counter%20depends%20on%20the%20chosen%20ODR%20and%20m_hms%5B1%3A0%5D%20bits.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_17.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_17.png%22%20style%3D%22width%3A%20540px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F32065i8DE18177E4C12E40%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22pastedImage_17.png%22%20alt%3D%22pastedImage_17.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ESo%20the%20only%20way%20to%20reduce%20the%20time%20step%20is%20to%20increase%20the%20ODR%20and%20eventually%20use%20only%20the%20magnetometer%20(m_hms%5B1%3A0%5D%20%3D%200b01).%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EBest%20regards%2C%3C%2FP%3E%3CP%3ETomas%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-705823%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20FXOS8700%20magnetic%20interrupt%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-705823%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Tomas%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EI%20implemented%20thefirst%20snippet%20without%20the%20asleep%20configuration%20and%20indeed%20it%20works.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EThe%20issue%20is%20with%20the%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22%22%3E%3CCODE%3EM_THS_COUNT_REG%3CSPAN%20class%3D%22%22%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Ewhich%20determines%20the%20debouncing%20interval.%20Specifically%20the%20interrupt%20triggers%20very%20late%20with%20regards%20to%20the%20project%20requirements.%20Initially%20this%20was%20set%20to%201.%3C%2FP%3E%3CP%3EWould%20this%20sensor%20work%2C%20assuming%20you%20have%20to%20track%20very%20fast%20moving%20object%20such%20as%20cars.%20(transient%20magnetic%20fields)%3F%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EThe%20datasheet%20suggests%20the%20minimum%20time%20is%2020ms%20but%20from%20experimental%20results%20the%20delay%20is%20much%20larger%20than%20that.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EBest%2C%3C%2FP%3E%3CP%3EDi%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-705822%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20FXOS8700%20magnetic%20interrupt%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-705822%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Di%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EI%20successfully%20implemented%20the%20sleep%20mode%2C%20here%20is%20my%20code%3A%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CPRE%20class%3D%22language-c%20line-numbers%22%3E%3CCODE%3E%3CSPAN%20class%3D%22keyword%20token%22%3Evoid%3C%2FSPAN%3E%20FXOS8700CQ_Init%20%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22keyword%20token%22%3Evoid%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22punctuation%20token%22%3E%7B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_WriteRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20M_THS_X_MSB_REG%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x00%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Threshold%20value%20MSB%26nbsp%3B%20%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_WriteRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20M_THS_X_LSB_REG%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x80%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Threshold%20value%20LSB%26nbsp%3B%20%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_WriteRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20M_THS_CFG_REG%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0xCF%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Event%20flag%20latch%20enabled%2C%20logic%20OR%20of%20enabled%20axes%2C%20only%20X-axis%20enabled%2C%20wake%20on%20magnetic%20threshold%20event%2C%20threshold%20interrupt%20enabled%20and%20routed%20to%20INT1%20%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_WriteRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20M_THS_COUNT_REG%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x0A%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20100ms%20at%20100Hz%20ODR%20and%20magnetometer%20mode%20only%20%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_WriteRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20M_CTRL_REG1%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x1D%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Max%20OSR%2C%20only%20magnetometer%20is%20active%20%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_WriteRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20CTRL_REG3%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x00%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Push-pull%2C%20active%20low%20interrupt%20%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_WriteRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20CTRL_REG2%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x04%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Auto-sleep%20mode%20enabled%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_WriteRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20ASLP_COUNT_REG%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x06%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Auto-sleep%20counter%20set%20to%201.92s%20(6%20x%200.32s%20%3D%201.92s)%20%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_WriteRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20CTRL_REG4%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x80%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Auto-sleep%2Fwake%20interrupt%20enabled%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_WriteRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20CTRL_REG5%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x80%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Route%20auto-sleep%2Fwake%20interrupt%20to%20INT1%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_WriteRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20CTRL_REG1%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x19%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20ODR%20%3D%20100Hz%2C%20Active%20mode%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22punctuation%20token%22%3E%7D%3C%2FSPAN%3E%20%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22line-numbers-rows%22%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3C%2FP%3E%3CPRE%20class%3D%22language-c%20line-numbers%22%3E%3CCODE%3E%3CSPAN%20class%3D%22keyword%20token%22%3Evoid%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22token%20function%22%3EPORTD_IRQHandler%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22punctuation%20token%22%3E%7B%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PORTD_PCR4%20%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3E%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20PORT_PCR_ISF_MASK%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Clear%20the%20interrupt%20flag%20%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Int_Flag%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E1%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%0A%3CSPAN%20class%3D%22punctuation%20token%22%3E%7D%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22line-numbers-rows%22%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3C%2FP%3E%3CPRE%20class%3D%22language-c%20line-numbers%22%3E%3CCODE%3E%3CSPAN%20class%3D%22keyword%20token%22%3Ewhile%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22number%20token%22%3E1%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22punctuation%20token%22%3E%7B%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22keyword%20token%22%3Eif%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EInt_Flag%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22punctuation%20token%22%3E%7B%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Int_Flag%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Int_Source%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_ReadRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20M_INT_SRC_REG%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22keyword%20token%22%3Eif%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EInt_Source%20%3CSPAN%20class%3D%22operator%20token%22%3E%26amp%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x04%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Magnetic%20threshold%20event%20detected%3F%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22punctuation%20token%22%3E%7B%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20M_Ths_Src%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_ReadRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20M_THS_SRC_REG%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Read%20the%20M_THS_SRC%20register%20to%20clear%20the%20SRC_M_THS%20flag%20in%20the%20M_INT_SRC%20register%20and%20deassert%20the%20INT1%20pin%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Event_Counter%3CSPAN%20class%3D%22operator%20token%22%3E%2B%2B%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22punctuation%20token%22%3E%7D%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Int_Source%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_ReadRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20INT_SOURCE_REG%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22keyword%20token%22%3Eif%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EInt_Source%20%3CSPAN%20class%3D%22operator%20token%22%3E%26amp%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x80%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%26nbsp%3B%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Auto-sleep%2Fwake%20interrupt%3F%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22punctuation%20token%22%3E%7B%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Sysmod%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_ReadRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20SYSMOD_REG%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22punctuation%20token%22%3E%7D%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22punctuation%20token%22%3E%7D%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22punctuation%20token%22%3E%7D%3C%2FSPAN%3E%3CSPAN%20class%3D%22line-numbers-rows%22%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EI%20hope%20it%20will%20help%20you.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EBest%20regards%2C%3C%2FP%3E%3CP%3ETomas%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-705821%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20FXOS8700%20magnetic%20interrupt%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-705821%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Di%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EI%20have%20just%20done%20a%20simple%20test%20using%20the%20following%20settings%20(without%20the%20sleep%20mode)%20and%20it%20works%20well%20as%20you%20can%20see%20on%20the%20picture%20below.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CPRE%20class%3D%22language-c%20line-numbers%22%3E%3CCODE%3E%3CSPAN%20class%3D%22keyword%20token%22%3Evoid%3C%2FSPAN%3E%20FXOS8700CQ_Init%20%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22keyword%20token%22%3Evoid%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22punctuation%20token%22%3E%7B%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_WriteRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20M_THS_X_MSB_REG%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x00%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Threshold%20value%20MSB%26nbsp%3B%20%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_WriteRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20M_THS_X_LSB_REG%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x80%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Threshold%20value%20LSB%26nbsp%3B%20%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_WriteRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20M_THS_CFG_REG%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0xCB%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Event%20flag%20latch%20enabled%2C%20logic%20OR%20of%20enabled%20axes%2C%20only%20X-axis%20enabled%2C%20threshold%20interrupt%20enabled%20and%20routed%20to%20INT1%20%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_WriteRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20M_THS_COUNT_REG%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x0A%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20100ms%20at%20100Hz%20ODR%20and%20magnetometer%20mode%20only%20%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_WriteRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20M_CTRL_REG1%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x1D%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Max%20OSR%2C%20only%20magnetometer%20is%20active%20%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_WriteRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20CTRL_REG3%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x00%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Push-pull%2C%20active%20low%20interrupt%20%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_WriteRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20CTRL_REG1%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22number%20token%22%3E0x19%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20ODR%20%3D%20100Hz%2C%20Active%20mode%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22punctuation%20token%22%3E%7D%3C%2FSPAN%3E%3CSPAN%20class%3D%22line-numbers-rows%22%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CPRE%20class%3D%22language-c%20line-numbers%22%3E%3CCODE%3E%3CSPAN%20class%3D%22keyword%20token%22%3Evoid%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22token%20function%22%3EPORTD_IRQHandler%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22punctuation%20token%22%3E%7B%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PORTD_PCR4%20%3CSPAN%20class%3D%22operator%20token%22%3E%7C%3C%2FSPAN%3E%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20PORT_PCR_ISF_MASK%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Clear%20the%20interrupt%20flag%20%3C%2FSPAN%3E%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20M_Ths_Source%20%3CSPAN%20class%3D%22operator%20token%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22token%20function%22%3EI2C_ReadRegister%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E(%3C%2FSPAN%3EFXOS8700CQ_I2C_ADDRESS%3CSPAN%20class%3D%22punctuation%20token%22%3E%2C%3C%2FSPAN%3E%20M_THS_SRC_REG%3CSPAN%20class%3D%22punctuation%20token%22%3E)%3C%2FSPAN%3E%3CSPAN%20class%3D%22punctuation%20token%22%3E%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22comment%20token%22%3E%2F%2F%20Read%20the%20M_THS_SRC%20register%20to%20clear%20the%20SRC_M_THS%20flag%20in%20the%20M_INT_SRC%20register%20and%20deassert%20the%20INT1%20pin%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22punctuation%20token%22%3E%7D%3C%2FSPAN%3E%3CSPAN%20class%3D%22line-numbers-rows%22%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3CSPAN%3E%E2%80%8D%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Mag%20threshold.JPG%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Mag%20threshold.JPG%22%20style%3D%22width%3A%20793px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F31416i6C1787CE1EA929B2%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Mag%20threshold.JPG%22%20alt%3D%22Mag%20threshold.JPG%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ECan%20you%20please%20try%20to%20reproduce%20it%3F%20%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EMeanwhile%20I%20will%20try%20to%20implement%20the%20sleep%20mode.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EBest%20regards%2C%3C%2FP%3E%3CP%3ETomas%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-705820%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20FXOS8700%20magnetic%20interrupt%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-705820%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Tomas%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EI%20already%20tried%20disabling%20the%20sleep%20mode%20with%20the%20same%20results.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EThe%20sleep%20mode%20functionality%20is%20needed%20however%20since%20this%20is%26nbsp%3B%20a%20long%20term%20solution%20where%20you%20can't%20easily%20replace%20the%20batteries.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EI%20also%20tried%20changing%20the%20threshold%20on%20z%20axis.%20Still%20the%20same%20issue.%3C%2FP%3E%3CP%3EWhen%20a%20magnetic%20object%20(ex%20headphone)%20is%20in%20the%20vicinity%20all%203%20axis%20are%20above%20100%20counts.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EAs%20it%20stands%20right%20now%20the%20magnetometer%20streams%20data%20correctly%20however%20the%20interrupt%20functionality%20is%20not%20responsive%20and%20does%20not%20change%20as%20per%20spec%20even%20if%20taking%20into%20account%20the%20debouncing%20counter%20(M_THS_COUNT)%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3EDi%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-705819%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20FXOS8700%20magnetic%20interrupt%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-705819%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EI%20will%20try%20to%20reproduce%20your%20settings%20and%20get%20back%20to%20you%20soon.%20At%20first%20glance%20everything%20seems%20to%20be%20correct.%20Can%20you%20please%20try%20to%20test%20the%20magnetometer%20threshold%20function%20without%20using%20the%20sleep%20mode%3F%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EBest%20regards%2C%3C%2FP%3E%3CP%3ETomas%3C%2FP%3E%3C%2FLINGO-BODY%3E