<?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>nrf51822 tempeture based on interrupt</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15729/nrf51822-tempeture-based-on-interrupt</link><description>I can read temp value by pulling flag but I Want to do that by interrupt
I added this code to my Keil but interrupt on temp didn&amp;#39;t work.
I use Adc interrupt like this definition. 
 static void temp_init(void){	

NRF_TEMP-&amp;gt;INTENSET |= TEMP_INTENSET_DATARDY_Enabled;</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Aug 2016 19:37:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15729/nrf51822-tempeture-based-on-interrupt" /><item><title>RE: nrf51822 tempeture based on interrupt</title><link>https://devzone.nordicsemi.com/thread/60028?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2016 19:37:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70c17769-5609-479c-a2cd-7c58fedbfbac</guid><dc:creator>ALi</dc:creator><description>&lt;p&gt;this my adc code: I copied.
and start task in app timer and it works:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//ADC initialization
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_None &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_VBG &amp;lt;&amp;lt; ADC_CONFIG_REFSEL_Pos)							/*!&amp;lt; Use internal 1.2V bandgap 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;
}

/* Interrupt handler for ADC data ready event */
void ADC_IRQHandler(void)
{
	uint16_t adc_result;
	
	/* Clear dataready event */
  NRF_ADC-&amp;gt;

EVENTS_END = 0;	
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;/* Write ADC result both to the UART and over BLE */
adc_result = NRF_ADC-&amp;gt;RESULT;
printf(&amp;quot;ADC p01: %d / 1023\r\n&amp;quot;,adc_result);&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//Use the STOP task to save current. Workaround for PAN_028 rev1.5 anomaly 1.
  NRF_ADC-&amp;gt;TASKS_STOP = 1;
	
	//Release the external crystal
	//sd_clock_hfclk_release();
    }
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 tempeture based on interrupt</title><link>https://devzone.nordicsemi.com/thread/60027?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2016 08:30:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65165a79-1d4f-430c-9bd6-e3501a790d66</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;ADC too have start  task. Difficult to say how you configured ADC without looking at your code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 tempeture based on interrupt</title><link>https://devzone.nordicsemi.com/thread/60026?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2016 08:21:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b84af828-19fa-4072-b656-47e34d317c07</guid><dc:creator>ALi</dc:creator><description>&lt;p&gt;no, it didn&amp;#39;t CALL , but why my ADC interrupt call. it has same form like this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 tempeture based on interrupt</title><link>https://devzone.nordicsemi.com/thread/60025?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2016 08:05:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f87d701c-1f22-4ca6-bc28-e58b8985461d</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;then make sure that it gets called after you power the TEMP module. there is nothing else wrong that i can see&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 tempeture based on interrupt</title><link>https://devzone.nordicsemi.com/thread/60024?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2016 08:00:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0b401c4-f577-420e-8342-5c843caa9815</guid><dc:creator>ALi</dc:creator><description>&lt;p&gt;I do that in my app timer interrupt&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 tempeture based on interrupt</title><link>https://devzone.nordicsemi.com/thread/60023?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2016 07:00:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd82c444-22ca-4936-8782-c3e5e3bb25e1</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;you for got to do&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_TEMP-&amp;gt;TASKS_START = 1; 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;after you power up TEMP module&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>