Page 313 - Making PIC Microcontroller Instruments and Controllers
P. 313

DEBUGGING















                   General



                   It takes a long time to become a good  debugger It has taken me forcvet, and I am still
                   leaming and still not very good  at it. The  ploblem is that you must have a  good  under-
                   standilg of the PIC you are using and come up with a solid design. Though this may
                   seem  pretty straightforward,  it isn't, especially if you are using a new  PIC  and rhe PIC
                   16F877Awe  are discussing is new to most  ofus.
                     In plain English, this means that I really do not know how to tell  you to become a
                   good  debugger. Even so,I need to give you some  guidance  to help  you,  so I have  put
                   down everything that came to mind as I was  debuggilg the  various projects  in this book.
                   In these  paragraphs,I  have allowed myself some repetition uDder the vadous headings
                   so they can each stand alone.
                     At the end  of the chapter, I have included some  questions  and  answofi that werc the
                   result of some discussions on the Web site for another  Droiect but that are also relevant
                   to any  discussion about the 16F877A PIC.



                   Debugging  and Troubleshooting



                   Debugging is not a random  process  during which one mighl hope to get lucky. It is a
                   very carcfully thought out stratregy  to find out why a program  is not behaving the way
                   it was intended to and what needs  to be done to conecttheqoblem. Yourri  havefued
                   the  problen  only if yolt can make the  problem come back b!  undoing the  ft.   A \ag.te
                   suspicion that you might have  fixed the problem  by pressing  on a warm component  is
                   not enough to conclude  that lhe  prcblem has actually be€n solved. You must be able to
                   make the  problem  come back. This is exacdy the reason why intermittent  prcblems  are
                   so hard to nx. lt's  had  io make them come and  go on command. In other words, it is
                   harder to clearly understand the problem  because it is htermittent.


                                                                                       3t5
   308   309   310   311   312   313   314   315   316   317   318