<?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>ESB - net datarate with 2 MBit/s on-air data rate</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/128890/esb---net-datarate-with-2-mbit-s-on-air-data-rate</link><description>Hi H&amp;#229;kon, 
 this is my follow-up ticket as requested here: 
 You can see my setup in the esb_ptx application in https://github.com/stemschmidt/esb-evaluation.git 
 I am currently able to transmit the data that I want to transmit, but only with the 4 MBit</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 06 Aug 2026 16:11:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/128890/esb---net-datarate-with-2-mbit-s-on-air-data-rate" /><item><title>RE: ESB - net datarate with 2 MBit/s on-air data rate</title><link>https://devzone.nordicsemi.com/thread/569974?ContentTypeID=1</link><pubDate>Thu, 06 Aug 2026 16:11:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9086330e-948f-438f-946d-3da0b76a0ac0</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Stefan,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The overall RF payload will look something like this:&lt;/p&gt;
&lt;p&gt;| 1 byte Preamble | 3 to 5 bytes RF address | Packet control field | payload | CRC |&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So if we sum up the total on-air bytes, it will be approx. 5-10 bytes of overhead, depending on your settings.&lt;/p&gt;
&lt;p&gt;The on-air time will then be:&lt;/p&gt;
&lt;p&gt;40 us + 4 us per byte * (66 + 5) = 324 us&lt;/p&gt;
&lt;p&gt;Note that this excludes CPU handling, so the overall timing number will be higher than this.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You have setup 320 us as the timing signal, wanting approx. 3125 payloads of 66 byte user data per second.&lt;/p&gt;
&lt;p&gt;On 2 MBit, I measure approx. 2679 payloads of 66 bytes each per second.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is a latency of 320 us per received payload a hard requirement for you?&lt;/p&gt;
&lt;p&gt;You can&amp;nbsp;adjust the payload size to &amp;quot;#define NUM_SAMPLES 3*16U&amp;quot; and set prj.conf::CONFIG_ESB_MAX_PAYLOAD_LENGTH=252,&amp;nbsp;which should allow you to send&amp;nbsp;&amp;nbsp;one RF payload of 194 bytes (2+3*64) every 3*320 us at 2 MBit data rate.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;PS:&lt;/p&gt;
&lt;p&gt;I added a 1 sec timer, just to push the byte counter, and moved your semaphore for testing. Here is a patch:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;diff --git a/esb_ptx/src/main.c b/esb_ptx/src/main.c
index 0942c7a..9802e81 100644
--- a/esb_ptx/src/main.c
+++ b/esb_ptx/src/main.c
@@ -35,7 +35,7 @@ LOG_MODULE_REGISTER(esb_ptx, CONFIG_ESB_PTX_APP_LOG_LEVEL);
 
 #define ESB_RF_CHANNEL 10U
 
-#define NUM_SAMPLES 16U
+#define NUM_SAMPLES 3*16U
 typedef struct {
     uint16_t left;
     uint16_t right;
@@ -48,7 +48,11 @@ typedef struct {
 
 static struct esb_payload tx_payload = {0};
 static void sample_handler(struct k_timer* timer);
+static void esb_throughput_handler(struct k_timer* timer);
+
 K_TIMER_DEFINE(sample_timer, sample_handler, NULL);
+K_TIMER_DEFINE(timer, esb_throughput_handler, NULL);
+
 static K_SEM_DEFINE(tx_sem, 1, CONFIG_ESB_TX_FIFO_SIZE);
 static int packets_handed_over = 0;
 static int packets_sent = 0;
@@ -151,7 +155,7 @@ static int esb_initialize(void) {
     /* PTX Mode, only send. */
     esb_config.protocol = ESB_PROTOCOL_ESB_DPL;
     esb_config.mode = ESB_MODE_PTX;
-    esb_config.bitrate = ESB_BITRATE_4MBPS;
+    esb_config.bitrate = ESB_BITRATE_2MBPS;
     esb_config.crc = ESB_CRC_OFF;
     esb_config.use_fast_ramp_up = true;
     esb_config.payload_length = sizeof(audio_message_t);
@@ -195,9 +199,12 @@ static int esb_initialize(void) {
     return 0;
 }
 
+static uint32_t total_bytes_received;
+
 void event_handler(struct esb_evt const* event) {
     switch (event-&amp;gt;evt_id) {
         case ESB_EVENT_TX_SUCCESS:
+            total_bytes_received += sizeof(audio_message_t);
             if (packets_sent % 2) {
                 dk_set_led(PACKET_SENT, 0);
             } else {
@@ -212,9 +219,17 @@ void event_handler(struct esb_evt const* event) {
             LOG_DBG(&amp;quot;Packet received&amp;quot;);
             break;
     }
+    k_sem_give(&amp;amp;tx_sem);
 }
 
-static void sample_handler(struct k_timer* timer) { k_sem_give(&amp;amp;tx_sem); }
+static void sample_handler(struct k_timer* timer) {  }
+static void esb_throughput_handler(struct k_timer* timer)
+{
+    static uint32_t prev_byte_ctr;
+    uint32_t diff_byte_ctr = total_bytes_received - prev_byte_ctr;
+    printk(&amp;quot;%d\n&amp;quot;, diff_byte_ctr);
+    prev_byte_ctr = total_bytes_received;
+}
 
 int main(void) {
     int rc;
@@ -251,7 +266,7 @@ int main(void) {
     LOG_INF(&amp;quot;Sending test packet&amp;quot;);
 
     k_timer_start(&amp;amp;sample_timer, K_USEC(320), K_USEC(320));
-
+    k_timer_start(&amp;amp;timer, K_MSEC(1000), K_MSEC(1000));
     while (1) {
         /* Prepare package. */
         for (int i = 0; i &amp;lt; NUM_SAMPLES; i++) {
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>