PIC16F84A Tachometer LED routine


Closed Thread
Results 1 to 21 of 21

Hybrid View

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


    Did you find this post helpful? Yes | No

    Wink

    Hi, Santa ( de bois )

    1) Just the usual gag with PORTA.4 ...

    Did you place an external pullup resistor or something to drive the pin to HIGH state ???


    2) I note 10 Mhz need a HS Osc ... ( but generally works with XT !!! )


    3)
    Code:
    MAIN1:
            PULSIN PORTA.4,0,W1            ' Measure pulse-width in 4µS resolution
            GOTO MAIN
    you'd better try

    Code:
    MAIN1:
            RCTIME PORTA.4,0,W1            ' Measure pulse-width in 4µS resolution
            GOTO MAIN

    4) your Mathematics are really bad for INTEGERS using ...


    W1 = W1 * 4 ' Convert µS to mS
    W1 = (60000 / W1) ' Revs in 60 mS
    W1 = W1 * 1000 ' Revs in 60 sec
    you'd much better use DIV32 ...



    That's the first hits ...

    Alain
    ************************************************** ***********************
    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 " !!!
    *****************************************

  2. #2
    Join Date
    Oct 2008
    Location
    Denmark
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Sorry for letting the problem out (I was kinda tired).

    The attached image views the first digit of 4. As if the algorithm doesn't calculate the RPM correct.

    1) - I have not yet build the circuit, as I don't have a programmer.
    2) - I don't think the Simulator cares about HS or XT :-)

    3) I wrote RCTIME instead of PULSIN, but it didn't chance anything.

    Actually, after reading the manual to PBP, i don't know how to use DIV32.
    I've tried examples, but I still can't figure it out.


    - Thanks again guys. :-)
    Attached Images Attached Images  

Similar Threads

  1. Conway's Game Of Life
    By wellyboot in forum mel PIC BASIC Pro
    Replies: 45
    Last Post: - 28th May 2020, 06:14
  2. Free Project - 245 LED Display
    By T.Jackson in forum Code Examples
    Replies: 221
    Last Post: - 16th August 2009, 04:59
  3. Single digit 7 Seg LED clock - PIC16F88
    By thirsty in forum Code Examples
    Replies: 4
    Last Post: - 17th July 2009, 08:42
  4. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 20:19
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 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