I have created another thread instead on the same topic as my question differs slightly. Im still confused on what frequency the PIC runs at with various modes.
Mode 1: External Oscillator connected to OSC1 and OSC2. A crystal of 16MHz is connected to OSC1 and OSC2 giving the frequency of oscillation (Fosc) of 16Mhz ( quite obviously). What confuses me is, in some diagrams ( PIC18F4620 Spec) you will see Fosc/4 coming out. Is Fosc/4 our frequency at which our code runs? I tried connected my PIC to 16Mhz crystal and see 16 Mhz at OSC1 and OSC2 ...Shouldnt OSC2 read Fosc/4 ( 4Mhz) ?
Mode 2: Selecting frequency via internal oscillator (OSC = INTIO67). Say I select 8Mhz....what is the frequency my code runs at? 8 or 8/4 Mhz?
There is no reference to INTIO67 in the datasheet so I assume you are talking about a function of the compiler you are using. It may vary from one make of compiler to the other, but the version I have has the following in the PIC18F4620.INC file:
Code:
; OSC = RCIO6 External RC oscillator, port function on RA6
; OSC = INTIO67 Internal oscillator block, port function on RA6 and RA7
; OSC = INTIO7 Internal oscillator block, CLKOUT function on RA6, port function on RA7
There is no reference to INTIO67 in the datasheet so I assume you are talking about a function of the compiler you are using. It may vary from one make of compiler to the other, but the version I have has the following in the PIC18F4620.INC file:
Code:
; OSC = RCIO6 External RC oscillator, port function on RA6
; OSC = INTIO67 Internal oscillator block, port function on RA6 and RA7
; OSC = INTIO7 Internal oscillator block, CLKOUT function on RA6, port function on RA7
By looking through the .INC file I referred to above. I don't know if it is just me, but I find compiler documentation is very poor and the only way to find things out is to rummage around the include files (and .H ones).