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.

CC2640R2F: abort the "RF_cmdTxTest" command

Part Number: CC2640R2F

Hi

I have used smartRfStudio to generate a CW signal with the LAUNCHXL - CC2640R2F board, and then exported the code to CCS.

I would like to modify the code to send a continuous wave signal for a predefined period. In the RF_cmdTxTest, I see "end.trigger" and "end.time" fields, but I'm not sure how I can use them to abort transmission. 

I appreciate if someone can help me. Thanks.

Mohamad

  • I found out that by setting the RF_cmdTxTest fields as follow, the CW transmission can be aborted after a specific time:

    .endTrigger.triggerType = 0x4,
    .endTrigger.bEnaCmd = 0x1,
    .endTrigger.triggerNo = 0x2,
    .endTrigger.pastTrig = 0x1,
    .syncWord = 0x930B51DE,
    .endTime = 0x00000800

    Now, I have two new questions:
    1. Is it possible to return from the RF_cmdTxTest command to run other code (like controlling GPIOs) while the radio still transmitting?
    2. Each time I want to call the RF_cmdTxTest, I need to call the RF_cmdFs to set the frequency synthesizer and wait for the synthesizer to lock (~ 600us). Is it possible to avoid re-tuning the synthesizer?

    Thanks,
    Mohamad
  • 1. Yes.
    2. If you don't need to change the frequency that you don't need to call the RF_cmdFs

    You can do
    RF_cmdTxTest.endTime = RF_getCurrentTime() + "how long you want it to last"
    The duration you want it to last has to be converted.
    The radio timer counts as tick number. 4 ticks = 1 us.
    Therefore if you want it to end after 100us, then the value you need to plug in into " " will be 400.
  • Hi Christin

    Thanks for the reply.
    Regarding my first question: Can you explain a bit more. I am using the "rfCarrierWave_CC2640R2_LAUNCHXL_nortos_ccs" project with the smart_rf_settings files exported from SmartRF Studio 7. The RF_cmd_TxTest is as follows:

    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 = 0x1,
    .config.bFsOff = 0x1,
    .config.whitenMode = 0x2,
    .__dummy0 = 0x00,
    .txWord = 0xFFFF,
    .__dummy1 = 0x00,
    .endTrigger.triggerType = 0x4,
    .endTrigger.bEnaCmd = 0x0,
    .endTrigger.triggerNo = 0x0,
    .endTrigger.pastTrig = 0x0,
    .syncWord = 0x930B51DE,
    .endTime = 0x00000000
    };

    and I modified the mainThread function as follows:
    /* Send CMD_FS and wait until it has completed */
    RF_runCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);

    RF_cmdTxTest.endTime = 40000000; //10s CW output

    RF_runCmd(rfHandle, (RF_Op*)&RF_cmdTxTest, RF_PriorityNormal, NULL, 0);

    while (1)
    {
    if (redLed == 0)
    redLed = 1;
    else
    redLed = 0;
    PIN_setOutputValue(redLedPinHandle, CC2640R2_LAUNCHXL_PIN_RLED, redLed);
    CPUdelay(10000000);
    }

    I am using an RF power detector to check the RF output power.
    I get a 10sec pulse at the output of power detector (as expected). but the redLed starts to toggle after 10sec. (i.e. When the radio transmission is over.) Is there a way to toggle the LED while the radio still transmitting?

    Regarding my second question: if I don't call the RF_cmdFs each time before the RF_cmdTxTest, I won't see anything at the RF output.

    Thanks for your help,
    Mohamad
  • I figured out what should I do!

    Instead of "RF_runCmd" I used "RF_postCmd" and it solves the first issue.
    I used "RF_cmdTxTest.config.bFsOff = 0x0;" to keep the synthesizer on.