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: Sensor Controller task with two event triggers

Part Number: CC1352R

I have a task with I2C to read accelerometer data (acceleration, gyroscope, pedometer, etc). I'm trying to read the accelerometer and gyroscope every 10ms while only querying the pedometer every 1 second. So I allocated two events like so:

And I initialize them like so:

And I reset the triggers in each respective event handler with the same numbers.

Event Handler A

Event Handler B

However, both event handlers run ~1000ms apart every time. If I change Trigger 1 to evhSetupTimer1Trigger(1,10,2), both event handlers run at ~10ms intervals, always. Even if I attempt to change trigger 1 to 1000ms in the event handler. If I remove Event B entirely from the task, Event Handle A doesn't run at all. Why is this? Is it not possible to run two event triggers in the same task? Am I misunderstanding how to use the timers?

Note: I am using Timer 0 on another task which utilizes the Trigger 0, but that's on an entirely different task and I wouldn't expect it to affect this task.

  • You can do the following:

    Have the pedometer code run in the Execution code and set it up to run every 1000 ms

    The accelerometer and gyroscope code can run in the EventHandler A Code:

    //-----------------------------------------------
    // Initialization Code
    //-----------------------------------------------
    evhSetupTimer1Trigger(0, 10, 2) ;
    
    // Schedule the first execution
    fwScheduleTask(1);
    //-----------------------------------------------
    
    
    
    //-----------------------------------------------
    // Execution Code
    //-----------------------------------------------
    // Pedometer Code
    
    // Schedule the next execution
    fwScheduleTask(1);
    //-----------------------------------------------
    
    
    
    //-----------------------------------------------
    // Event Handler A Code
    //-----------------------------------------------
    // Accelerometer and gyroscope code
    
    evhSetupTimer1Trigger(0, 10, 2) ;
    //-----------------------------------------------
    

    In application:

    // Enable RTC ticks, with 1 Hz tick interval
    scifStartRtcTicksNow(0x00010000 / 1);

    Siri

  • That solution appears to work as intended. However, I'm still curious about this question in particular:

    1. Is it not possible to run two event triggers in the same task?
  • It is not possible to use the same timer for both of the events.

    evhSetupTimer1Trigger(0, 10, 2);
    evhSetupTimer1Trigger(1, 1000, 2);

    the second evhSetupTimer1Trigger will simply overwrite the first one.

    Siri

  • Thank you.