Pulsin Question


Closed Thread
Results 1 to 5 of 5

Thread: Pulsin Question

  1. #1
    Join Date
    Jan 2009
    Posts
    17

    Default Pulsin Question

    Hello,
    i´ve got a question using PULSIN.
    In my application a square-wave signal with 1KHz is applied to an PIC-input.(usind 18F6722)
    My crystal is 8MHz.
    I limited the PULSIN-Time by DEFINE PULSIN_MAX 1000
    So I think, during this PULSIN-Time a few pulses are received, the amount is not critical.
    Now my question is: Is only the first pulse measured and stored in the PULSIN-Variable or is the
    PULSIN-Variable overwritten by each new received pulse?
    If it is overwritten, what happens, when PULSIN_MAX time expires during a pulse is active?
    Thanks in advance

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default

    Hi,
    It measures one pulse only. Once it sees the "end" of that pulse the code continues on the line following the PULSIN statement.

    /Henrik.

  3. #3
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    The PULSIN command would measure the first complete high going, or low going pulse width it encounters, and then moves on to the next statement.

    If there is no pulse (or is wider than the timeout define), a value of 0 would be assigned to the variable.

    To answer the earlier question, it doesnt matter how many pulses are received during the time-out duration; only the first one would be measured, and the rest would be lost as the program moves on to the next line.

    Regards,

    Anand Dhuru

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,651


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Also think, when giving PULSIN_MAX value, it also will be the maximum time for PULSIN to wait for an incoming pulse ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5
    Join Date
    Jan 2009
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Pulsin Question

    Thanks to all,
    helped me very much to solve my problem!
    Best Regards
    Norbert

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts