Beans TASKS RUN
Hi All
Beans TASKS R gr8.
Need a little help, with INTERRUPT RATE.
SXB\'TASK demo code.SXB(27) Line 27, Warning 2, Pass 1: INTERRUPT RATE WILL BE " 1252.003"
-5ms?
Beans TASKS R gr8.
Need a little help, with INTERRUPT RATE.
SXB\'TASK demo code.SXB(27) Line 27, Warning 2, Pass 1: INTERRUPT RATE WILL BE " 1252.003"
-5ms?
Comments
It's just letting you know that the interrupt rate will not be EXACTLY what you specifed.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There is a fine line between arrogance and confidence. Make sure you don't cross it...
·
Thanks for your quick reply.
Please would you have a look at the code,
and maybe run it in SXSim.
Thanks for your time
-5ms?
The TASKS are going to take FOREVER to run in the simulator because you are using 50MHz in the code and the simulator runs at a constant speed (very slow).
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There is a fine line between arrogance and confidence. Make sure you don't cross it...
·
Thank you for having a look at the code.
The main thing is the Interrupt rate?,
what is a good Interrupt rate?,
how many instructions will I get in each Task at Interrupt rate of (#####)
is there a some, like TaskInstructions = (Clock / InterruptRate) - (TicksbetweenTasks * 5) ?
As I posted it with "SUB INTERRUPT InterruptRATE_0" it is " (very slow)"
But change to "SUB INTERRUPT InterruptRATE_9" and it's not so slow
2: call subs out of the Tasks,is this ok????
If you run the code in the SXSim as I posted, But change to SUB INTERRUPT InterruptRATE_9 then stop it then walk it
In the Status "Next instruction" you will see PAGE _BeanBREAK[noparse][[/noparse]000] coming up all the time,
but this sub is only called in one task, do I need to add a RETURN to the sub,
or is the task still running,
Thanks.
5ms.
If·you specify an·interrupt rate INTERRUPTRATE, and·you·use
TASKS RUN,nTICKS
then there will·be a tasktick every nTICKS/INTERRUPTRATE seconds.
Using TASKS SET,...
you define the rate at which a specific task is called.
This task suspends the mainloopcode until the·task returns.
The task should therefore never·block.
During task·execution the interrupt remains·running.
Ideally each·task should return within 1·tasktick.
If you have N tasks, the tasks should run every·N taskticks.
That way tasks·do not overlap and each·task will start on time.
You can call FUNCs and SUBs from a task.
regards peter