<?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>Slow conversion of external ADC with SoftDevice</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/49029/slow-conversion-of-external-adc-with-softdevice</link><description>Hi 
 There was a problem using the external ADC AD7792 in a project with SoftDevice. The problem is that when the ADC is processed in a project with SoftDevice, the waiting time for the end of the ADC conversion significantly increases - 10.5 seconds</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 17 Jul 2019 15:56:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/49029/slow-conversion-of-external-adc-with-softdevice" /><item><title>RE: Slow conversion of external ADC with SoftDevice</title><link>https://devzone.nordicsemi.com/thread/199061?ContentTypeID=1</link><pubDate>Wed, 17 Jul 2019 15:56:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80288861-8787-491a-99e3-48d44e2befe7</guid><dc:creator>Filya</dc:creator><description>&lt;p&gt;I&amp;#39;m sorry for the late reply.&lt;br /&gt;Problem solved. True, what exactly affected her is not clear, but now the process is completed in 4.5 seconds. Perhaps all the same, somehow the process was being worked out in parallel.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Slow conversion of external ADC with SoftDevice</title><link>https://devzone.nordicsemi.com/thread/196138?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2019 07:22:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0189962d-999f-4405-b43a-54e4e84e9011</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Nothing in the softdevice should make this go from 5 to 7 seconds. And at least not when you don&amp;#39;t use it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you specify where these seconds are spent, and how you get the data? Does the AD7792_Task() have a callback, or do you get the data inside this function? Does it take 7.5 seconds from the start of AD7792_Task() until the end of AD7782_Task() (or the callback)?&lt;/p&gt;
