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.

AWR1843: Timers Configuration using RTI and BIOS

Part Number: AWR1843
Other Parts Discussed in Thread: SYSBIOS

Hi,

Am using AWR1843, Am trying to configure some periodic events so am using the Timer and Clock modules from the BIOS, but when I use the code referred in the BIOS user guide, I get the following two issues: 1- regarding the Timer: I can't configure more than one time, when I do, only the first one works, the second one is not coming. 2- Regarding the Clock: when I configure more than one clock event, not all of them come with the correct period, some of them have duplicated periods, and the others are fine. So are there any constraints on using that code referred in the BIOS user guide regarding using it more than once to configure multiple events at the same time? I used the exact mentioned in the BIOS user guide.

The code for using one Timer instant:

Timer_Params timerParams;
Timer_Handle myTimer;
Error_Block eb;
Error_init(&eb);
Timer_Params_init(&timerParams);
timerParams.period = 10;
timerParams.periodType = Timer_PeriodType_MICROSECS;
timerParams.arg = 1;
myTimer = Timer_create(Timer_ANY, myIsr, &timerParams, &eb);
if (myTimer == NULL) {
System_abort("Timer create failed");
}

The code for using one Clock instant:

Clock_Params clockParams;
Clock_Handle myClock;
Error_Block eb;
Error_init(&eb);
Clock_Params_init(&clockParams);
clockParams.period = 5;
clockParams.startFlag = TRUE;
clockParams.arg = (UArg)0x5555;
myClock = Clock_create(myHandler1, 5, &clockParams, &eb);
if (myClock == NULL) {
System_abort("Clock create failed");
}

What I understood for the Timer; is that there are 2 RTI timer modules, RTIA and RTIB, and each one does have 4 interrupts, so I can use this code 8 times to configure 8 different timing events, but this is not working as I  mentioned, only 1 can be done, and the other are not working.

And for the Clock, it is something that's timing is handled by the BIOS; which tick is 1 ms by default, so whatever events can be configured as long as they are with period more than or equal the 1 ms, but this is not the case also, when I configure them, I have to place them in order from the high period to the low period, otherwise the other events will not be working, and even if I do, not all of them are coming with the correct period, some of them come with double the configured period.

  • Hi,

    Can you please provide more details about your application?

    Are you running on AWR1843 the SDK 3.x demo?

    "Am trying to configure some periodic event"

    So, you are trying to configure some periodic interrupts. How many? What is the resolution?

    Thank you
    Cesar
  • Yes, based on lab0007_medium_range_radar in mmwave_automotive_toolbox_2_4_7,

    Am trying to configure the following events using the Clock:
    - 100 ms --> works fine
    - 50 ms --> works as 100 ms
    - 20 ms --> works fine
    - 10 ms --> works as 20 ms
    - 1 ms --> works fine

    And the following events using the Timer:
    - 100 us --> works fine
    - 10 ms --> doesn't work

    I tried them in the code with the same mentioned order,
    For the Clock, if i configure the high periods first (same as order above), some periods are not OK, like 50 ms and 10 ms, however if i configure a less period first, the following higher periods don't come at all.
    For the Timer, only the first one works, otherwise don't.
  • And when I use the debugger while making only 1 timer, it gives this error:
    ti.sysbios.family.arm.v7r.vim.Hwi: line 271: E_undefined: Hwi undefined, intnum: 3
  • Do someone know how the 4 available compare interrupts per each timer can be used with this Timer module?
    Only you can use Timer_create() which creates 1 periodic instant per timer, but how is this related to the 4 compare options inside each timer.
  • Hi Ahmed,

    Are you creating a separate handle (Timer_Handle) for each timer instance?  I would try creating a global array of timer handles, or 4 separate variables.

      -dave

  • I use the following code for creation, however I didn't get ur point, how to do it will array or variables?

    Timer_Params timer_params;
    Timer_Handle timer_handle;
    Error_Block error_block;

    Error_init(&error_block);

    Timer_Params_init(&timer_params);

    timer_params.period = period_us;
    timer_params.periodType = Timer_PeriodType_MICROSECS;
    timer_params.arg = 1;

    timer_handle = Timer_create(timer, (Timer_FuncPtr)func_ptr, &timer_params, &error_block);
  • It looks to me that you may be overwriting the same timer. The first argument to Timer_create() is the timer ID, which you show as "timer". As discussed in Section 8.3 of the BIOS User Guide, this will need to be a unique ID for each timer, based on the resources available on the specific hardware (in this case, AWR1843). You can use label "Timer_ANY" to let BIOS choose the ID.

    Timer_create() returns a handle for the timer, which looks like is also being overwritten in your code by using the same variable, or lost if defined as a variable that is local to a function. The timer handle is needed to modify and delete the timer. So, I would try this:

    //This array of 4 timer handles is defined outside of all functions
    Timer_Handle my_timer_handle[4];

    Inside the function that creates the timers, each call would initialize a specific handle, eg.

    my_timer_handle[i] = Timer_create(Timer_ANY, (Timer_FuncPtr)func_ptr, &timer_params, &error_block);


    Another alternative approach would be to create a single timer running at the fastest timeout common to all required timers, then use counters to call functions and/or trigger events at the proper times.

    -dave

  • You can only call Timer_create(Timer_ANY, (Timer_FuncPtr)func_ptr, &timer_params, &error_block); once in the code,
    If you tried to call it again, it would say "timer not available",
    That is because the only available values for the id are 0 and 1, 0 seems to be already used by the BIOS, so only one value is remaining which is 1,
    That was my question, why the id values are only 0 and 1, although there are 4 available compare registers per each RTI module.
  • Hi,

    SysBIOS supports only 2 timers. Since this is a generic Real Time OS, it only supports 2 timers

    thank you
    Cesar