simple PASM hanging on Waitpne and waitpeq
RS_Jim
Posts: 1,765
Hi,
I am trying to run multiple pings in PASM in a single cog.
When I comment out the waitpne,waitpeq, the program loops through and enables each ping in turn. When I remove the comments, it pulses the first ping and then hangs.
help
Jim
I am trying to run multiple pings in PASM in a single cog.
When I comment out the waitpne,waitpeq, the program loops through and enables each ping in turn. When I remove the comments, it pulses the first ping and then hangs.
help
Jim
Comments
Thanks,
Jim
Mask (s-field) bitwise ANDed with INA before the comparison with State (d-field).
You can never use a # on the left side and you should try to avoid # on the right side too as that would limit you to the first 9pins and makes it harder to change code later.
Using WAITPxx with a single pin is very easy:
How to wait for 2pins either one is low:
How to wait for 2pins where one is low and one is high:
How to wait for 2pins where either one is high
Since you've 60us to wait pr cm of distance for a sonar sensor the reduced granularity of
elapsed time by using an ASM loop rather than waitpne is not an issue as 60us is 1200
instructions...
Jim