View previous topic :: View next topic |
Author |
Message |
sraiderk
Joined: 09 Feb 2005 Posts: 48
|
16F877 resets itself? |
Posted: Fri Mar 04, 2005 6:39 am |
|
|
I use the 16f877 with version 3.212 . I use timer0,1,2 interrupts and also
rs232 receive interrupts. Not always, But sometimes pic resets itself. Is it normal? what can be the reason for this. My code is really big. it makes multifunctions. I hope this error coming from rs232. Please looking this view. Thanks a lot up to now. Byee... |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Fri Mar 04, 2005 6:48 am |
|
|
No
Quote: | what can be the reason for this | WDT timeout, brownout, noise, bad code, and the list goes on
Quote: | My code is really big. it makes multifunctions | Shouldn't cause any resets because of this but will make it more difficult to determine.
The fact that you said RS232, I would look to see that I am not overrunning any buffers. Also make sure the the WDT is off and that you specified NOLVP in your fuses. |
|
|
sraiderk
Joined: 09 Feb 2005 Posts: 48
|
|
Posted: Fri Mar 04, 2005 7:04 am |
|
|
Thanks Mark for your reply. I accept your idea. I use the fuse like the following.
#fuses HS, NOPROTECT, BROWNOUT,LVP,WRT
My question I don't know the meaning in using
LVP:Low Voltage Programming enable bit ? |
|
|
sraiderk
Joined: 09 Feb 2005 Posts: 48
|
|
Posted: Fri Mar 04, 2005 7:07 am |
|
|
Thanks Mark for your reply. I accept your idea. I use the fuse like the following.
#fuses HS, NOPROTECT, BROWNOUT,LVP,WRT
My question I don't know the meaning in using
LVP:Low Voltage Programming enable bit ? |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Fri Mar 04, 2005 9:17 am |
|
|
It is doubtful then you are using it. You need to change LVP to NOLVP. If you don't, a change on the LVP pin will cause problems. |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
Posted: Fri Mar 04, 2005 10:16 am |
|
|
Also check the C/Asm list file. Near the top, the compiler will tell you how many stack locations your program will use. The 16 series chips only have an 8 level stack. If your program is trying to use more than 8 locations, it will hang and eventually the watchdog will reset the pic. This may be the cause of what you're seeing. |
|
|
|