Discussion specific to the DIP and TQFP packaged ZX devices like the ZX-40, ZX-44, ZX-32 and ZX-328 series. The differences between these devices is primarily the packaging and pinout so most issues will apply to all devices.
DH*
Post
by DH* » 19 July 2006, 8:37 AM
This is my first stab at multitasking. My task stack is 50 bytes.
Just before starting my main loop I start the task with...
The task is...
Code: Select all
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?
mikep
Posts: 796 Joined: 24 September 2005, 15:54 PM
Post
by mikep » 19 July 2006, 8:54 AM
dhouston wrote: Code: Select all
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.
Mike Perks
DH*
Post
by DH* » 19 July 2006, 10:33 AM
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.