This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Continuous Wave for nRF9160

Is there any test firmware available (or reference code) for doing total radiated power measurements?  I have the nRF9160 designed onto a PCB and we'd like to do some antenna measurements. Ideally I'd be able to put the nRF9160 into a continuous wave mode.

Thanks!

Johnny

Parents
  • Hi,

     

    There's a test AT command specified in the AT Command pdf at chapter 4.19, "%XRFTEST".

    You can input this command by using the example at_client, in combination with nRF connect application "LTE Link Monitor".

     

    Kind regards,

    Håkon

  • Thank you.  Some follow-up questions: 

    I know I can send AT commands via the LTE Link Monitor program, but could I instead use a terminal program like Putty and tap into the UART pins to the nRF9160 on the development kit? 

    Looking at the schematic for the development kit, P0.26 through P0.29 appear to be the UART comms for the AT commands.  Where on the development kit would I connect to those UART lines? Is it TPs7-10? Or is it D19 - D22?

    What I'm hoping I can do is load the at_client example onto my prototype PCB with a few modifications and send the AT commands over UART.  But I wanted to try it first on the development kit.

    Thanks again for the help!

    Johnny

  • Hi Johnny,

     

    You can use a normal terminal if you'd like. LTE Link Monitor is basically only a terminal that parses the AT command into a more "human readable" format. 

    jlienau03 said:
    Putty and tap into the UART pins to the nRF9160 on the development kit? 

     If you're using the DK, you do not need to tap into the pins directly, just open the COM port with baud 115k2.

    jlienau03 said:
    What I'm hoping I can do is load the at_client example onto my prototype PCB with a few modifications and send the AT commands over UART.  But I wanted to try it first on the development kit.

    Are you thinking of using the DK itself as a USB->UART bridge for your custom board?

    If you want to use the UART bridge on the DK for your own board, you can connect to the TP7 (RTS) / TP8 (CTS) / TP9 (RXD) / TP10 (TXD) near the "nRF ONLY" switch.

    Note that the 91 mounted on the nRF91-DK must then not have UART enabled at this point, as it will then create a pin conflict.

     

    Kind regards,

    Håkon

  • I do not want to use the DK as a USB->UART bridge.  I have a USB to serial bridge already (a standard USB to serial FTDI converter).  I was just looking to send AT commands outside of the LTE Link Monitor program directly to the nRF9160 on the DK with my own bridge instead of using the USB->UART bridge already on the DK.  I'm trying to figure out where I would tap in to the UART ports to do that?

    For my custom board, I will wire directly to the UART ports on my custom board with my USB to serial converter.  I want to test it all out on the DK first (as described above), before moving over to my custom board.

    Thanks,

    Johnny

  • Hi,

     

    In order to do this, you need to change the pin out for the UARTE0 peripheral.

    This must be done both in the secure_boot application, via the "nrf9160_pca10090.overlay" file, and

    in your application, at_client, using "nrf9160_pca10090ns.overlay" as this application is in the non-secure region.

     

    I can recommend to use gpios between P0.10 and P0.20, as these are all routed out by default to the pin header list, so its easier to access.

    The .overlay file for secure_boot (nrf9160_pca10090.overlay):

    /* needed to get the NRF_UARTE2 defined */
    &uart2 {
    	current-speed = <1000000>;
    	status = "ok";
    	tx-pin = <18>;
    	rx-pin = <17>;
    	rts-pin = <19>;
    	cts-pin = <21>;
    };
    
    &uart0 {
    	current-speed = <115200>;
    	status = "ok";
    	tx-pin = <somepin>;
    	rx-pin = <somepin>;
    	rts-pin = <somepin>;
    	cts-pin = <somepin>;
    };

    And here's an example .overlay file for the at_client example:

    &uart0 {
    	current-speed = <115200>;
    	status = "ok";
    	tx-pin = <somepin>;
    	rx-pin = <somepin>;
    	rts-pin = <somepin>;
    	cts-pin = <somepin>;
    };

     

    After creating or editing the existing .overlay file, you should delete the build directory and regenerate the Cmake files prior to building/flashing.

     

    Kind regards,

    Håkon

  • Ok thanks, I have it working now on the development kit.  I'm able to send AT commands from a terminal program directly to the nRF9160.  Your example code worked great (I used P0.10, 11, 12, and 13).

    One last question, since this all began with me trying to do a Continuous Wave... when I try to send the AT command to do a CW I get an error back saying it 'Failed.'  I get this error both for my modified code above, or if I'm using the original code and the nRF Connect Link Monitor program to send the command.  Additionally, it doesn't seem like any of the RF test AT commands are working.  I tried to do RX as well but that didn't work.  I've copied a picture of the failure from the nRF Connect Link Monitor program below.

  • Hi,

     

    Try to reset the board, not input any other AT command than this one:

    %RFTEST=2,1,0

    This should do a GPS SNR test, and provide something like this:

    ***** Booting Zephyr OS v1.13.99-ncs2 *****
    The AT host sample started
    AT%XRFTEST=2,1,0
    %XRFTEST: -103
    OK 

    Do note that you shall not test any TX without placing the device into a shielded box. This is a restricted and licensed band!

    Kind regards,

    Håkon

