finding missing pulses


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default Re: finding missing pulses

    I'm a bit puzzled by this, but I'm thinking a big state machine and a timer.

    The state machine starts after the detection of the 1ms pulse (you could use PulseIn for that). Once you have a negative pulse with a duration of 1ms you go into the state machine. Start a timer checking for the first falling edge. If the falling edge is more than 300us you missed a pulse (tag it as missing), stop the timer and start counting again for the next 300us. If you did not miss a pulse (i.e. you got a falling edge - tag it as present), stop the timer and wait for the next rising edge, start your 300us count once more. Do this until your overall count is 10. At that point you should be ready for the next 1ms pulse. I'm probably all over the place, but this seems reasonable. This does nothing to figure whether any present pulse is a 1 or 0; but you can add that after you get the missing pulse detection part.

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default Re: finding missing pulses

    I would suggest Interrupts on Port B, bit 0. It has Interrupt on edge either high or low, and you control this by bit 6 in Option_Reg.

    I'll try a test code to show you how.

    Do you have a PIC prefference?

    Ioannis

Similar Threads

  1. need help finding a PIC
    By asdhillon86 in forum General
    Replies: 1
    Last Post: - 9th January 2011, 23:49
  2. Help in finding technical info.
    By hackableFM in forum Off Topic
    Replies: 3
    Last Post: - 27th February 2009, 03:20
  3. Help finding Alarm System Example
    By bbawkon in forum General
    Replies: 1
    Last Post: - 20th September 2008, 05:39
  4. Lost in finding a example
    By F1CHF in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th January 2007, 22:20
  5. Help finding Crosspoint Switch?
    By muddy0409 in forum General
    Replies: 13
    Last Post: - 12th January 2007, 02:30

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