At the top of your program, before anything else ...
Send the value of the RCON and STKPTR registers to an LCD or serial interface to the PC.
Compare the values to table 4-3 in the datasheet.
Then you will know what caused the reset.
At the top of your program, before anything else ...
Send the value of the RCON and STKPTR registers to an LCD or serial interface to the PC.
Compare the values to table 4-3 in the datasheet.
Then you will know what caused the reset.
DT
Hi Darrel,
I have put this code at the beginning of the program (really there is some register inizialization before):
debug "RCON ",#RCON," - STKPTR ",#STKPTR,13,10
RCON.0=1
RCON.1=1
When I power on the board I see "1 RCON 28 - STKPTR 0" so POR and BOR bit are cleared.
Then I leave the board running and when the problem occours I have a reset and I see "RCON 31 - STKPTR 0".
What does it means ? I have difficulties to guess.
My God .... sorry I have bored you. I found a variable not initialized in my code. There is nothinhg to explain. The program is doing what I wrote. They were not real resets, but jumps to the beginning of the program.
Sorry again, but I was becoming crazy ...
Thanks Darrel. It is watching to RCON that I realized they were not Resets.
Marco
Bookmarks