µTasker Forum
September 05, 2010, 06:05:21 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: January 2010: uTasker utFAT version released for M522XX, SAM7X, LM3SXXXX, LPC2XXX and AVR32 - see utFAT board for full details!
Note that Internet Explorer 8 doesn't work with the forum (unless compatibility view is selected); please use Firefox or Chrome (or other well behaved browsers) as alternative!
 
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: EVK1105 PERIODIC Software Timer  (Read 214 times)
kmjackson
Newbie
*
Offline Offline

Posts: 11


View Profile
« on: July 07, 2010, 12:07:36 pm »

Hi Mark,

I need a PERIODIC software timer.  Is there a way to set this up or should I just keep retriggering it?  Iguess the other option is to use a GLOBAL_HARDWARE_TIMER.



Thank you,
Kenneth
Logged
mark
Global Moderator
Hero Member
*****
Offline Offline

Posts: 1899



View Profile WWW
« Reply #1 on: July 07, 2010, 01:33:52 pm »

Hi Kenneth

You can get details about timer use here:
http://www.utasker.com/docs/uTasker/uTaskerTimers.PDF

It is possible to configure a task as a periodic task which will be scheduled at the defined period (in the task configuration table) or, using monostable timers, a task can periodically schedule itself. The second method is more flexible but the first is simplest for simple tasks which just need to perform something periodically (doesn't otherwise use timers etc.).

A periodic HW timer is used when high accuracy is required since it is executed from the HW timer interrupt routine.

Global HW timers are not recommended and are not supported in all projects. The other methods are usually adequate and are reliable.

Regards

Mark
Logged
mhoneywill
Full Member
***
Offline Offline

Posts: 115


View Profile
« Reply #2 on: July 27, 2010, 03:48:43 pm »

Hi Mark,

Just to clarify my understanding and that of others, if a Task has a state of UTASKER_GO it will run in polled mode, if its period time in the ctTaskTable is set to 0 or NO_DELAY_RESERVE_MONO i.e. it will be run every time the it is checked in the sheduling loop.

But if it has a period set to a value in the ctTaskTable then it will instead run at this periodic rate.

const UTASKTABLEINIT ctTaskTable[] = {
  // task name,  task routine,   input queue size, start delay, period, initial task state
  { "Wdog",      fnTaskWatchdog, NO_QUE,      0, (DELAY_LIMIT)( 0.2 * SEC ),  UTASKER_GO},      // watchdog task (runs immediately and then periodically)
  { "M-Menu",    fnMenuTask,    MEDIUM_QUE,  0, (DELAY_LIMIT)( 0.125 * SEC ), UTASKER_GO},  //

Cheers

Martin
Logged
mark
Global Moderator
Hero Member
*****
Offline Offline

Posts: 1899



View Profile WWW
« Reply #3 on: July 27, 2010, 06:29:22 pm »

Hi Martin

The UTASKER_GO (initial) state together with a periodic timer value will cause the task to run immediately and then move to periodic mode.
It will only remain in periodic polling mode when no periodic value to set (i.e. 0). Therefore your understanding is correct.

Regards

Mark
« Last Edit: July 29, 2010, 09:36:29 pm by mark » Logged
mhoneywill
Full Member
***
Offline Offline

Posts: 115


View Profile
« Reply #4 on: July 28, 2010, 10:11:03 am »

Hi Mark,

I just wanted to clarify this for other users at it was not immediatly obvious from the documentation when I started with uTasker.

I think you mean above

It will only remain in polling mode when no periodic value to set (i.e. 0). Therefore your understanding is correct.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
Copyright © 2010 utasker.com. Webdesign and Hosting by e-future.ch 2010
Valid XHTML 1.0! Valid CSS!
Page created in 2.028 seconds with 18 queries.