<?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>NRF52840 DK, SAADC, and HFXO</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69328/nrf52840-dk-saadc-and-hfxo</link><description>Hello, all. 
 
 I am working on a project in which I got to sample a signal that has a minimum frequency of 1Hz and a maximum frequency of 10kHz (The full range must be faithfully sampled and transmitted) and stream the sampled data via BLE to an Android</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 08 Jun 2021 00:33:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69328/nrf52840-dk-saadc-and-hfxo" /><item><title>RE: NRF52840 DK, SAADC, and HFXO</title><link>https://devzone.nordicsemi.com/thread/314050?ContentTypeID=1</link><pubDate>Tue, 08 Jun 2021 00:33:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8d3621e-89c8-4857-87c7-22194ac10677</guid><dc:creator>Thiago</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;J&amp;oslash;rgen.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Actually, these are two waves, a square wave, and a sine wave, input to two ADC channels (p0.04 and p0.05 in the nRF52840 Dev. board). The plots are of the waves after ADC sampling and transfer via UART to a COM port in a computer.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is the best I got after the BLE transmission to a tablet:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/800x600/__key/communityserver-discussions-components-files/4/Two-channels-_2D00_-Sine-x-Square.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As can be seen, some error is still present in the waves.&amp;nbsp;So, it seems like it is not due to the ADC sampling.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 DK, SAADC, and HFXO</title><link>https://devzone.nordicsemi.com/thread/313972?ContentTypeID=1</link><pubDate>Mon, 07 Jun 2021 14:24:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eac301ea-b346-455e-ad96-16ec62b6f05d</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Does these plots show the same SAADC samples sent over UART (red) and BLE (blue)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 DK, SAADC, and HFXO</title><link>https://devzone.nordicsemi.com/thread/313256?ContentTypeID=1</link><pubDate>Thu, 03 Jun 2021 06:22:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db929878-e54b-4c7b-b071-971bfb016db7</guid><dc:creator>Thiago</dc:creator><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;I tested two channels ADC and sent the data via UART to a terminal after reorganizing the samples, a necessary step since ADC stores the samples in an alternate fashion. I tested signals with 10kHz and 20kHz frequencies.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is how the waveforms look like:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;At 10kHz:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/800x240/__key/communityserver-discussions-components-files/4/2-Channels_5F00_10kHz.png" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;At 20kHz:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/800x240/__key/communityserver-discussions-components-files/4/2-Channels_5F00_20kHz.png" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This probably means that if there is a problem it is with the BLE transmission, either in the client or the server.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 DK, SAADC, and HFXO</title><link>https://devzone.nordicsemi.com/thread/301139?ContentTypeID=1</link><pubDate>Mon, 22 Mar 2021 09:08:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30059cf0-7968-4d47-965c-fb89a634daca</guid><dc:creator>Thiago</dc:creator><description>&lt;p&gt;Hello, Jorgen.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="14926" url="~/f/nordic-q-a/69328/nrf52840-dk-saadc-and-hfxo/300413#300413"]Have you checked how the raw samples look if you get it directly from the board (with a debugger/UART/RTT), and then plot it in your graph?[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t tested that yet, but when I do it I will share the results here in this ticket.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 DK, SAADC, and HFXO</title><link>https://devzone.nordicsemi.com/thread/300413?ContentTypeID=1</link><pubDate>Wed, 17 Mar 2021 12:55:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd2ed822-d158-40d7-8868-e3ed39261d00</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;So you are saying that the transfer of data over BLE affects the signal?&lt;/p&gt;
