View previous topic :: View next topic |
Author |
Message |
sinan Guest
|
Internal Oscillator PIC16F877A |
Posted: Wed Apr 15, 2009 1:47 pm |
|
|
Hi,
1)when using internal oscillator, do we still need an external clock? |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Wed Apr 15, 2009 2:20 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
sinan Guest
|
|
Posted: Wed Apr 15, 2009 5:59 pm |
|
|
We are using PIC16F877A not 6F877A. We checked the datasheet for 16F, and it says there is internal oscillator. |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Wed Apr 15, 2009 6:23 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
sinan Guest
|
|
Posted: Wed Apr 15, 2009 7:15 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
Guest
|
|
Posted: Wed Apr 15, 2009 7:26 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Wed Apr 15, 2009 7:27 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
Guest
|
|
Posted: Wed Apr 15, 2009 7:36 pm |
|
|
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? |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Apr 16, 2009 3:02 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
|