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.

RTOS/CC2650: CC2650/RTOS

Part Number: CC2650

Tool/software: TI-RTOS

Hello All,

I am using CC2650 i want to use RTC timer as general purpose timers so that in idle mode also i can  able to maintain the timer.

I want to use RTC and RTC event. I have gone through all the related RTC post still the concept is not clear as per my requirement.

Please help me to solve this.

Thanks and Regards,

Ap.

  • Hi,

    are you using TI-RTOS? You have two options:

    • Use the Clock module infrastructure provided by TI-RTOS. This is based upon the RTC timer channel 0 and is the way to go for one-shot and for periodic timers. You can have as many Clock objects running at the same time as you want. The Clock module contains a virtual timer abstraction.
    • If you really need raw access, use RTC channel 1 or 2 directly. Read the documentation of the Timer module. It contains some information how to add channel handlers:
    Channel 0 of the RTC is dedicated to use by the Clock module. This Timer module implementation is therefore responsible for overall management of the RTC, including resetting and starting the RTC during application boot, and providing the single interrupt service routine (ISR) for the RTC.
    Channels 1 and 2 of the RTC are not used by the Clock module. These channels may be available for use by some applications, depending upon the mix of software components being used. For this purpose, this Timer module supports sharing of the RTC interrupt, to support usage of these other channels (in parallel with the usage of Channel 0 by the Clock module).
    
    To use one of these other channels the application will need to explicitly configure an interrupt "hook" function for the channel. In this case, when an RTC interrupt triggers the ISR will check the status of each channel to see if the corresponding channel hook function should be called.
    The time match values for Channel 0 will be automatically programmed by the Clock module. To use Channels 1 (and/or Channel 2), the application will need to explicitly program the match value for the corresponding channel, for the desired time for the interrupt. Also, the application will need to explicitly enable the additional channel, and include it in the combined event configuration.
    
    The below snippets show an example of using Channel 1, with Driverlib API calls to configure an RTC event at 4 seconds after boot.
    First, in the application .cfg file a hook function is defined for Channel 1:
        var Timer = xdc.module('ti.sysbios.family.arm.cc26xx.Timer');
        Timer.funcHookCH1 = "&myHookCH1";
    
    In main(), Channel 1 is first cleared, a compare (match) value of 4 seconds is set, the channel is enabled, and is included (along with Channel 0) in the combined event configuration:
        AONRTCEventClear(AON_RTC_CH1);
        AONRTCCompareValueSet(AON_RTC_CH1, 0x40000);
        AONRTCChannelEnable(AON_RTC_CH1);
        AONRTCCombinedEventConfig(AON_RTC_CH0 | AON_RTC_CH1);
    
    With the above, myHookCH1() will be called when the RTC reaches a count of 4 seconds. At that time, a new compare value can be written for the next interrupt that should occur for Channel 1.

    There is an issue with this example (fixed in the upcoming SDK release). You need to initialize the RTC after calling BIOS_start(). So you need to move above code into a task.

  • Hello Richard,

    Basically i want to sync 2 devices. When 1 BLE device is advertising other device should scan for 1st device and start its RTC clk and RTC event in 2nd device so that i can track and maintain in 2nd device advertising interval of 1st device with help of RTC clk.
    how to implement this with RTC event.


    Thanks and Regards,
    Amol Motar

  • Hello

    Can you suggest how to use RTC timer to start or stop advertising event or scan event


    Thanks and Regards
    amol motar
  • I have no knowledge of the BLE stack. I will assign this thread to the BLE apps team.
  • Hello team,

    Yeah please I need to use rtc clk timer and rtc event I have read the rtc related previous post still I am not able to use  rtc  .

    Thanks and regards

    Ap

  • Hello team,

    I need to use rtc clk timer and rtc event I have read the rtc related previous post still I am not able to use rtc .
    Also I am trying to use this RTC timer and RTC event and trying to use power switch mode from Stand by mode to idle or active mode.

    Please help me to solve this.


    Thanks and regards

    Ap