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

18lf4620 resets on it's own

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



Joined: 03 Nov 2004
Posts: 13

View user's profile Send private message

18lf4620 resets on it's own
PostPosted: Tue Sep 26, 2006 3:06 pm     Reply with quote

Hello all,

I have a 18lf4620 and it resets on it's own. I used the reset_cause() func and it tells me the WDT is responsible. I have NOWDT set in the fuses. Thanks in advance for any help, here is the code:
Code:
#include <18f4620.h>
#include <stdlib.h>
#fuses NOLVP, NOWDT, EC_IO
#use delay (clock=25000000)
#use rs232 (baud=115200, xmit=PIN_E1, rcv=PIN_E0)


void main (void)
{
   int8 data;
   int8 res_data;

   delay_ms (2000);
   
   res_data = restart_cause ();
   
   if (res_data > 0)
   {
      printf ("reset cause = %u", res_data);
      putc (0x0D);
      putc (0x0A);
   }


   do
   {
      if (kbhit ())
      {
         data = getc ();
         printf ("data = %x", data);
         putc (0x0D);
         putc (0x0A);
      }
   }
   while (1);
}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

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

1. What's your compiler version ?

2. What value is displayed for the restart cause ?
TEK66TIM



Joined: 03 Nov 2004
Posts: 13

View user's profile Send private message

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

Thanks for the quick reply, I think I found my problem, I use the Melabs Epic programmer and just updated the programmer software. The config programming was turned off, I set this to on and re-programmed the chip, it looks like it's working.
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