Jan 28, 2014
03:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 28, 2014
03:05 AM
Looking at the System Timer application, I do not find any App that could provide a simple Delay_usec(uint32_t uiUs) function? Is there any possibility without using RTOS?
- Tags:
- IFX
5 Replies
Not applicable
Jan 28, 2014
04:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 28, 2014
04:01 AM
Jan 28, 2014
02:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 28, 2014
02:56 PM
thanks, I have solved by using SYSTM002 APP. Here my code:
void delayMicroseconds(uint32_t dwUs)
{
handle_t TimerId;
bTimerExpired = FALSE;
/*
* This funcion uses SysTick Exception for controlling the timer list. Call back function
* registered through this function will be called in SysTick exception when the timer is expired.
* One shot timers are removed from the timer list, if it expires. To use
* this SW timer again it has to be first deleted and then created again.
*
* @param[in] Period Timer period value in microseconds
* @param[in] TimerType Type of Timer(ONE_SHOT/PERIODIC)
* @param[in] TimerCallBack Call back function of the timer(No Macros are allowed)
* @param[in] pCallBackArgPtr Call back function parameter
*/
TimerId = SYSTM002_CreateTimer(dwUs,SYSTM002_ONE_SHOT,m_Timer,NULL);
if(TimerId != 0)
{
//Timer is created successfully
SYSTM002_StartTimer(TimerId);
// Wait until timer expires
while (!bTimerExpired)
;
// Delete Timer since is One-Shot
SYSTM002_DeleteTimer(TimerId);
}
}
where 'm_Timer' is;
void m_Timer(void* Temp)
{
bTimerExpired = TRUE;
}
void delayMicroseconds(uint32_t dwUs)
{
handle_t TimerId;
bTimerExpired = FALSE;
/*
* This funcion uses SysTick Exception for controlling the timer list. Call back function
* registered through this function will be called in SysTick exception when the timer is expired.
* One shot timers are removed from the timer list, if it expires. To use
* this SW timer again it has to be first deleted and then created again.
*
* @param[in] Period Timer period value in microseconds
* @param[in] TimerType Type of Timer(ONE_SHOT/PERIODIC)
* @param[in] TimerCallBack Call back function of the timer(No Macros are allowed)
* @param[in] pCallBackArgPtr Call back function parameter
*/
TimerId = SYSTM002_CreateTimer(dwUs,SYSTM002_ONE_SHOT,m_Timer,NULL);
if(TimerId != 0)
{
//Timer is created successfully
SYSTM002_StartTimer(TimerId);
// Wait until timer expires
while (!bTimerExpired)
;
// Delete Timer since is One-Shot
SYSTM002_DeleteTimer(TimerId);
}
}
where 'm_Timer' is;
void m_Timer(void* Temp)
{
bTimerExpired = TRUE;
}
Not applicable
Jan 29, 2014
02:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 29, 2014
02:08 AM
I think this is not the right way to create a microsecond timer.
The functions are depending on the systick that is normally a millisecond timer.
you should check if this function Returns realistic values in microseconds.
Using the sample in the link is much easier and it delivers true microseconds without any Interrupts.
The functions are depending on the systick that is normally a millisecond timer.
you should check if this function Returns realistic values in microseconds.
Using the sample in the link is much easier and it delivers true microseconds without any Interrupts.
Jan 29, 2014
04:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 29, 2014
04:23 AM
ok, thanks!
Jan 06, 2020
11:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 06, 2020
11:49 PM
Actually I am new in DAVE so I can't find anything for delaying any PWM so please guide me if RTOS make a delay function, i dont know how to use RTOS app i.e FREERTOS app.