PULSIN - Logic Level Voltage Transiion


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default Re: PULSIN - Logic Level Voltage Transiion

    Table 10.1 and Table 26.3 tell you what you need. You might also try measuring between rising edges to see if the period is what you think it is.

  2. #2
    Join Date
    Sep 2010
    Posts
    50


    Did you find this post helpful? Yes | No

    Default Re: PULSIN - Logic Level Voltage Transiion

    Thanks Dave,
    I will try your recommendations when I get to work tomorrow. Looking at the rise time 9 ns today makes me think that that is probably not the problem. Takes a lot of 9 nsec to add up to 3 usec I am going to look at it closely so at least I understand more about what is going on and the effects of rise/fall times in general. Looks like you have a bunch of stuff I need to look at on your web site. So much to do, so little time. Thanks, again. CC

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


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

  4. #4
    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