CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Internal Oscillator PIC16F877A

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
sinan
Guest







Internal Oscillator PIC16F877A
PostPosted: Wed Apr 15, 2009 1:47 pm     Reply with quote

Hi,

1)when using internal oscillator, do we still need an external clock?
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Wed Apr 15, 2009 2:20 pm     Reply with quote

With an internal oscillator you don't need an external clock. Only one of the two clock sources can be active at the same time.

The PIC6F877A does not have an internal oscillator.
sinan
Guest







PostPosted: Wed Apr 15, 2009 5:59 pm     Reply with quote

We are using PIC16F877A not 6F877A. We checked the datasheet for 16F, and it says there is internal oscillator.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Wed Apr 15, 2009 6:23 pm     Reply with quote

sinan wrote:
We are using PIC16F877A not 6F877A.
A typing error. There do not exist PIC6Fxxx chips and I meant a PIC16F877A.
Quote:
We checked the datasheet for 16F, and it says there is internal oscillator.
Well, not in my datasheet for the PIC16F877A. This says:
Quote:
14.2.1 OSCILLATOR TYPES
The PIC16F87XA can be operated in four different
oscillator modes. The user can program two configura-
tion bits (FOSC1 and FOSC0) to select one of these four
modes:
• LP Low-Power Crystal
• XT Crystal/Resonator
• HS High-Speed Crystal/Resonator
• RC Resistor/Capacitor
There do exist other PIC16 processors with an internal oscillator but not this one.
sinan
Guest







PostPosted: Wed Apr 15, 2009 7:15 pm     Reply with quote

Thank you very much for helping me out.

Also, if you want to operate in XT mode with 2MHz, do we need to suply external 2Mhz oscillator and set #use delay(clock=2Mhz) or do we need to supply external 20Mhz oscillator and set #use delay(clock=2Mhz) . So basically, my question is do we have to use 20Mhz external clock?

Thanks again
Guest








PostPosted: Wed Apr 15, 2009 7:26 pm     Reply with quote

Quote:
5.0 TIMER0 MODULE
The Timer0 module timer/counter has the following
features:
• 8-bit timer/counter
• Readable and writable
• 8-bit software programmable prescaler
• Internal or external clock select


Here, they talk about internal clock, that is why I thought there exists an internal oscillator.

Thanks
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Wed Apr 15, 2009 7:27 pm     Reply with quote

The external crystal should have the same frequency as declared in the delay statement.

Set the XT fuse for the 2MHz crystal or HS for a 20MHz crystal.
Guest








PostPosted: Wed Apr 15, 2009 7:36 pm     Reply with quote

Thanks very very much for your answers.

So I am using 2Mhz external crystal. In my code I set

#fuses XT

In the CCS program, Do I also change the Configuration Bits accordingly for the Oscillator. My TA told me not to change it from HS.

So if your fuse is in XT in the code, do you also alter the configuration bits?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Apr 16, 2009 3:02 pm     Reply with quote

The XT fuse sets the correct Config bits in the HEX file when the
program is compiled. The XT fuse controls the Config Bits for the
oscillator setting.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group