MPL3115A2 - Automatic Capture and Poll (no interrupts)?

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

MPL3115A2 - Automatic Capture and Poll (no interrupts)?

448 Views
ckhassan
Contributor I

Hello,

Can anyone help me with this?  Here's what I'd like to do, but either it's not an option, or I'm not setting it up and/or using it correctly.

1. Configure the automatic data capture at 1-second intervals.

2. set for altimeter mode

3. No fifo...just collect data and overwrite the value if I don't read it in time.

4. No interrupts...just poll PDR from the main program to know when to read data.

I think I have been able to set up the automatic data capture at (at 1s interval with OSR = 128 to mitigate noise), but the PDR flag seems to always be set, consequently the main program reads data at a rate much faster than 1s and the data isn't correct...it's around 80,000 and that's with the sensor just sitting on my desk where it should be very close to zero.

Thank you in advance for any advice or assistance. 

0 Kudos
1 Reply

399 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hello Chris,

The PDR flag is set when a new pressure/altitude data is ready and cleared by reading the OUT_P_MSB register.

By default the ST[3:0] = 0b0000, so for any OSR setting the time to data ready is 1s:

pastedImage_7.png

Attached you can find a simple code example for your reference.  

Hope it helps.

Best regards,

Tomas

0 Kudos