View Single Post
  #4   Spotlight this post!  
Unread 12-02-2006, 16:44
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: How to use a "Timer"

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
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)