Shop OBEX P1 Docs P2 Docs Learn Events
Pulsin question — Parallax Forums

Pulsin question

ArchiverArchiver Posts: 46,084
edited 2001-08-30 10:03 in General Discussion
Tracy:

Your message said:

The BS2 pulsin command returns a value of zero when it does not detect a
pulse within 65535*2 microseconds (=0.131070 seconds).

I read this in the manual, but its meaning is not clear (at least,to me).
Does this mean that the BS2 times-out as soon as it receives the pulsin
command, or does it mean that it times-out if it doesn't receive the
trailing pulse edge in 0.13 secs? I would hope it is the latter.

Thanks,
Ray McArthur

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2000-05-26 06:48
    >>The BS2 pulsin command returns a value of zero when it does not detect a
    >>pulse within 65535*2 microseconds (=0.131070 seconds).

    >I read this in the manual, but its meaning is not clear (at least,to me).
    >Does this mean that the BS2 times-out as soon as it receives the pulsin
    >command, or does it mean that it times-out if it doesn't receive the
    >trailing pulse edge in 0.13 secs? I would hope it is the latter.


    A program cannot become "stuck" at a pulsin command, waiting for a pulse
    that never comes. The command execution will terminate within 0.262
    seconds with or without a good pulse being detected. A result of zero
    means either (1) that a pulse never started, or (2) that it was too long in
    duration.

    The manual says, "Pulsin waits a maximum of 0.131 seconds for a trigger,
    then returns with 0 in resultVariable. If the pulse is longer than 0.131
    seconds, Pulsin returns a 0 in resultVariable."


    -- Tracy
  • ArchiverArchiver Posts: 46,084
    edited 2000-05-26 19:14
    Tracy:

    Thanks for the clarification. I never used the command, and thought the
    program would wait as it does for serin.

    Regards,
    Ray McArthur

    Original Message
    From: Tracy Allen <emesys@c...>
    To: <basicstamps@egroups.com>
    Sent: Friday, May 26, 2000 1:48 AM
    Subject: [noparse][[/noparse]basicstamps] Pulsin question
    > A program cannot become "stuck" at a pulsin command, waiting for a pulse
    > that never comes. The command execution will terminate within 0.262
    > seconds with or without a good pulse being detected. A result of zero
    > means either (1) that a pulse never started, or (2) that it was too long
    in
    > duration.
  • ArchiverArchiver Posts: 46,084
    edited 2001-08-29 19:06
    i have a BS2sx and i want to time how long i have a high input on a
    pin. The PULSIN command limits me to 52.428 ms. Is there a way around
    this or a way to set up something that will allow me to measure a high
    signal for up to 1 second?
    please help
  • ArchiverArchiver Posts: 46,084
    edited 2001-08-30 03:35
    how about something like

    if high then goto timing loop

    then subtract out the cost of the initial and exit time for the -if




    Original Message
    From: <jer_2911@b...>
    To: <basicstamps@yahoogroups.com>
    Sent: Wednesday, August 29, 2001 1:06 PM
    Subject: [noparse][[/noparse]basicstamps] Pulsin Question


    > i have a BS2sx and i want to time how long i have a high input on a
    > pin. The PULSIN command limits me to 52.428 ms. Is there a way around
    > this or a way to set up something that will allow me to measure a high
    > signal for up to 1 second?
    > please help
    >
    >
    > 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.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-08-30 04:38
    should i try this using the same pulsin command within a loop, checking every so
    often for the condition of the input? how often, can you set a time limit ( like
    ten miliseconds ) to this function?
    thanks for your response by the way.
    ` shawn


    > ** Original Subject: RE: [noparse][[/noparse]basicstamps] Pulsin Question
    > ** Original Sender: "rad0" <rden25@m...>
    > ** Original Date: Wed, 29 Aug 2001 22:35:26 -0400

    > ** Original Message follows...

    >
    > how about something like
    >
    > if high then goto timing loop
    >
    > then subtract out the cost of the initial and exit time for the -if
    >
    >
    >
    >
    >
    Original Message
    From: <jer_2911@b...>
    > To: <basicstamps@yahoogroups.com>
    > Sent: Wednesday, August 29, 2001 1:06 PM
    > Subject: [noparse][[/noparse]basicstamps] Pulsin Question
    >
    >
    > > i have a BS2sx and i want to time how long i have a high input on a
    > > pin. The PULSIN command limits me to 52.428 ms. Is there a way around
    > > this or a way to set up something that will allow me to measure a high
    > > signal for up to 1 second?
    > > please help
    > >
    > >
    > > 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.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    >
    > 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.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >


    >**
    End Original Message
    **

    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-08-30 10:03
    >i have a BS2sx and i want to time how long i have a high input on a
    >pin. The PULSIN command limits me to 52.428 ms. Is there a way around
    >this or a way to set up something that will allow me to measure a high
    >signal for up to 1 second?
    >please help

    http://www.emesystems.com/BS2speed.htm#longpulse

    has some routines that resolve longer (~1 minute) time intervals to
    better than one millisecond, using a BS2. Finer by a factor of 2.5
    with the BS2sx.

    -- Tracy
Sign In or Register to comment.