gnupic: help - weird intermittent resets
Subject:
help - weird intermittent resets
From:
David McNab ####@####.####
Date:
30 Jul 2005 03:14:02 +0100
Message-Id: <42EAE25D.4070200@rebirthing.co.nz>
Hi,
I'm getting a weird and frustrating problem with a pic18f252 that
intermittently resets itself.
I've reduced my test program to the bare essentials - pseudo-code is:
- clear trisc.0
- while true
- reset portc.0 # turn on piezo buzzer
- wait 1ms # long enough to click buzzer
- set portc.0 # turn off buzzer
- wait 249ms
Config:
- wdt and bor are on
- 20 MHz crystal, with 18pF caps to ground
Observations:
- pic resets at random times, varying between 1s and 20s
- pic resets much less often when I disconnect the
max232-based tty interface
- pic resets less often with much smaller progs (eg, the above
test prog written in c and compiled under ccs, as opposed to written
in forth and bloated out to 4k by the vm and support code)
- power supply is delivering rock-solid 4.85 volts
- i cannot reproduce this resetting when running the prog via gpsim
Thoughts:
- crystal is dodgy, locking up
- pic is affected by ambient electrical noise
Any ideas on cause, and fix/workaround?
--
Cheers
David