PULSIN & RCTIME resolution calculation


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938

    Default PULSIN & RCTIME resolution calculation

    Hello,

    I'm currently using PULSIN & RCTIME commands in a project having a 16LF88 PIC.

    The PBP helpfile says The resolution of PULSIN is dependent upon the oscillator frequency. If
    a 4MHz oscillator is used, the pulse width is returned in 10us increments. If a 20MHz oscillator is used, the pulse width will have a 2us resolution.


    Today, I found a "new" 16F1827 model that looks to be much better than the one I use now and more adapted to my usage (it is even far cheaper...). This new PIC can go up to 32MHz oscillator.

    Am I correct to say the resolution of (i.e.) PULSIN & RCTIME will then be an increment of 1,25µs?

    How do I really calculate this? I did 40/32...
    Roger

  2. #2
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    1.25uS is correct. Those commands count the clock cycles to make the time measurement. The resolution is evidently 40 clock cycles (of the main osc frequency).

    40 clock cycles at 4mhz is 10uS
    40 clock cycles at 20mhz is 2uS
    40 clock cycles at 32mhz is 1.25uS
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default

    Thank you
    Roger

Similar Threads

  1. Replies: 17
    Last Post: - 12th April 2014, 02:17
  2. PULSIN Resolution
    By cotang in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 28th December 2008, 21:47
  3. Better understanding PULSIN
    By Wirecut in forum mel PIC BASIC
    Replies: 12
    Last Post: - 29th June 2008, 10:17
  4. Funny PULSIN values: what is going on???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th April 2008, 08:02
  5. PULSIN and RCTIME
    By Dwayne in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th November 2004, 14:45

Members who have read this thread : 1

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