Shop OBEX P1 Docs P2 Docs Learn Events
InA vs. Waitpeq — Parallax Forums

InA vs. Waitpeq

Luis DigitalLuis Digital Posts: 371
edited 2009-04-28 00:47 in Propeller 1
Hello,

Is InA and Waitpeq the same hardware (input)?

Because, Waitpeq seems that is more sensitive to noise.

Thanks.

Comments

  • JonnyMacJonnyMac Posts: 9,194
    edited 2009-04-28 00:43
    waitpeq samples ina and applies the mask to it. The underlying assembly code (also waitpeq) probably operates a lot faster than your manual sampling/scanning and is, therefore, more sensitive to transient signals.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-04-28 00:47
    Both can read the same input pins. (WAITPEQ can also read the currently non-existent INB.) When you read INA, it samples the pins the moment you execute it. If you execute it infrequently, it will be less likely to pick up noise pulses. WAITPEQ just sits on the input until the condition you specify is matched. Consequently, any brief noise pulse that can be captured with 12.5ns granularity will be picked up.

    -Phil
Sign In or Register to comment.