Interrupts.

Started by Francisco Lobo February 9, 2004
Are there any plans to support or way's to do a software/timer
interrupt calls? Like forcing a sub to run at a specified interval?
THanks
Bye --
Este mensaje ha sido analizado con MailScanner
y se considera que estlimpio.



From: Francisco Lobo <>

> Are there any plans to support or way's to do a
> software/timer interrupt calls? Like forcing a sub
> to run at a specified interval?

We may do something like this in the future. Possibly we would
implement a DelayUntil procedure or something similar.

-- Frank Manning
-- NetMedia, Inc.



DelayUntil would be cool, but i need a method to guarantee that the sub
will be exec at a specified rate like 100hz or something like that,
forcing interrupt on other calls, just like a hardware interrupt..
Thanks!



I though about running a hardware timer to generate an external
interrupt, but have never tried this. Partly because I did not see
where I could guarentee the amount of jitter between the interrupt and
the start of execution.

What I felt would be more useful would be to specify a task that would
execute every 'n'th time frame. Such as

CallTask "TaskName", TaskStack, n

where TaskName would be scheduled to be run every n time slices.

Inside Taskname, something like a WaitForScheduling (similar to a
WaitForInterrupt) could suspend the task, which would then resume with
the next instruction when the task is again scheduled.

Andy --- In , Francisco Lobo <francisco@f...> wrote:
> DelayUntil would be cool, but i need a method to guarantee that the
sub
> will be exec at a specified rate like 100hz or something like that,
> forcing interrupt on other calls, just like a hardware interrupt.. >
> Thanks!





> ... running a hardware timer to generate an external interrupt...

You might consider that, by setting two processor control registers, an
edge on the processor's T0 input (8535 pin 40), normally unused, can
trigger task switching; it also clocks the soft RTC and other
housekeeping in the OS. Normally, Timer0 clocks these actions at 512Hz.

We discussed this as a method to synchronize two BX-24s sometime back,
by driving both processors' T0 pins with the same 512Hz (or, with some
thought, another frequency) signal. I've searched the archive for that
thread but came up empty; I'm sure it's there, somewhere.

This technique might provide you with your external interrupt. The tick
is high priority, normally suspending the active task immediately,
giving control to a suspended task. Judicious code might make that work
for you.

[Dan, don't bother interjecting, please. You owe us _any_ demonstration
that the OS itself is a task; the last request, you'll recall from last
week, was Frank. I'll close my eyes so I won't steal the code from you,
OK?] Tom
Tom Becker
--... ...--
www.RighTime.com
The RighTime Clock Company, Inc., Cape Coral, Florida USA
+1239 540 5700