At 07:12 PM 11/17/02 -0800, you wrote: >After chasing a random crashing problem on a 16F877 project for days now, >I've run dry of troubleshooting strategies (not that I had very many >sensible ones to begin with). In short, my project will perform certain >operations flawlessly sometimes, then fails spectacularly on the 'n'th >attempt, with 'n' generally residing between 1 and 10. My inexperience has >likely led me to commit some programming faux pas I just can't spot. To >help get me unstuck, would any of you gurus be willing to complete the >phrase; > >"When my program blows up randomly, the first thing I look for is..." First figure out if it is hardware or software (sometimes it is a combination of the two, unfortunately, but this is rare). If it is software, this sort of behavior is usually related to interrupts (incomplete restoration of pre-interrupt state), or un-initialized variables, including pointers. Usually good design will prevent this sort of thing, and just as well as it can be very hard to track down. Sometimes not setting the carry flag explicitly if there are multiple paths to a given routine can cause this sort of problem. If hardware, try to narrow it down to internally created problems vs. externally (including outputs and inputs of your project). For example, if you are switching a 3HP motor with a contactor and a relay, try disconnecting the motor, then the contactor, then the relay and replacing the latter with an LED. There are also the obvious (but not when they are thwarting you) bad solder joints, pins not properly inserted into sockets, poor supply bypassing, amplifiers and voltage regulators oscillating and such like. And EMI/RFI. Inputs not connected and even a power pin not connected are other possibilities. Best regards, Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads