<?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>NRF52832 boards, date receivig rate on central side.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44781/nrf52832-boards-date-receivig-rate-on-central-side</link><description>Hi, i use the saadc example(triggered by ppi+timer) with uart to get voltage signal and transmit to central device( another custom nrf52832 board), and the central prints data on pc. the problem is the data receiving rate on the central side is so low</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 13 Mar 2019 06:11:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44781/nrf52832-boards-date-receivig-rate-on-central-side" /><item><title>RE: NRF52832 boards, date receivig rate on central side.</title><link>https://devzone.nordicsemi.com/thread/175814?ContentTypeID=1</link><pubDate>Wed, 13 Mar 2019 06:11:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39340664-af78-4dc9-a859-6b69a493b43f</guid><dc:creator>1730143</dc:creator><description>&lt;p&gt;update the saadc_callback code&lt;br /&gt; }&lt;pre class="ui-code" data-mode="text"&gt; void saadc_callback(nrf_drv_saadc_evt_t const * p_event)
{    
	uint16_t val;
	uint8_t value;
    if (p_event-&amp;gt;type == NRF_DRV_SAADC_EVT_DONE)
    {
        ret_code_t err_code;
        static uint8_t data_array[SAMPLES_IN_BUFFER*2];
        err_code = nrf_drv_saadc_buffer_convert(p_event-&amp;gt;data.done.p_buffer, SAMPLES_IN_BUFFER);
        APP_ERROR_CHECK(err_code);
        uint8_t i;
        printf(&amp;quot;\r\nADC event number:%d \r\n&amp;quot;, (int)m_adc_evt_counter);
        for (i = 0; i &amp;lt; SAMPLES_IN_BUFFER; i++)
           {
			    val = p_event-&amp;gt;data.done.p_buffer[i];				
				printf(&amp;quot;%d\r\n&amp;quot;,val);					
				value=val&amp;gt;&amp;gt;4;				
				value|=1;
				switch(i|252)
					{
					    case 252:
						value&amp;amp;=249;
						break;
					    case 253:
						value&amp;amp;=251;
						value|=2;
						break;
						case 254:
						value|=4;
						value&amp;amp;=253;
						break;
						case 255:
						value|=6;
                        break;								 
					}
					value=0;
					value=val;
					value&amp;amp;=254;//11111110
					data_array[i*2+1]=value;
                    value=0;
			}
        uint16_t length = (uint16_t)(i*2);				
        err_code = ble_nus_data_send(&amp;amp;m_nus, data_array, &amp;amp;length, m_conn_handle);
        if ( (err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp; (err_code != NRF_ERROR_BUSY) &amp;amp;&amp;amp;
                         (err_code != NRF_ERROR_NOT_FOUND) )
			{
				APP_ERROR_CHECK(err_code);
			}
        m_adc_evt_counter++;
    }
}				&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>