Shop OBEX P1 Docs P2 Docs Learn Events
Frequency Measurement — Parallax Forums

Frequency Measurement

ArchiverArchiver Posts: 46,084
edited 2003-01-05 06:23 in General Discussion
I'm currently using a BS2 and PULSIN to measure the output frequency
of a magnetic hall sensor (speed and direction) – well, I'm actually
monitoring 2 hall sensors, but they do the same thing. I need to
know when there is no speed (no frequency), and when there is speed
(is frequency).

My problem is this... When there is no speed (no frequency), the BS2
is frozen at the PULSIN instruction waiting for a pulse for 131 ms
before timing out and moving on to the rest of my code. This delay
is killing me. Is there some other way to go about this with a BS2,
or do I need to switch to another microcontroller? I need to know
when there is speed and when there isn't with the lowest latency
possible. [noparse]:)[/noparse]

Thanks in advance,
Chris

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-01-04 18:28
    Would using COUNT be a better choice? I don't know the frequency you
    are measuring, but you can specify the interval to count for, such as
    20mS?

    -Martin




    --- In basicstamps@yahoogroups.com, "crocco17 <crocco17@y...>"
    <crocco17@y...> wrote:
    > I'm currently using a BS2 and PULSIN to measure the output
    frequency
    > of a magnetic hall sensor (speed and direction) – well, I'm
    actually
    > monitoring 2 hall sensors, but they do the same thing. I need to
    > know when there is no speed (no frequency), and when there is speed
    > (is frequency).
    >
    > My problem is this... When there is no speed (no frequency), the
    BS2
    > is frozen at the PULSIN instruction waiting for a pulse for 131 ms
    > before timing out and moving on to the rest of my code. This delay
    > is killing me. Is there some other way to go about this with a
    BS2,
    > or do I need to switch to another microcontroller? I need to know
    > when there is speed and when there isn't with the lowest latency
    > possible. [noparse]:)[/noparse]
    >
    > Thanks in advance,
    > Chris
  • ArchiverArchiver Posts: 46,084
    edited 2003-01-05 06:23
    --- In basicstamps@yahoogroups.com, "Martin Hebel <martin@s...>"
    <martin@s...> wrote:
    > Would using COUNT be a better choice? I don't know the frequency
    you
    > are measuring, but you can specify the interval to count for, such
    as
    > 20mS?
    >
    > -Martin
    >

    That might just do the trick. I'll have to think about & test it,
    but it sounds workable. I just took the "advanced freq measurement"
    StampWorks example and ran with it... [noparse]:)[/noparse]

    Thanks Martin. [noparse]:)[/noparse]

    Chris
Sign In or Register to comment.