<?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>Sending Packet latency over BLE</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/68990/sending-packet-latency-over-ble</link><description>Hi, 
 
 The system has an nRF52840 as a BLE USB Dongle plugged to a PC, and connected by BLE to another device (another nRF52840). 
 I measure the latency time between the time the dongle sends a BLE packet until it arrives to the connected device. 
</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 02 Dec 2020 09:30:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/68990/sending-packet-latency-over-ble" /><item><title>RE: Sending Packet latency over BLE</title><link>https://devzone.nordicsemi.com/thread/282826?ContentTypeID=1</link><pubDate>Wed, 02 Dec 2020 09:30:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b7e2a06-e3ed-4d65-b692-3feef0fd9772</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello JK,&lt;/p&gt;
[quote user=""]The BLE connection Interval is 7.5 ms. ( I configured the max and min connection interval to 7.5 ms and the two devices managed to set the connection interval to 7.5 ms successfully)[/quote]
&lt;p&gt;Did you use the slave latency in your tests?&lt;br /&gt;Slave latency will let the peripheral device ignore upcoming connection events for a number of times, if it has no new data to send.&lt;/p&gt;
[quote user=""]So we expect to have latency up to 7.5 ms or maybe 15 ms max, please correct me if I am wrong.[/quote]
&lt;p&gt;Yes, I would expect values in the 1 - 7.5 ms range - since you might queue a packet for sending immediately after the previous connection event ( 7.5 ms ), or immediately before the next ( &amp;lt; 1 ms ).&lt;br /&gt;I therefore suspect that something might be wrong with the test setup, rather than the BLE transmissions.&lt;br /&gt;Are you familiar with the &lt;a href="https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Sniffer-for-Bluetooth-LE"&gt;nRF Sniffer tool&lt;/a&gt;? It is a powerful tool for BLE Development, which lets you monitor on-air traffic and packet exchanges.&lt;br /&gt;Could you provide a sniffer trace of the communication during the test? This will lay out the exact times that the packets are sent and received.&lt;/p&gt;
[quote user=""]The latency measure by a scope connected to two pins, one on the dongle raised before sending a packet, and the other pin is on the connected device raised when a packet received,[/quote]
&lt;p&gt;What was the priority used for your pin-setting callback?&lt;br /&gt;This will not provide accurate results of the packet sending and reception, since this will only happen once that particular callback gets to execute. This is not representative of when a packet actually arrived, since the SoftDevice takes priority over any application-layer tasks for timing critical operations, so the application will not be given back access to the CPU before the SoftDevice has finished all its timing-critical tasks.&lt;br /&gt;The SoftDevice&amp;#39;s timing critical tasks are however not longer than 1 ms ( unless you are dealing with multiple connections ), and could therefore not alone be the reason for the very long delays you are seeing in pin-toggling.&lt;br /&gt;&lt;br /&gt;It would be very helpful to get a sniffer trace of the communication during the test, so we may see what is actually being sent on air, and at which intervals it is sent.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>