Gaaah! Need help understanding WAITPEQ...
Steel
Posts: 313
Sorry, I have searched the forums and haven't really found what I am looking for, and I am trying to understand the manual, but it isn't working in my program.
I am in PASM.
I want to hold my program until P31 goes low.
Here is my code:
some label
WAITPEQ 0 ,#rxpinmask
some code
.......
rxpinmask long $80_00_00_00
The code is not executing after the WAITPEQ command. as far as I can tell in the manual, the first number is what to compare the value to after INA has been ANDed with the second value.
...So...rxpinmask is only allowing P31 to be monitored. When P31 goes low, it triggers a "0" which matches with my value.
Yet it still doesn't work. Am I missing something? I know it may seem like a lame question.
Shaun
I am in PASM.
I want to hold my program until P31 goes low.
Here is my code:
some label
WAITPEQ 0 ,#rxpinmask
some code
.......
rxpinmask long $80_00_00_00
The code is not executing after the WAITPEQ command. as far as I can tell in the manual, the first number is what to compare the value to after INA has been ANDed with the second value.
...So...rxpinmask is only allowing P31 to be monitored. When P31 goes low, it triggers a "0" which matches with my value.
Yet it still doesn't work. Am I missing something? I know it may seem like a lame question.
Shaun
Comments
The way you wrote it (with the #) uses the address of rxpinmask as your mask rather than the mask itself.
Additionial issue, the destination slot doesn't take immediate values so unless your first instruction in the cog (address 0) is a nop it won't work either. So in your case just use the opposite condition: