How to Measure 2 or more digital inputs a the same time


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: How to Measure 2 or more digital inputs a the same time

    hendrik you mentioned other solutions what would they be , i have been asked to look at another project where i have to look at upto 15 inputs digital , sample the time , and at least record the time inputs for further use ,

    and i am concerned that the pics i am looking at will not cut it even at 64mhz any suggestion on how to choose pics with this in mind

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


    Did you find this post helpful? Yes | No

    Default Re: How to Measure 2 or more digital inputs a the same time

    Well, the first idea that springs to mind is to use the CCP module in capture mode.
    It does the same thing as the code above tries to emulate but it does it automatically, in hardware, in the background and can generate an interrupt whenever it captures the timer value so that the software can handle it.

    You initially mentioned "2 or more", then 4 and now up to 15 inputs so I'm not sure. There are 18F devices with up to 10 capture modules (3CCP and 7ECCP) but I don't know about 15....

    Is it really mandatory to sample all pulses at the same time instead of one after the other. You mention the pulsewidth of each pulse being 10-7000us but what is the frequency or repetition rate? If the repetition rate is fairly high and the pulsewidth isn't expected to change much over 15 periods (or however many "channels" you want) then I think you can still do it with a small PIC and PulsIn.

    /Henrik.

Similar Threads

  1. how to measure RPM and SPEED at the same time
    By teeeeee in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th July 2012, 08:34
  2. Measure time in mS between two pulses
    By Fredrick in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 7th March 2011, 07:20
  3. PIC 18f4680 DIGITAL INPUTS
    By MegaADY in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 30th July 2008, 07:34
  4. Setting up digital inputs
    By quester in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 22nd March 2008, 22:14
  5. Digital inputs
    By Christopher4187 in forum General
    Replies: 5
    Last Post: - 1st August 2007, 23:14

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