1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

How to use debugger with PIC microcontroller

Discussion in 'Microcontrollers' started by Flyback, Apr 21, 2017.

  1. Flyback

    Flyback Well-Known Member

    Joined:
    Jan 5, 2007
    Messages:
    1,998
    Likes:
    34
    Hello,

    Our remote software engineer wants us to run some debug code on our controlled lighting system.
    There is a problem with it and he says if we use the debugger it will help us diagnose where in the software its going wrong.
    The micro is PIC18F26K20.
    He says we should connect up to pin 14 (TX) and gnd at the micro.

    We should then run wires from these pins to the USB port of a laptop.

    He says we will also need a “serial data to file” program, and he says he uses “coolterm, so i guess we have to buy/download that?

    Do you know what program we need to use to capture the debug data?...is it MPLAB IPE v3.26? ...he has written us the code that we need to load for the purpose....we loaded the hex file no problem.

    However, what do we do next?

    Do we need to set up MPLAB IPE in debug mode or something?
     
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,251
    Likes:
    911
    Location:
    Rochdale UK
    I seems like a debug solution used in the Arduino environment...

    Every now and they stuff specific data down the serial port to a terminal... Any terminal program will work.. Personnaly I use teraterm or Putty... Both are free to use.. All you will see is ascii data on the terminal screen... You will, however, need a ttl to USB convertor... About £6 on ebay...
     
    Last edited: Apr 21, 2017
    • Like Like x 1
  3. Colin

    Colin Member

    Joined:
    Sep 25, 2003
    Messages:
    397
    Likes:
    22
    Location:
    Australia
    It's just like thinking a CRO will solve your problem.
    You should have never got to the stage of having a problem.
    Find out where the problem is located by simplifying your program and/or by adding a subroutine that gets called and either outputs a blinking LED or a tone.
    This will let you know if the micro has reached the particular location.
    This is the way to "home-in,"
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Little Ghostman

    Little Ghostman Well-Known Member Most Helpful Member

    Joined:
    Jan 7, 2011
    Messages:
    3,737
    Likes:
    433
    Location:
    SCOTLAND

    Flyback has the guy written in a debug code? Sounds like its set up to spit out information. How come he wont debug it with the source code? Depending what the problem is, seems to make more sense if you can see registers and set break points.

    Oh and I second putty or terra term, both good programs and free. The save file thing makes me think he wants the output? is that correct?
     

Share This Page