nRF5280, nRFSDK 17.0.1, SoftDevice 7.2.0
The nRF52840 data sheet describes the RADIO->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't see unmodulated carrier waves where I expect, and I do not understand how the equation "(m_phys_ch << 1) + 2" turns a channel number into a RADIO->FREQUENCY value correctly.
For example, let's take channel 24, which should be centered at 2470MHz. Clearly, the value "70" should be written to the RADIO->FREQUENCY register. But evaluating the equation "(24 << 1) + 2" gives us the result of "50", which is incorrect. Indeed, my spectrum analyzer shows me waves centered around incorrect MHz spectra when I use the SDK ble_dtm.c code.
I rewrote the code as:
and indeed now I get carrier waves centered around the channel frequency that I expect (e.g. ch24 does give me a wave at 2470MHz, and ch11 does give me a wave at 2405MHz).
Please confirm that this is a bug in the nRF SDK, or help me understand where I went wrong.
Thanks,
Charles