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

Intempestive RESET on PIC16F877

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



Joined: 10 Feb 2004
Posts: 7

View user's profile Send private message

Intempestive RESET on PIC16F877
PostPosted: Sun Feb 22, 2004 3:34 am     Reply with quote

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

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

PostPosted: Sun Feb 22, 2004 12:54 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Feb 23, 2004 2:48 am     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Tue Feb 24, 2004 2:22 am     Reply with quote

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

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

PostPosted: Tue Feb 24, 2004 8:19 am     Reply with quote

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!
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