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

Why is my 16F628 Resetting?

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







Why is my 16F628 Resetting?
PostPosted: Mon Nov 19, 2001 1:14 am     Reply with quote

The same sort of code on an earlier version
of the compiler worked fine on a 16F84.


On the 16F628, regardless of fuse settings,
and other settings.
#fuses INTRC_IO,NOWDT,NOLVP,MCLR,NOPROTECT,NOPUT,NOBROWNOUT
setup_timer_0(RTCC_INTERNAL);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_ccp1(CCP_OFF);
setup_ccp2(CCP_OFF);
setup_vref(FALSE);
setup_comparator(NC_NC_NC_NC);
disable_interrupts(GLOBAL);
disable_interrupts(INT_RTCC);
disable_interrupts(INT_CCP1);
disable_interrupts(INT_EEPROM);
disable_interrupts(INT_EXT);
disable_interrupts(INT_LCD);
disable_interrupts(INT_RB);
disable_interrupts(INT_TBE);
disable_interrupts(INT_RDA);
disable_interrupts(INT_COMP);
disable_interrupts(INT_TIMER1);
disable_interrupts(INT_TIMER2);

I'm using INTRC_IO, MCLR tied to Vdd externally.
I've tried disabling all interrupts. I'm using the
EPIC PICPlus Programmer from <a href="http://www.melabs.com" TARGET="_blank">http://www.melabs.com</a>
I've got solid 4.98 volts across Vdd and Vss with
a capacitor.

Simple and some complex instructions work, but certain
array accesses and printf() statements to the LCD cause
it to reset.

First I thought "Its the compiler"..
Then I thought "no", it couldn't be the compiler.
Now I'm back to wondering if its the compiler again.

Any ideas? Any reason to think it is some significant
difference between the '628 and the '84, or a problem
with 3.059 of the compiler?

Any help appreciated.
___________________________
This message was ported from CCS's old forum
Original Post ID: 1219
Paul Klissner
Guest







Re: Why is my 16F628 Resetting?
PostPosted: Mon Nov 19, 2001 1:37 am     Reply with quote

Aha! Finally. I'm using the EPIC programmer from the
command line, and it had been so long since I had
looked at the options that I didn't bother to specify
the 16F628 as the device. It required an upgrade for the
EPIC software from their site (I used beta 2.40) and
added the -d16F628 flag and whalla!

-Paul

:=The same sort of code on an earlier version
:=of the compiler worked fine on a 16F84.
:=
:=
:=On the 16F628, regardless of fuse settings,
:=and other settings.
:=#fuses INTRC_IO,NOWDT,NOLVP,MCLR,NOPROTECT,NOPUT,NOBROWNOUT
:= setup_timer_0(RTCC_INTERNAL);
:= setup_timer_1(T1_DISABLED);
:= setup_timer_2(T2_DISABLED,0,1);
:= setup_ccp1(CCP_OFF);
:= setup_ccp2(CCP_OFF);
:= setup_vref(FALSE);
:= setup_comparator(NC_NC_NC_NC);
:= disable_interrupts(GLOBAL);
:= disable_interrupts(INT_RTCC);
:= disable_interrupts(INT_CCP1);
:= disable_interrupts(INT_EEPROM);
:= disable_interrupts(INT_EXT);
:= disable_interrupts(INT_LCD);
:= disable_interrupts(INT_RB);
:= disable_interrupts(INT_TBE);
:= disable_interrupts(INT_RDA);
:= disable_interrupts(INT_COMP);
:= disable_interrupts(INT_TIMER1);
:= disable_interrupts(INT_TIMER2);
:=
:=I'm using INTRC_IO, MCLR tied to Vdd externally.
:=I've tried disabling all interrupts. I'm using the
:=EPIC PICPlus Programmer from <a href="http://www.melabs.com" TARGET="_blank"> <a href="http://www.melabs.com" TARGET="_blank">http://www.melabs.com</a></a>
:=I've got solid 4.98 volts across Vdd and Vss with
:=a capacitor.
:=
:=Simple and some complex instructions work, but certain
:=array accesses and printf() statements to the LCD cause
:=it to reset.
:=
:=First I thought "Its the compiler"..
:=Then I thought "no", it couldn't be the compiler.
:=Now I'm back to wondering if its the compiler again.
:=
:=Any ideas? Any reason to think it is some significant
:=difference between the '628 and the '84, or a problem
:=with 3.059 of the compiler?
:=
:=Any help appreciated.
___________________________
This message was ported from CCS's old forum
Original Post ID: 1221
adrian



Joined: 08 Sep 2003
Posts: 92
Location: Glasgow, UK

View user's profile Send private message

Re: Why is my 16F628 Resetting?
PostPosted: Tue Nov 20, 2001 6:41 am     Reply with quote

:=The same sort of code on an earlier version
:=of the compiler worked fine on a 16F84.
:=
:=
:=On the 16F628, regardless of fuse settings,
:=and other settings.
:=#fuses INTRC_IO,NOWDT,NOLVP,MCLR,NOPROTECT,NOPUT,NOBROWNOUT

:=I'm using INTRC_IO, MCLR tied to Vdd externally.

If you change your #fuses to NOMCLR, it will be tied to Vdd internally, so you don't need to do it externally.
___________________________
This message was ported from CCS's old forum
Original Post ID: 1247
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