<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic MPL3115A2 data ready interrupt issue in Sensors</title>
    <link>https://community.nxp.com/t5/Sensors/MPL3115A2-data-ready-interrupt-issue/m-p/1349955#M6712</link>
    <description>&lt;P&gt;Hi everyone.&lt;/P&gt;&lt;P&gt;I have an issue with the interrupt generated by the sensor on data ready. Once in a while the interrupt is not generated, so the new reading from the sensor doesn't take place.&lt;/P&gt;&lt;P&gt;I followed some code samples, but still the interrupt is unreliable. Here are parts of my code:&lt;/P&gt;&lt;P&gt;Initialization&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IIC_RegWrite(SlaveAddressIIC, CTRL_REG1, 0x04);
//delay
...
IIC_RegWrite(SlaveAddressIIC, CTRL_REG1, 0x80 | 0x18); // ALT_BIT, OSR8
IIC_RegWrite(SlaveAddressIIC, CTRL_REG2, 0x00);    
// Enable interrupt INT1 for data ready
IIC_RegWrite(SlaveAddressIIC, CTRL_REG3, 0x00); // Push/pull, active low
// INT_EN_DRDY_BIT is not enough to generate interrupt,
// INT_EN_PCHG_BIT must be also set
IIC_RegWrite(SlaveAddressIIC, CTRL_REG4, 0x80 | 0x02); // INT_EN_DRDY_BIT | INT_EN_PCHG_BIT
IIC_RegWrite(SlaveAddressIIC, CTRL_REG5, 0x80 | 0x02); // INT_EN_DRDY_BIT | INT_EN_PCHG_BIT - Interrupt su INT1
// DREM_BIT is not enough to generate interrupt,
// PDEFE_BIT must be also set
IIC_RegWrite(SlaveAddressIIC, PT_DATA_CFG_REG, 0x04 |0x02); // DREM_BIT | PDEFE_BIT&lt;/LI-CODE&gt;&lt;P&gt;Start pressure acquisition&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// Enable data ready interrupt on GPIO pin
...
// Set OST
IIC_RegWrite(SlaveAddressIIC, CTRL_REG1, ALT_BIT | OSR_8 | OST_BIT);&lt;/LI-CODE&gt;&lt;P&gt;ISR code clears MCU interrupt flag and sets a variable checked by main loop, where pressure reading is made as follows:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IIC_RegReadN(SlaveAddressIIC, 0x00, 5, (unsigned char *)mybuff);
// Convert readings
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data analyzer shows the correct communication between the MCU and sensor, with interrupt being generated and pressure reading performed. But once in a while the interrupt signal doesn't follow the request.&lt;/P&gt;&lt;P&gt;Any idea about the reason why this is happening? I'm currently using polling, but I would like to switch to a interrupt driven reading to reduce power consumption.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Feb 2026 20:54:17 GMT</pubDate>
    <dc:creator>paolog</dc:creator>
    <dc:date>2026-02-03T20:54:17Z</dc:date>
    <item>
      <title>MPL3115A2 data ready interrupt issue</title>
      <link>https://community.nxp.com/t5/Sensors/MPL3115A2-data-ready-interrupt-issue/m-p/1349955#M6712</link>
      <description>&lt;P&gt;Hi everyone.&lt;/P&gt;&lt;P&gt;I have an issue with the interrupt generated by the sensor on data ready. Once in a while the interrupt is not generated, so the new reading from the sensor doesn't take place.&lt;/P&gt;&lt;P&gt;I followed some code samples, but still the interrupt is unreliable. Here are parts of my code:&lt;/P&gt;&lt;P&gt;Initialization&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IIC_RegWrite(SlaveAddressIIC, CTRL_REG1, 0x04);
