Forum Index
What am I missing?

 
Author Message
DH*
Guest




Posted: 19 July 2006, 15:37 PM    Post subject: What am I missing?

This is my first stab at multitasking. My task stack is 50 bytes.

Just before starting my main loop I start the task with...
Code:
    CallTask TTLTask, TTLStack


The task is...
Code:
Sub TTLTask()

  Call WaitForInterrupt(zxPinChange, INT0)        'pin16 = ZC
  cnt = cnt + 1
     
End Sub

Pin16 has a square wave ZC from a TW523.

No matter how long the app runs, cnt never exceeds 1, indicating the task only gets called once.

Do I need to wrap the task procedure in a Do:Loop?
Back to top
mikep



Joined: 24 Sep 2005
Location: Austin, TX

Posted: 19 July 2006, 15:54 PM    Post subject: Re: What am I missing?

dhouston wrote:
Code:
Sub TTLTask()

  Call WaitForInterrupt(zxPinChange, INT0)        'pin16 = ZC
  cnt = cnt + 1
     
End Sub
The End Sub effectively ends the task. So yes you do need some kind of loop if you want the task to do more work.
Back to top
DH*
Guest




Posted: 19 July 2006, 17:33 PM    Post subject: Re: What am I missing?

mikep wrote:
The End Sub effectively ends the task. So yes you do need some kind of loop if you want the task to do more work.
Thanks - it works as expected with a loop.
Back to top
Display posts from previous:   
Page 1 of 1

 



ZBasic Microcontrollers Home
All content Copyright © 2005, 2006, 2007, 2008 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group