1. Find some way to verify that your stack depth REALLY IS what you = think it must be below. The PICs don't do a stack overflow the way a PC = does... at least in that series, it's messy. 2. Make sure code that should not be re-entrant (calling itself) isn't. This gets more difficult when you realize that you aren't trying to = catch just a recursive call, per se, but also to catch an accidental branch back into yourself becaue your page bits were set wrong. 3. Be sure your basic algorithm is sound! Try implementing/simulating = it in C (WITH THE SAME NUMBER OF VARIABLES AND SUBROUTINES) and see if it = does what you expect. Especially important with floating-point math and = DSP, compression, and decompression work. 4. Be suspicious of RAM overlays. Try using single-purpose variables = until your problem is cleared up. 5. Component test everything. That means, take each function, dump it = on a chip with a test harness, and call it about a million times to make sure it works. 6. Failing anything else, start locking down relocatable code segments = and RAM variables to fixed addresses and REALLY verify the hell out of = EVERY page and bank select. Good luck! Matt Heck Crystal Engineering > -----Original Message----- > From: Rob Robson [mailto:danagger@TELUS.NET] > Sent: Sunday, November 17, 2002 7:12 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: [PIC]: favorite anti-blowup strategies >=20 >=20 > After chasing a random crashing problem on a 16F877 project=20 > 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=20 > perform certain > operations flawlessly sometimes, then fails spectacularly on the 'n'th > attempt, with 'n' generally residing between 1 and 10. My=20 > inexperience has > likely led me to commit some programming faux pas I just=20 > can't spot. To > help get me unstuck, would any of you gurus be willing to complete the > phrase; >=20 > "When my program blows up randomly, the first thing I look for is..." >=20 > Thanks in advance! >=20 > Rob Robson >=20 > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu >=20 >=20 >=20 -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads