<?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>[nRF52] ADC and BLE send</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69924/nrf52-adc-and-ble-send</link><description>Hello all, I&amp;#39;m working on ADC and data transmission. 
 Device do ADC first, and send those values. 
 Sampling frequency of ADC is ~80 kHz (sampling per 13 microseconds), and using 2 Mbps transmission mode. 
 An array is sent to nRF52 app (smartphone)</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Jan 2021 08:28:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69924/nrf52-adc-and-ble-send" /><item><title>RE: [nRF52] ADC and BLE send</title><link>https://devzone.nordicsemi.com/thread/289934?ContentTypeID=1</link><pubDate>Tue, 19 Jan 2021 08:28:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38d28f18-ab87-47b5-b1c0-e0cb5a69fac5</guid><dc:creator>DL_November</dc:creator><description>&lt;p&gt;Hi! I&amp;#39;m suffering from a similar problem...&lt;/p&gt;
&lt;p&gt;Is the graph now shows no sudden increase?&lt;/p&gt;
&lt;p&gt;May I ask you how did you draw the graph?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52] ADC and BLE send</title><link>https://devzone.nordicsemi.com/thread/289919?ContentTypeID=1</link><pubDate>Tue, 19 Jan 2021 07:21:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47fc42de-10dc-428d-bc39-d0f1b5eb4f0f</guid><dc:creator>juulee</dc:creator><description>&lt;p&gt;Sorry for late reply.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know why it shows very low speed.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But, with your help - sd_ble_gatts_hvx, I solved this low speed problem!&lt;/p&gt;
&lt;p&gt;I got nice data transmission speed with code modification using that API.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for your help, Berg.&lt;/p&gt;
&lt;p&gt;Have a nice day!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52] ADC and BLE send</title><link>https://devzone.nordicsemi.com/thread/288360?ContentTypeID=1</link><pubDate>Mon, 11 Jan 2021 11:17:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7060a641-add9-4176-866c-16a60790c176</guid><dc:creator>Vidar Berg</dc:creator><description>[quote user="juulee"]&lt;p&gt;From the debug terminal, I saw that &amp;quot;Data len is set to 244&amp;quot; with Galaxy S9+.&lt;/p&gt;
&lt;p&gt;And I checked that PHY is 2M in the log of nRF connect mobile app.&lt;/p&gt;[/quote]
&lt;p&gt;Just to confirm, did you test my project without any modifications? I don&amp;#39;t understand how you could only get 60 kbps when both 2M PHY and&amp;nbsp; data length extension are supported.&lt;/p&gt;
[quote user="juulee"]&lt;p&gt;In one cycle, TX happens twice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sending one ADC buffer (with 121 16-bit numbers) per one cycle. (using double buffering, so A[0]~A[120] is first one, and A[121]~A[241] is second one)&lt;/p&gt;
&lt;p&gt;If I want to send data twice per cycle, how can I do it? (I&amp;#39;m using function &amp;quot;ble_fs_send_adc_data&amp;quot; to send data, which I wrote above.)&lt;/p&gt;[/quote]
&lt;p&gt;You can send multiple packets per connection by making sure you always have multiple packets queued up in the TX output queue (i.e. repeat call to send function until it starts returning NRF_ERROR_NO_MEM -&amp;nbsp; see API doc &lt;span&gt;&lt;a title="sd_ble_gatts_hvx" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.2.0/group___b_l_e___g_a_t_t_s___f_u_n_c_t_i_o_n_s.html?cp=4_7_3_1_2_4_2_4#ga313fe43c2e93267da668572e885945db"&gt;sd_ble_gatts_hvx&lt;/a&gt;&lt;/span&gt;). &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52] ADC and BLE send</title><link>https://devzone.nordicsemi.com/thread/287944?ContentTypeID=1</link><pubDate>Thu, 07 Jan 2021 12:33:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17d9a420-deb4-4be9-95f4-77702c5ca0cb</guid><dc:creator>juulee</dc:creator><description>&lt;p&gt;Thanks for reply.&lt;/p&gt;
&lt;p&gt;From the debug terminal, I saw that &amp;quot;Data len is set to 244&amp;quot; with Galaxy S9+.&lt;/p&gt;
&lt;p&gt;And I checked that PHY is 2M in the log of nRF connect mobile app.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also I have one more question.&lt;/p&gt;
&lt;p&gt;Bottom picture is from online power profiler for BLE.&lt;/p&gt;
&lt;p&gt;In one cycle, TX happens twice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sending one ADC buffer (with 121 16-bit numbers) per one cycle. (using double buffering, so A[0]~A[120] is first one, and A[121]~A[241] is second one)&lt;/p&gt;
&lt;p&gt;If I want to send data twice per cycle, how can I do it? (I&amp;#39;m using function &amp;quot;ble_fs_send_adc_data&amp;quot; to send data, which I wrote above.)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for your help!!&lt;/p&gt;
&lt;p&gt;Have a nice day.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1610022850885v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52] ADC and BLE send</title><link>https://devzone.nordicsemi.com/thread/287911?ContentTypeID=1</link><pubDate>Thu, 07 Jan 2021 10:32:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81f4eafa-7cc0-4092-8080-f2ab84a0c2fb</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Lee, Happy new year!&lt;/p&gt;
&lt;p&gt;This throughput is about what you can expect with nRF disconnect for desktop , but I would have expected it to be considerable higher with the s9+ even if the 1M PHY ends up getting selected. Maybe this phone doesn&amp;#39;t support data length extenstion (ie longer radio packets).&amp;nbsp; Could you try to find&amp;nbsp; another phone you can test with? I don&amp;#39;t have the Galaxy S9+ here to compare the results, unfortunately.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52] ADC and BLE send</title><link>https://devzone.nordicsemi.com/thread/287029?ContentTypeID=1</link><pubDate>Thu, 31 Dec 2020 04:29:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b90fcfd5-9c05-49b8-a699-c856bae8c1bf</guid><dc:creator>juulee</dc:creator><description>&lt;p&gt;Thanks for your help!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;However, the results are bad.. (~62kbps)&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tested with nRF connect app with my smartphone (Galaxy S9+, supports BLE 5) and also nrf Connect app for PC (nRF52840 USB dongle).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Maybe it&amp;#39;s because of PHY setting.&lt;/p&gt;
&lt;p&gt;From debugger, I&amp;#39;ve saw this line: &amp;quot;PHY update. tx: 1, rx: 1&amp;quot;, which is different from your reference picture.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also, from nRF connect app, I saw this setting.&lt;/p&gt;
&lt;p&gt;The setting was &amp;#39;LE 1M&amp;#39;, so I checked on &amp;#39;LE 2M&amp;#39;.&lt;/p&gt;
&lt;p&gt;But after I click OK and enter this setting again, check for &amp;#39;LE 2M&amp;#39; has been erased.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t find out why this PHY setting happens...&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you have any idea?&lt;/p&gt;
&lt;p&gt;I uploaded codes on nRF52 DK.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for your help!!!&lt;/p&gt;
&lt;p&gt;Happy new year.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Lee&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1609388558694v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1609388753142v2.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52] ADC and BLE send</title><link>https://devzone.nordicsemi.com/thread/286977?ContentTypeID=1</link><pubDate>Wed, 30 Dec 2020 10:15:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98227ae9-7df4-4ee8-a5a3-598420924fc1</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry for the delayed response. The max. throughput is often limited by the phone, and link quality is of course a factor. Could you please try my throughput test example below too see if it gives you any higher transfer speed?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2262.nrf5_5F00_sdk_5F00_17.0.2-_2D00_-ble_5F00_app_5F00_uart_5F00_throughput.zip"&gt;devzone.nordicsemi.com/.../2262.nrf5_5F00_sdk_5F00_17.0.2-_2D00_-ble_5F00_app_5F00_uart_5F00_throughput.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52] ADC and BLE send</title><link>https://devzone.nordicsemi.com/thread/286672?ContentTypeID=1</link><pubDate>Mon, 28 Dec 2020 10:17:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5a507b6-1739-4a6c-8bec-cb88020c0ff5</guid><dc:creator>juulee</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint32_t ble_fs_send_adc_data(uint16_t conn_handle, ble_fs_t * p_fs, uint8_t *  p_data, uint16_t length)
{
    ble_gatts_hvx_params_t params;
    uint16_t len = length;
    //p_fs-&amp;gt;bytes_sent += len; // keep track of how many lengths have been sent!
    memset(&amp;amp;params, 0, sizeof(params));
    params.type   = BLE_GATT_HVX_NOTIFICATION;
    params.handle = p_fs-&amp;gt;adc_char_handles.value_handle;
    params.p_data = p_data;
    params.p_len  = &amp;amp;len;
    return sd_ble_gatts_hvx(conn_handle, &amp;amp;params);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I added one more function here. Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>