Post Go back to editing

MISO gets stuck to 1 in ADXL 372

Category: Datasheet/Specs
Product Number: ADXL372

Hi,

I am trying to configure ADXL372. I am trying to detect the activity & inactivity without any interrupts.

The activity threshold is set as 4g and inactivity threshold as 2g. Following are the register values which are assigned.

time_act=0x02

time_inact=0x0001 

timing=0x60

measure=0x20

power_ctl=0x0B

The device is in loop mode with 3200Hz ODR with 200Hz bandwidth and also enabling LPF. The settling time is set to 370ms and sclk is working at 5MHz.

According to the datasheet in loop mode when there is inactivity then awake bit =0 and when activity is detected then awake bit=1.

When the device is at rest awake bit =0 which is correct and when device ID is read it gives correct value but when some vibrations are given then awake bit doesn't become 1 & when device ID is read it gives correct value.

Sometimes when multiple vibrations are given MISO gets stuck to 1 and even device ID is read as 0xFF.

Best regards

Rahul

Parents
  • Hello  thanks for reaching out.

    This sounds like a wiring problem on a first sight, there should be no change on the device ID unless there is an issue on the communications. I would also crosscheck the SPI configuration.

    On the other hand the LPF is fixed to the ODR, BW = 1/2*ODR. This means that you either have a 3200 Hz ODR with 1600 Hz BW, or 200 Hz BW with a 400 Hz ODR, but no 200 Hz BW with and ODR over 400 Hz as 3,2 KHz.

    Please refer to page 15 and 18 of ADXL372 (Rev. C) for clarification. The LPF that you can disable on 0x3F reg, is the activity detection flag, as explained in page 18. I understand this can be confusing, excuse any inconvenience.

    regards,

    Mario SM

  • Thanks for getting back to me. I think the SPI configuration is correct because I am able to read device ID properly.

    1) I have observed that when CS=1 and SCLK=1 when no read or write operation is happening then MISO does not get stuck to 1 when multiple vibrations are given to the device.

    When CS=1 and SCLK=0 and no read or write operation happens then MISO gets stuck to 1 when multiple vibrations are given to the device.

    I think this might be happening because when SCLK=0 the device thinks its an I2C communication instead of SPI.

    2) Also I tried changing the bandwidth as per BW=1/2*ODR. I am unable to detect activity in loop mode when some vibrations are given.

    3) How do you convert the X-axis data register value in terms of g ? 

    Should we consider all 16-bits or only 12-bits ? 

  • Hello   hope you had a great weekend.

    -1,2 Could you kindly share your wiring scheme, the whole register configuration and a snippet of code showing how the SPI is initialized, the BW is set, and the activity loop is configured?

    -3 You can refer to  pg. 36 of ADXL372 (Rev. C)  as reference.  Note that only the 12 most significant bits are used to retrieve meaningful data.



    Here you have some code snippets as reference:

       //read all FIFO_samples_sets 
       adxl372_read_multi_reg(&adxl372,ADI_ADXL372_FIFO_DATA,(FIFO_samples_sets-1)*6, &FIFOdata[0]);
    
       //Process data: convert to gee and print in serial port 
       for (int i = 0; i <= (FIFO_samples_sets-2)*6; i= i+6) {
           uint16_t aux = 0;
           aux = ((uint16_t)(FIFOdata[i] <<4) | FIFOdata[i+1]>>4)&0x0FFF;
           X = (float)twos_complement(aux,12)*0.1;
           aux = ((uint16_t)(FIFOdata[i+2] << 4) | FIFOdata[i+3]>>4)&0x0FFF;
           Y = (float)twos_complement(aux,12)*0.1;
           aux = ((uint16_t)(FIFOdata[i+4] << 4) | FIFOdata[i+5]>>4)&0x0FFF;
           Z = (float)twos_complement(aux,12)*0.1;
     
           Serial.print(X);
           Serial.print("\t");
           Serial.print(Y);
           Serial.print("\t"); 
           Serial.println(Z); 
     }
    
    
    short twos_complement(unsigned short val,unsigned char bits)
    {
        short value  = (short)val;
        if (value & (1 << (bits-1))){
           value -= 1 << bits;
        }
        return value;
    }


    Regarding the SPI configuration you have some reference in pages 6 and 29 of the datasheet. I would try to lower the SPI clock speed alongside crosschecking the configuration to match the DS:

     
    SPI.setDataMode(SPI_MODE0); //CPHA = CPOL = 0    MODE = 0



    Hope this helps, let me know if I can assist you with any other thing.

    Have a nice week,

    Mario SM

  • Thanks for the reply. The register configuration is as follows,

    offset values for x,y,z = 0x00 

    Threshold_x = 03C1 for 3g activity threshold value

    Threshold_y  = 03C1

    Threshold_z = 03C1

    time_act = 0x00 

    Threshold_inact_x = 0281 for 2g inactivity threshold value

    Threshold_inact_y = 0281

    Threshold_inact_z = 0281

    Time_inact = 0x00C8 

    timing =0x60    for 3200Hz ODR

    measure =0x23  for loop mode & 1600Hz BW

    power_ctl=0x03  for full BW mode

    I just want to detect activity and inactivity without interrupts.

    Also if x-axis register value is obatined as 0xFFE0 and if we want to convert to g then its value is -0.2g ?

  • Hi there, just following up about this case. Were you able to find a solution to this? I am checking internally to see if we have any info on anything like this.

Reply Children
No Data