
Originally Posted by
keithdoxey
.....
True... because of the way the program is written it will repeatedly service the PortB loop until such time as PORTB.0 = 1
If you want BOTH loops to be serviced then there is a way of doing that. Admittedly they wont be serviced simultaneously but each will be repeatedly serviced.....
I wanted to indicate that when a continious loop is in progress and you need that progress as long as your circuit is in operation, you will not be able to do other things.
In my example above, "While" statements have loops inside.
They are not a single line of instructions, they are loops.
One must be completed so that other can run. But, if you need an infinite loop, it will never exit that loop.
However, if we had a dual core PIC as Melanie mentioned or quad core, then you can do a simple thing as below. Say CORE1, CORE2, CORE3 etc. are new commands of PBP's 2010 version.
Code:
CORE1 'Separate Job Handler.
While PORTB.0 = 0
Do a loop here....
Wend
END CORE1
CORE2 'Separate Job Handler.
While PORTB.A = 1
Do a loop here....
Wend
END CORE2
CORE3 'Separate Job Handler.
...
END CORE3
..
...
....
etc...
they all work simultaneously.
Am I being too much imaginery here?
Last edited by sayzer; - 1st September 2006 at 10:24.
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Bookmarks