View previous topic :: View next topic |
Author |
Message |
curious Guest
|
PIC16877 gets stuck in the main |
Posted: Mon Oct 11, 2004 6:33 am |
|
|
Hiiii everybody.
I have a circuit with 16F877.
I use 20 Mhz cyristal frequency.
But, sometimes, before going to any interrupt
routine, in the main, watch dog is timing out and reseting the PIC for 1 or 2 or 3 times. (ramdomly differs) Then working fine.
But, for push button resets or power-on resets, rarely it is the same as above. it is working properly.
For sometimes, there is no WDT reseting and everything is going on perfectly.
Changing WDT time out peryot (18, 36 ... ms etc) is not making any difference.
I definetely know that it is sticking in the main. there is no any infinite loop in the main.
If it jumped from the main to the first ISR or any other ISR, some LEDs and LCD display would show any characters that are normally seen on it.
If I remove WDT in the code, it is coming to the ISRs, but it gets stuck for some times.
What should I do?
HELPs complitely appreciated.
curious |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Mon Oct 11, 2004 9:06 am |
|
|
You should post a small sample program that demonstrates the problem as well as the compiler version. Make sure to use the code button when posting code. |
|
|
curious Guest
|
solved |
Posted: Mon Oct 18, 2004 6:54 am |
|
|
hiii Mark....
I use PCM ver 3.155.
problem solved.
I just put the line enable_interrupts(global); in do/while loop (in the main)
it was like this :
....... // some lines
ext_int_edge(L_TO_H);
enable_interrupts(INT_EXT);
..... // some lines
enable_interrupts(global);
do{
;
} while (1)
and made them like this....
....... // same as above
ext_int_edge(L_TO_H);
enable_interrupts(INT_EXT);
..... // same as above
do{
enable_interrupts(global);
} while (1)
Startup problem is vanished completely !
Is there any body who can explain this ?
curious |
|
|
Guest
|
|
Posted: Mon Oct 18, 2004 8:06 am |
|
|
Quote: | ...
3.122 The PCW IDE has new customizable editor functions
3.125 A problem with interrupts getting disabled is fixed
3.125 Compiler work-arounds added for the latest PIC18 errata
...
|
I thought this problem was fixed way behind... |
|
|
curious Guest
|
int. |
Posted: Tue Oct 19, 2004 6:14 am |
|
|
thanks guest... |
|
|
|