Need help with PULSIN Timings


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2006
    Location
    Indiana, USA
    Posts
    72

    Default Need help with PULSIN Timings

    I am using a 16F684 with the internal OSC set to 8Mhz and I'm trying to read a 5 volt PWM signal that has the following widths:

    1.4mS
    1.6mS
    2.4mS
    3.3mS
    4.4mS
    5.4mS
    6.0mS
    8.0mS
    9.0mS

    I know that PULSIN depends on the actual OSC speed and not the defined OSC speed. and 4MHz will have 10uS resolution, which means 8MHz should have 5uS resolution in my thinking, maybe I'm wrong. If so, then all of my numbers divide nicely by 5 and 1.4mS should equal 1400uS in my PULSIN Variable right? or something close enough.

    or would my above widths measure something else in the variable?

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Need help with PULSIN Timings

    At 8Mhz, the resolution is 5uS.
    But the pulsin result for 1.4mS should be ~280 ... (0.0014 / 0.000005)
    at 9.0mS it's ~1800 ... (0.009 / 0.000005)

    You'll probably want to adjust the PULSIN_MAX define if 9.0mS is the maximum width.
    DT

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