<?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>nrf52810 SAADC + interrupt without HAL</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64751/nrf52810-saadc-interrupt-without-hal</link><description>Please, give me an advice. I need to measure the supply voltage and trigger an interrupt after the measurement. An END interrupt is triggered only once. It must be without libraries, just by writing to NRF_SAADC-&amp;gt;....</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 12 Aug 2020 12:27:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64751/nrf52810-saadc-interrupt-without-hal" /><item><title>RE: nrf52810 SAADC + interrupt without HAL</title><link>https://devzone.nordicsemi.com/thread/264261?ContentTypeID=1</link><pubDate>Wed, 12 Aug 2020 12:27:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:162f4653-13da-4c66-b14b-2b14da3bafc5</guid><dc:creator>haakonsh</dc:creator><description>[quote user="jca"]libraries must not be used[/quote]
&lt;p&gt;&amp;nbsp;You need to use the HAL in order to operate the nRF52 safely, for instance:&amp;nbsp;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;__STATIC_INLINE void nrf_saadc_event_clear(nrf_saadc_event_t event)
{
    *((volatile uint32_t *)((uint8_t *)NRF_SAADC + (uint32_t)event)) = 0x0UL;
#if __CORTEX_M == 0x04
    volatile uint32_t dummy = *((volatile uint32_t *)((uint8_t *)NRF_SAADC + (uint32_t)event));
    (void)dummy;
#endif
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;That dummy read is necessary, see&amp;nbsp;&lt;a title="Migrating from the nRF51 Series to the nRF52 Series" href="https://infocenter.nordicsemi.com/topic/migration_nrf52/MIG/nrf52_migration/preface.html?cp=4_8"&gt;Migrating from the nRF51 Series to the nRF52 Series&lt;/a&gt;&amp;nbsp;-&amp;gt;&amp;nbsp;&lt;a title="Functional changes" href="https://infocenter.nordicsemi.com/topic/migration_nrf52/MIG/nrf52_migration/functional.html?cp=4_8_0"&gt;Functional changes&lt;/a&gt;.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52810 SAADC + interrupt without HAL</title><link>https://devzone.nordicsemi.com/thread/264258?ContentTypeID=1</link><pubDate>Wed, 12 Aug 2020 12:13:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2af9d8ea-f207-44f3-bf05-51cf58a53240</guid><dc:creator>jca</dc:creator><description>&lt;p&gt;It doesn&amp;#39;t work. I have a project where bluetooth is used and due to the size of the softdevice, all logs must be turned off and libraries must not be used.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52810 SAADC + interrupt without HAL</title><link>https://devzone.nordicsemi.com/thread/264243?ContentTypeID=1</link><pubDate>Wed, 12 Aug 2020 11:35:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f1cb21e-1710-4feb-a5f2-4abf88a48ef0</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Try to use &lt;a title="nrf_saadc_event_clear" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.0/group__nrf__saadc__hal.html?cp=7_1_6_8_0_30_3_35#ga821c82c2900bb7469afffffc9f8ca0c5"&gt;nrf_saadc_event_clear&lt;/a&gt;&amp;nbsp;instead of&amp;nbsp;&lt;span&gt;NRF_SAADC-&amp;gt;EVENTS_END = 0;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52810 SAADC + interrupt without HAL</title><link>https://devzone.nordicsemi.com/thread/264230?ContentTypeID=1</link><pubDate>Wed, 12 Aug 2020 10:55:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e654bbf-63b1-4e72-9fb0-0159ccdba348</guid><dc:creator>jca</dc:creator><description>&lt;p&gt;&lt;span class="tlid-translation translation" lang="en"&gt;&lt;span class="" title=""&gt;I start the measurement by software.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="tlid-translation translation" lang="en"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="tlid-translation translation" lang="en"&gt;In interrupt the flag is cleared.:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="tlid-translation translation" lang="en"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="tlid-translation translation" lang="en"&gt;void SAADC_IRQHandler(void)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(NRF_SAADC-&amp;gt;EVENTS_END &amp;gt; 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;NRF_SAADC-&amp;gt;EVENTS_END = 0;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="tlid-translation translation" lang="en"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52810 SAADC + interrupt without HAL</title><link>https://devzone.nordicsemi.com/thread/264227?ContentTypeID=1</link><pubDate>Wed, 12 Aug 2020 10:48:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f49ff5d4-5f32-43cb-bb0c-d32b29815219</guid><dc:creator>haakonsh</dc:creator><description>[quote user=""] An END interrupt is triggered only once. [/quote]
&lt;p&gt;&amp;nbsp;Have you remembered to clear it after it has fired?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>