"pragma cpu_fosc" Statement

The "pragma cpu_fosc" statement tells the compiler what the intended frequency of the CPU clock generating oscillator is. A 4MHz oscillator is specified as 4000000. This is divided by 4 internally by the PIC core to produce a 1MHz clock. The compiler uses the cpu_fosc value to calculate other parameters which are made available to the programmer, such as:

syntax

pragma cpu_fosc 4000000
The "pragma cpu_fosc" statement provides the oscillator value for use by the rest of the program through the CPU_FOSC manifest constant. The programmer may use this constant like any other constant.
e.g.

	x = CPU_FOSC / 1000