PIC Programming

Discussion in 'Programmer's Corner' started by Archiebold, Mar 18, 2007.

  1. Archiebold

    Thread Starter New Member

    Feb 18, 2007
    6
    0
    Hi all. I was wondering how many of you know how to program a pic for a frequency counter of sorts. See, what i have is a digital clock pusle coming from an optical sensor. My problem is getting the PIC to show the speed after it gets the clock pulse. I am not asking anyone to do it for me (altho i wouldnt turn it down :p ) but help would be greatly appreciated. I am trying to learn the code, but it is being self taught. I can give more details if needed.

    Thanks
    RJV
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    Use an internal timer to run for a period of one second (or another time period that works better). During the time interval, use the pulses to increment an internal count. The the end of the one second period, the count is the number of pulses per second.
     
  3. Archiebold

    Thread Starter New Member

    Feb 18, 2007
    6
    0
    Thanks, that actually helps alot. I am gonna seach the internet to see if i can find code exampes.
     
Loading...