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

LP Oscillator doesn't oscillate at main frequency

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



Joined: 13 Apr 2011
Posts: 406

View user's profile Send private message

LP Oscillator doesn't oscillate at main frequency
PostPosted: Mon May 15, 2017 9:35 am     Reply with quote

32.768KHz LP Oscillator doesn't oscillate at main frequency on PIC16F627-04; instead oscillate at 194KHz.

I tried to reduce the drive by putting a 100K resistor in series at OSCO (pin 15) without success.

When I connect the 10x oscilloscope tip in about 1 to 2 seconds goes from 194KHz to 32.744KHz.

Any recommendation about this?
_________________
Electric Blue


Last edited by E_Blue on Mon May 15, 2017 11:29 am; edited 1 time in total
newguy



Joined: 24 Jun 2004
Posts: 1900

View user's profile Send private message

PostPosted: Mon May 15, 2017 9:39 am     Reply with quote

Adding the scope probe is changing the capacitance. What crystal are you using (specifically, what is the crystal's rated capacitance), and what crystal load capacitors are you using?
E_Blue



Joined: 13 Apr 2011
Posts: 406

View user's profile Send private message

PostPosted: Mon May 15, 2017 11:18 am     Reply with quote

I have no data about the crystal, is a watch cylindrical crystal.

I tried with 33pF and 66pF.
_________________
Electric Blue
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Mon May 15, 2017 11:43 am     Reply with quote

Why use parts without data?.
It just wastes your time and money....

Everything has specifications, and it is well worth taking the time to get a crystal that matches the drive requirements of the chip.

Trying to use a crystal without data is about as sensible as a 'chocolate fireguard'. The only way to get good accuracy from a crystal is to have a good impedance match, and the right drive. There is no point at all in using a crystal, if these are not happening....

Now, it's quite exceptional to need a Rs over 100K.

Look at AN849 page 8. You do realise that you need two capacitors?.
newguy



Joined: 24 Jun 2004
Posts: 1900

View user's profile Send private message

PostPosted: Mon May 15, 2017 11:45 am     Reply with quote

Those values sound to be too high. The one time I created a RTC with a 32.768kHz crystal, I seem to remember using caps that were just a few pF each. Then again, that could be a function of the crystal I was using.

Can you try removing the caps entirely, so that the only capacitance is the stray capacitance (which will be pretty small)?
E_Blue



Joined: 13 Apr 2011
Posts: 406

View user's profile Send private message

PostPosted: Mon May 15, 2017 12:06 pm     Reply with quote

Where I live there's not big suppliers, as Digikey, Arrow, Mouser and so.
So, for components like crystals there's no code to search as if there are for microcontroller or ICs.

The resistance was a try because we see some pictures on the web where some people use it for CMOS oscillators.
_________________
Electric Blue
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Mon May 15, 2017 1:15 pm     Reply with quote

If you look at the AN I refer to, you will see that they suggest that if the Rs has to go over about 100K, you should be adding a larger loading capacitor on the source drive pin, to bring the value down, or it'll make the oscillator to sensitive to noise.

The crystal sees the two capacitors in series as it's load. So you can keep the right loading by increasing the source capacitor and reducing the capacitor on the other side of the crystal.

It should be possible to find data about any part these days. Part number on the crystal case?.
E_Blue



Joined: 13 Apr 2011
Posts: 406

View user's profile Send private message

PostPosted: Wed May 17, 2017 1:29 pm     Reply with quote

Finally I make a new prototype board with new components except the microcontroller and work fine with 27pF in OSCON and OSCIN.
_________________
Electric Blue
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Thu May 18, 2017 12:06 am     Reply with quote

Well done.
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