nrf21540 working confirmation

Hi All!

I am using nrf21540DK, NCS version 2.3.0, Radio Test example, RSSI Viewer as a Scanner, and VSCODE studio as an IDE. 

I am getting -23dbm when set to nrf52840 at -4 to 4dbm and -46dbm when setting nrf52840 at -20dbm. The distance between Scanner (nrf52833 connected to RSSI Viewer) and nrf21540 is 1 Meter almost.

I want to confirm that nrf21540 is working properly and reading out the internal registers like CONFREG0-3. Can you please help me with that 

1)how to read them via SPI any code example?

2)As we are configuring the nrf21540 in Radio test example via UART commands (like output_power pos8dBm,start_channel 20 , and start_tx_sweep, etc) .So we are basically configuring these registers . Can you help me to find out where we can read those registers (CONFREG0-3) in the Radio test example?

3)I am also testing the custom board (nrf21540 + nrf52833).I configured pins according to our design but got -67dbm. This means nrf21540 is not working properly So to ensure that nrf21540 registers are properly configured, I need the above-mentioned point # 1-2 suggestions/solutions if possible. 

Thanks & Regards,

Muhammad Usman

  • Hi  !

    As per your instructions, I created the ticket. Thanks again for the support!

    Thanks & Regards,

    Muhammad Usman

  • Hi  

    I tried to read SPI signals as well, and as per my custom HW configuration, I changed the pins according to that. Now I connected the oscilloscope to the SCK of SPI pin # 0.23. And sent the following commands as mentioned below but no signal output on SCk

    VSCODE window :

    I am using nrf52833DK for SPI signal reading because it's easy to access the PIns .Am I doing right or is something missing?

    Thanks & regards,

  • Hi 

    The radio_test sample doesn't officially support the nRF21540DK, and I think it will require some modifications in order to work properly with this board. I will do some checking internally to see if someone else has made this work and get back to you.  

    In the mean time, would you be able to test the Direct Test Mode sample instead?

    This sample properly supports the nRF21540DK, and you can use the Direct Test Mode app in nRF Connect for Desktop to control the board over USB. 

    Best regards
    Torbjørn

  • Hi 

    Thank you for the response! Sure I will try to test with it 

    I have some confusion. Can you please guide me,

    1)I tried my custom board (nrf52833+nrf21540) with the following example to add the FEM 

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/peripheral_uart/README.html

    But faced the same issue as mentioned above. 

    2)Some people are testing it, nrf21540DK with a radio test example in the following link 

     nrf21540 gain always 20dB 

    3)My requirement is to Increase the signal strength will "Direct test mode Sample" help me with that? Eventually, I have to run it to my custom board(nrf52833+nrf21540) with my main BLE project. Will you guide me that how to integrate that sample into my project(For example in peripheral uart) ?

    Thanks & regards,

    Muhammad Usman

  • Hi Muhammad

    I have to rectify my previous response a bit. 

    While the nRF21540DK is not listed as one of the supported boards for the radio_test sample it does actually work, you just need to enable the FEM device yourself by adding CONFIG_FEM=y to your prj.conf file. 

    Once this is done you can then run some additional commands which will allow you to set the gain of the nRF21540. 

    If you press tab after flashing the board with CONFIG_FEM set you will notice that there are some more commands available, such as the total_output_power setting. This setting allows you to set the output power on the antenna, which will be the sum of the output power set in the nRF52 and the nRF21540 (the libraries will decide which values to set in each device to reach the target output power). 

    If you set the total_output_power to 20 you should see a stronger signal. 

    Finally, I don't think you can trust the RSSI viewer too much when the incoming signal is very strong (> -20dBm). This is based on the RSSI feature in the nRF radio, which is not super accurate and will not be able to accurately detect very strong signals. If you want to ensure that you see the difference between enabling the FEM or not I would try to add some attenuation between the DUT and the RSSI receiver in order to keep the incoming signal at a lower level. 

    Muhammad Usman said:
    I have to run it to my custom board(nrf52833+nrf21540) with my main BLE project. Will you guide me that how to integrate that sample into my project(For example in peripheral uart) ?

    Are you planning to make your own custom board files? 

    If you build a Bluetooth sample for the nRF21540DK board then the FEM should automatically be enabled, and no additional step is needed (CONFIG_FEM is only needed in the radio_test sample). 

    If you are making your own custom board you need to ensure that the board files configure the nRF21540 device correctly. 

    Best regards
    Torbjørn

Related