pic micro programming

i am trying to program a pic16f877 to desplay the rpm of a motor. I am using a sensor on the shaft to give me 4 puls per revolution. I am thinking of using capture and compare facility of the pic. or some timer . can anyone help me

Reply to
eddie
Loading thread data ...

Sure. There is a key at each bottom, outside corner of your keyboard. You might try a spelling checker too.

--
  Keith
Reply to
krw

You can do this two ways:

1) you can count pulses over a measured time interval (using a timer) or 2) you can time the interval between pulses (CCP)

What is the speed range of the motor?

How often do you need to calculate the RPM?

The answer to those two questions will determine the best approach.

Reply to
Anthony Fremont

You know what? I think it's very nice that you offered to help him, and I hope that the poster gets something out of it. Now that I have said that. The remainder of this reply is for some others that might be reading it, and you know who you are.

I don't have anything nice to say about people that have nothing better to do than ridicule some one's miss spellings and maybe, incorrect use of a words.

Simply put, if the message is clearly conveyed, why add insult to injury. The poster wasn't asking for some one to correct their spelling or grammar, just a little help. And I thought the message was very clear.

If the message was not readable, then i would understand at least, for any one that is willing to help to simply ask them to repost it a little clearer with out all the other slag, negative commits and obscenities thrown in.

If you feel that you must unload on some one due to a back day or life style? then, that is what beer and the other half is for!

--
"I'm never wrong, once i thought i was, but was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5
Reply to
Jamie

The minimum rpm i want to desplay on my Lcd is 400 and maximum is

1500. I want to time every 2second
Reply to
eddie

the rpm of a motor. I

If you are so smart how comes you dont realize that am not asking help for some minor Grammatical error.

Reply to
eddie

The RPM is kinda low, but you could get away with counting the pulses over the two second update period as long as you don't need very high resolution. At 400 RPM, you would count 53 pulses every two seconds. At 1500 RPM, the count would be 200. This makes the math non-trivial since you have to multiply the number of pulses counted over two seconds by 7.5 to calculate RPM. OTOH, you can just left shift the count by three bits (multiply by 8) giving you an error of about 7% high. I should have asked before, how much accuracy and resolution do you need?

Reply to
Anthony Fremont

desplay the rpm of a motor. I

Well, since you asked... I gave help where it was most needed.

--
  Keith
Reply to
krw

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.