AnsweredAssumed Answered

Adxl375 has no interrupt,why?

Question asked by paddyxu on Jan 26, 2016
Latest reply on Jun 14, 2016 by Anthony.DeSimone

hi

    I designed a single shock sensor with adxl375,the spi interface is ok,and the interrupt interface of cpu is ok,the same time ,I can write and read the data form adxl375. But adxl375 has no interrupt output.the code :

void adxl375Init(void)

{

  uint8 readByte = 0x0;

  uint8 writeByte;

 

  // Set ADXL375_DATA_FORMAT

  writeByte = 0x0f; //0x2F

  adxl375SpiWriteReg(ADXL375_DATA_FORMAT,&writeByte,1);

 

  // Set THRESH_SHOCK threshold

  writeByte = 0x3; //0x1D THRESH_SHOCK -31.2g

  adxl375SpiWriteReg(ADXL375_THRESH_SHOCK,&writeByte,1);

  

  // set shock duration to 50 ms.

  writeByte = 0x0; //0x50;

  adxl375SpiWriteReg(ADXL375_DUR,&writeByte,1);

 

  //set latency to 40 ms

  writeByte = 0x0;//0x20

  adxl375SpiWriteReg(ADXL375_Latent,&writeByte,1);

 

  // set shock window to 300 ms.   

  writeByte = 0x0;//0xF0

  adxl375SpiWriteReg(ADXL375_Window,&writeByte,1);

 

  // Set  enable X-, Y-, and Z-axes participation in shock detection.

  writeByte = 0x07;

  adxl375SpiWriteReg(ADXL375_SHOCK_AXES,&writeByte,1);

 

  //Write 0x0F to Register 0x2C to set output data rate to 3200 Hz

  writeByte = 0x07;

  adxl375SpiWriteReg(ADXL375_BW_RATE,&writeByte,1);

 

  // Write 0x40/0x20 to Register 0x2E to enable single shock or double shock, respectively

  writeByte = 0x40;

  adxl375SpiWriteReg(ADXL375_INT_ENABLE,&writeByte,1);

 

  // Write 0x40/0x20 to Register 0x2E to  assign single shock or double shock interrupt, respectively, to the INT2 pin

  writeByte = 0x40; //single shock map to int2.

  adxl375SpiWriteReg(ADXL375_INT_MAP,&writeByte,1);

 

 

  //Write 0x08 to Register 0x2D to start the measurement.

  //It is recommended that the POWER_CTL register be configured last.

 

  writeByte = 0x08;

  adxl375SpiWriteReg(ADXL375_POWER_CTL,&writeByte,1);

      

}

Outcomes