<?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>Throughput (Speed) test of 802.15.4 Radio driver</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53514/throughput-speed-test-of-802-15-4-radio-driver</link><description>Hi, 
 I am a beginner in nRF52840, I am using 802.15.4 example to calculate the speed of 802.15.4 radio driver. 
 As per nrf_802154_received_timestamp we can get the timestamp when the last symbol of the frame was received (in us). 
 and nrf_802154_first_symbol_timestamp_get</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 24 Oct 2019 14:15:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53514/throughput-speed-test-of-802-15-4-radio-driver" /><item><title>RE: Throughput (Speed) test of 802.15.4 Radio driver</title><link>https://devzone.nordicsemi.com/thread/216664?ContentTypeID=1</link><pubDate>Thu, 24 Oct 2019 14:15:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e7936ce-d76f-40ef-a30a-551942585d10</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The functions for timestamps you are using look OK, but they don&amp;#39;t really measure throughput though, just calculate the transmission time of a single frame in firmware the same way you will calculate it manually in a notebook.&lt;/p&gt;
&lt;p&gt;Each 802.15.4 frame has the following parts:&lt;/p&gt;
&lt;p&gt;4 bytes of preamble&lt;/p&gt;
&lt;p&gt;1 byte of start frame delimiter&lt;/p&gt;
&lt;p&gt;1 byte of PHY header&lt;/p&gt;
&lt;p&gt;Variable length MAC frame (including CRC)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The &amp;#39;lenght&amp;#39; argument in the &amp;#39;nrf_802154_received_timestamp&amp;#39; function is this variable length MAC frame, but it excludes 2 bytes of CRC.&lt;/p&gt;
&lt;p&gt;To calculate the transmission time you need to add (4+1+1+2)=8 bytes to lenght of a frame. The bitrate of 802.15.4 is 250kbps. which means that one byte is transmitted in 32 microseconds. Transmiting time of a frame containing 16 bytes then is:&lt;/p&gt;
&lt;p&gt;16 bytes of MAC frame + 8 bytes of overhead calculated above = 24 bytes in total&lt;/p&gt;
&lt;p&gt;24 bytes * 32 microseconds/byte = 0.768 ms&lt;/p&gt;
&lt;p&gt;So you will need 0.768 ms to transmit 16 bytes in a MAC frame. The same calculation is the one you are doing above in firmware measuring the timestamps between the frames.&lt;/p&gt;
&lt;p&gt;If you want to measure throughput you need to transmit multiple frames with known payload and catch timings&amp;nbsp;(like timestamps) of multiple frames to calculate total transmission time with an external time source like TIMER peripheral, and use some sort of statistics (simplest one is average).&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marjeris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>