Parallel processing

Gapak

Senior Member
Hello, I also posted this entry on the French version.
I find that a pulse generated in the main program using the "pulse out" command interrupts the running of the subprogram ( start 1) during the duration of the pulse.
Is it normal or am I doing something wrong?
When I replace the "pulse out" command by a classic "output on" then "wait" then "output off" the subprogram is not affected.
I use a 20M2 and program with Logicator.
Thanks for your help.
Gapak
 

hippy

Technical Support
Staff member
[ Moved to Active Forum ]

Yes; this is normal. Any commands that take the PICAXE time to execute like PULSOUT will stop other tasks from proceeding while they execute.

In fact all commands will stop other tasks briefly, but they are usually such short stops that it isn't usually noticed.
 

AllyCat

Senior Member
Hi,

Yes, in general, the PICaxe will "complete" one instruction from each task in sequence, so a "slow" instruction (such as SERIN) may delay the other task(s) very considerably.

As Far As I Know, the only exception is PAUSE and similar commands (but not PAUSEUS), which passes on to the next task(s). However, I guess that may itself extend the length of the PAUSE (so for short delays, PAUSEUS might be preferred).

Cheers, Alan.
 

kranenborg

Senior Member
Sometimes you may consider using several picaxes (each one running a single task) in a distributed system as an alternative, since the chips are so cheap ... .
 

Gapak

Senior Member
Thank you all, I understand now how the subprogram gets its time to run.
So for example if you need a 0.6 second pulse somewhere in the main program it is better to use "output on" then "wait 0.6" then "output off" instead of the "pulse out" command if you do not want any visible interruption of the subprogram.
Gapak
 

hippy

Technical Support
Staff member
Yes, that would be better. During PAUSE or WAIT commands the PICAXE will allow other tasks to continue to run.
 
Top