View previous topic :: View next topic |
Author |
Message |
TEK66TIM
Joined: 03 Nov 2004 Posts: 13
|
18lf4620 resets on it's own |
Posted: Tue Sep 26, 2006 3:06 pm |
|
|
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
|
|
Posted: Tue Sep 26, 2006 3:18 pm |
|
|
1. What's your compiler version ?
2. What value is displayed for the restart cause ? |
|
|
TEK66TIM
Joined: 03 Nov 2004 Posts: 13
|
|
Posted: Tue Sep 26, 2006 3:25 pm |
|
|
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. |
|
|
|