<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>npm1300 readings delayed by  one measurement</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/117274/npm1300-readings-delayed-by-one-measurement</link><description>Hi, I am using the npm1300 with the nrf9160 with ncs2.7 When we do a reading from the npm1300 to get the current and voltage values, the readings are always delayed by 1 reading. So for example, if I have the voltage set to 3.7V, and then change it to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 19 Dec 2024 14:57:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/117274/npm1300-readings-delayed-by-one-measurement" /><item><title>RE: npm1300 readings delayed by  one measurement</title><link>https://devzone.nordicsemi.com/thread/515789?ContentTypeID=1</link><pubDate>Thu, 19 Dec 2024 14:57:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32cde1c2-d81d-4503-8f81-16bdfa6cede4</guid><dc:creator>helsing</dc:creator><description>[quote user="dave_s"]If I want the immediate results can I call sensor_fetch() twice back to back?&amp;nbsp; Do I need to leave any time in between for the ADC to process?[/quote]
&lt;p&gt;This would work, however, it is not ideal in terms of energy consumption.&lt;/p&gt;
&lt;p&gt;The conversion time, &lt;a href="https://docs.nordicsemi.com/bundle/ps_npm1300/page/chapters/core_components/saadc/doc/frontpage.html#ariaid-title11"&gt;t&lt;sub&gt;conv&lt;/sub&gt;&lt;/a&gt; is 250 &lt;span&gt;µs per sample. Four samples are triggered by the fetch() function (battery voltage, battery current, battery ntc, die temperature). &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;On the nPM1300 EK we trigger sampling, wait for it to be done, and then read out the result. This way one will get the latest result.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It is possible to do ADC readings from the application with manual I2C reads/writes. We have functions for this in npm1300.h: &lt;code&gt;mfd_npm1300_reg_write &lt;/code&gt;&lt;/span&gt;and&lt;span&gt; &lt;code&gt;mfd_npm1300_reg_read&lt;/code&gt;.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: npm1300 readings delayed by  one measurement</title><link>https://devzone.nordicsemi.com/thread/515561?ContentTypeID=1</link><pubDate>Wed, 18 Dec 2024 16:22:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15b811f8-f609-4cbc-bd32-1ba67b0094c4</guid><dc:creator>dave</dc:creator><description>&lt;p&gt;Thanks&lt;br /&gt;&lt;br /&gt;Is that the desired behavior or a bug?&lt;br /&gt;&lt;br /&gt;If I want the immediate results can I call sensor_fetch() twice back to back?&amp;nbsp; Do I need to leave any time in between for the ADC to process?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: npm1300 readings delayed by  one measurement</title><link>https://devzone.nordicsemi.com/thread/515445?ContentTypeID=1</link><pubDate>Wed, 18 Dec 2024 11:18:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c57505a3-bbc8-4f49-b6d1-8a6bcaccacdb</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;Hi Dave,&lt;/p&gt;
&lt;p&gt;It seems like the behavior is due to the way the driver was implemented. When you call the &lt;code&gt;sensor_fetch()&lt;/code&gt; function, the nPM1300 driver reads out the ADC result registers and then triggers a new conversion. Consequently, the sensor channel results you obtain will actually reflect the results from the previous &lt;code&gt;sensor_fetch()&lt;/code&gt; call, rather than the most recent one you just initiated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: npm1300 readings delayed by  one measurement</title><link>https://devzone.nordicsemi.com/thread/514897?ContentTypeID=1</link><pubDate>Fri, 13 Dec 2024 13:25:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b866cbec-7cc2-41f7-b62b-ad9029bb583d</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;Hi Dave, &lt;/p&gt;
&lt;p&gt;We are looking into this and will get back to you next week.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>