# How many ticks are required to count the following revolution per minute?

The timer in my micro-controller is running at 25Mhz. I need to program the hardware timer such that it counts for 6400 rpm. This means 6400 times on bit '1' in 60 seconds. So in 1 seconds it is 1 seconds 6400/60 rotations. Now, I want to achieve this so that hardware timer has 6400/60 times bit 1 in 1 seconds. Thus, the timer should count till 6400/60 if the timer was running at 1 Hz. However, the timer is running at 25 * 10^6 Hz .How can I count 6400/60 here. If I calculate it comes to 6400 * 25 * 10^6 /60 which is a very high value. I cannot program this value on to my hardware timer register. Is my logic correct? Can you please help me on the reasoning here.

You have $6400\frac{round}{minute}=6400\frac{round}{60\ seconds}$. These has to be produced by $25\cdot 10^6\frac{round}{second}$. Then you must divide the micro-controller $\frac{round}{second}$ figure into $\frac{6400}{60}\frac{round}{second}$ equal parts. This makes $$\text{tick-interval}=\frac{60\cdot 25\cdot 10^6}{6400}=234,375$$ That's it.
To verify the answer, we have found that the micro-controller runs $$60\cdot 25\cdot 10^6=1,500,000,000\text{ cycles pr. minute}$$ and in steps of $234,375\text{ cycles}$ we see that $6400$ counts make $$6400\cdot 234,375=1,500,000,000\text{ cycles}$$ thus lasting exactly one minute.
• @SHREYASJOSHI: It is not correct to multiply by $6400$ when you want $6400$ parts. The word parts is italic here to underpin that you divide into parts. Thus division by $6400$ must be involved in any rendering of the solution. – String May 14 '14 at 9:56
• @SHREYASJOSHI:There is somehow a brain teaser about the concept of division and multiplication here. See my last edit. If you line up the $1,500,000,000$ cycles that the micro-controller runs pr. minute and divide those into $6400$ equal parts of length $234,375$ it all adds up. I hope this helps, after all! I am not trying to confuse you, but merely trying to do my best at explaining it. Which is hard when my image of it seems so clear to me, yet I can perfectly see how your wording of it is misleading you ... – String May 14 '14 at 11:47