View previous topic :: View next topic |
Author |
Message |
Chibouraska
Joined: 11 May 2007 Posts: 57 Location: Montreal,Canada
|
PIC18F46J11 Reset problem |
Posted: Fri Feb 12, 2010 1:12 pm |
|
|
Hi!
I'm working on a project using PIC18F46J11 MCU, everything goes good but the micro keeps resetting after 2 minutes and 50 seconds(about). I tried playing around with fuses, taking some out but I still get the same problems.
The MCU is well decoupled with .1u caps. There is no WDT enabled. Any idea would be well appreciated.
thanks !
AC
-------------- |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Feb 12, 2010 1:24 pm |
|
|
Post a very small test program that shows the problem. For example,
you could have a program that displays "Hello World" on a terminal,
and then have it stop in a continuous while(1) loop at the end of main().
If the program is resetting, it will display "Hello World" over and over
again, every 2 minutes and 50 seconds.
Try that and post the results.
The program that you post must be small, and it must compile with
no errors.
Also post your compiler version. |
|
|
Guest
|
|
Posted: Fri Feb 12, 2010 1:56 pm |
|
|
Thanks for your help!
OK i made a small project using the same hardware (same PCB)
Code: | void main {
fprintf(UART1,"RESETTING !!!");
while (TRUE) {
fprintf(UART1,"LOOPING !");
delay_ms(1000);
}
} |
And the same thing happened after 2 mins 50 secs i see RESETTING !!!
Im a bit confused it looks like a hardware problem but why does it reset
at same interval each time, Thanks
AC
----------- |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Feb 12, 2010 2:10 pm |
|
|
The program that you post must be small, and it must compile with
no errors.
You posted a code fragment. Post a complete, compilable program.
To be compilable, it must have an #include, #fuses, #use delay,
#use rs232, etc., statements.
And also this:
Also post your compiler version. |
|
|
Chibouraska
Joined: 11 May 2007 Posts: 57 Location: Montreal,Canada
|
|
Posted: Fri Feb 12, 2010 3:00 pm |
|
|
Compiler version 4.099
Code: | #include <18F46J11.h>
#device adc=8
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz for PCM/PCH(>10mhz for PCD)
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOXINST //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#FUSES STVREN //Stack full/underflow will cause reset
#FUSES NOPROTECT //Code not protected from reading
#FUSES FCMEN //Fail-safe clock monitor enabled
#FUSES IESO //Internal External Switch Over mode enabled
#FUSES IOL1WAY //Allows only one reconfiguration of peripheral pins
#FUSES PRIMARY //Primary clock is system clock when scs=00
#FUSES NOWPCFG
#FUSES WPBEG
#FUSES WPDIS
#FUSES LPT1OSC //Timer1 configured for low-power operation
#FUSES T1DIG
#FUSES MSSPMSK7
#FUSES DSWDT2147483648
#FUSES DSWDT
#FUSES DSBOR
#FUSES RTCOSC_T1
#FUSES DSWDTOSC_INT
#FUSES WPFP0
#FUSES WPFP1
#FUSES WPFP2
#FUSES WPFP3
#FUSES WPFP4
#FUSES WPFP5
#FUSES NOCPUDIV
#use delay(clock=20000000)
#use rs232(STREAM=UART1,uart1, baud=9600)
|
Thanks!! |
|
|
Chibouraska
Joined: 11 May 2007 Posts: 57 Location: Montreal,Canada
|
|
Posted: Fri Feb 12, 2010 3:21 pm |
|
|
OK i compiled the same little program on machine that is running ver 4.104
of the compiler and i didnt get no reset of the MCU. I guess it was something
with the compiler at ver 4.099. Anybody have an idea of why ??? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Feb 12, 2010 3:42 pm |
|
|
I installed vs. 4.099 and compiled your program, and ran it on a 18F24J11
on a PicDem2-Plus board. I don't have a 18F46J11, but the 18F24J11 is
in the same family. It worked. I changed the loop delay to be every
60 seconds (1 second was too short). Here is the display after several
minutes:
Quote: |
RESETTING !!!LOOPING !LOOPING !LOOPING !LOOPING !LOOPING !
LOOPING !LOOPING !LOOPING !LOOPING !LOOPING ! |
This is with vs. 4.099. |
|
|
Chibouraska
Joined: 11 May 2007 Posts: 57 Location: Montreal,Canada
|
|
Posted: Fri Feb 12, 2010 9:56 pm |
|
|
Thanks PCM_Programmer, anyway it works for me using the last version
of the compiler, it is possible that there was an issue with this device(18F46j11) because it's a recent one, i don't know, but i would like to.
I will get a 18F24j11 device to try. thanks again!
AC
---------- |
|
|
|