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

PCA20035 Antenna Tuning RF Switches

Hello,

I'm looking for a little clarification on how the antenna tuning circuitry works on the Thingy:91 v1.0.0 board.

From a previous topic on the DevZone, I saw that one user was able to get the GPS on the PCA20035 board working by removing the XMAGPIO command from the GPS sample application.
https://devzone.nordicsemi.com/f/nordic-q-a/50457/thingy-91/201867#201867

I now have my own Thingy:91 and want to be able to configure it for B20 LTE and then GPS. From the board-nonsecure.c file in the device tree I can see that the following AT command is flashed with my firmware to the device.

#define AT_CMD_MAGPIO		"AT%XMAGPIO=1,1,1,450,451,746,803,698,748," \
				"824,894,880,960,1710,2200,791,849,1574,1577"

This then shows up in the post-boot COM port information:

SPM: NS image at 0xc000                                                                                                                                                            
SPM: NS MSP at 0x20024ac8                                                                                                                                                          
SPM: NS reset vector at 0x1517d                                                                                                                                                    
SPM: prepare to jump to Non-Secure image.                                                                                                                                          
***** Booting Zephyr OS v1.14.99-ncs2 *****                                                                                                                                        
[00:00:00.287,994] <dbg> board_nonsecure.leds_init: LEDs initialized                                                                                                               
                                                                                                                                                                                   
[00:00:00.301,422] <dbg> board_nonsecure.pca20035_magpio_configure: AT CMD: AT%XMAGPIO=1,1,1,450,451,746,803,698,748,824,894,880,960,1710,2200,791,849,1574,1577                   
[00:00:00.316,101] <dbg> board_nonsecure.pca20035_magpio_configure: AT RESP: OK                                                                                                    
                                                                                                                                                                                   
[00:00:00.323,425] <dbg> board_nonsecure.pca20035_magpio_configure: MAGPIO successfully configured                                                                                 
Application Started                                                                                                                                                                
Starting up into NB-IoT mode                                                                                                                                                       
Opening AT Command Socket     

From the Info center, I can see that the Antenna Tuning on the PCA20035 is controlled by 3 RF Switches that are connected to the MAGPIOs and each 3 bit combination (from 000-111) is used for different LTE bands with 111 being GPS. From that I would assume that what I actually need is MAGPIO configuration "1,0,1,791,849" for LTE and "1,1,1,1574,1577" for GPS. However, the start-up seems to just pile them all in together as one big command.

Is that the correct way to utilise the MAGPIOs on the PCA20035 or do they actually need to be properly configured for each operation (LTE or GPS).

  • Hi,

     

    This format (pre-v0.7.1 og the AT command reference document) of the %XMAGPIO command you have to pile out a lot of bands like this as the order determines the state. This means what is really written:

    AT%XMAGPIO= MAGPIO0_enable, MAGPIO1_enable, MAGPIO2_enable, state000_low, state000_high, state100_low, state100_high, state010_low, state010_high, state110_low, state110_high, state001_low, state001_high, state101_low, state101_high, state011_low, state011_high, state111_low, state111_high
     

    where

    • state000_low is the lower edge of the band which shall have the 000 state
    • state000_high is the upper edge of the band which shall have the 000 state
    • state100_low is the lower edge of the band which shall have the 100 state
    • state100_low is the lower edge of the band which shall have the 100 state

    etc.

     

    Whichever states are not used, in Thingy91 the 000 state and 011 state, you assign 'dummy' bands (bands that will never be used) to these.

     

    The new format allows you to skip the unused states, or set a single state in a command, see this link.

     

    Best regards,

    Andreas

  • Hi Andreas,

    So your saying that the above examples I gave:

    NB-IoT B20  AT%XMAGPIO=1,0,1,1,791,849

    GPS             AT%XMAGPIO=1,1,1,1,1574,1577

    would be the appropiate ways to initialise the modem for a PCA20035 v1.0.0 device?

  • Hi,

     

    No, the correct commands would be

     

    AT%MAGPIO=1,1,1,1,5,791,849
    AT%MAGPIO=1,1,1,1,7,1574,1577

    The first three 1s are to instruct the modem that all MAGPIOs are used, even if the pin is low it is in use. The 4th '1' is to instruct how many different states there are in total, if you plan on using both these commands in the same application (without potentially erasing the previous setting) this should be 2. The 5 and the 7 instruct which of the state the two following band limits shall be used for. Which state maps to which combination of MAGPIOs is described in the AT command description.

     

    You can also set both in one command by sending

    AT%XMAGPIO=1,1,1,2,5,791,849,7,1574,1577

     

    Best regards,

    Andreas

  • Hi Andreas,

    Thanks for the information, I will flash these AT commands and test the GPS response (once it stops raining Sweat smile). Already found one satelite while inside a structure so that's promising.

  • Hi,

     

    Alright, cool. The one satellite is indeed promising, it should be an indication that the command is correct as finding satellites while indoors is quite challenging in itself.

     

    Best regards,

    Andreas

Related