This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2651P3: DIO_21

Part Number: CC2651P3
Other Parts Discussed in Thread: SYSCONFIG, Z-STACK

2.4 GHz team,

Our customer needs to set DIO_21 to control the TX/RX switch.  It needs to be low for Receive, and high for the PA to be enabled.  Do we have a software example or documentation to describe exactly how to do this?

Thanks,
Darren

  • Hey Darren,

    Once the customer imports LP_CC2651P3 example and chooses "Use Custom Board" inside the SysConfig Board View, then they can modify the SysConfig RF module to specify number of antenna switch control pins along with GPIO selection and configuration.  I advise that they also consult the default truth table from the generated ti_drivers_config.c default LaunchPad configuration and notice the "Value Inversion" option for RF GPIOs.

    Regards,
    Ryan

  • Hi Ryan,

    I am the one dealing with this issue. I tried your suggestion. However, we are using the RKP package, and the LP uses the RGZ. When I try "switch device", I am not allowed to change to the RKP device. The message is "This migration is not supported by Z-Stack. Migration to this target is not supported via SysConfig. Consider starting from a more familiar example to your desired migration target in <SDK_INSTALL_DIR>/examples/.

    Any suggestions?

    Thanks,

    Andy

  • Hi Andy,

    There is a section for using a different package variant from the Z-Stack Migration Guide.

    The different package variants are binary compatible as long as the software does not access a non-existing IO on the considered package. For the 5x5 package, the available IOs are between IOID_0 and IOID_22. The Migrating Board Variant instructions should be used to change from the RGZ package to the RKP, which will also require selecting Use Custom Board as directed in Custom Hardware since the CC13xx or CC26xx LaunchPad hardware uses the RGZ variant.

    Regards,
    Ryan

  • Hi Ryan,

    The "Migrating Board Variant" instructions you mentioned above detail the exact procedure I followed. This is from the instructions:

    and this is what I get:

    I'm OK with keeping the package as RGZ and only using the IO that's available. Just want to make sure that's the right way to do it.

    Andy

  • The current recommended method is to not use the SysConfig Migration Tool and only use the GPIO available for the RGZ package.

    Regards,
    Ryan

  • OK, no problem. Another difference between RGZ and RKP is the PA output. The LP uses PA pins TX_20DBM_P / TX_20DBM_N. The RKP doesn't support 20dBm, and instead uses pins TX_10DBM_P / TX_10DBM_N. In the RF Design module, I see that I can select between LP_CC2551P3 and LP_CC2651P3_10DBM:

    so I guess I select the 10DBM option there. Anything else I need to do?

    Andy

  • Good point, however that RF Design will currently conflict with Z-Stack Radio configurations.  I will ask the Z-Stack Development Team whether this is planned to be addressed in an upcoming SDK.  As it currently stands, ti_radio_config.c would need to be excluded from the SysConfig Build and copied/modified with the settings and PA table entries exported from Smart RF Studio 7.  You would also need to set a non-PA value for the Zigbee TX power and then change it during run-time of the application using Z-Stack APIs.

    Regards,
    Ryan

  • OK, I think you are saying I need to set "Transmit Power" to "0" in the Z-stack module in syscfg. And I will look into the ti_radio_config.c part. But, should I use the LP_CC2651P3 or LP_CC2651P3_10DBM selection for the RF design? Or does it not matter?

    Andy

  • Andy,

    You should not use the LP_CC2651P3_10DBM RF Design selection, please keep the default LP_CC2651P3  version.  Attached are the ti_radio_config changes I believe are necessary to generate 6-10 dBm PA tables. 

     

    /*
     *  ======== ti_radio_config.c ========
     *  Configured RadioConfig module definitions
     *
     *  DO NOT EDIT - This file is generated for the CC2651P3RGZ
     *  by the SysConfig tool.
     *
     *  Radio Config module version : 1.14
     *  SmartRF Studio data version : 2.26.0
     */
    
    #include "ti_radio_config.h"
    #include DeviceFamily_constructPath(rf_patches/rf_patch_cpe_ieee_802_15_4.h)
    
    
    // *********************************************************************************
    //   RF Frontend configuration
    // *********************************************************************************
    // RF design based on: LP_CC2651P3 (CC2651-P3EM-7XD24-PA24)
    
    // TX Power tables
    // The RF_TxPowerTable_DEFAULT_PA_ENTRY and RF_TxPowerTable_HIGH_PA_ENTRY macros are defined in RF.h.
    // The following arguments are required:
    // RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost, coefficient)
    // RF_TxPowerTable_HIGH_PA_ENTRY(bias, ibboost, boost, coefficient, ldoTrim)
    // See the Technical Reference Manual for further details about the "txPower" Command field.
    // The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
    
    // 2400 MHz, 5 dBm
    RF_TxPowerTable_Entry txPowerTable_2400_pa5[TXPOWERTABLE_2400_PA5_SIZE] =
    {
        {-20, RF_TxPowerTable_DEFAULT_PA_ENTRY(8, 3, 0, 2) }, // 0x04C8
        {-18, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 3, 0, 2) }, // 0x04CA
        {-15, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 3, 0, 3) }, // 0x06CD
        {-12, RF_TxPowerTable_DEFAULT_PA_ENTRY(16, 3, 0, 5) }, // 0x0AD0
        {-10, RF_TxPowerTable_DEFAULT_PA_ENTRY(19, 3, 0, 5) }, // 0x0AD3
        {-9, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 3, 0, 6) }, // 0x0CD4
        {-6, RF_TxPowerTable_DEFAULT_PA_ENTRY(19, 2, 0, 11) }, // 0x1693
        {-5, RF_TxPowerTable_DEFAULT_PA_ENTRY(21, 2, 0, 11) }, // 0x1695
        {-3, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 2, 0, 12) }, // 0x1899
        {0, RF_TxPowerTable_DEFAULT_PA_ENTRY(29, 1, 0, 22) }, // 0x2C5D
        {1, RF_TxPowerTable_DEFAULT_PA_ENTRY(33, 1, 0, 25) }, // 0x3261
        {2, RF_TxPowerTable_DEFAULT_PA_ENTRY(38, 1, 0, 31) }, // 0x3E66
        {3, RF_TxPowerTable_DEFAULT_PA_ENTRY(47, 1, 0, 36) }, // 0x486F
        {4, RF_TxPowerTable_DEFAULT_PA_ENTRY(32, 0, 0, 65) }, // 0x8220
        {5, RF_TxPowerTable_DEFAULT_PA_ENTRY(46, 0, 0, 59) }, // 0x762E
        RF_TxPowerTable_TERMINATION_ENTRY
    };
    
    // 2400 MHz, 5 + 20 dBm
    RF_TxPowerTable_Entry txPowerTable_2400_pa5_10[TXPOWERTABLE_2400_PA5_10_SIZE] =
    {
        {-20, RF_TxPowerTable_DEFAULT_PA_ENTRY(8, 3, 0, 2) }, // 0x04C8
        {-18, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 3, 0, 2) }, // 0x04CA
        {-15, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 3, 0, 3) }, // 0x06CD
        {-12, RF_TxPowerTable_DEFAULT_PA_ENTRY(16, 3, 0, 5) }, // 0x0AD0
        {-10, RF_TxPowerTable_DEFAULT_PA_ENTRY(19, 3, 0, 5) }, // 0x0AD3
        {-9, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 3, 0, 6) }, // 0x0CD4
        {-6, RF_TxPowerTable_DEFAULT_PA_ENTRY(19, 2, 0, 11) }, // 0x1693
        {-5, RF_TxPowerTable_DEFAULT_PA_ENTRY(21, 2, 0, 11) }, // 0x1695
        {-3, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 2, 0, 12) }, // 0x1899
        {0, RF_TxPowerTable_DEFAULT_PA_ENTRY(29, 1, 0, 22) }, // 0x2C5D
        {1, RF_TxPowerTable_DEFAULT_PA_ENTRY(33, 1, 0, 25) }, // 0x3261
        {2, RF_TxPowerTable_DEFAULT_PA_ENTRY(38, 1, 0, 31) }, // 0x3E66
        {3, RF_TxPowerTable_DEFAULT_PA_ENTRY(47, 1, 0, 36) }, // 0x486F
        {4, RF_TxPowerTable_DEFAULT_PA_ENTRY(32, 0, 0, 65) }, // 0x8220
        {5, RF_TxPowerTable_DEFAULT_PA_ENTRY(46, 0, 0, 59) }, // 0x762E
        {6, RF_TxPowerTable_HIGH_PA_ENTRY(42, 0, 1, 39, 20) }, // 0x144F2A
        {7, RF_TxPowerTable_HIGH_PA_ENTRY(31, 1, 0, 20, 20) }, // 0x14285F
        {8, RF_TxPowerTable_HIGH_PA_ENTRY(26, 1, 1, 25, 16) }, // 0x10335A
        {9, RF_TxPowerTable_HIGH_PA_ENTRY(31, 1, 1, 31, 16) }, // 0x103F5F
        {10, RF_TxPowerTable_HIGH_PA_ENTRY(38, 1, 1, 39, 16) }, // 0x104F66
        RF_TxPowerTable_TERMINATION_ENTRY
    };
    
    
    
    //*********************************************************************************
    //  RF Setting:   IEEE 802.15.4-2006, 250 kbps, OQPSK, DSSS = 1:8
    //
    //  PHY:          ieee154
    //  Setting file: setting_ieee_802_15_4.json
    //*********************************************************************************
    
    // PARAMETER SUMMARY
    // Channel - Frequency (MHz): 2405
    // TX Power (dBm): 0
    
    // TI-RTOS RF Mode Object
    RF_Mode RF_prop_ieee154 =
    {
        .rfMode = RF_MODE_AUTO,
        .cpePatchFxn = &rf_patch_cpe_ieee_802_15_4,
        .mcePatchFxn = 0,
        .rfePatchFxn = 0
    };
    
    // Overrides for CMD_RADIO_SETUP_PA
    uint32_t pOverrides_ieee154[] =
    {
        // override_ieee_802_15_4.json
        // Rx: Set LNA bias current offset to +15 to saturate trim to max (default: 0)
        (uint32_t)0x000F8883,
        // Set VCTRIM to 0 for 20 dBm PA
        ADI_HALFREG_OVERRIDE(1,26,0xF,0x0),
        // Set VCTRIM to 0 for 20 dBm PA
        ADI_HALFREG_OVERRIDE(1,27,0x7,0x0),
        // Tx: Set DCDC settings IPEAK=3, dither = off
        (uint32_t)0x00F388D3,
        // TX: set intFreq = 0
        (uint32_t)0x00000343,
        // RX: set intFreq = 0
        (uint32_t)0x00000323,
        (uint32_t)0xFFFFFFFF
    };
    
    
    
    // CMD_RADIO_SETUP_PA
    // Radio Setup Command for Pre-Defined Schemes
    const rfc_CMD_RADIO_SETUP_PA_t RF_cmdRadioSetup_ieee154 =
    {
        .commandNo = 0x0802,
        .status = 0x0000,
        .pNextOp = 0,
        .startTime = 0x00000000,
        .startTrigger.triggerType = 0x0,
        .startTrigger.bEnaCmd = 0x0,
        .startTrigger.triggerNo = 0x0,
        .startTrigger.pastTrig = 0x0,
        .condition.rule = 0x1,
        .condition.nSkip = 0x0,
        .mode = 0x01,
        .loDivider = 0x00,
        .config.frontEndMode = 0x0,
        .config.biasMode = 0x1,
        .config.analogCfgMode = 0x0,
        .config.bNoFsPowerUp = 0x0,
        .config.bSynthNarrowBand = 0x0,
        .txPower = 0x2C5D,
        .pRegOverride = pOverrides_ieee154,
        .pRegOverrideTxStd = 0,
        .pRegOverrideTx20 = 0
    };
    
    // CMD_FS
    // Frequency Synthesizer Programming Command
    const rfc_CMD_FS_t RF_cmdFs_ieee154 =
    {
        .commandNo = 0x0803,
        .status = 0x0000,
        .pNextOp = 0,
        .startTime = 0x00000000,
        .startTrigger.triggerType = 0x0,
        .startTrigger.bEnaCmd = 0x0,
        .startTrigger.triggerNo = 0x0,
        .startTrigger.pastTrig = 0x0,
        .condition.rule = 0x1,
        .condition.nSkip = 0x0,
        .frequency = 0x0965,
        .fractFreq = 0x0000,
        .synthConf.bTxMode = 0x0,
        .synthConf.refFreq = 0x0,
        .__dummy0 = 0x00,
        .__dummy1 = 0x00,
        .__dummy2 = 0x00,
        .__dummy3 = 0x0000
    };
    
    // CMD_IEEE_TX
    // IEEE 802.15.4 Transmit Command
    const rfc_CMD_IEEE_TX_t RF_cmdIeeeTx_ieee154 =
    {
        .commandNo = 0x2C01,
        .status = 0x0000,
        .pNextOp = 0,
        .startTime = 0x00000000,
        .startTrigger.triggerType = 0x0,
        .startTrigger.bEnaCmd = 0x0,
        .startTrigger.triggerNo = 0x0,
        .startTrigger.pastTrig = 0x0,
        .condition.rule = 0x1,
        .condition.nSkip = 0x0,
        .txOpt.bIncludePhyHdr = 0x0,
        .txOpt.bIncludeCrc = 0x0,
        .txOpt.payloadLenMsb = 0x0,
        .payloadLen = 0x1E,
        .pPayload = 0,
        .timeStamp = 0x00000000
    };
    
    // CMD_IEEE_RX
    // IEEE 802.15.4 Receive Command
    const rfc_CMD_IEEE_RX_t RF_cmdIeeeRx_ieee154 =
    {
        .commandNo = 0x2801,
        .status = 0x0000,
        .pNextOp = 0,
        .startTime = 0x00000000,
        .startTrigger.triggerType = 0x0,
        .startTrigger.bEnaCmd = 0x0,
        .startTrigger.triggerNo = 0x0,
        .startTrigger.pastTrig = 0x0,
        .condition.rule = 0x1,
        .condition.nSkip = 0x0,
        .channel = 0x00,
        .rxConfig.bAutoFlushCrc = 0x0,
        .rxConfig.bAutoFlushIgn = 0x0,
        .rxConfig.bIncludePhyHdr = 0x0,
        .rxConfig.bIncludeCrc = 0x0,
        .rxConfig.bAppendRssi = 0x1,
        .rxConfig.bAppendCorrCrc = 0x1,
        .rxConfig.bAppendSrcInd = 0x0,
        .rxConfig.bAppendTimestamp = 0x0,
        .pRxQ = 0,
        .pOutput = 0,
        .frameFiltOpt.frameFiltEn = 0x0,
        .frameFiltOpt.frameFiltStop = 0x0,
        .frameFiltOpt.autoAckEn = 0x0,
        .frameFiltOpt.slottedAckEn = 0x0,
        .frameFiltOpt.autoPendEn = 0x0,
        .frameFiltOpt.defaultPend = 0x0,
        .frameFiltOpt.bPendDataReqOnly = 0x0,
        .frameFiltOpt.bPanCoord = 0x0,
        .frameFiltOpt.maxFrameVersion = 0x3,
        .frameFiltOpt.fcfReservedMask = 0x0,
        .frameFiltOpt.modifyFtFilter = 0x0,
        .frameFiltOpt.bStrictLenFilter = 0x0,
        .frameTypes.bAcceptFt0Beacon = 0x1,
        .frameTypes.bAcceptFt1Data = 0x1,
        .frameTypes.bAcceptFt2Ack = 0x1,
        .frameTypes.bAcceptFt3MacCmd = 0x1,
        .frameTypes.bAcceptFt4Reserved = 0x1,
        .frameTypes.bAcceptFt5Reserved = 0x1,
        .frameTypes.bAcceptFt6Reserved = 0x1,
        .frameTypes.bAcceptFt7Reserved = 0x1,
        .ccaOpt.ccaEnEnergy = 0x0,
        .ccaOpt.ccaEnCorr = 0x0,
        .ccaOpt.ccaEnSync = 0x0,
        .ccaOpt.ccaCorrOp = 0x1,
        .ccaOpt.ccaSyncOp = 0x1,
        .ccaOpt.ccaCorrThr = 0x0,
        .ccaRssiThr = 0x64,
        .__dummy0 = 0x00,
        .numExtEntries = 0x00,
        .numShortEntries = 0x00,
        .pExtEntryList = 0,
        .pShortEntryList = 0,
        .localExtAddr = 0x12345678,
        .localShortAddr = 0xABBA,
        .localPanID = 0x0000,
        .__dummy1 = 0x000000,
        .endTrigger.triggerType = 0x1,
        .endTrigger.bEnaCmd = 0x0,
        .endTrigger.triggerNo = 0x0,
        .endTrigger.pastTrig = 0x0,
        .endTime = 0x00000000
    };
    
    // CMD_IEEE_CSMA
    // IEEE 802.15.4 CSMA-CA Command
    const rfc_CMD_IEEE_CSMA_t RF_cmdIeeeCsma_ieee154 =
    {
        .commandNo = 0x2C02,
        .status = 0x0000,
        .pNextOp = 0,
        .startTime = 0x00000000,
        .startTrigger.triggerType = 0x0,
        .startTrigger.bEnaCmd = 0x0,
        .startTrigger.triggerNo = 0x0,
        .startTrigger.pastTrig = 0x0,
        .condition.rule = 0x0,
        .condition.nSkip = 0x0,
        .randomState = 0x0000,
        .macMaxBE = 0x00,
        .macMaxCSMABackoffs = 0x00,
        .csmaConfig.initCW = 0x0,
        .csmaConfig.bSlotted = 0x0,
        .csmaConfig.rxOffMode = 0x0,
        .NB = 0x00,
        .BE = 0x00,
        .remainingPeriods = 0x00,
        .lastRssi = 0x00,
        .endTrigger.triggerType = 0x0,
        .endTrigger.bEnaCmd = 0x0,
        .endTrigger.triggerNo = 0x0,
        .endTrigger.pastTrig = 0x0,
        .lastTimeStamp = 0x00000000,
        .endTime = 0x00000000
    };
    
    // CMD_IEEE_RX_ACK
    // IEEE 802.15.4 Receive Acknowledgement Command
    const rfc_CMD_IEEE_RX_ACK_t RF_cmdIeeeRxAck_ieee154 =
    {
        .commandNo = 0x2C03,
        .status = 0x0000,
        .pNextOp = 0,
        .startTime = 0x00000000,
        .startTrigger.triggerType = 0x0,
        .startTrigger.bEnaCmd = 0x0,
        .startTrigger.triggerNo = 0x0,
        .startTrigger.pastTrig = 0x0,
        .condition.rule = 0x0,
        .condition.nSkip = 0x0,
        .seqNo = 0x00,
        .endTrigger.triggerType = 0x0,
        .endTrigger.bEnaCmd = 0x0,
        .endTrigger.triggerNo = 0x0,
        .endTrigger.pastTrig = 0x0,
        .endTime = 0x00000000
    };
    
    
    
    7801.ti_radio_config.h

    Regards,
    Ryan

  • OK, thanks Ryan. I'll try this once our prototype boards are in and follow up if I have any questions or issues.

    Regards,

    Andy

  • Please note that you can do the same for ti_zstack_config.h and TXPOWER if you want to change the TX power level between 6 and 10 dBm during compilation instead of runtime.

    Regards,
    Ryan

  • Noted, thanks. Compile time is better since we will always want to run at 10dBm.