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.

AWR1843AOP: Multiple timers

Part Number: AWR1843AOP
Other Parts Discussed in Thread: SYSBIOS

Hi,

I want to use multiple timers with AWR1843AOP.
I couldn't find the timer in the SDK driver, so I decided to use HAL.Timer in the BIOS.

I included the following header in my code.
"ti\bios_6_73_01_01\packages\ti\sysbios\hal\Timer.h"

I implemented the timer by referring to Chapter 8.3 of the following document.
"ti\bios_6_73_01_01\docs\Bios_User_Guide.pdf"

It worked fine with only one timer.
However, when I declared the second timer, the first timer also stopped working properly.
The function of the timer is confirmed by the toggle of the IO signal.
Please tell me how to make two timers work at the same time.


-------------------------------------------------------------------------------------------------------------------------
Timer_Handle timerHandle;
Timer_Handle timerHandle2;

void MmwDemo_mssInitTask(UArg arg0, UArg arg1)
{
Timer_Params timerParams;
Timer_Params timerParams2;

/* 1st-timer */
Error_init(&eb);
Timer_Params_init(&timerParams);
timerParams.period = 1000; /* 1 ms */
timerHandle = Timer_create(Timer_ANY, tickFxn, &timerParams, &eb);
if (timerHandle == NULL) {
System_abort("Timer create failed");
}
taskHandle = Task_create(masterTask, NULL, &eb);
if (taskHandle == NULL) {
System_abort("Task create failed");
}

/* 2nd-timer */
Error_init(&eb);
Timer_Params_init(&timerParams2);
timerParams2.period = 300; /* 300 us */
timerHandle2 = Timer_create(Timer_ANY, tickFxn2, &timerParams2, &eb);
if (timerHandle2 == NULL) {
System_abort("Timer create failed");
}
taskHandle2 = Task_create(masterTask2, NULL, &eb);
if (taskHandle2 == NULL) {
System_abort("Task create failed");
}

return;
}

void masterTask(UArg arg0, UArg arg1)
{
// Condition detected requiring a change to timer period
Timer_stop(timerHandle);
Timer_start(timerHandle);
}

void tickFxn(UArg arg0)
{
GPIO_toggle (SOC_XWR18XX_GPIO_2);
}

void masterTask2(UArg arg0, UArg arg1)

{
// Condition detected requiring a change to timer period
Timer_stop(timerHandle2);
Timer_start(timerHandle2);
}

void tickFxn2(UArg arg0)
{
GPIO_toggle (SOC_XWR18XX_GPIO_14);
}
-------------------------------------------------------------------------------------------------------------------------

Best Regards,
Hiroyuki Yasui