cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to get LPS33 low pressure threshold to output to INT/DRDY pin.

DHoli.1
Associate

Can someone help with the specific sequence to get the INT_DRDY output to become active when the pressure drops from the reference pressure by 156 hPA (120 mmHg).

I have read and reread the data sheet, and examined the ST "C" library source. I am able to configure the output pin for DRDY successfully.

The current sequence is outlined below. I've tried several different orders of the sequence. The pressure readings are correct in both value and timing. The INT_DRDY works correctly when configured as DRDY.

However, applying an external vacuum that is 3X the threshold setting does not cause the output to be active.

Thanks for your help in this matter.

Dave

1) Perform a software reset.

2) Initialize control registers 1 - 3. Here are some relevant bits:

   REG.CTRL.REG1.ODR        = 5; //Output data rate 75Hz

   REG.CTRL.REG2.ONE_SHOT   = 0; //Init to idle mode

   REG.CTRL.REG3.INT_S      = INT_S_P_Low; // Interrupt on pressure low

  REG.CTRL.REG3.DRDY       = 0;         //Don't interrupt when data ready

  REG.CTRL.REG3.F_OVR      =0; //Dont interrupt on FIFO overrun

  REG.CTRL.REG3.F_FTH      =0; //Dont interrupt on FIFO threshold

  REG.CTRL.REG3.F_FSS5     =0; //Dont interrupt in FIFO ready

  REG.CTRL.REG3.PP_OD      =0; //DRDY pin push pull

  REG.CTRL.REG3.INT_H_L    =0; //Interrupt active high

3)Check the WHOAMI register.

4)Set low power mode

5)Set the output data rate

6) Wait for 10 pressure samples

7) Set AUTOZERO

😎 Wait two more samples.

9) Set the interrupt register :

   INTReg.Bits.AUTORIFP = 0;

   INTReg.Bits.RESET_ARP = 0;

   INTReg.Bits.AUTOZERO = 0;

   INTReg.Bits.RESET_AZ = 0;

INTRegCache->Bits.DIFF_EN = 1;

   INTRegCache->Bits.PLE    = 1;

   INTRegCache->Bits.PHE    = 1;

   INTRegCache->Bits.LIR    = 1;

10) Set the threshold register:

const unsigned short OverPthreshold = (unsigned short)((float)(60.f * 1.3f * 16.f));

1 ACCEPTED SOLUTION

Accepted Solutions
DSull.3
Associate III

Hi Dave, if you are interested in detecting the low crossing event, while are you configuring the INTRegCache->Bits.PHE bit to one?

Did you also check the content of REF_P register, to see if the threshold has been correctly stored after the AUTOZERO command?

The AUTOZERO bit should then reset automatically, without need to put it at zero.

I also read that The value is expressed as: Interrupt threshold (hPA) = (THS_P) / 16

Your threshold is 60.f * 1.3f * 16.f = 1248 dec, so the threshold is 1248/16 = 78 hPa. Shouldn't you double the ths value?

https://www.st.com/resource/en/datasheet/lps33w.pdf

\Dk

View solution in original post

1 REPLY 1
DSull.3
Associate III

Hi Dave, if you are interested in detecting the low crossing event, while are you configuring the INTRegCache->Bits.PHE bit to one?

Did you also check the content of REF_P register, to see if the threshold has been correctly stored after the AUTOZERO command?

The AUTOZERO bit should then reset automatically, without need to put it at zero.

I also read that The value is expressed as: Interrupt threshold (hPA) = (THS_P) / 16

Your threshold is 60.f * 1.3f * 16.f = 1248 dec, so the threshold is 1248/16 = 78 hPa. Shouldn't you double the ths value?

https://www.st.com/resource/en/datasheet/lps33w.pdf

\Dk