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.

CC1312R7: CC1312 Discontinuous Transmit Data

Part Number: CC1312R7

Hello everynoe,

I want to print continuous data using CC1312. But I couldn't get exactly the results I wanted. The total transmit time takes 2.25ms (for 255 bytes). But after every 255bytes, TX shuts down. And the reopening time is about 175us.

1) Is this the RX/TX switching time of CC1312?

2) If so, can I use CC1312 only in transmit mode? What I mean is clearly visible in the spectrum image I shared below.

n the spectrum image below, the transmitted signal seems to completely close the TX chain at the end of 255 bytes (-60dbm is the lowest point). The only thing that comes to my mind is the switching time of CC1312.

NOTES: I will never use Receive in my application.

Best Regards

  • First of all, it is possible to transmit longer packets than 255 bytes if you switch to using the Advanced TX command. It will accept a length that is 2 bytes instead of 1.

    However, if you need to do continuous TX you need to set packet length to infinite and use a TX queue to handle the data.

    The following post contains an example that you can use as a starting point for this:

    (+) CC1310: CMD_PROP_TX_ADV Example - Sub-1 GHz forum - Sub-1 GHz - TI E2E support forums

    Siri

  • Hello @Siri 

    Thanks for reply.

    There are improvements in data transmission, but there is still no fully continuous time data transmission. rf_tx goes off every time PAYLOAD_LENGTH is reset. Actually, what I want to do is just transfer data. It will continuously transfer (TX) the payload data I give it. Without ever stopping the TX line in the time domain.

    Sincelery

  • I ran the example I linked to and did not have any problems.

    the data bugger is sent back-to-back as described:

    #include <stdlib.h>
    #include <unistd.h>
    
    #include <ti/drivers/rf/RF.h>
    #include <ti/drivers/GPIO.h>
    
    #include DeviceFamily_constructPath(driverlib/rf_prop_mailbox.h)
    
    #include "ti_drivers_config.h"
    #include <ti_radio_config.h>
    #include DeviceFamily_constructPath(driverlib/rf_data_entry.h)
    
    #define PACKET_INTERVAL     500000  /* Set packet interval to 500000 us or 500 ms */
    #define TX_BUFFERS_TO_SEND  100
    
    
    /***** Variable declarations *****/
    static RF_Object rfObject;
    static RF_Handle rfHandle;
    
    /* The buffer below contains a packet that is sent back-to-back TX_BUFFERS_TO_SEND every PACKET_INTERVAL. */
    static uint8_t txSyncPacket[] = {
                                    /**********************************************/
                                    0x55, 0x55, 0x55, 0x55,         // Preamble
                                    0x93, 0x0B, 0x51, 0xDE,         // Sync Word
                                    0x03,                           // Length byte
                                    0xCC, 0x00, 0xFF                // 3 bytes payload
                                    /**********************************************/
                                };
    
    static rfc_dataEntryPointer_t txEntry;
    static dataQueue_t txQueue;
    
    volatile uint8_t packetSent = false;
    static uint8_t packetCounter = 0;
    
    static void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e);
    
    
    /***** Function definitions *****/
    
    void *mainThread(void *arg0)
    {
        RF_Params rfParams;
        RF_Params_init(&rfParams);
    
        GPIO_setConfig(CONFIG_GPIO_GLED, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);
        GPIO_write(CONFIG_GPIO_GLED, CONFIG_GPIO_LED_OFF);
        GPIO_setConfigAndMux(CONFIG_GPIO_GLED, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW, IOC_PORT_RFC_GPO0);
    
        txEntry.pNextEntry = (uint8_t*)&txEntry;
        txEntry.status = DATA_ENTRY_PENDING;
        txEntry.config.type = DATA_ENTRY_TYPE_PTR;
        txEntry.pData = (uint8_t*)txSyncPacket;
        txEntry.length = sizeof(txSyncPacket);
    
        RF_cmdPropTxAdv.pPkt = (uint8_t*)&txQueue;
        RF_cmdPropTxAdv.pktLen = 0;
        RF_cmdPropTxAdv.startTrigger.triggerType = TRIG_NOW;
        RF_cmdPropTxAdv.startTrigger.pastTrig = 1;
        RF_cmdPropTxAdv.startTime = 0;
        RF_cmdPropTxAdv.syncWord = 0x55555555; // cannot turn off sync so make it part of preamble
    
        txQueue.pCurrEntry = (uint8_t*)&txEntry;
        txQueue.pLastEntry = NULL;
    
        rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
    
    
        /* Set the frequency */
        RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
    
        while(1)
        {
            packetCounter = 0;
            txQueue.pCurrEntry = (uint8_t*)&txEntry;
    
            /* Send packet */
            RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTxAdv, RF_PriorityNormal, &callback, RF_EventTxEntryDone);
            while(!packetSent);
            packetSent = false;
            usleep(PACKET_INTERVAL);
        }
    }
    
    void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
    {
        if (e & RF_EventTxEntryDone)
        {
            packetCounter++;
    
            if (packetCounter == (TX_BUFFERS_TO_SEND - 1))
            {
                txQueue.pLastEntry = txQueue.pCurrEntry;
            }
        }
        else if (e & RF_EventLastCmdDone)
        {
            packetSent = true;
        }
    }

    I output the Binary data signal that goes to the modulator when sending on a pin to verify:

    Siri

  • Hello @Siri,

    Thanks for reply. I think my problem is the sync bytes. I gave them as dummy frames. I think I need to add the first 4 bytes of my data packet to the sync. It's reasonable. I will try it and write the results here.

    Hello again @Siri

    I tried the sample code you gave as is. The result is still the same. Is there any chance to connect the RF OUT end to the spectrum analyzer? In Spectrum, you will observe that RF OUT goes instantaneously in zero span mode. This is exactly my problem. I don't see a continuous time TX stream.

    I am sharing the spectrum image for a clearer understanding. I put a 500ms wait in the code. So that it can be seen more clearly. 500ms RF_OUT at the output power I want, 500ms RF_OUT off??? So I cannot make a continuous package stream. The code is exactly the same as your example.

    Sincelery

  • If you actually look at the code I sent, you will see that it does not send continuously. It sends packets back-to-back (NO delay between them), and it sends 100 packets (TX_BUFFERS_TO_SEND  100).

    In your original questions you asked how to send packets without having to restart the TX every 255 bytes, and I showed you how to do that.

    If you need more than 100 packet, you need to increase TX_BUFFERS_TO_SEND.

    If you want to send continuously, you have to re-write your code to do that.

    The logic analyzer plot I sent are showing that every packet (from my example) is sent without ANY delay between the packet.

    Siri

  • It was a good discussion, thank you. Can I transfer data continuously with CC1312R7? Based on my experiments, I think there is a hardware RX/TX switching time. And I can't make this time disappear. I think I should be able to just tell the chip to transmit. But how?

    Sincelery

  • Yes, you can transfer data continuously. 

    That is exactly what I wrote in my previous post:

    "If you want to send continuously, you have to re-write your code to do that."

    If you change the code I gave you like this, it will transmit forever:

    void *mainThread(void *arg0)
    {
        RF_Params rfParams;
        RF_Params_init(&rfParams);
    
        txEntry.pNextEntry = (uint8_t*)&txEntry;
        txEntry.status = DATA_ENTRY_PENDING;
        txEntry.config.type = DATA_ENTRY_TYPE_PTR;
        txEntry.pData = (uint8_t*)txSyncPacket;
        txEntry.length = sizeof(txSyncPacket);
    
        RF_cmdPropTxAdv.pPkt = (uint8_t*)&txQueue;
        RF_cmdPropTxAdv.pktLen = 0;
        RF_cmdPropTxAdv.startTrigger.triggerType = TRIG_NOW;
        RF_cmdPropTxAdv.startTrigger.pastTrig = 1;
        RF_cmdPropTxAdv.startTime = 0;
        RF_cmdPropTxAdv.syncWord = 0x55555555; // cannot turn off sync so make it part of preamble
    
        txQueue.pCurrEntry = (uint8_t*)&txEntry;
        txQueue.pLastEntry = NULL;
    
        rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
    
        RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
    
        RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTxAdv, RF_PriorityNormal, NULL, RF_EventTxEntryDone);
    
        while(1);
    }

    Why are you asking about RX/TX switching time?

    You have stated that you are not using RX, and you want continuous TX.

    Siri 

  • Hello @Siri,

    I found the source of the problem. If you follow the "RF_runCmd" function, you will see that you turn off all interrupt routines, clock sources, load the necessary parameters for RF broadcast and turn them on again. I don't know how necessary it is to do these. I guess I'll have to write a function like RF_runCmd from scratch and test its accuracy. It would be nice to get comments from TEXAS' FAs on this issue.

    Sincelery

     

  • Not sure what you mean, and there is definitely no reason to modify the RF_runCmd.

    You can run the exact code I shared in the last post, and it starts TX and never ends.

    I have tested what you asked for with our official drivers, and everything begave as it is supposed to.

    We will not be able to support any modifications to the drivers.

    Siri