Shop OBEX P1 Docs P2 Docs Learn Events
Help with WAITPEQ and WAITPNE ? — Parallax Forums

Help with WAITPEQ and WAITPNE ?

$WMc%$WMc% Posts: 1,884
edited 2008-11-26 21:33 in Propeller 1
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%___·······························

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-11-26 21:15
    The %0100 and the %1100 are not pointers to I/O pins and the waitpeq doesn't set anything. It's like saying:

    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.
  • $WMc%$WMc% Posts: 1,884
    edited 2008-11-26 21:33
    Mr Green

    Thanks for the clarity.I was just way over thinking it.

    _________$WMc%______
Sign In or Register to comment.