<?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>Question about how to check the external resistance and output of lpco</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/102986/question-about-how-to-check-the-external-resistance-and-output-of-lpco</link><description>hi 
 I am trying to detect the low voltage of the battery with lpcomp. 
 In this regard, I have two questions. 
 
 1) External resistance of lpcomp input pin 
 - link : devzone.nordicsemi.com/.../measuring-lithium-battery-voltage-with-nrf52 
 
 Looking</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 21 Aug 2023 15:44:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/102986/question-about-how-to-check-the-external-resistance-and-output-of-lpco" /><item><title>RE: Question about how to check the external resistance and output of lpco</title><link>https://devzone.nordicsemi.com/thread/442372?ContentTypeID=1</link><pubDate>Mon, 21 Aug 2023 15:44:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:341afe83-5270-449f-aae1-6d464e9f7679</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1)&lt;/p&gt;
[quote user=""]Can lpcomp use a larger resistor than this?[/quote]
&lt;p&gt;The main thing here is that voltage on the GPIO input should not be higher than VDD voltage. This is also true for LPCOMP. The post you linked to explained it like this. &amp;quot;&lt;span&gt;We also want R2 to be large. R2 should be chosen such that the input voltage does not exceed Vdd when the battery is full (4.2 V). In this example Vdd is 3.3 V, so we choose R2 to be 2 MΩ which will give 3 V at AIN when battery is 4.2 V.&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;2)&lt;/p&gt;
[quote user=""]So what I&amp;#39;m curious about, is reading the output of lpcomp. Can I use nrf_gpio_pin_read() as I read normal GPIO?[/quote]
&lt;p&gt;No. Normally, you get an event when the&amp;nbsp;input is below/above a&amp;nbsp;threshold.&amp;nbsp;But, you can also trigger a reading with the SAMPLE task, and read the result in the&amp;nbsp;Compare result register.&amp;nbsp; See&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/lpcomp.html?cp=5_2_0_38#concept_tdv_zkx_lr"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/lpcomp.html?cp=5_2_0_38#concept_tdv_zkx_lr&lt;/a&gt;&amp;nbsp;on how it works.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>