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.

TI-RTOS, CC1310 and interrupt by timer

Other Parts Discussed in Thread: CC1310, CC2650, SYSBIOS

How can I setup interrupt periodically fired by timer relatively often, lets say, every 10uS?

I have PWM already running, so it should not conflict with PWM.

I did not find any similar samples in TI Resources.

I have never use CC1310 and TI-RTOS before, just started, so I am also experiencing some lack of documentation, where it is located?

  • Hi Serge,

    You can create a Timer instance with a 10us period. You can go through SYS/BIOS (TI-RTOS Kernel) user guide for examples and details on the Timer module.

    You can find TI-RTOS User's Guide and other documentation in the following directory:
    C:\ti\tirtos_xxxx_2_xx_xx_xx\docs

    The SYS/BIOS kernel documentation can be found here:
    C:\ti\tirtos_xxxx_2_xx_xx_xx\products\bios_6_xx_xx_xx\docs

    Best,
    Ashish
  • Hi Serge,

    It all depends on what you are trying to achieve. 10us is a very short period for an MCU running any embedded OS.

    There are several options that you should consider:

    1. ISR
    2. Clock module
    3. Sensor Controller

    Here is a post that shows how to generate rapid pin toggling. You could inspire yourself from the post to execute your code in the ISR. The author was able to trigger an ISR every 1.5us (just for pin toggling). It uses the CC2650, but it's the same architecture as the CC1310

    For the clock module, refer to the SYS/BIOS (TI-RTOS kernel) documentation to understand how to configure it.

    Here is a post that shows the author having issues with the clock module (but it contains code that you could use). CC2650 again but it will be the same.

    The sensor controller is a very low power microcontroller embedded into the IC and runs at 24MHz. It might be able to do what you want if it is dedicated only to one task.

    If you want to go with that option, I recommend downloading the IDE : Sensor Controller Studio. Once you've opened it, the start page should have a link to a "Getting Started Guide" which will be very useful to understand how it works.

    If you wonder what would be recommended:

    For a relatively simple solution: try the clock module (you should know very rapidly whether the CC1310 device can handle such a short period). Otherwise, try the ISR.

    I've kept the Sensor Controller solution for last since it might take some time to learn and wrap your head around it. If time is not really an issue, then I would definitely recommend trying it out.

    Regards,

    Michel

  • Ok, thanks to everybody, seems like it is working now.

    I have tried Clock module, was not able to run it so fast and stable, may be I wasn't so consistent trying...
    My next try was with Timer object, and now seems like it is working.
    Code is here:
    - - - 8< - - - - - - - - -
    #include <ti/sysbios/hal/Timer.h>
    Timer_Handle timer_handle;
    Timer_Params timerParams;

    Timer_Params_init (&timerParams);
    timerParams.period=10; // uS
    timerParams.periodType=Timer_PeriodType_MICROSECS;
    timerParams.arg=1;
    timer_handle = Timer_create(Timer_ANY, PeriodicFunc, &timerParams, NULL);
    if (timer_handle == NULL) {System_abort("Timer create failed\n");}
    Timer_start(timer_handle); //not really needed, started automatically
    ...

    Void PeriodicFunc(UArg arg0)
    {
    // something very fast here
    }
    - - - 8< - - - - - - - - -

    Actually, if period is set as 7 uS or lower it became unstable on my system.
    But, I have revised my approach and have decided I can survive with 45uS :-)

    Thank you, everybody.
  • There was a suggested answer and since there has been no active on this thread for more than a week, the suggested answer was marked as verify. Please feel free to select the "Reject Answer" button and reply with more details.