<?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>nrf5340 |  SAADC ISR blocking ble_data_recieve events.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93598/nrf5340-saadc-isr-blocking-ble_data_recieve-events</link><description>Hello, 
 
 I have a project that is based on the peripheral_uart example that receives start and stop commands from a periperal_central device via BLE to send ADC samples over BLE to the central device at a rate of 6Khz. 
 
 The device is suppose to start</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 08 Nov 2022 14:18:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93598/nrf5340-saadc-isr-blocking-ble_data_recieve-events" /><item><title>RE: nrf5340 |  SAADC ISR blocking ble_data_recieve events.</title><link>https://devzone.nordicsemi.com/thread/394735?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2022 14:18:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b195ab43-685d-43af-91e8-97d65dfe0a04</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Since BLE can only send data at the connection intervals, there should not be any changes in the data output rate. The only difference should be that you will be send more samples in a single transfer instead of sending many smaller packets containing a single sample.&lt;/p&gt;
&lt;p&gt;The priority of the timing critical BLE tasks should always be higher than the application interrupts, so I do not think that the SAADC handling itself is blocking any incoming packets. What might be blocking the transfers, however, is the many small packets that you are sending, creating much overhead in transfer time, preventing other BLE activity.&lt;/p&gt;
&lt;p&gt;It seems you already have set the SAADC interrupt priority to low (IRQ_PRIO_LOWEST), which should not make it preempt any other tasks than the ones with the same priority (or lower, like main thread).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 |  SAADC ISR blocking ble_data_recieve events.</title><link>https://devzone.nordicsemi.com/thread/394522?ContentTypeID=1</link><pubDate>Mon, 07 Nov 2022 16:56:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa35770f-775f-4939-a512-d4d8fbc1fe5d</guid><dc:creator>mattmacleod</dc:creator><description>&lt;p&gt;Hi Jargen,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for your quick reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I need an output data rate of 6000Hz for an industrial sensing system that needs to be monitored in Realtime. Wont buffering the sample rate reduce that?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is there any other way I could unblock the interrupt handler during a BLE receive?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Matt&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 |  SAADC ISR blocking ble_data_recieve events.</title><link>https://devzone.nordicsemi.com/thread/394497?ContentTypeID=1</link><pubDate>Mon, 07 Nov 2022 15:27:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da766de2-7aa5-4511-8ce8-becd79adcdc4</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Do you need to have&amp;nbsp;a buffer size of 1? Since the minimum connection interval of BLE is 7.5ms, you could set the buffer size larger to only get interrupt when the SAADC have sampled multiple samples, and then send the data over BLE as a larger chunk (you should be able to complete ~45 samples during 7.5ms). This will&amp;nbsp;reduce&amp;nbsp;the time that the CPU needs to spend in the SAADC interrupt handler. As the SAADC peripheral support EasyDMA for sampling directly to RAM, and you can set the buffer size up to&amp;nbsp;&lt;span&gt;16383 samples.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Jørgen&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>