Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Fosc PIC18F4620 Confused!

Status
Not open for further replies.

Neyolight

Full Member level 5
Joined
Aug 29, 2011
Messages
306
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
World
Activity points
3,624
Hi

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?

Thanks
 

See section 2.3 - the divide by 4 is only for EC mode, not crystal oscillator.

The clock is always divided by 4 to make the instruction cycle. So with and 8MHz clock the instructing cycle will be 500ns.

Keith
 

Using OSC= HS , One has to be in EC or ECIO mode...in both case Fosc is divided by 4? This means I should see Fosc/2 on OSC2 ?

Using an internal oscillator of 8Mhz...drops the frequency down to 2Mhz?
 

HS uses an external crystal, EC uses an external clock. They are totally different modes. See section 2.1.

In every mode the raw clock is divided by 4 to get the instruction cycle.

Keith
 
Thanks :) Got it!

One last question --> INTIO67 ...Is that INTIO1 or INTIO2? My guess would be INTIO2 with I/O on A6 and A7
 

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

Hopefully that answers the question.

Keith.
 
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

Hopefully that answers the question.

Keith.

Where did you find this information about compiler from?
 

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).

Keith
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top