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

PIC16877 gets stuck in the main

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







PIC16877 gets stuck in the main
PostPosted: Mon Oct 11, 2004 6:33 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Mon Oct 11, 2004 9:06 am     Reply with quote

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
PostPosted: Mon Oct 18, 2004 6:54 am     Reply with quote

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








PostPosted: Mon Oct 18, 2004 8:06 am     Reply with quote

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... Confused Question
curious
Guest







int.
PostPosted: Tue Oct 19, 2004 6:14 am     Reply with quote

thanks guest...
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