Shop OBEX P1 Docs P2 Docs Learn Events
pulsout — Parallax Forums

pulsout

ArchiverArchiver Posts: 46,084
edited 2004-02-13 14:57 in General Discussion
OK so its

pulsout I/O pin, period

Ok so I'm understanding that if the I/O pin I'm using say p0 is low
when I call pulsout it will "pulse" to high for the period. But why
is it high for 2 times the period? That's what I'm reading in my A/D
project from parallax... Why doesn't it just let you specify exactly
how long to pulse???

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-04-04 11:13
    it does ask you how long to pulse. it is the period.
    for example pulsout 2, 1 on a bs2 will be 2us
    pulsout 2, 30 will be 60us
    pulsout 2, 100 will be 200us
    pulsout 2, 65535 will be 131070us or 131.07ms

    ken smith


    --- In basicstamps@yahoogroups.com, "packetdude2000"
    <dark_archon1@j...> wrote:
    > OK so its
    >
    > pulsout I/O pin, period
    >
    > Ok so I'm understanding that if the I/O pin I'm using say p0 is low
    > when I call pulsout it will "pulse" to high for the period. But why
    > is it high for 2 times the period? That's what I'm reading in my
    A/D
    > project from parallax... Why doesn't it just let you specify
    exactly
    > how long to pulse???
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-15 21:04
    doh remembering stuff now... thanks
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-15 21:56
    Maybe I forgot... but I was under the impression that the period for a
    sine wave at least is the time between any two equivalent points. Then
    1/t = f, and likewise 1/f = t. I don't get why you are multiplying it by
    2. Pulsout does just go from the previous state then into an inverted one
    for X time right? Then back to the original state?
  • ArchiverArchiver Posts: 46,084
    edited 2004-02-13 08:49
    Does anyone has any experience in sending a pulse with PULSOUT through
    a long wire let's say about 20m?

    Thanks
    Michael
  • ArchiverArchiver Posts: 46,084
    edited 2004-02-13 13:23
    Haven't use pulseout, but have sent pulses many times.

    If you want a real square pulse, then you will want to use a line driver
    chip, a coaxial cable, and impedance match it at both ends.

    Another method, you can send it through the wire pair (twisted is best), put
    a resistance at the end across the wires, and use a comparitor or op amp
    (configured as a differential receiver) to regenerate the shape.

    But if you aren't picky and just need the pulse, it will propogate. Likely
    there will be some leading edge and falling edge softening due to the
    relatively high driving impedance of the stamp and the large amount of
    capacitance on the cable.

    How well it will work depends upon your exact application, but likely it can
    be made to work, and relatively easily.

    Original Message
    From: magzi3 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=mwU-Mw5GPyvYU2vXy3q5PYkG0Auf2uT7RESK3QG7rtb1AFVJ8BuBhB5ziBbpPEGnm0KNcaJ-By5_GZHOqYGH]magzi@p...[/url
    Sent: Friday, February 13, 2004 3:49 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] PULSOUT


    Does anyone has any experience in sending a pulse with PULSOUT through a
    long wire let's say about 20m?

    Thanks
    Michael



    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.

    Yahoo! Groups Links
  • ArchiverArchiver Posts: 46,084
    edited 2004-02-13 14:57
    For really long distances (4000 feet)
    RS-485 works really well.

    The problem with 'PULSOUT' is what do you
    want to do at the far end? Detect that the
    pulse occurred? (This is easy). Detect the
    exact width of the pulse? (This is hard).

    The width of the pulse is going to 'smear',
    and the amplitude will drop,
    because of the capacitance/resistance of
    the cable. At 20 mA, the stamp has lots of
    drive for its pins, so there's no reason
    this can't work. You'll have to do some
    proof-of-concept work to find the gotchas.
    (in other words, do it and see what happens ;-) )

    --- In basicstamps@yahoogroups.com, "magzi3" <magzi@p...> wrote:
    > Does anyone has any experience in sending a pulse with PULSOUT
    through
    > a long wire let's say about 20m?
    >
    > Thanks
    > Michael
Sign In or Register to comment.