waitpne in PASM
mirror
Posts: 322
I don't know if anybody else has found this, but waitpne possibly needs some more instruction in the user manual for assembly. If I do:
Then it just goes round and round as fast as possible. The waitpne doesn't seem to stop execution at all. But if I do:
The all is good, and waitpne behaves as expected. (The extra and instruction is the only change - honest).
Am I missing something, or have others found the same thing?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's not all that hard to count the number of grains of sand on the beach. The hardest part is making a start - after that it just takes time.·· Mirror - 15 May 2007
ScanInputs waitpne LastIn,MaskIn 'Wait for a pin change mov LastIn,INA 'Get the pins . wrlong foo, bar 'Tell spin about change . jmp #ScanInputs LastIn long 0 MaskIn long $00_00_ff_00
Then it just goes round and round as fast as possible. The waitpne doesn't seem to stop execution at all. But if I do:
ScanInputs waitpne LastIn,MaskIn 'Wait for a pin change mov LastIn,INA 'Get the pins and LastIn,MaskIn 'Mask out unwanteds . wrlong foo, bar 'Tell spin about change . jmp #ScanInputs LastIn long 0 MaskIn long $00_00_ff_00
The all is good, and waitpne behaves as expected. (The extra and instruction is the only change - honest).
Am I missing something, or have others found the same thing?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's not all that hard to count the number of grains of sand on the beach. The hardest part is making a start - after that it just takes time.·· Mirror - 15 May 2007
Comments
There's nothing wrong with the description in the manual, but something like your second code fragment could be a useful example of a common task in the "Assembly Code Examples for the Beginner" thread. If you do post it there, it would need a little more in the way of comments about what you're trying to do.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.