MPL3115A2 - Bare metal example project

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

MPL3115A2 - Bare metal example project

MPL3115A2 - Bare metal example project

Hi Everyone,

 

To complete the collection of simple bare-metal examples for the Xtrinsic sensors on the FRDM-FXS-MULTI(-B) sensor expansion board, I would like to share here another example code/demo I have created for the MPL3115A2 pressure sensor.

 

This example illustrates:

1. Initialization of the MKL25Z128 MCU (mainly I2C and PORT modules).

2. I2C data write and read operations.

3. Initialization of the MPL3115A2.

4. Output data reading using an interrupt technique.

5. Conversion of the output values from registers 0x01 – 0x05 to real values in Pascals and °C.

6. Visualization of the output values in the FreeMASTER tool.

 

1. As you can see in the FRDM-FXS-MULTI(-B)/FRDM-KL25Z schematics and the image below, I2C signals are routed to the I2C1 module (PTC1 and PTC2 pins) of the KL25Z MCU and the INT1 output (INT_PED) is connected to the PTA13 pin (make sure that pins 2-3 of J5 on the sensor board are connected together using a jumper). The INT1 output of the MPL3115A2 is configured as a push-pull active-low output, so the corresponding PTA13 pin configuration is GPIO with an interrupt on falling edge.

 

12950_12950.jpg

 

The MCU is, therefore, configured as follows.

void MCU_Init(void)

{

     //I2C1 module initialization

     SIM_SCGC4 |= SIM_SCGC4_I2C1_MASK;        // Turn on clock to I2C1 module

     SIM_SCGC5 |= SIM_SCGC5_PORTC_MASK;       // Turn on clock to Port C module

     PORTC_PCR1 |= PORT_PCR_MUX(0x2);         // PTC1 pin is I2C1 SCL line

     PORTC_PCR2 |= PORT_PCR_MUX(0x2);         // PTC2 pin is I2C1 SDA line

     I2C1_F  |= I2C_F_ICR(0x14);              // SDA hold time = 2.125us, SCL start hold time = 4.25us, SCL stop hold time = 5.125us

     I2C1_C1 |= I2C_C1_IICEN_MASK;            // Enable I2C1 module

         

         //Configure the PTA13 pin (connected to the INT1 of the MPL3115A2) for falling edge interrupts

     SIM_SCGC5 |= SIM_SCGC5_PORTA_MASK;       // Turn on clock to Port A module

     PORTA_PCR13 |= (0|PORT_PCR_ISF_MASK|     // Clear the interrupt flag

                       PORT_PCR_MUX(0x1)|     // PTA5 is configured as GPIO

                       PORT_PCR_IRQC(0xA));   // PTA5 is configured for falling edge interrupts

         

        //Enable PORTA interrupt on NVIC

     NVIC_ICPR |= 1 << ((INT_PORTA - 16)%32);

     NVIC_ISER |= 1 << ((INT_PORTA - 16)%32);

}

 

2. The 7-bit I2C address of the MPL3115A2 is fixed value 0x60 which translates to 0xC0 for a write and 0xC1 for a read. As shown above, the SCL line is connected to the PTC1 pin and SDA line to the PTC2 pin. The I2C clock frequency is 125 kHz.

The screenshot below shows the write operation which writes the value 0x39 to the CTRL_REG1 register (0x26).

 

12951_12951.jpg

 

And here is the single byte read from the WHO_AM_I register (0x0C). As you can see, it returns the correct device ID 0xC4.

 

12952_12952.jpg

 

Multiple bytes of data can be read from sequential registers after each MPL3115A2 acknowledgment (AK) is received until a no acknowledge (NAK) occurs from the KL25Z followed by a stop condition (SP) signaling an end of transmission. A burst read of 5 bytes from registers 0x01 to 0x05 is shown below. It also shows how the INT1 pin is automatically deasserted by reading the output registers.

 

12953_12953.jpg

 

 

3. At the beginning of the initialization, all MPL3115A2 registers are reset to their default values by setting the RST bit of the CTRL_REG1 register. The DRDY interrupt is enabled and routed to the INT1 pin that is configured to be a push-pull, active-low output. Further, the OSR ratio of 128 is selected and finally the part goes into Active barometer (eventually altimeter) mode.

 

void MPL3115A2_Init (void)

{

     I2C_WriteRegister(MPL3115A2_I2C_ADDRESS, CTRL_REG1, 0x04);          // Reset all registers to POR values     

     Pause(0x631);          // ~1ms delay     

     I2C_WriteRegister(MPL3115A2_I2C_ADDRESS, PT_DATA_CFG_REG, 0x07);    // Enable data flags

     I2C_WriteRegister(MPL3115A2_I2C_ADDRESS, CTRL_REG3, 0x00);          // Push-pull, active low interrupt

     I2C_WriteRegister(MPL3115A2_I2C_ADDRESS, CTRL_REG4, 0x80);          // Enable DRDY interrupt

     I2C_WriteRegister(MPL3115A2_I2C_ADDRESS, CTRL_REG5, 0x80);          // DRDY interrupt routed to INT1 - PTA13

     I2C_WriteRegister(MPL3115A2_I2C_ADDRESS, CTRL_REG1, 0x39);          // Active barometer mode, OSR = 128     

        //I2C_WriteRegister(MPL3115A2_I2C_ADDRESS, CTRL_REG1, 0xB9);        // Active altimeter mode, OSR = 128

}

 

4. In the ISR, only the interrupt flag is cleared and the DataReady variable is set to indicate the arrival of new data. 

void PORTA_IRQHandler()

{

     PORTA_PCR13 |= PORT_PCR_ISF_MASK;          // Clear the interrupt flag

     DataReady = 1;  

}

 

5. In the main loop, the DataReady variable is periodically checked and if it is set, both pressure (eventually altitude) and temperature data are read and then calculated. 

if (DataReady)          // Is a new set of data ready?

