Posted: Thu Jun 26, 2014 9:59 pm Post subject: Tacho
Hi
has someone made a tachometer with 1 rpm resolution and can give me som hints on how this can be done.
Let say we have an engine with a sensor that give us one puls pr. revolution.
If i calculate the frequency i can get more than 60rpm resolution.
Am not asking for someone to make the code for me, just a formula or some basics.
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
Posted: Fri Jun 27, 2014 3:52 am Post subject:
AN 138 seems remarkably complicated.
With 1 pulse per rev, just measure the time between pulses using a high speed timer, like eg timer1. The timer input capture function works well for this. Set the prescaler to give a count which does not overflow at the lowest possible engine speed.
Then the rpm is just 60,000,000/timer count, if the count is in microsec. Scaling the count to the actual clock frequency and divider used is pretty obvious. _________________ Adrian Jansen
Computer language is a framework for creativity
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum