Shop OBEX P1 Docs P2 Docs Learn Events
Catching a 12us (microsecond) wide signal — Parallax Forums

Catching a 12us (microsecond) wide signal

QAHQAH Posts: 13
edited 2010-01-09 17:16 in BASIC Stamp
Hello! What do I need to do to catch a 12 microsecond wide rise fall signal? Do you use a PULSEIN command?

Basically an outside device is going to send my stamp that rise signal and when the signal falls my stamp will send back some data. So what is the best way to accomplish this?

By the way, I have a BS2

Thanks

Post Edited (QAH) : 1/9/2010 4:39:37 PM GMT

Comments

  • Tracy AllenTracy Allen Posts: 6,662
    edited 2010-01-09 17:16
    Assuming the Stamp can sit there and wait for the pulse, yes, PULSIN is the command to use. It may be necessary to put it in a loop, because it will only wait about a tenth of a second for each try. In the loop there is a small chance that it will miss an input pulse.

    top:
    DO
      PULSIN 1, 1, [noparse][[/noparse]result]
    LOOP UNTIL result
      ' send back some data
    GOTO top
    



    If the program has to do other things while waiting, it will be necessary to stretch or latch the pulse so the Stamp can get to it at its own leisurely pace.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
Sign In or Register to comment.