//delay
...
IIC_RegWrite(SlaveAddressIIC, CTRL_REG1, 0x80 | 0x18); // ALT_BIT, OSR8
IIC_RegWrite(SlaveAddressIIC, CTRL_REG2, 0x00);    
// Enable interrupt INT1 for data ready
IIC_RegWrite(SlaveAddressIIC, CTRL_REG3, 0x00); // Push/pull, active low
// INT_EN_DRDY_BIT is not enough to generate interrupt,
// INT_EN_PCHG_BIT must be also set
IIC_RegWrite(SlaveAddressIIC, CTRL_REG4, 0x80 | 0x02); // INT_EN_DRDY_BIT | INT_EN_PCHG_BIT
IIC_RegWrite(SlaveAddressIIC, CTRL_REG5, 0x80 | 0x02); // INT_EN_DRDY_BIT | INT_EN_PCHG_BIT - Interrupt su INT1
// DREM_BIT is not enough to generate interrupt,
// PDEFE_BIT must be also set
IIC_RegWrite(SlaveAddressIIC, PT_DATA_CFG_REG, 0x04 |0x02); // DREM_BIT | PDEFE_BIT&lt;/LI-CODE&gt;&lt;P&gt;Start pressure acquisition&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// Enable data ready interrupt on GPIO pin
...
// Set OST
IIC_RegWrite(SlaveAddressIIC, CTRL_REG1, ALT_BIT | OSR_8 | OST_BIT);&lt;/LI-CODE&gt;&lt;P&gt;ISR code clears MCU interrupt flag and sets a variable checked by main loop, where pressure reading is made as follows:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IIC_RegReadN(SlaveAddressIIC, 0x00, 5, (unsigned char *)mybuff);
// Convert readings
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data analyzer shows the correct communication between the MCU and sensor, with interrupt being generated and pressure reading performed. But once in a while the interrupt signal doesn't follow the request.&lt;/P&gt;&lt;P&gt;Any idea about the reason why this is happening? I'm currently using polling, but I would like to switch to a interrupt driven reading to reduce power consumption.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Feb 2026 20:54:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MPL3115A2-data-ready-interrupt-issue/m-p/1349955#M6712</guid>
      <dc:creator>paolog</dc:creator>
      <dc:date>2026-02-03T20:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: MPL3115A2 data ready interrupt issue</title>
      <link>https://community.nxp.com/t5/Sensors/MPL3115A2-data-ready-interrupt-issue/m-p/1350024#M6713</link>
      <description>&lt;P&gt;Hi Paolog,&lt;/P&gt;
&lt;P&gt;please test an MPL3115A2 code attached, my colleague had created few years ago. It might help you to solve the issue.&lt;/P&gt;
&lt;P&gt;With Best Regards,&lt;/P&gt;
&lt;P&gt;Jozef&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 12:01:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MPL3115A2-data-ready-interrupt-issue/m-p/1350024#M6713</guid>
      <dc:creator>JozefKozon</dc:creator>
      <dc:date>2021-10-04T12:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: MPL3115A2 data ready interrupt issue</title>
      <link>https://community.nxp.com/t5/Sensors/MPL3115A2-data-ready-interrupt-issue/m-p/1350110#M6714</link>
      <description>&lt;P&gt;Hi Jozef, thank you for sharing the code.&lt;/P&gt;&lt;P&gt;I did some changes and the interrupt seems to be working fine now. This are the changes I did to my code:&lt;/P&gt;&lt;P&gt;1. Setting register&amp;nbsp;PT_DATA_CFG_REG to 0x07 instead of 0x06 (all three bits&amp;nbsp;DREM_BIT,&amp;nbsp; PDEFE_BIT and TDEFE_BIT are set, while I didn't set TDEFE_BIT), and moved the instruction before setting any of the other registers&lt;/P&gt;&lt;P&gt;2. Setting&amp;nbsp;CTRL_REG4 and&amp;nbsp;CTRL_REG5 to 0x80 instead of 0x82 (INT_EN_DRDY_BIT only, while I also set INT_EN_PCHG_BIT as it seemed like the interrupt wouldn't trigger without it)&lt;/P&gt;&lt;P&gt;I think that moving the instruction to set&amp;nbsp;PT_DATA_CFG_REG in first place is the key, but well, code seems to be working fine and the analyzer always shows the interrupt now.&lt;/P&gt;&lt;P&gt;Thank you again.&lt;/P&gt;&lt;P&gt;Paolo&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 14:25:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MPL3115A2-data-ready-interrupt-issue/m-p/1350110#M6714</guid>
      <dc:creator>paolog</dc:creator>
      <dc:date>2021-10-04T14:25:05Z</dc:date>
    </item>
  </channel>
</rss>

