Log in

View Full Version : PIC18F8722 TIMER2 Frequency?


TechnocratiK
29-01-2008, 11:08
So I was reading over Kevin Watson's gyro code (found here (http://www.kevin.org/frc/frc_gyro.zip)) and his code seems to suggest that TIMER2 has a clock frequency of 10 MHz. Is this external to the PIC on the IFI board? From the 18F8722 datasheet, it seems that the internal clock is at 8 MHz, not 10 MHz. What is the source for the TIMER2 oscillator, and what is its frequency?

Los Frijoles
29-01-2008, 11:22
The PIC in the controller is running at 40mhz and since it takes 4 clock ticks to execute 1 instruction cycle, it runs at 10 mips (million instructions per second). With a no prescaler, Timer2 runs at 10mhz. However, if a prescaler is set (recommended), it can run alot slower if need be. Look at the datasheet on Microchip.com.

The PIC in the robot runs off a crystal and the timer2 source is usually the instruction cycle clock.

mluckham
29-01-2008, 11:26
It is 10 MHz, I know because I developed some code programming the timers.

Here is the datasheet
http://www.ifirobotics.com/rc.shtml#Specifications

TechnocratiK
29-01-2008, 12:54
Awesome. Thanks a lot.