&lt;p&gt;This indicates that the problem is with the transfer of the samples, or processing on the receiving side, not with the SAADC samples itself.&lt;/p&gt;
&lt;p&gt;Have you checked how the raw samples look if you get it directly from the board (with a debugger/UART/RTT), and then plot it in your graph?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 DK, SAADC, and HFXO</title><link>https://devzone.nordicsemi.com/thread/300262?ContentTypeID=1</link><pubDate>Wed, 17 Mar 2021 01:17:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef54b2c0-1b39-4ed7-afdc-fcda10ac70ae</guid><dc:creator>Thiago</dc:creator><description>&lt;p&gt;Hello, Jorgen.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I just would like to add that after testing the same board and code connected with another development board (Before it was connecting with an Android device) I was able to get much higher speeds and improved signal quality.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your support, Jorgen.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 DK, SAADC, and HFXO</title><link>https://devzone.nordicsemi.com/thread/288024?ContentTypeID=1</link><pubDate>Thu, 07 Jan 2021 16:30:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74a9897b-445b-4392-aa58-8a5d477ec749</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Not running offset calibration should not cause this, but we have an errata for some of the nRF52 chips that could cause samples to be written to RAM after offset calibration if the correct steps are not taken.&lt;/p&gt;
&lt;p&gt;I will try to test your application, but it will take some time to get hold of some signal generator for the inputs.&lt;/p&gt;
&lt;p&gt;I see that you send the samples over BLE. Is the plots from the buffers on the nRF side, or have they been transmitted over BLE? Have you verified that the samples in the SAADC buffer match what is received on the other side of the BLE link?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 DK, SAADC, and HFXO</title><link>https://devzone.nordicsemi.com/thread/287355?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2021 01:03:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6614c448-897c-45f1-978f-b510ab7954c0</guid><dc:creator>Thiago</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;J&amp;oslash;rgen. Happy new year.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am not running offset calibration. Could it be the cause of the issue?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The code is in the uploaded file. It runs in the nRF_SDK_16.0.0. It should be placed in the \examples\ble_peripheral folder of the SDK.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/BLE_5F00_SAADC.zip"&gt;devzone.nordicsemi.com/.../BLE_5F00_SAADC.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 DK, SAADC, and HFXO</title><link>https://devzone.nordicsemi.com/thread/287308?ContentTypeID=1</link><pubDate>Mon, 04 Jan 2021 15:46:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41cea7c1-91b0-4d9c-96d3-c18280b2bf3b</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;The outlier-samples seems to happen quite regularly. Does these correspond to the start/end of the SAADC buffers or something similar?&lt;/p&gt;
&lt;p&gt;Are you running offset calibration in your application? If you are, you should make sure to follow &lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52840_Rev1/ERR/nRF52840/Rev1/latest/anomaly_840_237.html"&gt;this errata&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Can you post your full project/code for us to reproduce this behavior?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 DK, SAADC, and HFXO</title><link>https://devzone.nordicsemi.com/thread/286555?ContentTypeID=1</link><pubDate>Thu, 24 Dec 2020 09:47:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0b1d19b-4062-4832-a041-8ea21a9a0c41</guid><dc:creator>Thiago</dc:creator><description>&lt;p&gt;Hello, Jorgen.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your response.&lt;/p&gt;
&lt;p&gt;Currently, the acquisition time is configured to 3us and the sampling event is triggered at every 10us by a timer.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here are some images of the sampled signals:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;50Hz sine wave:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/800x650/__key/communityserver-discussions-components-files/4/50Hz.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1Khz sine wave:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x800/__key/communityserver-discussions-components-files/4/1kHz.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;5kHz sine wave:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/800x640/__key/communityserver-discussions-components-files/4/5kHz.jpg" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I saw in the forum people saying that while reading data with the ADC, it was suggested to remove the debugger and to use a stable power source (not the computer USB). I tried it but the result was not different.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Would you happen to know why&amp;nbsp;the ADC&amp;nbsp;readings are like that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 DK, SAADC, and HFXO</title><link>https://devzone.nordicsemi.com/thread/284290?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2020 10:50:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d056ce5c-107c-406a-afa7-429c019d329a</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;What is the sample-rate you are using for sampling? Enabling oversampling will reduce the effective maximum sample-rate, as the SAADC needs to capture N number of samples for each channel before performing the averaging, so it makes sense that enabling oversampling may distort the higher frequency signals if the sample rate is not kept high enough. I can&amp;#39;t explain why the lower frequency signals are distorted without oversampling though.&lt;/p&gt;
&lt;p&gt;Can you give some example output or plots of the distorted samples compared to the original signal, to give a better understanding of the problem?&lt;/p&gt;
&lt;p&gt;The source of the HFCLK is not configured per se, but it is used whenever it is started by &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/clock.html#register.TASKS_HFCLKSTART"&gt;triggering the HFCLKSTART task&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;
NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;
while (NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0);&lt;/pre&gt;&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>