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.

CC2640: Configuring CC2640 for Proprietary mode

Part Number: CC2640

Note: I wanted to post this in the 'Other wireless technologies forum', but when entering CC2640, it only allows the Bluetooth Forum. Could a moderator please relocate this post,

Summary of requests

  • Looking for C code to configure the CC2640 in 1Mbps GFSK, 2Mbps GFSK, 5Mbps 8-FSK modes of proprietary operation

  • Looking for more detailed documentation of the RF API and RF hardware interface (see details below)

  • Looking for clarification on the differences between the standard and HS API.

More detailed information

We have an application where we will need to use the CC2640 in proprietary mode. The CC2640 datasheet calls out that proprietary mode is possible, but the CC13x0, CC26x0 techincal reference manual as well as the SDK documentation is somewhat incomplete on how to use these modes. With no official support in RF Smart Studio for these modes, I’m left piecing together things to get this chip working.

For chip configuration, I’ve been given some examples by my FAE on how to configure the chip in 5Mbps mode. He also pointed me at the CC13x0 code examples for the HS API. Even though I have got the chip going in some of these modes, I can't trust that the chip is truly configured for optimal operation based on the performance I’ve been seeing. Is it possible to get C code that has the configuration commands and settings for the CC2640 in the following modes of proprietary operation:

  • 1Mbps GFSK
  • 2Mbps GFSK
  • 5Mbps 8-FSK

In the absence of that, is it possible to get more through documentation on these modes and APIs? With so much of the operation black-boxed in RF Smart Studio, it makes it hard to put together these configurations on my own without better understanding of some of the modes of operation described below:

  • Operation of the the RF register overrides
  • Operation of the CPE, RFE and MCE patches and when they should be used
  • Setting of the TX power register. This is only described in passing in the TRM and points to using the RF Smart Studio setting. Many of the different sources I've got for proprietary mode have different TX power settings which I am unable to differentiate if I'm really at max TX power (+5dBm).

Finally, I’m not sure which API to use in proprietary modes. There is both the standard and HS APIs. Is there information somewhere on the differences and when to use each of these?

