<?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>nRFSDK BLE DTM CARRIER_TEST RADIO-&amp;gt;FREQUENCY assignment doesn&amp;#39;t make sense?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/117221/nrfsdk-ble-dtm-carrier_test-radio--frequency-assignment-doesn-t-make-sense</link><description>nRF5280, nRFSDK 17.0.1, SoftDevice 7.2.0 
 
 The nRF52840 data sheet describes the RADIO-&amp;gt;FREQUENCY register this way: 
 
 
 And describes the legal values for it in this table: 
 
 
 But then the ble_dtm.c file has this code: 
 
 
 
 I don&amp;#39;t see unmodulated</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 18 Dec 2024 13:58:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/117221/nrfsdk-ble-dtm-carrier_test-radio--frequency-assignment-doesn-t-make-sense" /><item><title>RE: nRFSDK BLE DTM CARRIER_TEST RADIO-&gt;FREQUENCY assignment doesn't make sense?</title><link>https://devzone.nordicsemi.com/thread/515521?ContentTypeID=1</link><pubDate>Wed, 18 Dec 2024 13:58:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54eab72b-f661-4000-86da-72a13113b909</guid><dc:creator>charles_fi</dc:creator><description>&lt;p&gt;Ahhhhh thanks, that explains the mystery!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRFSDK BLE DTM CARRIER_TEST RADIO-&gt;FREQUENCY assignment doesn't make sense?</title><link>https://devzone.nordicsemi.com/thread/515515?ContentTypeID=1</link><pubDate>Wed, 18 Dec 2024 13:47:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdb528a1-cf0e-4cf9-8062-0852cfe06356</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Charles,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you look in the DTM specifications (Bluetooth Core, Volume 6, Part F), this reference to the channel in the same way:&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1734529526378v1.png" alt=" " /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This mean that the channels in DTM does not follow the placement of BLE channels (37-39 placed within other channels), but reference the channels directly in order from 0-39, where channel 0 is 2402MHz and channel 39 is 2480.&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><item><title>RE: nRFSDK BLE DTM CARRIER_TEST RADIO-&gt;FREQUENCY assignment doesn't make sense?</title><link>https://devzone.nordicsemi.com/thread/514782?ContentTypeID=1</link><pubDate>Thu, 12 Dec 2024 14:43:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15f5be92-3978-4a93-a2c0-f83d59f56187</guid><dc:creator>charles_fi</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;J&amp;oslash;rgen-&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for pointing me in the right direction! I am testing BLE, but unfortunately I&amp;#39;m still confused by the original nRF5 SDK calculation being done in ble_dtm.c:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_RADIO-&amp;gt;FREQUENCY    = (m_phys_ch &amp;lt;&amp;lt; 1) + 2;&lt;/pre&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;quot;m_phys_ch&amp;quot; gets the channel ID from the 16-bit DTM CARRIER_TEST command&amp;#39;s &amp;quot;freq&amp;quot; field bits. So, there&amp;#39;s no transformation there from what I can see- if &amp;quot;freq&amp;quot; is set to 17, then &amp;quot;m_phys_ch&amp;quot; is set to 17.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the table from your&amp;nbsp;response (linked at &amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/guides/short-range-guides/b/bluetooth-low-energy/posts/bluetooth-smart-and-the-nordics-softdevices-part-1"&gt;Bluetooth Smart and the Nordic&amp;#39;s Softdevices - Part 1 GAP Advertising&lt;/a&gt;&amp;nbsp;)&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot-2024_2D00_12_2D00_12-at-9.29.42_2F20_AM.png" /&gt;&lt;/p&gt;
&lt;p&gt;The code &amp;quot;(m_phys_ch &amp;lt;&amp;lt; 1) + 2&amp;quot; multiplies the channel by 2 and adds 2 to it, so it&amp;#39;s equivalent to a math formula &amp;quot;f(x) = 2x + 2&amp;quot;. Let&amp;#39;s try it with some values from this table:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;f(4)  = (2 *  4) + 2 = 10 -&amp;gt; 2410MHz, but ch4 is at 2412MHz.
f(36) = (2 * 36) + 2 = 72 -&amp;gt; 2472MHz, but ch36 is at 2478MHz.
f(17) = (2 * 17) + 2 = 36 -&amp;gt; 2436MHz, but ch17 is at 2440MHz.
f(0)  = (2 *  0) + 2 =  2 -&amp;gt; 2402MHz, but ch0 is at 2404MHz.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So, all of these calculations seem wrong by 2-6MHz in the BLE spectrum as well, depending on which &amp;quot;side&amp;quot; of the channel 38 spectrum they&amp;#39;re on.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think it&amp;#39;s possible to&amp;nbsp;accurately map a channel to a specific frequency using a simple &amp;quot;bias and scale&amp;quot; approach because the advertising channel indices make the range discontinuous. Wouldn&amp;#39;t you need something like this instead?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int freq(int ch) {
	switch (ch) {
	  case 37: return 2;  // ch37 = 2402MHz
	  case 38: return 26; // ch38 = 2426MHz
	  case 39: return 80; // ch39 = 2480MHz
	  default: break;
	}

    // ch0 starts at 2404, so bias by 4.
    // 2MHz between channel centers, so multiply by 2.
    // An additional 2MHz gap accounts for ch37 if ch &amp;gt; 10
	return 4 + (ch * 2) + ((ch &amp;gt; 10) * 2);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Charles&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRFSDK BLE DTM CARRIER_TEST RADIO-&gt;FREQUENCY assignment doesn't make sense?</title><link>https://devzone.nordicsemi.com/thread/514741?ContentTypeID=1</link><pubDate>Thu, 12 Dec 2024 12:57:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41e75e5b-57d1-40ec-bd50-a1ba24ca1218</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]And describes the legal values for it in this table:[/quote]
&lt;p&gt;This table lists channels supported when using the radio &lt;a href="https://standards.ieee.org/ieee/802.15.4/3582/"&gt;IEEE 802.15.4 mode&lt;/a&gt;. IEEE 802.15.4 mode is not used for Bluetooth Low Energy, but are used for other protocols like &lt;a href="https://www.nordicsemi.com/Products/Wireless/Thread"&gt;Thread&lt;/a&gt; and &lt;a href="https://www.nordicsemi.com/Products/Wireless/Zigbee"&gt;Zigbee&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The Bluetooth Low Energy specifications defines 40 channels (0-39) located from 2402 MHz to 2480 MHz, 2 MHz apart (see figure in &lt;a href="https://devzone.nordicsemi.com/guides/short-range-guides/b/bluetooth-low-energy/posts/bluetooth-smart-and-the-nordics-softdevices-part-1"&gt;this blog post&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Direct Test Mode is defined in the Bluetooth Core specifications and is only intended for testing/verifying Bluetooth Low Energy operations.&lt;/p&gt;
&lt;p&gt;If you intend to use IEEE 802.15.4 mode with another protocol (Thread/Zigbee or proprietary), you can use the Radio Test firmware (&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.8.0/page/nrf/samples/peripheral/radio_test/README.html"&gt;nRF Connect SDK&lt;/a&gt; / &lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/nrf_radio_test_example.html"&gt;nRF5 SDK&lt;/a&gt;), which allows you to set radio mode (data_rate) and correct channels (start_channel) for both BLE and IEEE 802.15.4 mode.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>