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 CCS Technical Support

16F676 Internal Oscillator

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



Joined: 23 Dec 2008
Posts: 83

View user's profile Send private message

16F676 Internal Oscillator
PostPosted: Tue Dec 14, 2010 6:41 am     Reply with quote

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: 19510

View user's profile Send private message

PostPosted: Tue Dec 14, 2010 9:19 am     Reply with quote

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