<?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>Use AREF1(pin0.06) as analog reference voltage for ADC instead of internal VBG</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15186/use-aref1-pin0-06-as-analog-reference-voltage-for-adc-instead-of-internal-vbg</link><description>Dear Sir:
Could I use the external reference AREF1(pin0.06) instead of internal VBG 1.2V for ADC operation ?
I do the following settings to config using external reference 
 nrf_adc_config.resolution = NRF_ADC_CONFIG_RES_10BIT;
 nrf_adc_config.scaling</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Jul 2016 05:58:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15186/use-aref1-pin0-06-as-analog-reference-voltage-for-adc-instead-of-internal-vbg" /><item><title>RE: Use AREF1(pin0.06) as analog reference voltage for ADC instead of internal VBG</title><link>https://devzone.nordicsemi.com/thread/57982?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2016 05:58:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66bf18e2-7908-47a8-a95d-3cc42456afa0</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;I imagine the RC circuit was some kind of filter? It depends on your usecase, if you know you have noisy power lines then it might be a good idea. If you do have noisy power lines it might not be the best idea to use an external reference to start with.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use AREF1(pin0.06) as analog reference voltage for ADC instead of internal VBG</title><link>https://devzone.nordicsemi.com/thread/57981?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2016 05:56:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96d8b3e6-14e3-41b9-8ce0-2497870ea634</guid><dc:creator>yunlong.wang</dc:creator><description>&lt;p&gt;Hi:&lt;/p&gt;
