P2 WAITCNT
pic18f2550
Posts: 400
in Propeller 2
Hello,
this command does not exist in P2.
How can I recreate this on the P2?
Comments
I believe this has been replaced with WAITX.
Mike
If I read the description of "WAITX" correctly, you can stop the COG by n CLOCK pulses.
I have to start a program loop, with different length, but always at the same time.
This was no problem with WAITCNT because a value was simply added to the counter.
Please check this out.
https://forums.parallax.com/discussion/comment/1448060/#Comment_1448060
Mike
WAITCNT is now called WAITCT1..3 in PASM and you use it together with ADDCT1..3. So you can handle 3 different time periods.
It's all described in the documentation (see chapter: Events)
In Spin2 it's just WAITCT().
Andy
See the p2 tricks and traps reference thread for p2 replacement code
Thank you.
As the waitct? instructions do not reload the timer, you have to use addct? first.
I have already taken over.
https://forums.parallax.com/discussion/173049/p2-pasm-sin-16bit#latest
How does waitcnt behave when the time is up?
The code is processed without interruption and the associated flag is cleared?
In the example, I simply want to limit the repetition rate to a maximum value.
Falling below this value is not a problem.
Yes.
Correct use of recurring GETCT. It starts a fresh timeout each time.
Since the variable t is reloaded each time overflow occurs,
the values hitix and lotix should be set to 2 less.
Then everything should fit.
I wouldn't bother unless it costs nothing. It won't be consistent upon overruns.
I think JNCTx could replace WAITCTx if
(a) absolute precision is not needed
(b) waits must be interruptible.
Replace
with
Am I correct?
A background is the runtime monitoring of several program pieces.
This should already be accurate.