{

     DataReady = 0;                                                                                                                   

     I2C_ReadMultiRegisters(MPL3115A2_I2C_ADDRESS, OUT_P_MSB_REG, 5, RawData);          // Read data output registers 0x01-0x05          

         /* Get pressure, the 20-bit measurement in Pascals is comprised of an unsigned integer component and a fractional component.

     The unsigned 18-bit integer component is located in RawData[0], RawData[1] and bits 7-6 of RawData[2].

     The fractional component is located in bits 5-4 of RawData[2]. Bits 3-0 of RawData[2] are not used.*/                                       

     Pressure = (float) (((RawData[0] << 16) | (RawData[1] << | (RawData[2] & 0xC0)) >> 6) + (float) ((RawData[2] & 0x30) >> 4) * 0.25;                                       

         /* Get temperature, the 12-bit temperature measurement in °C is comprised of a signed integer component and a fractional component.

     The signed 8-bit integer component is located in RawData[3].

     The fractional component is located in bits 7-4 of RawData[4]. Bits 3-0 of OUT_T_LSB are not used. */                   

     Temperature = (float) ((short)((RawData[3] << | (RawData[4] & 0xF0)) >> 4) * 0.0625;                   

         /* Get altitude, the 20-bit measurement in meters is comprised of a signed integer component and a fractional component.

     The signed 16-bit integer component is located in RawData[0] and RawData[1].

     The fraction component is located in bits 7-4 of RawData[2]. Bits 3-0 of RawData[2] are not used */                             

         //Altitude = (float) ((short) ((RawData[0] << | RawData[1])) + (float) (RawData[2] >> 4) * 0.0625;

}

 

6. The calculated values can be watched in the "Variables" window on the top right of the Debug perspective or in the FreeMASTER application. To open and run the FreeMASTER project, install the FreeMASTER 1.4 application and FreeMASTER Communication Driver. 

12954_12954.jpg

 

12955_12955.jpg

 

Attached you can find the complete source code written in the CW for MCU's v10.5 including the FreeMASTER project.

If there are any questions regarding this simple application, do not hesitate to ask below. Your feedback or suggestions are also welcome.

 

Regards,

Tomas

Original Attachment has been moved to: FreeMASTER---FRDM-KL25Z-MPL3115A2-Pressure-and-temperature-reading-using-I2C-and-interrupt.zip

Original Attachment has been moved to: FRDM-KL25Z-MPL3115A2-Pressure-and-temperature-reading-using-I2C-and-interrupt.zip

Labels (1)
Attachments
%3CLINGO-SUB%20id%3D%22lingo-sub-1128966%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EMPL3115A2%20-%20Bare%20metal%20example%20project%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1128966%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Everyone%2C%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20complete%20the%20collection%20of%20simple%20bare-metal%20examples%20for%20the%20Xtrinsic%20sensors%20on%20the%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fwww.freescale.com%2Fwebapp%2Fsps%2Fsite%2Fprod_summary.jsp%3Fcode%3DFRDM-FXS-MULTI-B%22%20target%3D%22_blank%22%3EFRDM-FXS-MULTI(-B)%20sensor%20expansion%20board%3C%2FA%3E%2C%20I%20would%20like%20to%20share%20here%20another%20example%20code%2Fdemo%20I%20have%20created%20for%20the%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fwww.freescale.com%2Fwebapp%2Fsps%2Fsite%2Fprod_summary.jsp%3Fcode%3DMPL3115A2%22%20target%3D%22_blank%22%3EMPL3115A2%20pressure%20sensor%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20'Arial'%2C'sans-serif'%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3EThis%20example%20illustrates%3A%3C%2FP%3E%0A%3CP%20style%3D%22font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E1.%20Initialization%20of%20the%20MKL25Z128%20MCU%20(mainly%20I2C%20and%20PORT%20modules).%3C%2FP%3E%0A%3CP%3E2.%20I2C%20data%20write%20and%20read%20operations.%3C%2FP%3E%0A%3CP%3E3.%20Initialization%20of%20the%20MPL3115A2.%3C%2FP%3E%0A%3CP%3E4.%20Output%20data%20reading%20using%20an%20interrupt%20technique.%3C%2FP%3E%0A%3CP%3E5.%20Conversion%20of%20the%20output%20values%20from%20registers%200x01%20%E2%80%93%200x05%20to%20real%20values%20in%20Pascals%20and%20%C2%B0C.%3C%2FP%3E%0A%3CP%20style%3D%22font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E6.%20Visualization%20of%20the%20output%20values%20in%20the%20%3CA%20class%3D%22jive-link-external-small%22%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%236a737b%3B%22%20href%3D%22http%3A%2F%2Fwww.freescale.com%2Fwebapp%2Fsps%2Fsite%2Fprod_summary.jsp%3Fcode%3DFREEMASTER%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EFreeMASTER%20tool%3C%2FA%3E.%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E1.%20As%20you%20can%20see%20in%20the%20%3CA%20class%3D%22jive-link-external-small%22%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%236a737b%3B%22%20href%3D%22http%3A%2F%2Fcache.freescale.com%2Ffiles%2Fsensors%2Fdoc%2Fsupport_info%2FFRDM-FXS-MULTI-B.pdf%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EFRDM-FXS-MULTI(-B)%3C%2FA%3E%2F%3CA%20class%3D%22jive-link-external-small%22%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20color%3A%20%236a737b%3B%22%20href%3D%22http%3A%2F%2Fcache.freescale.com%2Ffiles%2Fsoft_dev_tools%2Fhardware_tools%2Fschematics%2FFRDM-KL25Z_SCH_REV_E.pdf%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EFRDM-KL25Z%3C%2FA%3E%20schematics%20and%20the%20image%20below%2C%20I2C%20signals%20are%20routed%20to%20the%20I2C1%20module%20(PTC1%20and%20PTC2%20pins)%20of%20the%20KL25Z%20MCU%20and%20the%20INT1%20output%20(INT_PED)%20is%20connected%20to%20the%20PTA13%20pin%20(%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3Emake%20sure%20that%20pins%202-3%20of%20J5%20on%20the%20sensor%20board%20are%20connected%20together%20using%20a%20jumper%3C%2FSPAN%3E).%20The%20INT1%20output%20of%20the%20MPL3115A2%20is%20configured%20as%20a%20push-pull%20active-low%20output%2C%20so%20the%20corresponding%20PTA13%20pin%20configuration%20is%20GPIO%20with%20an%20interrupt%20on%20falling%20edge.%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2212950_12950.jpg%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%2212950_12950.jpg%22%20style%3D%22width%3A%20817px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F118235i0808D26829132213%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2212950_12950.jpg%22%20alt%3D%2212950_12950.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3EThe%20MCU%20is%2C%20therefore%2C%20configured%20as%20follows.%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%20font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20font-weight%3A%20inherit%3B%22%3E%3CSTRONG%3Evoid%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSTRONG%3EMCU_Init%3C%2FSTRONG%3E%3C%2FSPAN%3E(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%20font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20font-weight%3A%20inherit%3B%22%3E%3CSTRONG%3Evoid%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E)%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%7B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F%2FI2C1%20module%20initialization%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20SIM_SCGC4%20%7C%3D%20SIM_SCGC4_I2C1_MASK%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Turn%20on%20clock%20to%20I2C1%20module%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20SIM_SCGC5%20%7C%3D%20SIM_SCGC5_PORTC_MASK%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Turn%20on%20clock%20to%20Port%20C%20module%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PORTC_PCR1%20%7C%3D%20PORT_PCR_MUX(0x2)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20PTC1%20pin%20is%20I2C1%20SCL%20line%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PORTC_PCR2%20%7C%3D%20PORT_PCR_MUX(0x2)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20PTC2%20pin%20is%20I2C1%20SDA%20line%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20I2C1_F%26nbsp%3B%20%7C%3D%20I2C_F_ICR(0x14)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20SDA%20hold%20time%20%3D%202.125us%2C%20SCL%20start%20hold%20time%20%3D%204.25us%2C%20SCL%20stop%20hold%20time%20%3D%205.125us%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20I2C1_C1%20%7C%3D%20I2C_C1_IICEN_MASK%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Enable%20I2C1%20module%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2FConfigure%20the%20PTA13%20pin%20(connected%20to%20the%20INT1%20of%20the%20MPL3115A2)%20for%20falling%20edge%20interrupts%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20SIM_SCGC5%20%7C%3D%20SIM_SCGC5_PORTA_MASK%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Turn%20on%20clock%20to%20Port%20A%20module%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PORTA_PCR13%20%7C%3D%20(0%7CPORT_PCR_ISF_MASK%7C%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Clear%20the%20interrupt%20flag%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PORT_PCR_MUX(0x1)%7C%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20PTA5%20is%20configured%20as%20GPIO%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PORT_PCR_IRQC(0xA))%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20PTA5%20is%20configured%20for%20falling%20edge%20interrupts%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2FEnable%20PORTA%20interrupt%20on%20NVIC%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20NVIC_ICPR%20%7C%3D%201%20%26lt%3B%26lt%3B%20((%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%230000c0%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20inherit%3B%20font-weight%3A%20inherit%3B%22%3E%3CEM%3EINT_PORTA%3C%2FEM%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E-%2016)%2532)%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20NVIC_ISER%20%7C%3D%201%20%26lt%3B%26lt%3B%20((%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%230000c0%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20inherit%3B%20font-weight%3A%20inherit%3B%22%3E%3CEM%3EINT_PORTA%3C%2FEM%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E-%2016)%2532)%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E2.%20The%207-bit%20I%3CSUP%3E2%3C%2FSUP%3EC%20address%20of%20the%20MPL3115A2%20is%20fixed%20value%200x60%20which%20translates%20to%200xC0%20for%20a%20write%20and%200xC1%20for%20a%20read.%20As%20shown%20above%2C%20the%20SCL%20line%20is%20connected%20to%20the%20PTC1%20pin%20and%20SDA%20line%20to%20the%20PTC2%20pin.%20The%20I2C%20clock%20frequency%20is%20125%20kHz.%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3EThe%20screenshot%20below%20shows%20the%20write%20operation%20which%20writes%20the%20value%200x39%20to%20the%20CTRL_REG1%20register%20(0x26).%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%20margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2212951_12951.jpg%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%2212951_12951.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F118236i30BD1C49316D69C5%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2212951_12951.jpg%22%20alt%3D%2212951_12951.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%20margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3EAnd%20here%20is%20the%20single%20byte%20read%20from%20the%20WHO_AM_I%20register%20(0x0C).%20As%20you%20can%20see%2C%20it%20returns%20the%20correct%20device%20ID%200xC4.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2212952_12952.jpg%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%2212952_12952.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F118237iB94E4739B1999BDE%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2212952_12952.jpg%22%20alt%3D%2212952_12952.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3EMultiple%20bytes%20of%20data%20can%20be%20read%20from%20sequential%20registers%20after%20each%20MPL3115A2%20acknowledgment%20(AK)%20is%20received%20until%20a%20no%20acknowledge%20(NAK)%20occurs%20from%20the%20KL25Z%20followed%20by%20a%20stop%20condition%20(SP)%20signaling%20an%20end%20of%20transmission.%20A%20burst%20read%20of%205%20bytes%20from%20registers%200x01%20to%200x05%20is%20shown%20below.%20It%20also%20shows%20how%20the%20INT1%20pin%20is%20automatically%20deasserted%20by%20reading%20the%20output%20registers.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2212953_12953.jpg%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%2212953_12953.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F118238iBCABA21700D76635%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2212953_12953.jpg%22%20alt%3D%2212953_12953.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3E3.%20%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3EAt%20the%20beginning%20of%20the%20initialization%2C%20all%20MPL3115A2%20registers%20are%20reset%20to%20their%20default%20values%20by%20setting%20the%20RST%20bit%20of%20the%20CTRL_REG1%20register.%20The%20DRDY%20interrupt%20is%20enabled%20and%20routed%20to%20the%20INT1%20pin%20that%20is%20configured%20to%20be%20a%20push-pull%2C%20active-low%20output.%20Further%2C%20the%20OSR%20ratio%20of%20128%20is%20selected%20and%20finally%20the%20part%20goes%20into%20Active%20barometer%20(eventually%20altimeter)%20mode.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Evoid%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%3CSTRONG%3EMPL3115A2_Init%3C%2FSTRONG%3E%20(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Evoid%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E)%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%7B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20I2C_WriteRegister(MPL3115A2_I2C_ADDRESS%2C%20CTRL_REG1%2C%200x04)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Reset%20all%20registers%20to%20POR%20values%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Pause(0x631)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20~1ms%20delay%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20I2C_WriteRegister(MPL3115A2_I2C_ADDRESS%2C%20PT_DATA_CFG_REG%2C%200x07)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Enable%20data%20flags%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20I2C_WriteRegister(MPL3115A2_I2C_ADDRESS%2C%20CTRL_REG3%2C%200x00)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Push-pull%2C%20active%20low%20interrupt%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20I2C_WriteRegister(MPL3115A2_I2C_ADDRESS%2C%20CTRL_REG4%2C%200x80)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Enable%20DRDY%20interrupt%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20I2C_WriteRegister(MPL3115A2_I2C_ADDRESS%2C%20CTRL_REG5%2C%200x80)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20DRDY%20interrupt%20routed%20to%20INT1%20-%20PTA13%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20I2C_WriteRegister(MPL3115A2_I2C_ADDRESS%2C%20CTRL_REG1%2C%200x39)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Active%20barometer%20mode%2C%20OSR%20%3D%20128%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2FI2C_WriteRegister(MPL3115A2_I2C_ADDRESS%2C%20CTRL_REG1%2C%200xB9)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F%2F%20Active%20altimeter%20mode%2C%20OSR%20%3D%20128%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E4.%20In%20the%20ISR%2C%20only%20the%20interrupt%20flag%20is%20cleared%20and%20the%20DataReady%20variable%20is%20set%20to%20indicate%20the%20arrival%20of%20new%20data.%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%20font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20font-weight%3A%20inherit%3B%22%3E%3CSTRONG%3Evoid%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%20font-weight%3A%20inherit%3B%22%3E%3CSTRONG%3EPORTA_IRQHandler%3C%2FSTRONG%3E%3C%2FSPAN%3E()%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%7B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PORTA_PCR13%20%7C%3D%20PORT_PCR_ISF_MASK%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Clear%20the%20interrupt%20flag%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20DataReady%20%3D%201%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-bottom%3A%200.0001pt%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20inherit%3B%20font-style%3A%20inherit%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E5.%20In%20the%20main%20loop%2C%20the%20DataReady%20variable%20is%20periodically%20checked%20and%20if%20it%20is%20set%2C%20both%20pressure%20(eventually%20altitude)%20and%20temperature%20data%20are%20read%20and%20then%20calculated.%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Eif%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E(DataReady)%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Is%20a%20new%20set%20of%20data%20ready%3F%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%7B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20DataReady%20%3D%200%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20I2C_ReadMultiRegisters(MPL3115A2_I2C_ADDRESS%2C%20OUT_P_MSB_REG%2C%205%2C%20RawData)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Read%20data%20output%20registers%200x01-0x05%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F*%20Get%20pressure%2C%20the%2020-bit%20measurement%20in%20Pascals%20is%20comprised%20of%20an%20unsigned%20integer%20component%20and%20a%20fractional%20component.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20The%20unsigned%2018-bit%20integer%20component%20is%20located%20in%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3ERawData%5B0%5D%2C%20%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-family%3A%20Consolas%3B%22%3ERawData%5B1%5D%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3Eand%20bits%207-6%20of%20%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-family%3A%20Consolas%3B%22%3ERawData%5B2%5D%3C%2FSPAN%3E.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20The%20fractional%20component%20is%20located%20in%20bits%205-4%20of%20%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-family%3A%20Consolas%3B%22%3ERawData%5B2%5D%3C%2FSPAN%3E.%20Bits%203-0%20of%20%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-family%3A%20Consolas%3B%22%3ERawData%5B2%5D%3C%2FSPAN%3E%20are%20not%20used.*%2F%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Pressure%20%3D%20(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Efloat%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E)%20(((RawData%5B0%5D%20%26lt%3B%26lt%3B%2016)%20%7C%20(RawData%5B1%5D%20%26lt%3B%26lt%3B%20%3CLI-EMOJI%20id%3D%22lia_smiling-face-with-sunglasses%22%20title%3D%22%3Asmiling_face_with_sunglasses%3A%22%3E%3C%2FLI-EMOJI%3E%20%7C%20(RawData%5B2%5D%20%26amp%3B%200xC0))%20%26gt%3B%26gt%3B%206)%20%2B%20(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Efloat%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E)%20((RawData%5B2%5D%20%26amp%3B%200x30)%20%26gt%3B%26gt%3B%204)%20*%200.25%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F*%20Get%20temperature%2C%20the%2012-bit%20temperature%20measurement%20in%20%C2%B0C%20is%20comprised%20of%20a%20signed%20integer%20component%20and%20a%20fractional%20component.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20The%20signed%208-bit%20integer%20component%20is%20located%20in%20%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-family%3A%20Consolas%3B%22%3ERawData%5B3%5D%3C%2FSPAN%3E.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20The%20fractional%20component%20is%20located%20in%20bits%207-4%20of%20%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-family%3A%20Consolas%3B%22%3ERawData%5B4%5D%3C%2FSPAN%3E.%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3EBits%203-0%20of%20OUT_T_LSB%20are%20not%20used.%20*%2F%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Temperature%20%3D%20(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Efloat%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E)%20((%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Eshort%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E)((RawData%5B3%5D%20%26lt%3B%26lt%3B%20%3CLI-EMOJI%20id%3D%22lia_smiling-face-with-sunglasses%22%20title%3D%22%3Asmiling_face_with_sunglasses%3A%22%3E%3C%2FLI-EMOJI%3E%20%7C%20(RawData%5B4%5D%20%26amp%3B%200xF0))%20%26gt%3B%26gt%3B%204)%20*%200.0625%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F*%20Get%20altitude%2C%20the%2020-bit%20measurement%20in%20meters%20is%20comprised%20of%20a%20signed%20integer%20component%20and%20a%20fractional%20component.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20The%20signed%2016-bit%20integer%20component%20is%20located%20in%20%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-family%3A%20Consolas%3B%22%3ERawData%5B0%5D%3C%2FSPAN%3E%20and%20%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-family%3A%20Consolas%3B%22%3ERawData%5B1%5D%3C%2FSPAN%3E.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20The%20fraction%20component%20is%20located%20in%20bits%207-4%20of%20%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-family%3A%20Consolas%3B%22%3ERawData%5B2%5D%3C%2FSPAN%3E.%20Bits%203-0%20of%20%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-family%3A%20Consolas%3B%22%3ERawData%5B2%5D%3C%2FSPAN%3E%20are%20not%20used%20*%2F%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2FAltitude%20%3D%20(float)%20((short)%20((RawData%5B0%5D%20%26lt%3B%26lt%3B%20%3CLI-EMOJI%20id%3D%22lia_smiling-face-with-sunglasses%22%20title%3D%22%3Asmiling_face_with_sunglasses%3A%22%3E%3C%2FLI-EMOJI%3E%20%7C%20RawData%5B1%5D))%20%2B%20(float)%20(RawData%5B2%5D%20%26gt%3B%26gt%3B%204)%20*%200.0625%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E6.%20The%20calculated%20values%20can%20be%20watched%20in%20the%20%22Variables%22%20window%20on%20the%20top%20right%20of%20the%20Debug%20perspective%20or%20in%20the%20FreeMASTER%20application.%20To%20open%20and%20run%20the%20FreeMASTER%20project%2C%20install%20the%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fwww.freescale.com%2Fwebapp%2Fsps%2Fsite%2Fprod_summary.jsp%3Fcode%3DFREEMASTER%26amp%3Bfpsp%3D1%26amp%3Btab%3DDesign_Tools_Tab%22%20target%3D%22_blank%22%3EFreeMASTER%201.4%20application%3C%2FA%3E%20and%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fwww.freescale.com%2Fwebapp%2Fsps%2Fsite%2Fprod_summary.jsp%3Fcode%3DFREEMASTER%26amp%3Bfpsp%3D1%26amp%3Btab%3DDesign_Tools_Tab%22%20target%3D%22_blank%22%3EFreeMASTER%20Communication%20Driver%3C%2FA%3E.%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2212954_12954.jpg%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%2212954_12954.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F118239i10CC5EA27E37AEBC%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2212954_12954.jpg%22%20alt%3D%2212954_12954.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2212955_12955.jpg%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%2212955_12955.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F118240i192138871C55286A%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2212955_12955.jpg%22%20alt%3D%2212955_12955.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAttached%20you%20can%20find%20the%20complete%20source%20code%20written%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fwww.freescale.com%2Fwebapp%2Fsps%2Fsite%2Fprod_summary.jsp%3Fcode%3DCW-MCU10%22%20target%3D%22_blank%22%3ECW%20for%20MCU's%20v10.5%3C%2FA%3E%20including%20the%20FreeMASTER%20project.%3C%2FP%3E%0A%3CP%20style%3D%22font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3EIf%20there%20are%20any%20questions%20regarding%20this%20simple%20application%2C%20do%20not%20hesitate%20to%20ask%20below.%20Your%20feedback%20or%20suggestions%20are%20also%20welcome.%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3ERegards%2C%3C%2FP%3E%0A%3CP%20style%3D%22font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%20color%3A%20%233d3d3d%3B%22%3ETomas%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EOriginal%20Attachment%20has%20been%20moved%20to%3A%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-339220%22%20target%3D%22_blank%22%3EFreeMASTER---FRDM-KL25Z-MPL3115A2-Pressure-and-temperature-reading-using-I2C-and-interrupt.zip%3C%2FA%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EOriginal%20Attachment%20has%20been%20moved%20to%3A%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-339220%22%20target%3D%22_blank%22%3EFRDM-KL25Z-MPL3115A2-Pressure-and-temperature-reading-using-I2C-and-interrupt.zip%3C%2FA%3E%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1128966%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EPressure%20Sensors%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
No ratings
Version history
Last update:
‎02-25-2021 11:35 AM
Updated by: