Help with WAITPEQ and WAITPNE ?
$WMc%
Posts: 1,884
Hello
· I need some help understanding the (%0100, %1100, 0) that falls after WAITPEQ or WAITPNE. This is in ref. to page 326,327·and 328 of the·"Propeller Manual v1.0".
_example_pg.326_··· waitpeq(%0100, %1100, 0)······ 'Wait for P3 & P2 to be low & high
________________·· outa[noparse][[/noparse]0] := 1···························· 'Set P0 high
How does·the %0100, %1100··· set the pins to P3 & P2 ?
How does is set them high or low ?
·I can see %0100 as a pointer to P2.·and %1000 = P3.The example on pg. 327 seems pretty simple but leads to·My confusion on the examples page.326 & 328.
_____Thanks____________$WMc%___·······························
· I need some help understanding the (%0100, %1100, 0) that falls after WAITPEQ or WAITPNE. This is in ref. to page 326,327·and 328 of the·"Propeller Manual v1.0".
_example_pg.326_··· waitpeq(%0100, %1100, 0)······ 'Wait for P3 & P2 to be low & high
________________·· outa[noparse][[/noparse]0] := 1···························· 'Set P0 high
How does·the %0100, %1100··· set the pins to P3 & P2 ?
How does is set them high or low ?
·I can see %0100 as a pointer to P2.·and %1000 = P3.The example on pg. 327 seems pretty simple but leads to·My confusion on the examples page.326 & 328.
_____Thanks____________$WMc%___·······························
Comments
repeat until (ina & %1100) == %0100
The difference is that the WAITPEQ puts the cog into a low power mode and checks the condition every clock cycle (normally 12.5ns) while the above statement doesn't affect the power drain and executes more slowly checking the I/O pins every few microseconds.
Thanks for the clarity.I was just way over thinking it.
_________$WMc%______