View previous topic :: View next topic |
Author |
Message |
xavier
Joined: 10 Feb 2004 Posts: 7
|
Intempestive RESET on PIC16F877 |
Posted: Sun Feb 22, 2004 3:34 am |
|
|
Hello,
Does any body could help me to find a way to avoid intempestive RESET on my project.
Each time I approch my hand near the PIC16F877 its reset !?
My fuses are :
...
#fuses HS,NOWDT,NOPUT,NOBROWNOUT,NOLVP,NOCPD,NOPROTECT,NOWRT
...
main()
{
...
setup_spi(SPI_MASTER| SPI_MODE_0_0 | SPI_CLK_DIV_16);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_256);
enable_interrupts(INT_RDA); // Autorise IT RS232
enable_interrupts(INT_TIMER0); // Autorise IT TIMER0
enable_interrupts(GLOBAL);
...
}
Should I place a resistor somewhere or can I find a software solution ?
Thanks in advance for your help (and sorry fo my bad english)
Xavier |
|
|
rwyoung
Joined: 12 Nov 2003 Posts: 563 Location: Lawrence, KS USA
|
|
Posted: Sun Feb 22, 2004 12:54 pm |
|
|
At the minimum you should have a resistor from MCLR- to Vcc. The nominal value is 47K it works with values as low as 4.7K and as high as 100K. The data sheets for Microchip parts, and especially newer parts or "A" revisions have several paragraphs about the Reset circuit.
Also make sure you have all the Ground pins and all the Vcc pins connected. Some parts have multiples. The PIC16F877 as two ground pins and 2 Vcc pins. _________________ Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month! |
|
|
xavier
Joined: 10 Feb 2004 Posts: 7
|
|
Posted: Mon Feb 23, 2004 2:48 am |
|
|
Of course I have place a 10K to MCLR-VCC and pins for power and ground are good.
I have no idea !
The PIC is running at 20Mhz and works fine until I stay far of it !!! |
|
|
Vector Research
Joined: 16 Feb 2004 Posts: 10 Location: Kelowna B.C
|
|
Posted: Tue Feb 24, 2004 2:22 am |
|
|
Check your oscilator crystal, It may need loading caps/resistor. Its may sound wierd, but it had happened to me..
vince |
|
|
rwyoung
Joined: 12 Nov 2003 Posts: 563 Location: Lawrence, KS USA
|
|
Posted: Tue Feb 24, 2004 8:19 am |
|
|
You should be using a parallel cut crystal and depending on the crystal and your layout you should have 18pF to 33pF of capacitance added from XTAL1 to GND and XTAL2 to GND.
The exact value depends on the crystal capacitance (datasheet) and on how much stray capacitance you already have in your layout. Too little and it won't start or it may start but not sustain oscillation. Too much and it won't start, take too long to start or otherwise malfunction.
A good starting point is 18pF or 27pF if you are soldering on Vector board or some other point-to-point system. If you are using the white plastic protoboard modules where you shove in wire, you can probably use 12pF to 18pF to get started.
The optimum value will produce a strong, stable oscillation quickly over a wide temperature and voltage range. Use a 100MHz oscilloscope and x10 probe to look at XTAL2 but keep in mind that the scope will be adding 15pF or more to the circuit node. If you can borrow an active FET probe for testing, those only add 3pF to 5pF typically. _________________ Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month! |
|
|
|