<?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>Why NRF24LE1 ADC is reading value always as 255?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/38893/why-nrf24le1-adc-is-reading-value-always-as-255</link><description>I am doing a register retention gzll transmit code with ADC. But problem is that the ADC value transmitted is always 255, if I connect ground to ADC it would read 247. Why is there such a problem here. Here is my code:</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Sep 2018 11:58:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/38893/why-nrf24le1-adc-is-reading-value-always-as-255" /><item><title>RE: Why NRF24LE1 ADC is reading value always as 255?</title><link>https://devzone.nordicsemi.com/thread/150687?ContentTypeID=1</link><pubDate>Thu, 27 Sep 2018 11:58:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ec03bf9-1ba4-4256-ae50-e67274a1b941</guid><dc:creator>infibit</dc:creator><description>&lt;p&gt;Yeah I started from the example again and this time I disabled pinwake up and it worked.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why NRF24LE1 ADC is reading value always as 255?</title><link>https://devzone.nordicsemi.com/thread/150683?ContentTypeID=1</link><pubDate>Thu, 27 Sep 2018 11:53:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9929c318-926a-481e-a1a1-9c467e6b6c81</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;This is a classic debug problem, you must try and fail a bit to learn, you don&amp;#39;t have to ask a question every time something is not working. Have you tried other analog input pins using the sdk example? Have you checked that there is no other functionality enabled for the pin you are using (e.g. jtag, uart, gpint, etc).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;A value of 255 means that you are either using the wrong pin, something is forcing the pin high, or there is a configuration issue. The recommendation is to use the example in the sdk and do as small changes as possible to check the different analog input pins.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why NRF24LE1 ADC is reading value always as 255?</title><link>https://devzone.nordicsemi.com/thread/150632?ContentTypeID=1</link><pubDate>Thu, 27 Sep 2018 08:41:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df046370-10aa-4079-88f1-becd15ca231a</guid><dc:creator>infibit</dc:creator><description>&lt;p&gt;Kenneth I am waiting for your reply.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why NRF24LE1 ADC is reading value always as 255?</title><link>https://devzone.nordicsemi.com/thread/150537?ContentTypeID=1</link><pubDate>Wed, 26 Sep 2018 16:06:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fde7be28-798c-4b44-8ece-1f0c21348577</guid><dc:creator>infibit</dc:creator><description>&lt;p&gt;Yes as I posted my code above,&amp;nbsp; I have done that already. So why is the ADC value coming as 255? Has it got something to do with gazell or pinwake or register retention mode interfering with the ADC?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why NRF24LE1 ADC is reading value always as 255?</title><link>https://devzone.nordicsemi.com/thread/150519?ContentTypeID=1</link><pubDate>Wed, 26 Sep 2018 14:43:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20047e8c-511a-4a84-a4ef-75ee2e063614</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I recommend to try the SDK example:&amp;nbsp;\nRFgo SDK 2.3.0.10040\source_code\projects\nrfgo_sdk\adc_examples\adc_single_step_mode&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You should only need to modify:&amp;nbsp;hal_adc_set_input_channel(HAL_ADC_INP_AIN0);&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why NRF24LE1 ADC is reading value always as 255?</title><link>https://devzone.nordicsemi.com/thread/150487?ContentTypeID=1</link><pubDate>Wed, 26 Sep 2018 12:47:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67e9da73-4182-464d-b4d3-3091dd0da8aa</guid><dc:creator>infibit</dc:creator><description>&lt;p&gt;Even after declaring P0DIR as 0x22, I am still getting the same problem. ADC reads 255 and if I ground it instead of reading 0 it reads 247.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why NRF24LE1 ADC is reading value always as 255?</title><link>https://devzone.nordicsemi.com/thread/150483?ContentTypeID=1</link><pubDate>Wed, 26 Sep 2018 12:32:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c00fc16e-71ed-463b-b229-3cfc503b8f79</guid><dc:creator>infibit</dc:creator><description>&lt;p&gt;Does this code of line &amp;nbsp;hal_adc_set_input_channel(HAL_ADC_INP_AIN6); not do that?&amp;nbsp; So how do we set a pin as input? (Also at the same time let me know how to set it as output? Say P0DIR =0 and P01 = 0 set it as output?). Since the pin wake up on port 0 needs P0DIR = 0x02, on the same lines P0DIR=0x22 will set AIN6 also as input?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why NRF24LE1 ADC is reading value always as 255?</title><link>https://devzone.nordicsemi.com/thread/150476?ContentTypeID=1</link><pubDate>Wed, 26 Sep 2018 12:21:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a907084-6f77-4102-bbd9-7911088cfd82</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Have you set the HAL_ADC_INP_AIN6 pin as input?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why NRF24LE1 ADC is reading value always as 255?</title><link>https://devzone.nordicsemi.com/thread/150470?ContentTypeID=1</link><pubDate>Wed, 26 Sep 2018 12:10:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0cbec35-3970-4034-9892-7e3c0c0a3af7</guid><dc:creator>infibit</dc:creator><description>&lt;p&gt;Dear Support Engineer, I am waiting for your reply.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>