Debugging with MPLab

Discussion in 'General Electronics Chat' started by Guinness1759, Jan 6, 2011.

  1. Guinness1759

    Thread Starter Member

    Dec 10, 2010
    How do I watch variable values in real time in MPLab? I tried the View -> Watch and entered in the variables, but they are not updating. Do I need to run MPLab in Debug mode to view these variables in real time?
  2. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    You need to compile with Debug and set a breakpoint. Variables will only update when a breakpoint is reached or CPU is halted.

    To update variables in "real time", you will need some kind of debug terminal like terminal software on your PC attached through the PICs serial output or to an LCD display. You would just write the values to your "debug" terminal".
    Guinness1759 likes this.
  3. maxpower097

    Well-Known Member

    Feb 20, 2009
    I think your gonna need an ICE to do that in real time while the chips banging. Other wise you can go into debug mode and it will update the variables after a breakpoint or on pause in simulation.
    Guinness1759 likes this.