RPM counter


Closed Thread
Results 1 to 9 of 9

Thread: RPM counter

  1. #1
    RUBiksCUbe's Avatar
    RUBiksCUbe Guest

    Default RPM counter

    Im working on an RPM counter for a motor that I need for a project but in order to actually count RPMs I need to get the program to run for a minute. Is there some command that will stop the PIC after a minute has passed?

  2. #2
    Join Date
    Sep 2005
    Location
    Dayton, Ohio
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    How about:

    //Set up one of the PIC's hardware Timer/Counters as a Counter

    //Pause 60000

    //Read the value of the counter


    What sort of RPM value do you expect? If it's fast, why not count for 15 seconds and multiply by 4, or count for 1 second and multiply by 60?
    Jim Robertson
    "MilesTag" DIY Lasertag
    www.lasertagparts.com/mtdesign.htm
    Dayton, Ohio

  3. #3
    RUBiksCUbe's Avatar
    RUBiksCUbe Guest


    Did you find this post helpful? Yes | No

    Question

    Its a PC cooling fan so I was expecting it to be sort of high. How do I set up one of the hardware timers as a counter? I've never done anything with them before.

  4. #4
    Join Date
    Sep 2005
    Location
    Dayton, Ohio
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    1. What chip are you using?

    2. Read the datasheet. It will have a section on each Timer/Counter available on your particular PIC. It tells you exactly what values to write to each register to set up the timer as a counter and how to read/write the current value of the counter. You will also be able to set up one of the I/O pins as a trigger for the counter and select rising/falling edge for triggering. Read up on the prescaler, you may need to set that up too.
    Jim Robertson
    "MilesTag" DIY Lasertag
    www.lasertagparts.com/mtdesign.htm
    Dayton, Ohio

  5. #5
    RUBiksCUbe's Avatar
    RUBiksCUbe Guest


    Did you find this post helpful? Yes | No

    Default

    Im using an 18F252. Im looking through the datasheet and I found that Timer0 uses the T0CON register and on the pin diagram it says that T0CKI is pin 6 (PortA.4). How to the timers work? I've never done anything with them before and I'm not even sure what they do.

  6. #6
    G8RPI's Avatar
    G8RPI Guest


    Did you find this post helpful? Yes | No

    Default

    Hi see my eariler post,

    http://www.picbasic.co.uk/forum/show...58&postcount=6

    for some example code.

  7. #7
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi,

    A simple way to read fan RPM:

    A 3-wire fan has a tach output, which usually outputs 1, 2, or 4 tach
    pulses per revolution, depending on the fan model.

    With the PicBasic "COUNT" you can count the pulses on the
    tach output and with simple math calculate the fan speed.


    Luciano

  8. #8
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    Additional information:

    Fan tachs are open-collector. You have to pull them up to 5V or you won't see any signal. I recommend values from 4.7K - 10K.
    Also, fans produce 2 pulses/revolution which means that a 3600 RPM fan will have a 120Hz signal on the tach line.
    Don't plan on the duty cycle being exactly 50%.

  9. #9
    RUBiksCUbe's Avatar
    RUBiksCUbe Guest


    Did you find this post helpful? Yes | No

    Default

    Im using a case fan instead of a processor fan so it dosent have a tach line. I was going to use a processor fan but it wasnt big enough for my project. I basically just need the motor inside the fan, but I need to know how fast it is running at 9v before I can use it. I was looking around and I just found the COUNT command which should work perfectally.
    Last edited by RUBiksCUbe; - 24th November 2005 at 17:36.

Similar Threads

  1. Interrupt RPM and Taylors Elapsed time on 18F4620
    By Tobias in forum mel PIC BASIC Pro
    Replies: 70
    Last Post: - 3rd February 2010, 16:12
  2. Pulsin vs. Interrupt RPM measurement
    By Tobias in forum General
    Replies: 1
    Last Post: - 31st December 2009, 01:29
  3. 16f877A and tmr1 external crystal question
    By comwarrior in forum General
    Replies: 3
    Last Post: - 13th July 2009, 00:40
  4. RPM - DIV32 Problem
    By davewanna in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 11th April 2008, 04:33
  5. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27

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