PULSIN - Logic Level Voltage Transiion


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Default Re: PULSIN - Logic Level Voltage Transiion

    Hi, CC

    @ First, you have to undersand how Pulsin works ...

    1) input is set to an ... Input !
    2) software counter is initialised and waits for the required edge to come ...
    3) leading Edge detected ... the counter ... counts ( unbelievable, eh ? )
    4) trailing edge detected ... counter stops counting ( see 3 )
    5) counter value is transferred to the target variable.

    from that ....

    1) you need a little delay between the Pulsin command and the effective counting can start ( presetting delay )
    2) you need a little delay between the counting is finished and a new command to be executed ...

    after that ...

    Code:
    WHILE TRIGGER=1:WEND 'MAKE SURE I DON'T START IN THE MIDDLE OF A PULSE
    is not useful ... as the pulsin command triggers ... on a level CHANGE ...

    If measuring very short times ... your result will be either 3 or 4 ( example ) ... and precision will be VERY, VERY bad ...

    So, ... it appears this way of measuring is " not so good " and you'd much better use the CCP module,in capture mode, with the 1/16 predivisor ... or if more samples required, a CD 4520 as an external 1/100 divider.

    AND ... YES, you've hit the Basic languages functions ( not only PBP ) limitations .... ... so, you have to directly drive the Pic registers !!!

    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 " !!!
    *****************************************

  2. #2
    Join Date
    Sep 2010
    Posts
    50


    Did you find this post helpful? Yes | No

    Default Re: PULSIN - Logic Level Voltage Transiion

    Alain,
    Thanks you very much for the clear explaination of how the pulsin function works! I will investigate the CCP capture mode method.
    Thanks, again.
    CC

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