Shop OBEX P1 Docs P2 Docs Learn Events
Pulsout Command To More Than One Pin — Parallax Forums

Pulsout Command To More Than One Pin

Mike MarksMike Marks Posts: 3
edited 2005-07-11 20:21 in BASIC Stamp
I have a need to send a pulsout to two·pins at a time. I want pulsout to occure simultaneously on both pins. I know I can do it with external circuitry using one pulsout, but want to do it within the Stamp.· Is there a program algorithm you recommend?· I tried the following test program with no luck.· Only P0 would go high.

DirL = % 00001111

x var OutA

loop:
·pulsout x, 60000
·pause 3000
goto loop

Regards,· Mike Marks

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-07-11 20:15
    Mike,

    ·· While you cannot PULSOUT to more than one pin at once, you can effectively PULSE more than one pin at once on a port by doing something like:

    Init:
       OUTS = 0                ' All pins LOW
       DIRS = 255              ' All pins outputs
    Main:
       PAUSE 3000              ' Wait a few seconds
       OUTA = %1111            ' Make all port A lines HIGH
       PAUSE 5                 ' PAUSE 5mS
       OUTA = %0000            ' Make all port A lines LOW
     
    etc.
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-07-11 20:17
    You want a 60 mSec pulse?

    LOW P0
    LOW P1
    LOW P2
    LOW P3

    Main:
    OutA = %0011
    PAUSE 60
    OutA = %0000
    PAUSE 3000
    GOTO MAIN
  • NewzedNewzed Posts: 2,503
    edited 2005-07-11 20:21
    f you want a very short pause, say 500us, then you can insert this in place of the PAUSE:

    pulsout anypin, 250

    The BS2 timing increment is 2us so 250 would = 500us.· This is just a dummy command to use up a little time so pick a pin that is not being used for anything.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester yet?
    http://hometown.aol.com/newzed/index.html

    ·
Sign In or Register to comment.