AnsweredAssumed Answered

FXAS21002 Not Generating Interrupts

Question asked by Kas Lewis on Jul 15, 2015
Latest reply on Jul 17, 2015 by Tomas Vaverka

Hello,

 

I am using the FSAX21002 on the FRDM-STBC-AGM01 board along with the FRDM-KL25Z and writing all the code using mbed. The issue that I am having is that the sensor does generate any interrupts no matter how I setup the sensor. I have tried using both with interrupts for the FIFO and for Data Ready in all cases no interrupt is generated. My setting tried for the interrupts are for the data ready interrupt (CRTL_REG2 - 0x0F or 0x0E) and for the FIFO interrupt (CRTL_REG2 - 0xC3 or 0xC2) all these setting produced no results. When using the FIFO F_SETUP was set to 0x54. My setup code is below.

 

int fxas_init() {
    int return_val = 0;
    int test = 0;
  
    sensor_data[0] = i2c_read(FXAS_ADDRESS_W, FXAS_WHO_AM_I);
    pc.printf("Expected ID from FXAS21002C is 0xD7\n\r");
    pc.printf("Returned value: %X\n\n\r", sensor_data[0]);
    
    if (sensor_data[0] == FXAS_ID){
        return_val = 0;
        return_val += i2c_write_verify(FXAS_ADDRESS_W, FXAS_CTRL_REG_1, 0x00);
        return_val += i2c_write_verify(FXAS_ADDRESS_W, FXAS_F_SETUP, 0x00);
        return_val += i2c_write_verify(FXAS_ADDRESS_W, FXAS_F_SETUP, 0x54);
        return_val += i2c_write_verify(FXAS_ADDRESS_W, FXAS_CTRL_REG_0, 0x03);
        
        return_val += i2c_write_verify(FXAS_ADDRESS_W, FXAS_CTRL_REG_2, 0xEB);//Also tried 0xAF with FXAS_F_SETUP set to 0x00 (0x54 line removed) 
        return_val += i2c_write_verify(FXAS_ADDRESS_W, FXAS_CTRL_REG_3, 0x08);//0x0C for INT2 to be used as sampling control or 0x08 for software control
        return_val += i2c_write_verify(FXAS_ADDRESS_W, FXAS_CTRL_REG_1, 0x13);
   }
    else{
        return_val = -1;    
    }  

 

Here is a logic capture of some of the setup and some data capture

FXAS setup & capture.png

Setup and data capture (First two blips verify the devices, FXAS and FXOS using the ID registers, next blip is FXAS setup and then finally data capture)

 

FXAS setup.png

FXOS setup

 

 

FXAS capture 3.png

Data Capture

 

Any help getting this sensor working would be very much appreciated.

 

Thankfully

Kas

Outcomes