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 support@ccsinfo.com

power no reset, how can I write this into my program?

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







power no reset, how can I write this into my program?
PostPosted: Wed Mar 19, 2003 8:25 am     Reply with quote

Hello
Firstly I think I should explain, I am a student tiring to teach myself how to program a PIC 16F877 and part of a project. I have now got most of the program working but the rs232 is a problem. If the circuit is reset i.e. the power turned off and on. The PIC does not transmit data, although a newly programmed PIC works fine. Iím sure this is because the program does not reset. But cant find much info on POR functions, is there one?

P.S. How do you use it?
___________________________
This message was ported from CCS's old forum
Original Post ID: 12834
PCM programmer



Joined: 06 Sep 2003
Posts: 20335

View user's profile Send private message

Re: power no reset, how can I write this into my program?
PostPosted: Wed Mar 19, 2003 12:58 pm     Reply with quote

:=Hello
:=Firstly I think I should explain, I am a student tiring to teach myself how to program a PIC 16F877 and part of a project. I have now got most of the program working but the rs232 is a problem. If the circuit is reset i.e. the power turned off and on. The PIC does not transmit data, although a newly programmed PIC works fine. Iím sure this is because the program does not reset. But cant find much info on POR functions, is there one?
:=
-----------------------------------------------------------
Try running the following test program and see if it works.
Make sure that you use these fuse settings. That's important.
The only one that you should change is the "HS". If you're
running at 4 MHz, then change it to "XT".

I think that your problem could be fixed by the BROWNOUT
fuse, or, possibly by the NOLVP fuse. Try this program and
see. I tested it on my demo board, and I can switch the
power on and off quickly, and I get "Hello World" every time.
(It also gives one garbage character at the beginning, but
I'm not concerned about that for this test).

#include "c:\Program Files\Picc\Devices\16F877.h"
#fuses HS, NOWDT, NOPROTECT, PUT, BROWNOUT, NOLVP
#use Delay(clock=8000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)

//====================================================

void main()
{

printf("Hello world\n\r");

while(1);
}
___________________________
This message was ported from CCS's old forum
Original Post ID: 12843
nigel
Guest







Re: power no reset, how can I write this into my program?
PostPosted: Thu Mar 20, 2003 4:55 am     Reply with quote

:=:=Hello
:=:=Firstly I think I should explain, I am a student tiring to teach myself how to program a PIC 16F877 and part of a project. I have now got most of the program working but the rs232 is a problem. If the circuit is reset i.e. the power turned off and on. The PIC does not transmit data, although a newly programmed PIC works fine. Iím sure this is because the program does not reset. But cant find much info on POR functions, is there one?
:=:=
:=-----------------------------------------------------------
:=Try running the following test program and see if it works.
:=Make sure that you use these fuse settings. That's important.
:=The only one that you should change is the "HS". If you're
:=running at 4 MHz, then change it to "XT".
:=
:=I think that your problem could be fixed by the BROWNOUT
:=fuse, or, possibly by the NOLVP fuse. Try this program and
:=see. I tested it on my demo board, and I can switch the
:=power on and off quickly, and I get "Hello World" every time.
:=(It also gives one garbage character at the beginning, but
:=I'm not concerned about that for this test).
:=
:=#include "c:\Program Files\Picc\Devices\16F877.h"
:=#fuses HS, NOWDT, NOPROTECT, PUT, BROWNOUT, NOLVP
:=#use Delay(clock=8000000)
:=#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
:=
:=//====================================================
:=
:=void main()
:={
:=
:=printf("Hello world\n\r");
:=
:=while(1);
:=}


Thanks for the advice. Have now changed the fuse setting on my program and it works perfectly. Thanks Again
___________________________
This message was ported from CCS's old forum
Original Post ID: 12865
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