<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://test-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>Enabling SAADC vddhdiv5 measurements on nrf5340</title><link>https://test-devzone.nordicsemi.com/f/nordic-q-a/88573/enabling-saadc-vddhdiv5-measurements-on-nrf5340</link><description>Hello, 
 I would like to measure battery voltage that is connected to the VDDH pin of an nrf5340 custom board. I understand that this is possible using the nrfx saadc driver, using vddhdiv5 as input to the ADC, but I lack the coding skills to implement</description><dc:language>en-US</dc:language><generator>Telligent Community 13 Non-Production</generator><lastBuildDate>Fri, 03 Jun 2022 12:33:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://test-devzone.nordicsemi.com/f/nordic-q-a/88573/enabling-saadc-vddhdiv5-measurements-on-nrf5340" /><item><title>RE: Enabling SAADC vddhdiv5 measurements on nrf5340</title><link>https://test-devzone.nordicsemi.com/thread/370881?ContentTypeID=1</link><pubDate>Fri, 03 Jun 2022 12:33:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a47e774c-c34e-4aa2-b249-d18d70f5959e</guid><dc:creator>user14926</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There is no nrfx_saadc example in the nRF Connect SDK, but you can start out with the sample created by my colleague in &lt;a href="https://test-devzone.nordicsemi.com/f/nordic-q-a/46716/simple-adc-code/362572#362572"&gt;this post&lt;/a&gt;. You will need to modify is a bit to work with nRF5340 DK, see &lt;a href="https://test-devzone.nordicsemi.com/f/nordic-q-a/87519/nrfx_saadc---buildconf-error-ppi_chen-dppic_chen/365927#365927"&gt;this post&lt;/a&gt;. In this sample, you should be able to set the input to VDDH/5 (&lt;a href="https://github.com/NordicSemiconductor/nrfx/blob/v2.8.0/hal/nrf_saadc.h#L73"&gt;NRF_SAADC_INPUT_VDDHDIV5&lt;/a&gt;&lt;span&gt;)&lt;/span&gt; in&amp;nbsp;NRFX_SAADC_DEFAULT_CHANNEL_SE() macro.&lt;/p&gt;
&lt;p&gt;You may also be able to &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.0.99-ncs1/samples/boards/nrf/battery/src/battery.c#L144"&gt;modify the input&lt;/a&gt; in the Zephyr NRFX Battery sample to use the VDDH/5 input (&lt;span&gt;SAADC_CH_PSELP_PSELP_VDDHDIV5)&lt;/span&gt;, but I have not tested this.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>