View previous topic :: View next topic |
Author |
Message |
microccd
Joined: 08 Aug 2006 Posts: 10
|
wrong state of pic16f876 |
Posted: Tue Sep 26, 2006 3:40 pm |
|
|
I program and test the pic16f876, most of time, it works fine. but sometime when I turn on the power switch, it was in wrong state(wrong output). I shut it down then turn it on again, it will have the correct output. what may cause that? thanks a lot! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Sep 26, 2006 3:54 pm |
|
|
Quote: | But sometime when I turn on the power switch, it was in wrong state(wrong output) |
Make sure you have the correct #fuses settings. Make sure you
have the ones shown in bold below:
#include <16F877.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
//====================================
void main()
{
while(1);
} |
|
|
microccd
Joined: 08 Aug 2006 Posts: 10
|
|
Posted: Tue Sep 26, 2006 4:03 pm |
|
|
the following is what i'm using, are they correct?
Code: |
#include <16f876.h>
#device ICD=TRUE
#fuses HS,NOWDT,NOLVP,PUT
#use delay(clock=20000000) |
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Sep 26, 2006 4:13 pm |
|
|
Did you read my post ? Look at the item shown in bold below.
Put it in your code !
#include <16F877.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000) |
|
|
microccd
Joined: 08 Aug 2006 Posts: 10
|
|
Posted: Tue Sep 26, 2006 4:23 pm |
|
|
yes, but what's the function of BROWNOUT? thank you. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
|