&lt;p&gt;Have you done some debugging to find out where this time is being used? And again, have you tried to analyze the SPI pins using a logic analyzer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Slow conversion of external ADC with SoftDevice</title><link>https://devzone.nordicsemi.com/thread/196048?ContentTypeID=1</link><pubDate>Tue, 02 Jul 2019 14:49:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f091075-c2ab-411d-825f-177ff135b92a</guid><dc:creator>Filya</dc:creator><description>&lt;p&gt;I tried to implement the ADC through SPI and really the time has decreased a little. Now shows 7.5 sec. It used to be 10.5 seconds, without softdevice it was 4.5 seconds.&lt;br /&gt;Perhaps the remaining 3 seconds. they run due to the same CPU load, as I have a pin control in my ADC code anyway to check the status of DOUT / RDY.&lt;br /&gt;Another incomprehensible situation that I mentioned earlier is that when bluetooth functions and other functions are commented out, time still shows 7.5 seconds.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int main(void)
{  
  ConfigPinsSleep();//Pin Configuration 
  
  log_init();
  lfclk_request();
  
  timers_init();
  
//  ble_stack_init();
//  power_management_init();
//  gap_params_init();
//  gatt_init();
//  services_init();
//  advertising_init();
//  conn_params_init();
//  peer_manager_init(); 
  
  //----ADC7792----//
  config_gpio_adc7792();
  spi_init();
  //--------------//
  
  //----SHT3x----//
//  twi_init();
  //------------//
  
//  rtc_init();
    
//  advertising_start();
  
  app_timer_start(m_our_char_timer_id, OUR_CHAR_TIMER_INTERVAL, NULL);
  
  //------LCD------//
//  config_gpio_lcd(); 
//  LCD_Init(150);
//  LCD_Clean(0); 
  //--------------//
  NRF_LOG_INFO(&amp;quot;My characteristics started.&amp;quot;);
  
  // Enter main loop.
  for (;;)
  {
//    idle_state_handle();

//    Processing_archive();
    
    AD7792_Task(AD7792_TASK_REQ_START_NEW_MEAS, 0, err_adc);

    
  }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Slow conversion of external ADC with SoftDevice</title><link>https://devzone.nordicsemi.com/thread/195980?ContentTypeID=1</link><pubDate>Tue, 02 Jul 2019 12:14:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af452175-036a-4b8d-822c-fd792c6293df</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I suggest that you try to use the SPI peripheral on the nRF instead of trying to bitbang the data from the ADC.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Filya"]I understand that if SOFTDEVICE_PRESENT is declared, then this already guarantees sufficient CPU load and the ADC will not work correctly&amp;nbsp;with the help of “bit-banging”, do I understand correctly?[/quote]
&lt;p&gt;&amp;nbsp;Not exactly. If you don&amp;#39;t use the radio (advertising or in a connection), it shouldn&amp;#39;t interrupt you. But we don&amp;#39;t know what you are doing in your application, so it is a bit difficult to tell exactly what&amp;#39;s happening in your case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Slow conversion of external ADC with SoftDevice</title><link>https://devzone.nordicsemi.com/thread/195964?ContentTypeID=1</link><pubDate>Tue, 02 Jul 2019 11:41:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb104fa1-b2dd-4b5e-96cb-8eadbc18801f</guid><dc:creator>Filya</dc:creator><description>&lt;p&gt;SoftDevice continues to work, even if do not declare the functions associated with bluetooth? (ble_stack_init, gap_params_init, gatt_init, etc.)&lt;br /&gt;I just experimented about, removing the declaration of all these functions and leaving only the call of the timer and the function of the ADC and still there was the same delay.&lt;br /&gt;I understand that if SOFTDEVICE_PRESENT is declared, then this already guarantees sufficient CPU load and the ADC will not work correctly&amp;nbsp;with the help of &amp;ldquo;bit-banging&amp;rdquo;, do I understand correctly?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Slow conversion of external ADC with SoftDevice</title><link>https://devzone.nordicsemi.com/thread/195923?ContentTypeID=1</link><pubDate>Tue, 02 Jul 2019 10:18:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f7c5d53-b99d-47c9-b871-c4e363cedac3</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Did you figure out why it takes more time when you use the softdevice? Does it take more time before you send the SPI cmd? Does it take more time before you get the reply from the AD7792?&lt;/p&gt;
&lt;p&gt;Can you try to use a logic analyser on the SPI pins and see what&amp;#39;s going on?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Slow conversion of external ADC with SoftDevice</title><link>https://devzone.nordicsemi.com/thread/195914?ContentTypeID=1</link><pubDate>Tue, 02 Jul 2019 09:39:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60931f94-3de3-4d0d-abff-48b63bcbb6cc</guid><dc:creator>awneil</dc:creator><description>[quote userid="75765" url="~/f/nordic-q-a/49029/slow-conversion-of-external-adc-with-softdevice/195909"]I control the ADC by personally switching pins [/quote]
&lt;p&gt;commonly known as&amp;nbsp; &amp;quot;bit-banging&amp;quot;,&amp;nbsp; which is obviously going to be affected by the CPU load - such as the SoftDevice.&lt;/p&gt;
&lt;p&gt;So this is to be expected.&lt;/p&gt;
&lt;p&gt;Should be obvious from observing the signals on an oscilloscope.&lt;/p&gt;
&lt;p&gt;The reason microcontrollers have hardware for stuff like this is precisely so that it does &lt;em&gt;&lt;strong&gt;not&lt;/strong&gt; &lt;/em&gt;require CPU resources!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Slow conversion of external ADC with SoftDevice</title><link>https://devzone.nordicsemi.com/thread/195909?ContentTypeID=1</link><pubDate>Tue, 02 Jul 2019 09:31:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fdab266f-6e6c-43d4-af3f-992702a8d375</guid><dc:creator>Filya</dc:creator><description>&lt;p&gt;I control the ADC by personally switching pins using the nrf_gpio_pin_set / nrf_gpio_pin_clear commands (for&amp;nbsp;SCLK and DIN pins). And with the help of nrf_gpio_pin_read (DOUT/RDY pin), I read the data from the ADC.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/6840.config.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Slow conversion of external ADC with SoftDevice</title><link>https://devzone.nordicsemi.com/thread/195027?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2019 07:49:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96d905b4-b6f7-4410-9ca6-8e6a4084688c</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Post a schematic of how you have the ADC connected to the&amp;nbsp;&lt;span&gt;nRF52840.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The ADC neither knows nor cares whether you have a softdevice (it doesn&amp;#39;t even know what microcontroller you&amp;#39;re using) - it just responds to the signals on its interface pins as specified in its datasheet.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So use an oscilloscope or logic analyser on the interface lines to see what is happening in the two cases ...&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Slow conversion of external ADC with SoftDevice</title><link>https://devzone.nordicsemi.com/thread/195011?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2019 07:31:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a87d3fd-2719-421e-b7aa-c50d662f1e08</guid><dc:creator>Edvin</dc:creator><description>[quote user=""]To control the ADC, I use the usual pin switching. I do not use SPI module.[/quote]
&lt;p&gt;&amp;nbsp;Can you explain what you mean by this? How do you control the ADC, and how do you get the data?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>