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

Problem w/ 20MHz Crystal

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



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

Problem w/ 20MHz Crystal
PostPosted: Fri Aug 27, 2004 12:15 pm     Reply with quote

Hello,

I have a HC49U at 20Mhz and the problem is, it works only when no caps are hooked upto it !?

I have 2 22uF caps, but when I put them on the pic stops working... I tried messing with the polarity in every combonation etc, nothing worked...

What could I be doing wrong ?
newguy



Joined: 24 Jun 2004
Posts: 1908

View user's profile Send private message

PostPosted: Fri Aug 27, 2004 12:42 pm     Reply with quote

It could be that there's enough parasitic capacitance on the crystal lines to allow it to work without any capacitors.

Maybe try 15 pF, or even 10 pF instead and see what happens.

How is the layout of the pcb? If there are any groundplanes really close to the crystal lines, then that would account for some parasitic capacitance. If you are just prototyping this on one of those push-in boards, then they're horrible for parasitic capacitance.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Aug 27, 2004 12:50 pm     Reply with quote

Quote:
I have 2 22 uF caps
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

PostPosted: Fri Aug 27, 2004 2:36 pm     Reply with quote

Ah, right. 22 pF caps.... oops.

Hmmm... So why does the clock work w/o caps and why do I still need them ?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Aug 27, 2004 2:57 pm     Reply with quote

Download the Pic16 Reference manual on the Oscillator:
http://ww1.microchip.com/downloads/en/DeviceDoc/31002a.pdf
See the following section for reasons why the capacitors are needed:
2.3.3.1 Determining Best Values for Crystals, Clock Mode, C1, C2, and Rs
ik1wvq



Joined: 21 Feb 2004
Posts: 20

View user's profile Send private message

PostPosted: Wed Sep 01, 2004 3:28 am     Reply with quote

hi,

try to place a 1.5M resistor across the crystal .. ( in parallel)

this problem was completely disappared in a my old project ..

this information from a application note of microchip !!

regards ..
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

RE:
PostPosted: Wed Sep 01, 2004 7:28 am     Reply with quote

Hi,

I have a similar problem, in this case only some crystals ( 20 Mhz ones) work, others simply do not work at all, but if I remove the 33pF caps then they work....

I have noticed that 4MHz crystals work perfectly well. Is it possibel that the problem may be with the PIC ( Iam using PIC 16F877- 20/4 )
My PCB has a ground track that is quite close to the 20 MHz crystal, do you think this might be the problem ???
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Wed Sep 01, 2004 10:40 am     Reply with quote

Are you using the HS fuse option instead of the XT???
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

PostPosted: Wed Sep 01, 2004 12:01 pm     Reply with quote

Yea, I'm using HS.

Whats odd is that it seems to work fine with no caps. I am doing that pulse width code and get the same times with caps in as caps out.

Also, I noticed last night I was working just outside our office and NONE of my code was working... so I was like WTF... loaded some code I knew worked and nothing.... I pulled one of the caps and it ran right up (twice) but then it went back to not working...

Its was probably 60degrees last night... Is that enough to screw up a Xsytal like that ?
drh



Joined: 12 Jul 2004
Posts: 192
Location: Hemet, California USA

View user's profile Send private message

PostPosted: Wed Sep 01, 2004 2:00 pm     Reply with quote

Application note AN849 at the microchip website might help. Also, are you using a parallel resonant crystal?
_________________
David
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