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

swapping between oscilators

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



Joined: 19 Nov 2003
Posts: 30

View user's profile Send private message

swapping between oscilators
PostPosted: Thu Jun 09, 2005 8:47 am     Reply with quote

I have a xtal unit feeding a 16f876a. They are both on the same power line, so power up at the same time. The problem is the code hangs (it actually goes into a loop - a sensible loop! that shouldn't exist).
I think the prob may be the xtal unit stabalizing period and having an effect on the PUT or just causing the 876 not to start correctly. (just guess Confused ing).
The s/w runs fine if a hardware reset is performed after power up, but has no effect if the reset line is held low during power up then released some seconds later.
Any ideas welcomed.
Many thanks
Les
valemike
Guest







PostPosted: Thu Jun 09, 2005 9:01 am     Reply with quote

what is the speed of your crystal? This is what I do for a 4MHz oscillator (it seems to work if i interchange XT with HS too):

#include <16F876.h>
#id CHECKSUM
#device ADC=10
//#fuses HS,NOWDT,NOPROTECT,NOLVP
#fuses HS,WDT,NOPROTECT,NOLVP,PUT
#use delay(clock=4000000, RESTART_WDT)

The above snippet might not help you, but your #fuses should be the first thing you compare with.
valemike
Guest







PostPosted: Thu Jun 09, 2005 9:02 am     Reply with quote

Also, you might want to check the values of your capacitors that you put on the crystal. But if it works okay after a POR, then who knows.
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