View previous topic :: View next topic |
Author |
Message |
siphorob
Joined: 12 Oct 2010 Posts: 12 Location: South Africa
|
Measuring RPMs using PIC16F877 |
Posted: Sun Oct 24, 2010 9:26 am |
|
|
Hi,
I'm using a hall effect sensor to calculate the speed of a dc motor, I tried a couple of Examples listed in CCS with very little luck.
Please help. _________________ Regards,
Brandon |
|
|
jacqueskleynhans
Joined: 10 Apr 2008 Posts: 109 Location: Cape Town, South Africa
|
|
Posted: Sun Oct 24, 2010 9:38 am |
|
|
Hi Brandon, You have to be more clear than that.
Post your code that you have so far with your compiler v. _________________ "THE ONLY EASY DAY WAS YESTERDAY" |
|
|
siphorob
Joined: 12 Oct 2010 Posts: 12 Location: South Africa
|
|
Posted: Sun Oct 24, 2010 9:41 am |
|
|
Hi,
I am using the example in EX_FREQC.C:
++++++++++++++++++++++++
Code removed.
Reason: Forum Rule #10
10. Don't post the CCS example code or drivers, or ask for such code and drivers.
http://www.ccsinfo.com/forum/viewtopic.php?t=26245
-- Forum Moderator
++++++++++++++++++++++++ _________________ Regards,
Brandon |
|
|
siphorob
Joined: 12 Oct 2010 Posts: 12 Location: South Africa
|
|
Posted: Sun Oct 24, 2010 11:31 am |
|
|
Was the information provided enough?
Please advise. _________________ Regards,
Brandon |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Sun Oct 24, 2010 11:39 am |
|
|
When you say you had very little luck, what happened? What did it do that it should not have, or what didn't it do that it should have? Did it hang? Did it give bad numbers? Zeros? Etc. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Oct 24, 2010 12:07 pm |
|
|
siphorob,
Use the forum's search page to find code for this. There is a link to
the Search page at top of the forum. Search for this:
Make sure you select "Search for all terms".
You will find both software and hardware (using PIC peripheral modules)
solutions. |
|
|
biozen
Joined: 08 Sep 2010 Posts: 10
|
|
Posted: Mon Oct 25, 2010 1:53 am |
|
|
We use Allegro gear tooth sensors for a product. The sensors produce a square wave which 'reflects' when the gear tooth passes across the sensor. Use the External Interrupt on the PIC to catch the rise/fall that indicates a gear tooth just passed. Using a timer you can measure the time between the two (or more) gear teeth. Do the maths there after to get the RPM...
We use a gear of 16 teeth. Start the timer and start counting the teeth. At the end of 16 counts of gear, stop and read timer. Average this over a few readings. This is the time for one rotation.
HTH,
Mohit. |
|
|
siphorob
Joined: 12 Oct 2010 Posts: 12 Location: South Africa
|
|
Posted: Mon Oct 25, 2010 5:33 am |
|
|
Dear PCM programmer,
I have tried a variety of samples found on the search results, the problems I have with code is very vague, or does not work completely.
Some of the treads are left with no conclusions. Is there a thread that maybe has a good solution?
Kind Regards,
Brandon
siphorob@gmail.com |
|
|
siphorob
Joined: 12 Oct 2010 Posts: 12 Location: South Africa
|
|
|
|