Hardware capture on 16F876


Results 1 to 7 of 7

Threaded View

  1. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink Count the convenient value ...

    Hi, Miniboost

    Real world rpm happen in a ... minute !!! ( Mr de la Pallice )

    if you want to count in a 1/10 of a second you count ... 15 counts for 9000 rpm ( let's be VERY optimistic !!! ) as tey are INTEGER counts ... you do with 14,15 or 16 .... never 15.238656

    Ok ... let's try other methods ...

    measure the period ... ahhh, better !!!

    with a 4 Mhz clock, using the CAPTURE module of a pic ( 16F628 or 876 i.e ) ... you can have a 1µS resolution ... say 65535 µS period to the max.

    Boooo ... can't measure less than 915 rpm !!!

    sooo ... let's look at TMR1 prescaler values ... 2 will fit ( 457 rpm ... ok ) also have 4 ...

    max rpm resolution ???

    9000 rpm is 6.7 ms period ... 3350 TMR1 counts ( W/ prescaler of 2 ) ... say better accuracy than 0.1 %

    Now, let's read something clear !!! ... you'll have to use a mean value over a reading period of .5 to 1 sec ... if you do not want the display to flicker too much !!!

    but you can also add a fast + mean bargraph ....

    Will be another story !!!

    Alain

    PS: no hardware capture function in PbP ... have to write it yourself ...
    Last edited by Acetronics2; - 4th April 2007 at 14:52.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. remote code learning
    By Bruce in forum Code Examples
    Replies: 20
    Last Post: - 21st February 2021, 15:38
  2. mS Timer
    By whmeade10 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th September 2020, 12:12
  3. Using hardware capture
    By Bruce in forum Code Examples
    Replies: 14
    Last Post: - 25th March 2012, 05:52
  4. Using CCP1 and CCP2 to measure instant fuel consumption
    By srspinho in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 20th September 2008, 15:50
  5. Measuring change of frequency with PIC
    By Aussie in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 19th July 2007, 01:47

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