What am I missing?

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.
Post Reply
DH*

What am I missing?

Post by DH* »

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: Select all

    CallTask TTLTask, TTLStack


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

Re: What am I missing?

Post by mikep »

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*

Re: What am I missing?

Post by DH* »

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.
Post Reply