<?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>Can I really not use LPCOMP and ADC at the same time?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/4666/can-i-really-not-use-lpcomp-and-adc-at-the-same-time</link><description>In the &amp;quot;NRF51 Series Reference Manual&amp;quot; (v3.0) it states: 
 The LPCOMP shares registers and other resources with peripherals that have the same ID as the LPCOMP.
You must disable all peripherals that have the same ID as the LPCOMP before the LPCOMP</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 03 Dec 2014 12:28:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/4666/can-i-really-not-use-lpcomp-and-adc-at-the-same-time" /><item><title>RE: Can I really not use LPCOMP and ADC at the same time?</title><link>https://devzone.nordicsemi.com/thread/16559?ContentTypeID=1</link><pubDate>Wed, 03 Dec 2014 12:28:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e924d3b9-2659-4504-8a07-d512c256d088</guid><dc:creator>Anne van Rossum</dc:creator><description>&lt;p&gt;Extremely useful! Thanks a lot!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I really not use LPCOMP and ADC at the same time?</title><link>https://devzone.nordicsemi.com/thread/16558?ContentTypeID=1</link><pubDate>Tue, 02 Dec 2014 15:42:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ee0abcf-c777-4bb1-922f-91768b2de3f3</guid><dc:creator>Anne van Rossum</dc:creator><description>&lt;p&gt;Thanks! It might indeed be that the PSEL MUX is the only thing shared. That would be nice. I personally don&amp;#39;t think the LPCOMP is implemented using ADC circuitry, but who knows... Awaiting your experiment! :-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I really not use LPCOMP and ADC at the same time?</title><link>https://devzone.nordicsemi.com/thread/16557?ContentTypeID=1</link><pubDate>Tue, 02 Dec 2014 12:59:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a9aba64-f5ad-4014-8ff8-702d7ef00b87</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;As far as I know, the PSEL MUX is shared. I learned this the hard way when I was trying to monitor voltage with LPCOMP on an AIN pin and sampling with the ADC on another AIN pin. I could enable both of them but the ADC output did not make sense and the LPCOMP did not trigger on the right voltage level.&lt;/p&gt;
&lt;p&gt;If I am correct that only the PSEL MUX is shared, then you should be able to measure battery voltage with the ADC while monitoring voltage on AIN pin with the LPCOMP. I have not tried this yet.&lt;/p&gt;
&lt;p&gt;I will seek confirmation on that only PSEL MUX is shared with ADC and LPCOMP, and update this thread otherwise.&lt;/p&gt;
&lt;p&gt;There is a LPCOMP example available on &lt;a href="https://devzone.nordicsemi.com/question/12751/lpcomp-wakeup-example/"&gt;this thread&lt;/a&gt;, ADC examples are available on &lt;a href="https://github.com/NordicSemiconductor/nrf51-ADC-examples"&gt;Nordic&amp;#39;s Github&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 3.12.2014&lt;/strong&gt;
I have done some testing, seems like the MUX is shared and nothing else. In my test code, I have monitored voltage level on AIN4 pin with LPCOMP and sampled on AIN6 with the ADC at the same time. The higher of the two input voltages will be input to both LPCOMP and ADC. For example if I have 0.6V on AIN6 and 1.5V on AIN4, 1.5V will be input to both LPCOMP and ADC. If I however use the ADC only to sample the supply voltage, i.e. not from AIN pin, then both LPCOMP and ADC work fine.&lt;/p&gt;
&lt;p&gt;I include my test code below, which in current state seems to work fine with ADC sampling supply voltage and LPCOMP monitoring voltage on AIN4. I have tested it with nRF51 SDK v6.1.0 and the nRF51822 development kit.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ADC_5F00_and_5F00_LPCOMP_5F00_test.zip"&gt;ADC_and_LPCOMP_test.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 4.12.2014&lt;/strong&gt;
The designer has confirmed that my findings are as expected. Only the PSEL MUX is shared, so it should be safe to use ADC for battery monitoring while using LPCOMP at the same time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>