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.

LAUNCHXL-CC1352R1: 1 Mbps data rate with CC1352

Part Number: LAUNCHXL-CC1352R1

Is the CC1352 capable of supporting a 128 byte transfer from one device to another (one way only, no ack needed) at a 1 KHz rate - basically about 1 Mbps data rate?  But just as important at the overall data rate, the latency can't be too large, and of course, we'd like the jitter to be minimal.

The EasyLink samples I've tried all have large latencies and/or small buffers.  Any pointers to sample code that works is appreciated.  Of course, it'd have to be 2.4 GHz band to meet these data rates.

I've not seen anything in this forum or some of the others.

Thanks

Ed

  • Hi Ed,

    You can use the BLE PHY, it's 1 Mbps.

    The easiest way to test is by downloading SmartRF Studio: www.ti.com/.../SMARTRFTM-STUDIO
  • Thanks Marie. 

    We need to be able to send 128 byte packets once a millisecond.  The radio has a max packet size of 37 bytes in SmartRF.   Breaking up the data into smaller packets is not a problem, as long as there is no significant delay between the packets.  Is there some example code that will handle the fragmentation?  

    Ed

  • Hi Ed,

    You can use the BLE PHY with proprietary RF APIs, i.e. CMD_PROP_TX etc. (You still have to use CMD_BLE5_RADIO_SETUP.)

    You can open an example project, e.g. rfPacketTx, and import the BLE PHY settings from SmartRF settings. You can check out the Proprietary RF Simplelink Academy labs ( dev.ti.com/.../ ) to learn how to do this.
  • Thanks.  This helped, but I'm still getting some indeterminate excessive delays for some reason.

    Do you have anything like Nordic Semi's Enhanced Shock Burst library?  Quick and easy to use, it encapsulates all the difficult radio handling into a very simple API that can transfer application packets up to 252 bytes, handles all the packet packing and unpacking, includes retries and optional acks.  Radio is easy to configure via a few simple defines.  This seems to be working very well for us so far, but we've got a lot more testing to do.

    Ed

  • Following the steps Marie mentioned will allow you to transmit packets of length up to 255 bytes. Sending longer packets require that you replace the CMD_PROP_TX with the CMD_PROP_TX_ADV.

    I have taken the rfPacketRX example from the simplelink_cc13x2_sdk_1_60_00_29 and changes the settings and API commands for you. The files are attached.

    to change the packet length you simply change the PAYLOAD_LENGTH

    /* Packet TX Configuration */
    #define PAYLOAD_LENGTH      128

    /*
     * Copyright (c) 2017, Texas Instruments Incorporated
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    /***** Includes *****/
    /* Standard C Libraries */
    #include <stdlib.h>
    
    /* TI Drivers */
    #include <ti/drivers/rf/RF.h>
    #include <ti/drivers/PIN.h>
    #include <ti/drivers/pin/PINCC26XX.h>
    
    /* Driverlib Header files */
    #include DeviceFamily_constructPath(driverlib/rf_prop_mailbox.h)
    
    /* Board Header files */
    #include "Board.h"
    #include "smartrf_settings/smartrf_settings.h"
    
    /***** Defines *****/
    
    /* Packet TX Configuration */
    #define PAYLOAD_LENGTH      128
    #define PACKET_INTERVAL     (uint32_t)(4000000*0.1f) /* Set packet interval to 100 ms */
    #define PACKET_COUNT        100
    
    /***** Prototypes *****/
    
    /***** Variable declarations *****/
    static RF_Object rfObject;
    static RF_Handle rfHandle;
    
    /* Pin driver handle */
    static PIN_Handle ledPinHandle;
    static PIN_State ledPinState;
    
    static uint8_t packet[PAYLOAD_LENGTH];
    static uint16_t seqNumber;
    
    /*
     * Application LED pin configuration table:
     *   - All LEDs board LEDs are off.
     */
    PIN_Config pinTable[] =
    {
        Board_PIN_LED0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
        Board_PIN_LED1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
        Board_DIO30_RFSW | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
        PIN_TERMINATE
    };
    
    /***** Function definitions *****/
    
    void *mainThread(void *arg0)
    {
        uint32_t curtime;
        uint16_t count = 0;
        RF_Params rfParams;
        RF_Params_init(&rfParams);
    
        /* Open LED pins */
        ledPinHandle = PIN_open(&ledPinState, pinTable);
        if (ledPinHandle == NULL)
        {
            while(1);
        }
        
        /* Route out PA active pin to LED0 */
        PINCC26XX_setMux(ledPinHandle, Board_PIN_LED0, PINCC26XX_MUX_RFC_GPO1);
    
        RF_cmdPropTx.pktLen = PAYLOAD_LENGTH;
        RF_cmdPropTx.pPkt = packet;
        RF_cmdPropTx.startTrigger.triggerType = TRIG_ABSTIME;
        RF_cmdPropTx.startTrigger.pastTrig = 1;
        RF_cmdPropTx.startTime = 0;
    
        /* Request access to the radio */
        rfHandle = RF_open(&rfObject, &RF_ble, (RF_RadioSetup*)&RF_cmdBle5RadioSetup, &rfParams);
    
        /* Set the frequency */
        RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
    
        /* Get current time */
        curtime = RF_getCurrentTime();
        
        while(count++ < PACKET_COUNT)
        {
            /* Create packet with incrementing sequence number and random payload */
            packet[0] = (uint8_t)(seqNumber >> 8);
            packet[1] = (uint8_t)(seqNumber++);
            uint8_t i;
            for (i = 2; i < PAYLOAD_LENGTH; i++)
            {
                packet[i] = i - 1;
            }
    
            /* Set absolute TX time to utilize automatic power management */
            curtime += PACKET_INTERVAL;
            RF_cmdPropTx.startTime = curtime;
    
            /* Send packet */
            RF_EventMask terminationReason = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx,
                                                       RF_PriorityNormal, NULL, 0);
    
            switch(terminationReason)
            {
                case RF_EventCmdDone:
                    // A radio operation command in a chain finished
                    break;
                case RF_EventLastCmdDone:
                    // A stand-alone radio operation command or the last radio
                    // operation command in a chain finished.
                    break;
                case RF_EventCmdCancelled:
                    // Command cancelled before it was started; it can be caused
                // by RF_cancelCmd() or RF_flushCmd().
                    break;
                case RF_EventCmdAborted:
                    // Abrupt command termination caused by RF_cancelCmd() or
                    // RF_flushCmd().
                    break;
                case RF_EventCmdStopped:
                    // Graceful command termination caused by RF_cancelCmd() or
                    // RF_flushCmd().
                    break;
                default:
                    // Uncaught error event
                    while(1);
            }
    
            uint32_t cmdStatus = ((volatile RF_Op*)&RF_cmdPropTx)->status;
            switch(cmdStatus)
            {
                case PROP_DONE_OK:
                    // Packet transmitted successfully
                    break;
                case PROP_DONE_STOPPED:
                    // received CMD_STOP while transmitting packet and finished
                    // transmitting packet
                    break;
                case PROP_DONE_ABORT:
                    // Received CMD_ABORT while transmitting packet
                    break;
                case PROP_ERROR_PAR:
                    // Observed illegal parameter
                    break;
                case PROP_ERROR_NO_SETUP:
                    // Command sent without setting up the radio in a supported
                    // mode using CMD_PROP_RADIO_SETUP or CMD_RADIO_SETUP
                    break;
                case PROP_ERROR_NO_FS:
                    // Command sent without the synthesizer being programmed
                    break;
                case PROP_ERROR_TXUNF:
                    // TX underflow observed during operation
                    break;
                default:
                    // Uncaught error event - these could come from the
                    // pool of states defined in rf_mailbox.h
                    while(1);
            }
            PIN_setOutputValue(ledPinHandle, Board_PIN_LED1,!PIN_getOutputValue(Board_PIN_LED1));
        }
        RF_yield(rfHandle);
        while(1);
    }
    
    

    
    //*********************************************************************************
    // Generated by SmartRF Studio version 2.8.0 (build #145)
    // Tested for SimpleLink SDK version: CC13x2 SDK 1.60.xx
    // Device: CC1352 Rev. 1.1
    //
    //*********************************************************************************
    
    
    //*********************************************************************************
    // Parameter summary
    // Address: off
    // Address0: 0xAA
    // Address1: 0xBB
    // Frequency: 868.00000 MHz
    // Data Format: Serial mode disable
    // Deviation: 25.000 kHz
    // Packet Length Config: Variable
    // Max Packet Length: 255
    // Packet Length: 30
    // RX Filter BW: 110 kHz
    // Symbol Rate: 50.00000 kBaud
    // Sync Word Length: 32 Bits
    // TX Power: 14 dBm (requires define CCFG_FORCE_VDDR_HH = 1 in ccfg.c, see CC13xx/CC26xx Technical Reference Manual)
    // Whitening: No whitening
    
    
    /*#include <ti/devices/DeviceFamily.h>
    #include DeviceFamily_constructPath(driverlib/rf_mailbox.h)
    #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h)
    #include DeviceFamily_constructPath(driverlib/rf_prop_cmd.h)
    //#include DeviceFamily_constructPath(rf_patches/rf_patch_cpe_prop.h)
    #include DeviceFamily_constructPath(rf_patches/rf_patch_mce_genfsk.h)
    #include DeviceFamily_constructPath(rf_patches/rf_patch_rfe_genfsk.h)
    #include DeviceFamily_constructPath(rf_patches/rf_patch_cpe_multi_protocol.h)
    
    #include <ti/drivers/rf/RF.h>
    #include "smartrf_settings.h"*/
    
    //*********************************************************************************
    // Generated by SmartRF Studio version 2.9.0 (build #64alpha-settings-ieee_802_15_4)
    // Compatible with SimpleLink SDK version: CC13x2 SDK 1.60.xx.xx
    // Device: CC1352R Rev. 1.1
    // 
    //*********************************************************************************
    
    
    //*********************************************************************************
    // Parameter summary
    // Adv. Address: 010203040506 
    // Adv. Data: dummy 
    // BLE Channel: 17 
    // Extended Header: 09 09 010203040506 babe 
    // Frequency: 2440 MHz
    // PDU Payload length:: 30 
    // TX Power: 5 dBm (requires define CCFG_FORCE_VDDR_HH = 0 in ccfg.c, see CC13xx/CC26xx Technical Reference Manual)
    // Whitening: true 
    
    #include <ti/devices/DeviceFamily.h>
    #include DeviceFamily_constructPath(driverlib/rf_mailbox.h)
    #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h)
    #include DeviceFamily_constructPath(driverlib/rf_ble_cmd.h)
    #include <ti/drivers/rf/RF.h>
    #include DeviceFamily_constructPath(rf_patches/rf_patch_cpe_bt5.h)
    #include DeviceFamily_constructPath(rf_patches/rf_patch_mce_bt5.h)
    #include "smartrf_settings.h"
    
    
    // TI-RTOS RF Mode Object
    RF_Mode RF_ble =
    {
        .rfMode = RF_MODE_AUTO,
        .cpePatchFxn = &rf_patch_cpe_bt5,
        .mcePatchFxn = &rf_patch_mce_bt5,
        .rfePatchFxn = 0,
    };
    
    // Overrides for CMD_BLE5_RADIO_SETUP
    static uint32_t pOverridesCommon[] =
    {
        // override_ble5_setup_override_common.xml
        // Synth: Use 48 MHz crystal, enable extra PLL filtering
        (uint32_t)0x02400403,
        // Synth: Configure extra PLL filtering
        (uint32_t)0x001C8473,
        // Synth: Configure synth hardware
        (uint32_t)0x00088433,
        // Synth: Configure faster calibration
        HW32_ARRAY_OVERRIDE(0x4004,1),
        // Synth: Configure faster calibration
        (uint32_t)0x1C0C0618,
        // Synth: Configure faster calibration
        (uint32_t)0xC00401A1,
        // Synth: Configure faster calibration
        (uint32_t)0x00010101,
        // Synth: Configure faster calibration
        (uint32_t)0xC0040141,
        // Synth: Configure faster calibration
        (uint32_t)0x00214AD3,
        // Synth: Decrease synth programming time-out (0x0298 RAT ticks = 166 us)
        (uint32_t)0x02980243,
        // DC/DC regulator: In Tx, use DCDCCTL5[3:0]=0xC (DITHER_EN=1 and IPEAK=4). In Rx, use DCDCCTL5[3:0]=0xC (DITHER_EN=1 and IPEAK=4).
        (uint32_t)0xFCFC08C3,
        // Bluetooth 5: Compensate for reduced pilot tone length
        (uint32_t)0x01080263,
        // Bluetooth 5: Compensate for reduced pilot tone length
        (uint32_t)0x08E90AA3,
        // Bluetooth 5: Compensate for reduced pilot tone length
        (uint32_t)0x00068BA3,
        // Bluetooth 5: Set correct total clock accuracy for received AuxPtr assuming local sleep clock of 50 ppm
        (uint32_t)0x0E490C83,
        // override_frontend_id.xml
        (uint32_t)0xFFFFFFFF,
    };
    
    
    // Overrides for CMD_BLE5_RADIO_SETUP
    static uint32_t pOverrides1Mbps[] =
    {
        // override_ble5_setup_override_1mbps.xml
        // PHY: Use MCE RAM patch, RFE ROM bank 3 (mode 0)
        MCE_RFE_OVERRIDE(1,0,0,0,3,0),
        // Bluetooth 5: Reduce pilot tone length
        HW_REG_OVERRIDE(0x5320,0x0240),
        // Bluetooth 5: Compensate for reduced pilot tone length
        (uint32_t)0x013302A3,
        (uint32_t)0xFFFFFFFF,
    };
    
    
    // Overrides for CMD_BLE5_RADIO_SETUP
    static uint32_t pOverrides2Mbps[] =
    {
        // override_ble5_setup_override_2mbps.xml
        // PHY: Use MCE RAM patch, RFE ROM bank 3 (mode 2)
        MCE_RFE_OVERRIDE(1,0,2,0,3,2),
        // Bluetooth 5: Reduce pilot tone length
        HW_REG_OVERRIDE(0x5320,0x0240),
        // Bluetooth 5: Compensate for reduced pilot tone length
        (uint32_t)0x00D102A3,
        (uint32_t)0xFFFFFFFF,
    };
    
    
    // Overrides for CMD_BLE5_RADIO_SETUP
    static uint32_t pOverridesCoded[] =
    {
        // override_ble5_setup_override_coded.xml
        // PHY: Use MCE RAM patch, RFE ROM bank 3 (mode 1)
        MCE_RFE_OVERRIDE(1,0,1,0,3,1),
        // Bluetooth 5: Reduce pilot tone length
        HW_REG_OVERRIDE(0x5320,0x0240),
        // Bluetooth 5: Compensate for reduced pilot tone length
        (uint32_t)0x078902A3,
        (uint32_t)0xFFFFFFFF,
    };
    
    
    // CMD_BLE5_RADIO_SETUP
    // Bluetooth 5 Radio Setup Command for all PHYs
    rfc_CMD_BLE5_RADIO_SETUP_t RF_cmdBle5RadioSetup =
    {
        .commandNo = 0x1820,
        .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,
        .defaultPhy.mainMode = 0x0,
        .defaultPhy.coding = 0x0,
        .loDivider = 0x00,
        .config.frontEndMode = 0x0,
        .config.biasMode = 0x0,
        .config.analogCfgMode = 0x0,
        .config.bNoFsPowerUp = 0x0,
        .txPower = 0x001F,
        .pRegOverrideCommon = pOverridesCommon,
        .pRegOverride1Mbps = pOverrides1Mbps,
        .pRegOverride2Mbps = pOverrides2Mbps,
        .pRegOverrideCoded = pOverridesCoded,
    };
    
    // 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,
    };
    
    // CMD_PROP_TX
    // Proprietary Mode Transmit Command
    rfc_CMD_PROP_TX_t RF_cmdPropTx =
    {
        .commandNo = 0x3801,
        .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,
        .pktConf.bFsOff = 0x0,
        .pktConf.bUseCrc = 0x1,
        .pktConf.bVarLen = 0x1,
        .pktLen = 0x1E, // SET APPLICATION PAYLOAD LENGTH
        .syncWord = 0x930B51DE,
        .pPkt = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    };
    
    // CMD_PROP_RX
    // Proprietary Mode Receive Command
    rfc_CMD_PROP_RX_t RF_cmdPropRx =
    {
        .commandNo = 0x3802,
        .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,
        .pktConf.bFsOff = 0x0,
        .pktConf.bRepeatOk = 0x0,
        .pktConf.bRepeatNok = 0x0,
        .pktConf.bUseCrc = 0x1,
        .pktConf.bVarLen = 0x1,
        .pktConf.bChkAddress = 0x0,
        .pktConf.endType = 0x0,
        .pktConf.filterOp = 0x0,
        .rxConf.bAutoFlushIgnored = 0x0,
        .rxConf.bAutoFlushCrcErr = 0x0,
        .rxConf.bIncludeHdr = 0x1,
        .rxConf.bIncludeCrc = 0x0,
        .rxConf.bAppendRssi = 0x0,
        .rxConf.bAppendTimestamp = 0x0,
        .rxConf.bAppendStatus = 0x1,
        .syncWord = 0x930B51DE,
        .maxPktLen = 0xFF, // MAKE SURE DATA ENTRY IS LARGE ENOUGH
        .address0 = 0xAA,
        .address1 = 0xBB,
        .endTrigger.triggerType = 0x1,
        .endTrigger.bEnaCmd = 0x0,
        .endTrigger.triggerNo = 0x0,
        .endTrigger.pastTrig = 0x0,
        .endTime = 0x00000000,
        .pQueue = 0, // INSERT APPLICABLE POINTER: (dataQueue_t*)&xxx
        .pOutput = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    };
    
    // CMD_TX_TEST
    rfc_CMD_TX_TEST_t RF_cmdTxTest =
    {
        .commandNo = 0x0808,
        .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,
        .config.bUseCw = 0x0,
        .config.bFsOff = 0x1,
        .config.whitenMode = 0x2,
        .__dummy0 = 0x00,
        .txWord = 0xAAAA,
        .__dummy1 = 0x00,
        .endTrigger.triggerType = 0x1,
        .endTrigger.bEnaCmd = 0x0,
        .endTrigger.triggerNo = 0x0,
        .endTrigger.pastTrig = 0x0,
        .syncWord = 0x930B51DE,
        .endTime = 0x00000000,
    };
    

    smartrf_settings.h

    BR

    Siri