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

wrong state of pic16f876

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



Joined: 08 Aug 2006
Posts: 10

View user's profile Send private message

wrong state of pic16f876
PostPosted: Tue Sep 26, 2006 3:40 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Sep 26, 2006 3:54 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Sep 26, 2006 4:03 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Sep 26, 2006 4:13 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Sep 26, 2006 4:23 pm     Reply with quote

yes, but what's the function of BROWNOUT? thank you.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Sep 26, 2006 4:42 pm     Reply with quote

Download the Microchip reference manual on the PIC reset module:
http://ww1.microchip.com/downloads/en/DeviceDoc/31003a.pdf
Read about Brownout on page 8.
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