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-CC1310: use RF_ratCapture to capture rising edge of RATGPO0?

Part Number: LAUNCHXL-CC1310
Other Parts Discussed in Thread: CC1310

Hi,

I am trying to obtain precise timing for when radio transmission starts. The TRM for the cc1310 says in Section 23.3.2.8: "The signal RATGPO0 goes high when transmission of a packet is initiated and low when transmission is done".

First, I use the DBELL:SYSGPOCTL register to output RATGPO0 on RFC_GPO1


    HWREG(RFC_DBELL_BASE + RFC_DBELL_O_SYSGPOCTL) &= ~(0xF << 4);
    HWREG(RFC_DBELL_BASE + RFC_DBELL_O_SYSGPOCTL) |= RFC_DBELL_SYSGPOCTL_GPOCTL1_RATGPO0;

Then I call the start_rat_capture function to capture a rising edge on "RfcGpi1".

    static volatile uint32_t rat_timestamp;

    static bool start_rat_capture() {
        RF_RatConfigCapture config = {
            .callback = +[](RF_Handle h, RF_RatHandle rh, RF_EventMask e, uint32_t compare_capture_time) {
                rat_timestamp = compare_capture_time;
            },
            .channel     = RF_RatChannelAny,
            .source      = RF_RatCaptureSourceRfcGpi1,
            .captureMode = RF_RatCaptureModeRising,
            .repeat      = RF_RatCaptureRepeat,
        };
        RF_RatHandle rat_handle = RF_ratCapture(rf_handle, &config, NULL);
        return rat_handle != RF_ALLOC_ERROR;
    }

The RF_ratCapture function returns 0, which I believe means it successfully configured it on RAT channel 0.

Is this all that is necessary? The callback never fires even though messages are transmitted and I'm unsure what else I need to configure.

Would appreciate any insight on why this is not working.

Thanks,

Alex

  • Small update:

    I added the following to the overrides for the radio div setup command because I read that altering the DBELL registers may not take effect if the RF core is not powered:

            HW_REG_OVERRIDE(0x1110, RFC_DBELL_SYSGPOCTL_GPOCTL1_RATGPO0),

    It still doesn't work.

  • Another update:

    Routed RFC_GPO1 to the external pin that's connected to the green LED on the launchpad board. It indeed blinks whenever a message is transmitted. So it's definitely routed correctly and there is a rising edge on the line. No idea why the callback is not running.

  • Hi Alexander, 

    Just wanted to clarify what you are trying to do here. If you are using the absolute trigger,  (TRIG_ABSTIME), you can provide a timestamp in terms of RAT ticks in the future and the transmission occurs at this time stamp. 

    But if you still need to capture the time stamp when the PA goes high, you can use pin_setmux() api to route it to a GPIO pin, which you seemed to have done already by routing it to the green LED. You should set up a second GPIO pin as an input and route this to RFC_GPO1. And connect the GPIO pins externally. This will route the PA signal to the RFC_GPIO1. But may not be optimal since it goes through external pins and wiring.

    Regards,

    Sid

  • Hi Sid,

    Thanks for the reply.

    I am a little confused about how this works then. What is the difference between RFC_GPO and RFC_GPI? Is there a diagram somewhere that I can refer to for clarification because I was under the assumption that RFC_GPO and RFC_GPI are the same line (i.e. RFC_GPIO)

    Does RAT capture only work if the pin is configured as an input?

    Also, for clarification: I am trying to obtain precise timestamps for the purposes of synchronizing between radios. I will be using TRIG_ABSTIME to provide a starting timestamp, but also using the rising and falling edge of this signal to characterize jitter during transmission. I am also going to try to do something similar on the receive side.

    I will try your suggestion and report back.

    Thanks,

    Alex

  • Hi Sid,

    I have configured another pin as input and connected it to the green LED pin. I am still not able to get the callback to fire.

    Here is the code:

    IO config:

        static constexpr PIN_Config config_table[] = {
            // GPIOs
            green_led | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PULLDOWN | PIN_DRVSTR_MAX,
            input_pin | PIN_INPUT_EN | PIN_NOPULL,
            PIN_TERMINATE,
        };

        static PIN_State green_state, input_state;
        PIN_Handle         green_handle, input_handle;
        bool initialize() {
            return PIN_init(config_table) == PIN_SUCCESS && (green_handle = PIN_open(&green_state, &config_table[0])) && (input_handle = PIN_open(&input_state, &config_table[1]));
        }

    multiplexers:

            PINCC26XX_setMux(pin::green_handle, pin::green_led, PINCC26XX_MUX_RFC_GPO1);
            PINCC26XX_setMux(pin::input_handle, pin::input_pin, PINCC26XX_MUX_RFC_GPI1);

    I've tried setting input pin to RFC_GPO1 and it also doesn't work. The green LED still blinks meaning there is still a rising edge on the line.

  • I got it to work.

    My previous message was correct except that I was calling PIN_open twice when I only needed to call it once. If I change initialize() to

        bool initialize() {
            if (PIN_init(config_table) == PIN_SUCCESS) {
                pin_handle = PIN_open(&pin_state, config_table);
            }
            return false;
        }

    Then it works.

    I would still appreciate any more documentation that you may have Sid w.r.t. where the GPO and GPI lines lie within the RF core and System cpu.

    Thanks,


    Alex