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.

Sensor Controller - Timer conflict



Hi,

I'm using sensor controller studio to implement and use some peripheral sensor with smartRF06. At this moment i'm using some features like the CPU Alert and Timer. I'm using the Timer to schedule the reads from the sensor, and saving the values in an array and when the array is half full i generate an alert. The problem is that if the timer is to big (more than some seconds) the alert is generated but it never return to the main processor task (using the ccs), there are some way to generate an immediately?

Best Regards,

Miguel

  • Hello Miguel,
    fwGenQuickAlertInterrupt will immediately send an alert to the main application processor. When you use fwGenAlertInterrupt the sensor controller code must finish its execution code or event handler code before the alert is generated.
  • Hi Eirik,

    I tried your suggestion and still not working when i use alot of time.

    I'm using this timer:

    evhSetupTimerTrigger(0, 250, 4); with this values, if i change the '4' for a '5' to increase the time, i stop receiving values in the main processor.

    Should I try another approach?

    Thank you for your reply.

    Regards,

    Miguel

  • Can you try to remove the sensor interface code and only test the evhSetupTimerTrigger setup to send alert interrupts to the main application processor at regular intervals to verify if this is an issue with your sensor communication or the sensor controller framework?
  • Hi Eirik,

    I tested our suggestion and this is what i do in the execution code.

    // Read the result after 100 milliseconds + a 20% margin
    evhSetupTimerTrigger(0, 250, 5);
    
    // Schedule the next execution
    fwScheduleTask(1);

    In the Event Handler Code.

    fwGenAlertInterrupt();
    //fwGenQuickAlertInterrupt();

    And still have the same problem for both, GenAlert or GenQuickAlert.

    If you want i can post my main.c here if it helps.

    Best Regards,

    Miguel

  • There can only be one active trigger at a time, and setting up a Timer trigger will cancel any previously configured trigger. If your next scheduled execution code run before the event handler code is triggered the event handler code will never run.

  • Hi Eirik,

    You are right, I change the fwScheduleTask(1); to my Event handler code and leave only the evhSetupTimerTrigger in the execution code and it's working now.

    Thank you.