&lt;p&gt;One more question, I search for the relation between ADC and capacitor yesterday , I found some suggestion that insert an RC circuit before ADC input.
So, is it neccessary to put a RC circuit  before ADC input pin, or a reservoir capacitor  is just enough ?&lt;/p&gt;
&lt;p&gt;Thanks a lot&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use AREF1(pin0.06) as analog reference voltage for ADC instead of internal VBG</title><link>https://devzone.nordicsemi.com/thread/57975?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2016 05:42:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87e8f492-1177-446f-bdc4-3eb5476f27c2</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;It has to be &amp;quot;large enough&amp;quot; so that if the power lines are pulled down the capacitor will still provide stable reference, somewhere in the µF range probably around 5-10 should be fine.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use AREF1(pin0.06) as analog reference voltage for ADC instead of internal VBG</title><link>https://devzone.nordicsemi.com/thread/57974?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2016 02:39:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9bf7d55-767a-480a-a3d4-c9797cede7fc</guid><dc:creator>yunlong.wang</dc:creator><description>&lt;p&gt;Hi：
I will try to add a capacitor to the AREF port, but how to define the capacitor value? Is there a formula to caculate the value ?
Thanks a lot&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use AREF1(pin0.06) as analog reference voltage for ADC instead of internal VBG</title><link>https://devzone.nordicsemi.com/thread/57970?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 13:04:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:851ee753-863b-422f-9eb0-755ba2b5e10e</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;Ah, then I understand. I thought you were not getting any output, my bad.&lt;/p&gt;
&lt;p&gt;Referring to the &lt;a href="http://infocenter.nordicsemi.com/pdf/nRF51822_PS_v3.2.pdf"&gt;product specification&lt;/a&gt; the ADC will get less accurate for lower voltages, with specificed 3 LSB error at 1V8, I think this may increase if the voltage decreases further. The 1.013V you see is likely within specifications of the ADC device.&lt;/p&gt;
&lt;p&gt;As you suggested earlier you can try to add a reservoir capacitor to the AREF port and see if this improves things.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use AREF1(pin0.06) as analog reference voltage for ADC instead of internal VBG</title><link>https://devzone.nordicsemi.com/thread/57980?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 12:49:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c74469e-ab69-4ac9-9e00-0bd9d4bd5537</guid><dc:creator>yunlong.wang</dc:creator><description>&lt;p&gt;Yes, I try to change ADC_CONFIG_INPSEL_AnalogInputOneThirdPrescaling to ADC_CONFIG_INPSEL_AnalogInputNoPrescaling, but the voltage I read is also larger than 1.0V.
The &amp;quot;previous code &amp;quot;you mentioned is my own code ? Yes, I can get value by the following code&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void mp_adc_config(void)
{    
    nrf_adc_config_t nrf_adc_config = NRF_ADC_CONFIG_DEFAULT;

		nrf_adc_config.resolution = NRF_ADC_CONFIG_RES_10BIT;
		nrf_adc_config.scaling = NRF_ADC_CONFIG_SCALING_INPUT_FULL_SCALE;
		nrf_adc_config.reference = NRF_ADC_CONFIG_REF_EXT_REF1;

    nrf_adc_configure( (nrf_adc_config_t *)&amp;amp;nrf_adc_config);

    nrf_adc_int_enable(ADC_INTENSET_END_Enabled &amp;lt;&amp;lt; ADC_INTENSET_END_Pos);  /*!&amp;lt; Interrupt enabled. */
    NVIC_SetPriority(ADC_IRQn, NRF_APP_PRIORITY_HIGH);   //Configure the priority
    NVIC_EnableIRQ(ADC_IRQn);
	
		mp_adc_init();

		nrf_adc_input_select(g_mpADC[MP_ADC_INDEX_TEMP].channel);
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use AREF1(pin0.06) as analog reference voltage for ADC instead of internal VBG</title><link>https://devzone.nordicsemi.com/thread/57979?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 12:45:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e7bf41f-13ba-4242-b5f0-c7bc99cbe7de</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;By the way, be sure to adjust the scaling, in the code I provided I had set ADC_CONFIG_INPSEL_AnalogInputOneThirdPrescaling, but this might not be right for your applciation, you need to tweak around with this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use AREF1(pin0.06) as analog reference voltage for ADC instead of internal VBG</title><link>https://devzone.nordicsemi.com/thread/57978?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 12:43:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01a2a37a-4359-43c2-8525-c0758835ca6a</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;Were you able to get any readings with the previous code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use AREF1(pin0.06) as analog reference voltage for ADC instead of internal VBG</title><link>https://devzone.nordicsemi.com/thread/57977?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 12:35:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93dec0bf-3c94-46f3-bc72-835bceb1aedb</guid><dc:creator>yunlong.wang</dc:creator><description>&lt;p&gt;Hi:
I use the following setting as you recommanded, the voltage value I read is 1.013V, But the real value is 0.9V. And when I use internal 1.2V as reference voltage ,the value I get is close to 0.9V.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_ADC-&amp;gt;CONFIG = (ADC_CONFIG_EXTREFSEL_AnalogReference1 &amp;lt;&amp;lt; ADC_CONFIG_EXTREFSEL_Pos) /* Bits 17..16 : ADC external reference pin selection. */
                    | (ADC_CONFIG_PSEL_AnalogInput2 &amp;lt;&amp;lt; ADC_CONFIG_PSEL_Pos)                      /*!&amp;lt; Use analog input 2 as analog input. */
                    | (ADC_CONFIG_REFSEL_External &amp;lt;&amp;lt; ADC_CONFIG_REFSEL_Pos)                      /*!&amp;lt; Use external voltage as reference for conversion. */
                    | (ADC_CONFIG_INPSEL_AnalogInputOneThirdPrescaling &amp;lt;&amp;lt; ADC_CONFIG_INPSEL_Pos) /*!&amp;lt; Analog input specified by PSEL with no prescaling used as input for the conversion. */
                    | (ADC_CONFIG_RES_10bit &amp;lt;&amp;lt; ADC_CONFIG_RES_Pos);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use AREF1(pin0.06) as analog reference voltage for ADC instead of internal VBG</title><link>https://devzone.nordicsemi.com/thread/57976?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 11:36:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eec1b650-1ba8-4c94-b0c3-60f639bc3a06</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;Instead of nrf_adc_configure() try calling&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_ADC-&amp;gt;CONFIG = (ADC_CONFIG_EXTREFSEL_AnalogReference1 &amp;lt;&amp;lt; ADC_CONFIG_EXTREFSEL_Pos) /* Bits 17..16 : ADC external reference pin selection. */
                    | (ADC_CONFIG_PSEL_AnalogInput2 &amp;lt;&amp;lt; ADC_CONFIG_PSEL_Pos)                      /*!&amp;lt; Use analog input 2 as analog input. */
                    | (ADC_CONFIG_REFSEL_External &amp;lt;&amp;lt; ADC_CONFIG_REFSEL_Pos)                      /*!&amp;lt; Use external voltage as reference for conversion. */
                    | (ADC_CONFIG_INPSEL_AnalogInputOneThirdPrescaling &amp;lt;&amp;lt; ADC_CONFIG_INPSEL_Pos) /*!&amp;lt; Analog input specified by PSEL with no prescaling used as input for the conversion. */
                    | (ADC_CONFIG_RES_10bit &amp;lt;&amp;lt; ADC_CONFIG_RES_Pos);                              /*!&amp;lt; 8bit ADC resolution. */
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use AREF1(pin0.06) as analog reference voltage for ADC instead of internal VBG</title><link>https://devzone.nordicsemi.com/thread/57971?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 10:35:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6278c484-05b8-4267-a062-355dd6485eba</guid><dc:creator>yunlong.wang</dc:creator><description>&lt;p&gt;Hi Yvind：
The VREF is 1.24V， and the following is ADC related Code&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void mp_adc_config(void)
{    

    //1.10 BIT ADC    2.SCALING_INPUT_FULL_SCALE     3.Vref = 1.24V  
    nrf_adc_config_t nrf_adc_config = NRF_ADC_CONFIG_DEFAULT;

		nrf_adc_config.resolution = NRF_ADC_CONFIG_RES_10BIT;
		nrf_adc_config.scaling = NRF_ADC_CONFIG_SCALING_INPUT_FULL_SCALE;
		nrf_adc_config.reference = NRF_ADC_CONFIG_REF_EXT_REF1;

    // Initialize and configure ADC
    nrf_adc_configure( (nrf_adc_config_t *)&amp;amp;nrf_adc_config);

    nrf_adc_int_enable(ADC_INTENSET_END_Enabled &amp;lt;&amp;lt; ADC_INTENSET_END_Pos);  /*!&amp;lt; Interrupt enabled. */
    NVIC_SetPriority(ADC_IRQn, NRF_APP_PRIORITY_HIGH);   //Configure the priority
    NVIC_EnableIRQ(ADC_IRQn);
	
		mp_adc_init();

		nrf_adc_input_select(g_mpADC[MP_ADC_INDEX_TEMP].channel);

		g_currAdcChannelIndex = 0;
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use AREF1(pin0.06) as analog reference voltage for ADC instead of internal VBG</title><link>https://devzone.nordicsemi.com/thread/57973?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 10:25:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56654488-9cc5-436a-bd96-4a0e33ad5428</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;What voltage are you applying to VREF? It should be between 0.83V - 1.3V. A capacitor on the pin helps keep constant voltage, however I still think you should see something, this leads me to think that there is something wrong with your code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use AREF1(pin0.06) as analog reference voltage for ADC instead of internal VBG</title><link>https://devzone.nordicsemi.com/thread/57972?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 10:18:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e055e80-06db-4772-8a91-7ee8b18ce8a8</guid><dc:creator>yunlong.wang</dc:creator><description>&lt;p&gt;Hi Yvind：
It seems no work, the following is the register setting of ADC on the product, Is there something wrong ?
&lt;strong&gt;&lt;em&gt;1. ADC-&amp;gt;CONFIG = 0x00020822
2. ADC-&amp;gt;INTENSET = 0x01
3. ADC-&amp;gt;INTENCLR = 0x01
4. ADC-&amp;gt;POWER = 0x01&lt;/em&gt;&lt;/strong&gt;
If we want to use external reference voltage, should I pay attention to the hardware desgin ? Do I need  to connect a capacitor from the AIN7( gpio0.06) pin to ground ?&lt;/p&gt;
&lt;p&gt;Thanks a lot&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use AREF1(pin0.06) as analog reference voltage for ADC instead of internal VBG</title><link>https://devzone.nordicsemi.com/thread/57969?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 08:40:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b27424f-d633-4ea3-99ba-466e40eaeda7</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I will assume you are using nRF51. Essentially you will need to configure EXTREFSEL with AREF1 and REFSEL with External. Something like this should work (I use hardware registers by preference).&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void adc_init(void)
{	
	/* Enable interrupt on ADC sample ready event*/		
	NRF_ADC-&amp;gt;INTENSET = ADC_INTENSET_END_Msk;   
	sd_nvic_SetPriority(ADC_IRQn, NRF_APP_PRIORITY_LOW);  
	sd_nvic_EnableIRQ(ADC_IRQn);
	
	NRF_ADC-&amp;gt;CONFIG	= (ADC_CONFIG_EXTREFSEL_AnalogReference1 &amp;lt;&amp;lt; ADC_CONFIG_EXTREFSEL_Pos) /* Bits 17..16 : ADC external reference pin selection. */
					| (ADC_CONFIG_PSEL_AnalogInput2 &amp;lt;&amp;lt; ADC_CONFIG_PSEL_Pos)					     /*!&amp;lt; Use analog input 2 as analog input. */
					| (ADC_CONFIG_REFSEL_External &amp;lt;&amp;lt; ADC_CONFIG_REFSEL_Pos)					     /*!&amp;lt; Use external voltage as reference for conversion. */
					| (ADC_CONFIG_INPSEL_AnalogInputOneThirdPrescaling &amp;lt;&amp;lt; ADC_CONFIG_INPSEL_Pos) /*!&amp;lt; Analog input specified by PSEL with no prescaling used as input for the conversion. */
					| (ADC_CONFIG_RES_10bit &amp;lt;&amp;lt; ADC_CONFIG_RES_Pos);							     /*!&amp;lt; 8bit ADC resolution. */ 
	
	/* Enable ADC*/
	NRF_ADC-&amp;gt;ENABLE = ADC_ENABLE_ENABLE_Enabled;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/question/3512/adc-reference-selection-nrf51822/"&gt;This answer&lt;/a&gt; also contains some useful information.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>