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.

CC1352R: Reading RTC Timer Ticks

Part Number: CC1352R

Dear TI,

I have a time stamp application, but would like to use the 32Khz clock (SCLK_LF) as the clock source for the ticks since it will still be running in standby mode.  Can I change the clock source of the time stamp module from the system clock to the SCLK_LF?  I expect the RTC is being clocked by the SCLK_LF, but don't see an easy way to read the RTC ticks?  I see I can create a clock from the ClockModule, but those all seem to use the system clock as their source as does the time stamp module.

Thanks,

Brett

  • Hi Brett,

    I would recommend letting the CC1352R control the clock source itself.

    Are you using an RTOS in your application?

    Cheers,

    Marie H

  • Yes, we will be using TIRTOS and we do plan on letting the RTOS control the power saving modes. Regardless, I want to time stamp a falling edge of a signal that could fall when the 1352 is in standby mode.  The edge should wake the processor up.  I see how to generate an interrupt when a GPIO sees an edge.  In the ISR I want to read the RTC value.  I should be able to use  AONRTCCurrentCompareValueGet  () right?  I'm working in the cloud and the compiler says 


    gpiointerrupt.c", line 45: fatal error #1965: cannot open source file "driverlib/aon_rtc.h"?

    I'm wondering, for a TIRTOS application, can I use the capture feature of the RTC to capture the value on a falling edge of a signal.  Just curious how much of the RTC I can use.  There is a warning about not reconfiguring it because the RTOS uses it.

    Thanks!

    Brett

  • Hi Brett

    I do not think it is a problem to read the RTC, but you should be careful and not re-configure it since it is used by TI-RTOS.

    I took the rfWakeOnRadio example, where a packet is transmitted everytime a button is pushed, and read the rtc in the GPIO interrupt callback. That seemed to work just fine.

    Modification to the original code is shown below:

    #include DeviceFamily_constructPath(driverlib/aon_rtc.h)
    
    .
    .
    .
    .
    .
    static uint32_t ISRTime;
    
    /***** Function definitions *****/
    /* GPIO interrupt Callback function for CONFIG_GPIO_BTN1. */
    void buttonCallbackFunction(uint_least8_t index) {
    
        /* Simple debounce logic, only toggle if the button is still pushed (low) */
        CPUdelay((uint32_t)((48000000/3)*0.050f));
        if (!GPIO_read(index)) {
            /* Post TX semaphore to TX task */
    
            ISRTime = AONRTCCurrentCompareValueGet();
    
            sem_post(&txSemaphore);
        }
    }
    

    BR

    Siri

  • Wow, ok, thank you so much!  Sorry I didn't get back to you sooner.