Xmc1200 systm001

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
in DAVE v 3.1.10 there is a SYSTM001 timer app. The app GUI shows three settings: SysTick, SWTimers and Interrupt Configuration.

What does 'Number of Software Timers' mean? It's not described in the documentation. I assumed that it means you can have for example 32 timers, each of which can be created/started/stopped/deled individually. The app is however not behaving like that. If I set more than one timer in the 'Number of Software Timers' field, none of my timers works. A 18ms delay timer would just appear to be hanging.

I need 3 timers, one with a 1ms timeout, one with a 18ms timeout, one with a 250ms timeout and they need to operate simultaneously.
the 250ms timeout calls a non-blocking function when it hits the callback function
the 18ms timeout is a delay
the 1ms timeout increments a variable.


If I set the 'Number of Software Timers' field to 1, I can use these timers individually and the timeout is correct..ish.

Is my assumption incorrect?
0 Likes
3 Replies
Not applicable
some more observation:

If a 1ms timer gets started whilst a lets say 900ms timer is already started, the 1ms timer never expires and the code hangs.

This is with the 'Number of software timers' field in the SYSTM001 GUI set to 3.
0 Likes
Not applicable
Hi Jurgen,

I've built a simple project with 3 periodic timers (1ms, 18ms & 250ms) and it worked without problem. Would you be able to provide some more project details or even provide your project for our analysis?

Best regards,
Sophia
0 Likes
Not applicable
Hi Sophia,

I don't think providing the project will help you unless I also send the hardware to you.
I am starting a 500ms timer. After that timer has started, I need occasional random delays and I use my WaitMS() function. This causes the whole application to hang, waiting for my WaitMS() function to finish. The callback function 'my_tmr_a' doesn't seem to get called.
The WaitMS() function works fine if it is called before the 500ms timer.

I am starting a 500ms timer this way:

void active_scan_tmr(void* Temp)
{
uint32_t Status = SYSTM001_ERROR;
if(UZ2400Channel>26)
{
Status = SYSTM001_StopTimer(ScanTimerId);
if(Status == DAVEApp_SUCCESS)
{
SYSTM001_DeleteTimer(ScanTimerId);
}
MAC_STATE=SCAN_DONE;
LED1_CLOSE();
MLME_SCAN_confirm (MAC_SUCCESS,ACTIVE,0,UZ2400Channels,node_number,N ULL,PANDescriptorList,0,NULL);
}
else MLME_SCAN_request(ACTIVE, UZ2400Channels, scan_duration, 0, 0, 0, 0, 0);
}

void ScanTimerStart(uint16_t count, SYSTM001_TimerCallBackPtr TimerCallBack)
{
ScanTimerId = SYSTM001_CreateTimer(count,SYSTM001_PERIODIC,Timer CallBack,NULL);
if(ScanTimerId != 0)
{
SYSTM001_StartTimer(ScanTimerId);
LED1_OPEN(); //for scan indication
}

}


This is my second timer that gets called at random intervals after the first timer has started:

void my_tmr_a(void* Temp)
{
TimerExpired=TRUE;
}

void WaitMS (uint16_t count, SYSTM001_TimerCallBackPtr TimerCallBack)
{
//handle_t TimerId;
uint32_t Status = SYSTM001_ERROR;
DelayTimerId = SYSTM001_CreateTimer(count,SYSTM001_PERIODIC,Timer CallBack,NULL);
if(DelayTimerId != 0)
{
TimerExpired=FALSE;
//Timer is created successfully
Status = SYSTM001_StartTimer(DelayTimerId);
if(Status == DAVEApp_SUCCESS)
{
// Wait till timer is expired
while(TimerExpired == FALSE)
{}
//stop the timer
Status = SYSTM001_StopTimer(DelayTimerId);
if(Status == DAVEApp_SUCCESS)
{
SYSTM001_DeleteTimer(DelayTimerId);
}
}
}
}


Best Regards
Jurgen
0 Likes