|
|
View previous topic :: View next topic |
Author |
Message |
arunkish
Joined: 23 Dec 2008 Posts: 83
|
16F676 Internal Oscillator |
Posted: Tue Dec 14, 2010 6:41 am |
|
|
Hello All,
I experience a strange problem with PIC16F676, when I tried to use the internal oscillator - 4 Mhz. I have a program that works fine, when I use external 4 Mhz oscillator, but when I remove the external oscillator and configured it to use the internal oscillator, the PIC is not working as expected. I use delay to read some data through the interrupt and it fails to read out.
Will there be differences in using the internal and external oscillators? I read the forums and tried almost everything with no luck. Can anyone please suggest how to use the internal oscillator?
This is my what i do to use internal oscillator.
Code: | #fuses BROWNOUT,NOWDT,NOPROTECT,NOMCLR,PUT
#fuses INTRC_IO
#use delay(clock=4000000)
|
I doubted if I might have erased the OSCAL calibration value and tried with different 16F676. I have the same results. Am I making a mistake or should I change the delays that I use to match the internal oscillator?
Compiler Version : 3.222
Regards |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19551
|
|
Posted: Tue Dec 14, 2010 9:19 am |
|
|
Do you have a frequency meter, or a calibrated oscilloscope?.
If so, try setting INTRC, rather than INTRC_IO, and measure the frequency on the clock output pin (should be 1MHz).
Now, your compiler is pretty old. The oldest I have still available, without loading archives, is 3.226, and this appears to select the fuses correctly. However this is no proof that 3.222 does. The 676, would have been a fairly 'new' chip when this compiler was launched, and CCS, fairly commonly gets errors in the configuration of new chips (the chip's data sheet dates to 2003, which 3.226, dates to 2005 - data sheets usually predate chip launch a little).
So, see if the output is correct, then try a simple 'toggle an output pin' type test with fixed timing intervals. If this works, then you have basically proved the chip is running, and at the expected frequency.
How accurate do your delays need to be?. The internal oscillator on this chip is better than some older designs, but will still not give 'crystal' accuracy.....
Best Wishes |
|
|
|
|
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
|