Shop OBEX P1 Docs P2 Docs Learn Events
Quick pin detection — Parallax Forums

Quick pin detection

JimAvantiJimAvanti Posts: 15
edited 2006-10-11 15:30 in BASIC Stamp
I am trying to write some simple code (BS2) that will monitor two input pins for a quick·pulse and then set output pins high while the two input pins are low.· The basics are written and work, however the pulse is so quick that the stamp sometimes misses it.· I tried using the pollin & pollwait commands on the BS2px and although it never missed a pulse, it is too limited a command since either of the two input pins going low make the pollwait work the same way.· For example I want pin6 to go high when pin0 goes low, and pin7 to go high when pin2 goes low.· Does anyone know a better way to do this?

Jim

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-11 04:36
    Look at the description of RAM locations 127-135 for the POLLMODE statement. When your program resumes execution after a POLLWAIT, the status of the input pins that triggered the POLLWAIT will be in RAM and you can extract the two input pins of interest and use them to set the output pins. This may not be fast enough to catch frequent input pulses, but does let you copy the pulses to the output pins separately.
  • metron9metron9 Posts: 1,100
    edited 2006-10-11 15:30
    If you still have a problem after using Mikes solution please post the details of the pulse, voltage min max, duration, and frequency.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think outside the BOX!
Sign In or Register to comment.