PDA

View Full Version : unexpectedly reset



mombasa
- 12th January 2017, 08:03
For my project I'm using a 18F4525 (48k.) With PBP3. I will use only 31k but the micro resets itself after a few minutes of operation. Pin 1 is permanently connected to the positive. WDT disabled. In the program I use a lot of GOTO and GOSUB. Could this be the cause? thanks

HenrikOlsson
- 12th January 2017, 08:21
You can poll the RCON register and see if it gives you a hint of what caused the reset. The most likely cause however is that you end up at a RETURN without a prior GOSUB.

/Henrik.

mombasa
- 12th January 2017, 11:44
Henrik thanks for your help. I discovered that I had started many GOSUB inside of GOTO and never found its RETURN. The stack had too many "orphaned" address "and then the micro doing strange things, and often went in reset.