<?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>Reading Analog Signals While Using the ble_peripheral_uart example in SDK15.0.0 and sending strings to an iPhone</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35697/reading-analog-signals-while-using-the-ble_peripheral_uart-example-in-sdk15-0-0-and-sending-strings-to-an-iphone</link><description>Reading analog signals while using the ble_peripheral_uart in SDK15.0.0 and sending strings to an iPhone 
 I am trying to read values from an analog peripheral device. To perform an analog read, I am using this example from the NordicSnippets simple examples</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 26 Jun 2018 11:50:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35697/reading-analog-signals-while-using-the-ble_peripheral_uart-example-in-sdk15-0-0-and-sending-strings-to-an-iphone" /><item><title>RE: Reading Analog Signals While Using the ble_peripheral_uart example in SDK15.0.0 and sending strings to an iPhone</title><link>https://devzone.nordicsemi.com/thread/137662?ContentTypeID=1</link><pubDate>Tue, 26 Jun 2018 11:50:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cadb309-3c32-4a9d-b8af-3b56ed165008</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Benjamin&lt;/p&gt;
&lt;p&gt;With lines 8-11 in place it will probably assert because you are trying to access the NRF_CLOCK module directly while using the SoftDevice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When using the SoftDevice you should request the external HF clock by calling &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v6.0.0/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html?cp=2_3_1_1_0_2_7_2_3#ga3e5afb495a1b0307c749cc268df94a74"&gt;sd_clock_hfclk_request()&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To verify whether or not the HF clock is running you can use the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v6.0.0/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html?cp=2_3_1_1_0_2_7_2_1#ga622439323dd33dbf6de9cf4508478d9e"&gt;sd_clock_hfclk_is_running&lt;/a&gt;(uint32_t *&amp;nbsp;&lt;em&gt;p_is_running&lt;/em&gt;) function.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also, what pin are you trying to sample?&lt;br /&gt;The original example you are referring to will simply try to measure the VDD voltage (common use case if you want to calculate battery life time).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you want to sample an external input you have to replace&amp;nbsp;SAADC_CH_PSELP_PSELP_VDD with SAADC_CH_PSELP_PSELP_AnalogInputX (where X&amp;nbsp;has to be between 0 and 7)&lt;br /&gt;The mapping between analog input 0-7 and the GPIO pins can be found in the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/pin.html?cp=2_1_0_3#pin_assign"&gt;pin assignment chapter&lt;/a&gt; of the product spec.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The channel index has no special significance other than allowing you to configure 8 independent ADC channels each with a unique ADC configuration. Each channel can be set to a separate input, each with it&amp;#39;s own gain setting, limit settings and so forth. Then you can easily samples through multiple channels in turn, without having to reconfigure the ADC each time you want to change the settings.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>