Quote:
|
Originally Posted by 6600gt
Sorry I ment the clock speed is 40 MHz but the timer incriments one every 4 of them. Same with the processor instructions cycle. It is 1/4 the speed of the clock.
The example has a 10MHz clock but but the acutal ticks on the timer are only 2.5 MHz so per second(assuming 1 to 1 prescale). So on the robot controller you have to multiply that number by 4 to get the real number of ticks per second( If you are going by the example in Kevin Watson's interrupt code or the data sheets).
|
Huh?
I've never heard of it running a 40MHz clock and none the tests I've run support that, they do however support a 10MHz clock.
For example, the code example I posted previously is a 4ms clock.
I preloaded the timer with 60535 so it would overflow 5000 ticks later (65535).
4ms / 5000 = 800 ns per tick
1 second / 800 ns = 1,250,000 ticks = 1.25 MHz
1.25MHz * 8 (1 to 8 prescale) = 10MHz
If I missed something, can you point out where I can find it? I'm genuinely confused and I don't understand where you got your numbers from.
Hopefully helping,
Matt