Thank you in advance for the help.

  • Hi,

    It is recommended to use CC2640R2 device for any new development instead of CC2640.
    Since you have already received the settings needed for these modes of operation, can you please elaborate on the performance issues you have been seeing.

    RF register overrides are used to configure modules on the device for optimal configuration for a specific PHY implementation. Since this device can be programmed over wide range of datarates and modulations, some customization is needed for operation in different modes.

    The RF core can operate using code in ROM or using patches. MCE, RFE and CPE are different modules responsible for different functions such as packet handling, front end configuration etc. Depending on functions that need modifications, the module responsible for this function might execute using patch instead of ROM. This is configured using "MCE_RFE_OVERRIDE" function.

    Please use the overrides and patches provided by TI for proper operation of radio.

    For TX output power, please use the settings from latest release of smartrf studio. These settings are derived based on testing hardwar selected on studio such as the launchpad.

    HS APIs are typically needed when the datarate is higher than 1mbps and below this datarate, proprietary APIs can be used.

    Regards,
  • Hi SVS,

    Thank you for the prompt reply. This does a lot to give me a pretty good overview of whats going on, but not all the detail I need to operate this chip in proprietary mode. I'll look into switching our hardware design to the CC2640R2 device as you are recommending that for new designs.

    As for configuring the device in proprietary mode, SmartRF Studio only has settings for 100kbps and 250kbps for the CC2640R2F, therefore I can not produce the settings for the higher data rate modes I described above. The CC2640 datasheet calls out settings for 5Mbps proprietary operation which is what lead me to include this chip in our design.

    For our product's application we must have 2Mbps proprietary operation. Can you provide the settings for these modes of operation given that SmartRF Sudio cannot produce them? I have seen posts elsewhere in the forum that people have been able to operate in these modes, but they didn't post details of the code and configuration.

    Best,
    ~Matt
  • Hello,

    The settings for 1mbps and 2mbps are based on BLE5 PHY and the settings can be exported from SmartRF Studio launched in BLE mode. The exported file contains APIs for transmission of a BLE packet by default. If this is not needed, HS APIs can be used to send and receive packet. To do this, change the RF_Mode to following:

    RF_Mode RF_ble5 =

    {

       .rfMode = RF_MODE_PROPRIETARY_2_4,

       .cpePatchFxn = &rf_patch_cpe_bt5,

       .mcePatchFxn = 0,

       .rfePatchFxn = 0,

    };

    Add the HS APIs and use them for TX and RX instead of BLE APIs.

    #include DEVICE_FAMILY_PATH(driverlib/rf_hs_mailbox.h)
    #include DEVICE_FAMILY_PATH(driverlib/rf_hs_cmd.h)


    // CMD_TX_HS
    rfc_CMD_HS_TX_t RF_cmdTxHS =
    {
        .commandNo                  = 0x3841,
        .status                     = 0x0000,
        .pNextOp                    = 0x00000000,
        .startTime                  = 0x00000000,
        .startTrigger.triggerType   = 0x0,
        .startTrigger.bEnaCmd       = 0x0,
        .startTrigger.triggerNo     = 0x0,
        .startTrigger.pastTrig      = 0x0,
        .condition.rule             = 0x1,
        .condition.nSkip            = 0x0,
        .pktConf.bFsOff             = 0x0,
        .pktConf.bUseCrc            = 0x1,
        .pktConf.bVarLen            = 0x1,
        .pQueue                     = 0,
    };

    // CMD_RX_HS
    rfc_CMD_HS_RX_t RF_cmdRxHS =
    {
        .commandNo                  = CMD_HS_RX,
        .status                     = 0x0000,
        .pNextOp                    = 0x00000000,
        .startTime                  = 0x00000000,
        .startTrigger.triggerType   = 0x0,
        .startTrigger.bEnaCmd       = 0x0,
        .startTrigger.triggerNo     = 0x0,
        .startTrigger.pastTrig      = 0x0,
        .condition.rule             = 0x1,
        .condition.nSkip            = 0x0,
        .pktConf.bFsOff             = 0,
        .pktConf.bUseCrc            = 1,
        .pktConf.bVarLen            = 1,
        .pktConf.bRepeatOk          = 0,
        .pktConf.bRepeatNok         = 0,
        .pktConf.addressMode        = 0,
        .rxConf.bAutoFlushCrcErr    = 0,
        .rxConf.bIncludeLen         = 1,
        .rxConf.bIncludeCrc         = 0,
        .rxConf.bAppendStatus       = 0,
        .rxConf.bAppendTimestamp    = 0,
        .maxPktLen                  = 0,
        .address0                   = 0,
        .address1                   = 0,
        .__dummy0                   = 0,
        .endTrigger.triggerType     = 1,
        .endTrigger.bEnaCmd         = 0,
        .endTrigger.triggerNo       = 0,
        .endTrigger.pastTrig        = 0,
        .endTime                    = 0,
        .pQueue                     = 0,
        .pOutput                    = 0,
    };

    Regards,

  • HI SVS,

    In our current design we have a CC2640 which only supports BLE4.2 and doesn't have the commands for BLE5 (at least in the SDK, I have no idea if the radio ROM supports them). The CC2640 Datasheet (SWRS176B) explicitly calls out the 5Mbps Proprietary mode as well as 2Mbps GFSK for BLE so I'm hoping it's possible to get it into these mode. Without support in SmartRF Studio, I'm still very unclear on how to hand craft a radio setup command to use for 2Mbps proprietary mode on the CC2640.

    I think what you are suggesting is for me to use SmartRF Studio to generate a config file for the CC2640 in BLE mode. The output of that is shown at the end of my post here (BLE tx/rx command omitted). I think there are the changes I need, but I still have some questions outlined:

    • In yellow, change the rfMode to propreitary_2_4
    • In purple, it seems to me that the mode of the setup command would need to change out of BLE mode?
    • In Orange, are the BLE modem control and RF patches still correct for prop mode?
    • In Green, there is no documentation on the internal registers that the register overrides set. Same as above, are these still correct for prop mode
    • Beyond setting the .mode in setup, it's unclear if I need to set the data rate anywhere else (2Mbps vs 5Mbps) and if any other support settings that need to change
    • If all that setup is done correctly, as you stated above I'd use the HS API commands for packet TX and RX

    Best,

    ~Matt

     

    Code begins below:

    //*********************************************************************************

    // Generated by SmartRF Studio version 2.11.0 (build#126)

    // The applied template is compatible with tirtos_simplelink_2_21_00

    // Device: CC2640 Rev. 2.2

    //

    //*********************************************************************************

    //*********************************************************************************

    // Parameter summary

    // Adv. Address: 010203040506

    // Adv. Data: 255

    // BLE Channel: 17

    // Frequency: 2440 MHz

    // PDU Payload length:: 30

    // TX Power: 5 dBm

    // Whitening: true

    #include <driverlib/rf_mailbox.h>

    #include <driverlib/rf_common_cmd.h>

    #include <driverlib/rf_ble_cmd.h>

    #include <ti/drivers/rf/RF.h>

    #include <rf_patches/rf_patch_cpe_ble.h>

    #include <rf_patches/rf_patch_rfe_ble.h>

    #include "smartrf_settings.h"

    // TI-RTOS RF Mode Object

    RF_Mode RF_ble =

    {

       .rfMode = RF_MODE_BLERF_MODE_PROPRIETARY_2_4,

       .cpePatchFxn = &rf_patch_cpe_ble,

       .mcePatchFxn = 0,

       .rfePatchFxn = &rf_patch_rfe_ble,

    };

    // Overrides for CMD_RADIO_SETUP

    uint32_t pOverrides[] =

    {

       // override_use_patch_ble_1mbps.xml

       // PHY: Use MCE ROM, RFE RAM patch

       MCE_RFE_OVERRIDE(0,0,0,1,0,0),

       // override_synth_ble_1mbps.xml

       // Synth: Set recommended RTRIM to 5

       HW_REG_OVERRIDE(0x4038,0x0035),

       // Synth: Set Fref to 3.43 MHz

       (uint32_t)0x000784A3,

       // Synth: Set loop bandwidth after lock to 80 kHz

       (uint32_t)0xA47E0583,

       // Synth: Set loop bandwidth after lock to 80 kHz

       (uint32_t)0xEAE00603,

       // Synth: Set loop bandwidth after lock to 80 kHz

       (uint32_t)0x00010623,

       // Synth: Configure PLL bias

       HW32_ARRAY_OVERRIDE(0x405C,1),

       // Synth: Configure PLL bias

       (uint32_t)0x1801F800,

       // Synth: Configure PLL latency

       HW32_ARRAY_OVERRIDE(0x402C,1),

       // Synth: Configure PLL latency

       (uint32_t)0x00608402,

       // Synth: Use 24 MHz XOSC as synth clock, enable extra PLL filtering

       (uint32_t)0x02010403,

       // Synth: Configure extra PLL filtering

       HW32_ARRAY_OVERRIDE(0x4034,1),

       // Synth: Configure extra PLL filtering

       (uint32_t)0x177F0408,

       // Synth: Configure extra PLL filtering

       (uint32_t)0x38000463,

       // override_phy_ble_1mbps.xml

       // Tx: Configure symbol shape for BLE frequency deviation requirements

       (uint32_t)0x013800C3,

       // Rx: Configure AGC reference level

       HW_REG_OVERRIDE(0x6088, 0x0045),

       // Tx: Configure pilot tone length to ensure stable frequency before start of packet

       HW_REG_OVERRIDE(0x52AC, 0x0360),

       // Tx: Compensate timing offset to match new pilot tone setting

       (uint32_t)0x01AD02A3,

       // Tx: Compensate timing offset to match new pilot tone setting

       (uint32_t)0x01680263,

       // override_frontend_id.xml

       (uint32_t)0xFFFFFFFF

    };

    // CMD_RADIO_SETUP

    // Radio Setup Command for Pre-Defined Schemes

    rfc_CMD_RADIO_SETUP_t RF_cmdRadioSetup =

    {

       .commandNo = 0x0802,

       .status = 0x0000,

       .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx

       .startTime = 0x00000000,

       .startTrigger.triggerType = 0x0,

       .startTrigger.bEnaCmd = 0x0,

       .startTrigger.triggerNo = 0x0,

       .startTrigger.pastTrig = 0x0,

       .condition.rule = 0x1,

       .condition.nSkip = 0x0,

       .mode = 0x00, // Does this need to be either 0x02 or 0x05 for 2Mbps or 5Mbps?

       .__dummy0 = 0x00,

       .config.frontEndMode = 0x0,

       .config.biasMode = 0x0,

       .config.analogCfgMode = 0x0,

       .config.bNoFsPowerUp = 0x0,

       .txPower = 0x9330,

       .pRegOverride = pOverrides

    };

    // CMD_FS

    // Frequency Synthesizer Programming Command

    rfc_CMD_FS_t RF_cmdFs =

    {

       .commandNo = 0x0803,

       .status = 0x0000,

       .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx

       .startTime = 0x00000000,

       .startTrigger.triggerType = 0x0,

       .startTrigger.bEnaCmd = 0x0,

       .startTrigger.triggerNo = 0x0,

       .startTrigger.pastTrig = 0x0,

       .condition.rule = 0x1,

       .condition.nSkip = 0x0,

       .frequency = 0x0988,

       .fractFreq = 0x0000,

       .synthConf.bTxMode = 0x0,

       .synthConf.refFreq = 0x0,

       .__dummy0 = 0x00,

       .__dummy1 = 0x00,

       .__dummy2 = 0x00,

       .__dummy3 = 0x0000

    };

  • Hi,

    For CC2640 device, radio patches are needed to program the device in 2mbps and 5mbps mode. Since this is not published, we are unable to share this without an NDA. Also, the settings for the same modes on CC2640 and CC2640R2 will be different since the code is executed from patches on former and from ROM on later. Please reach out to the local TI FAE for further information on HS modes for CC2640.

    Regards,
  • Hi SVS,

    I'm working with my FAE now to get this going. Thank you for your help heere in the forum along the way!

    best,

    ~Matt