|
|
View previous topic :: View next topic |
Author |
Message |
ljb
Joined: 19 Nov 2003 Posts: 30
|
swapping between oscilators |
Posted: Thu Jun 09, 2005 8:47 am |
|
|
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 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
|
|
Posted: Thu Jun 09, 2005 9:01 am |
|
|
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
|
|
Posted: Thu Jun 09, 2005 9:02 am |
|
|
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. |
|
|
|
|
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
|