Reply
  • Hi,

     

    Try to reset the board, not input any other AT command than this one:

    %RFTEST=2,1,0

    This should do a GPS SNR test, and provide something like this:

    ***** Booting Zephyr OS v1.13.99-ncs2 *****
    The AT host sample started
    AT%XRFTEST=2,1,0
    %XRFTEST: -103
    OK 

    Do note that you shall not test any TX without placing the device into a shielded box. This is a restricted and licensed band!

    Kind regards,

    Håkon

Children
  • I still get the same error following your instructions.  He's a picture again, along with the output log from the nRF Connect terminal.

    /cfs-file/__key/communityserver-discussions-components-files/4/2019_2D00_03_2D00_07T14_5F00_21_5F00_18.546Z_2D00_log.txt

  • Hi Johnny,

     

    This one took a long time before I saw..

    I think you are missing an X in your command, it should be "AT%XRFTEST". Could you see if that one executes successfully?

     

    Kind regards,

    Håkon

  • Awesome, you're right.  It works now.  I want to point out that some of the examples in the AT command reference document provided by Nordic omit the 'X' as well.  The picture below is from page 36 of the guide, which talks about the RF test commands.  This is probably where I got messed up.  The command is described correctly in the manual, but in the example code snippet there is no 'X.'  There are a few other examples like this too in the RF test section.

    I have one last question (hopefully). When I enter in an AT command for transmit I get a response from the module that is '%RFTEST: some number.'  According to the AT manual, dividing 'some number' by 16 is supposed to give me the power at the antenna.  When I send TX commands, the reply telling me the TX power is always negative and in the hundreds (see the nRF Connect terminal output below).  This seems to imply my power is well below -30 dBm, which can't be correct.  Am I interpreting this right, or is something else wrong?  I'm using development kits right out of the box with no modifications to them.  

  • I connected the DK directly to my spectrum analyzer so I could measure the conducted power directly.  I am actually seeing correlation between the %XRFTEST: some number response and what I am measuring on the spectrum analyzer.  I set the output power to 0 dBm and the response was -795.  -795/16 = about -49dBm.  This is approximately what I see when I measure it.  So, my question above now changes slightly: why is the power delivered to the antenna so low when I am requesting 0 dBm?  I am plugging directly into the connector that is on the DK.

  • Hi Johnny,

     

    Yes, you're right regarding the XRFTEST vs RFTEST in the AT commands pdf. I'll report this as a bug internally.

    Have you tried running the command without using a spectrum analyzer, just to see if the response is as expected then? Could the problem be the cable?

    I get a reported 22.69 dBm when running this command:

    ***** Booting Zephyr OS v1.13.99-ncs1-4741-g1d6219ffec *****
    The AT host sample started
    AT%XRFTEST=1,0
    OK
    AT%XRFTEST=1,1,13,7777,23,1,4
    %XRFTEST: 363
    OK
    

    Kind regards,

    Håkon

Related