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

main oscillator problem

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



Joined: 02 Feb 2010
Posts: 354

View user's profile Send private message

main oscillator problem
PostPosted: Sun Jan 08, 2012 9:04 am     Reply with quote

Hi all!
I'm watching that main oscillator on my PIC18F2525 stop work when I touch
osc pins (That is Normal), but when I remove disturbance it's never start normal until power-off and power-on device!
And I've devices that may be have this problem with disturbance coming over power.
My compiler ver. 4.104
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Sun Jan 08, 2012 10:24 am     Reply with quote

Considering the great effect a 20pF or 27pF capacitor has on the PIC crystal wouldn't you expect having a great big human attached to it would cause a major disturbance?

On the other hand ;-) the fact that it does not restart when you remove your hand may indicate your circuit is marginal. Is the crystal the right type specified by the PIC datasheet? Do you have the right capacitors as specified by the CRYSTAL datasheet? If it is a very small crystal is it being overpowered? Have you compensated for the stray capacitance of any breadboard you may be using? Is the PIC VSS/VDD well bypassed? Are the crystal and loading caps close to the PIC pins? Are there any noisy signal lines passing nearby?
_________________
The search for better is endless. Instead simply find very good and get the job done.
kmp84



Joined: 02 Feb 2010
Posts: 354

View user's profile Send private message

PostPosted: Sun Jan 08, 2012 11:23 am     Reply with quote

Hi "SherpaDoug"!
For Answer of your questions:
I've read datasheet for PIC18f2525 and observ them.
1.crystal -ok
2.Cap 2x20pf closer to OSC pins and GND
3.have 100nf between vcc pin and GND
and e.t.c....
I've make some comparison:
1.With same oscillator circuit and PIC16F628A-Oscillator start normal after disturbance.
2.I've tested couple 8050 devices all of them oscillator work more stable..
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Sun Jan 08, 2012 11:58 am     Reply with quote

It looks like you have all the usual suspects covered. I am not familiar with the PIC18 series, but I expect their oscillators to be just like the PIC16 series. My only other suggestion would be to try another crystal.
_________________
The search for better is endless. Instead simply find very good and get the job done.
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Sun Jan 08, 2012 12:11 pm     Reply with quote

You'd normally say that failure to restart, is a sign of the crystal circuit being overloaded. Too much capacitance?. Though the capacitors sound reasonable, how is the circuit actually built round the oscillator pins?. PCB?. Breadboard?. Wires?. Do you have a ground plane?. If so, is it relieved round the crystal pins?. Have you tried a second chip?. Do you have a spec for the crystal (are you sure it is a parallel resonant type - series resonant ones will often give problems like this with the PIC oscillator).

Best Wishes
kmp84



Joined: 02 Feb 2010
Posts: 354

View user's profile Send private message

PostPosted: Sun Jan 08, 2012 1:13 pm     Reply with quote

Hi Ttelmah!
http://home.comet.bg/datasheets/Quartz&ceramicresonators/HC-49_S.pdf
I've not another PIC18F2525 but try with 18F452 and no problem!
Maybe 18F2525 rev.0x07 have a problem with inside oscillator circuit?
Can WatchDog timer make general reset if main OSC stop ..?
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Sun Jan 08, 2012 3:28 pm     Reply with quote

Unfortunately, link doesn't work.
Yes, the watchdog can restart, or on most modern chips, if you set the FSCM fuse, the chip can switch automatically to the internal oscillator.
Latter chips drive the crystal less hard than older units, which tended to need a series resistor to avoid overdrive problems. If the gain of the crystal is low, might give problems.
However, are you sure your fuses are set right?. For example running a crystal at 8MHz, and selecting the XT fuse, will give a circuit that may well work, but will be underdriving the crystal....

Best Wishes
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Sun Jan 08, 2012 3:32 pm     Reply with quote

Working down from the sites main entry gets to the .pdf
What frequency are you running?. Do you know what load capacitance the one you have is rated for (the pdf, is for four different ratings....).
Have you tried with a series resistor?. You may actually be overdriving this type.

Best Wishes
kmp84



Joined: 02 Feb 2010
Posts: 354

View user's profile Send private message

PostPosted: Sun Jan 08, 2012 4:55 pm     Reply with quote

Code:
      #include <18F2525.h>
      #device HIGH_INTS=TRUE
      #build (nosleep)
      #fuses HS,PROTECT,NOLVP,PUT,BROWNOUT,NOMCLR
      #use delay(clock=11059200)
      #use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7,errors,STREAM=rs_485)
      #use rs232(baud=9600,rcv=PIN_B0,STREAM=GP_20_1)
      #use rs232(baud=9600,rcv=PIN_B1,STREAM=GP_20_2)
 

When i use "FCMEN"fuse have a problem with serial communication.
Also try use WDT to make General reset, but it's no happen.
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Jan 08, 2012 6:14 pm     Reply with quote

If the 2525 is like the 4550, the INTernal RC has a default of only 1MHz which may explain the problem with serial communications though you don't say what your problem really is.
Also the Internal RC is not the most stable 'clock' as noted in the datasheet and at higher baudrates will give you problems.
kmp84



Joined: 02 Feb 2010
Posts: 354

View user's profile Send private message

PostPosted: Tue Jan 10, 2012 2:01 am     Reply with quote

The problem was Solved when I stop "FCMEN" fuse, but I don't know why it's default set.
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