CaptainBoing
 Guru
 Joined: 07/09/2016 Location: United KingdomPosts: 2171 |
| Posted: 04:11pm 09 Oct 2022 |
|
|
|
Hello Phil
Hangs like this; I immediately suspect the internal voltage reference (1.8V) use a 47uF Tantalum for this and parallel it with a good quality 22nF ceramic disc to give as clean-a-reference as possible (don't know the pin numbers for you PIC - sorry)
Big thing that struck me, no mention of a WATCHDOG timer(?). I think your plan of attack should be isolating the cause of the hangs, but next is recovery asap. Use a watchdog in your main loop, nothing too aggressive. If this doesn't reset the thing then I suspect deeper problems. External reset is a nice to have but should largely be un-necessary. The WATCHDOG is a software tweak that should give instant results. You can use a system variable to detect the reason for startup and log it if it was caused by the watchdog timer
good luck!
h |