How does everyone debug their code?


Closed Thread
Results 1 to 31 of 31

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    There is several way indeed. Some use Proteus, some MPLAB sim, some use Serial communication (and/or ICD like Pickit 2 or MicroCode ICD), or still some LEDs or a LCD.

    What's the best method? Hard to tell, for me a blend mix of everything above (less Proteus as I don't trust it) do a really good job. And then, it really depend where I am in the development stage and how big the "bug" is.

    An ICD tells you exactly what happen in your code in real life, and more, it give you ALL internal register status, down side, they're usually a bit slow.

    HTH
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Hi,

    Steve is right ... ICD2 or 3 really are great tools, Consider Pickit too.

    16F690 not supported for debug ???

    FALSE !!! for 30 Euros at Farnell, you get the 16F690-ICD Debug adapter ...

    µChip ref AC 162061.

    Then just

    1) plug
    2) play
    3) Enjoy ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    You're kidding!

    In their wisdom the authors of PBP gave you a DEBUG command which can be directed out to any spare available PIC pin...

    Add a penny Resistor and you're communicating with your PC.

    Can it get any simpler?

  4. #4
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    You're kidding!

    In their wisdom the authors of PBP gave you a DEBUG command which can be directed out to any spare available PIC pin...

    Add a penny Resistor and you're communicating with your PC.

    Can it get any simpler?
    This sounds *just* the job...have you some linkage I can consume please?

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    The linkage is to your PBP Manual... use the really complex schematic provided in the DEBUG section.

  6. #6
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    The linkage is to your PBP Manual... use the really complex schematic provided in the DEBUG section.
    Whoop...there it is! (with a whopping one component count)

    Can someone talk me through the circuit? (just kiddin')

    I'm so excited, I'm actually thinking** about getting a round in.

    Many thanks,
    Hank.

    ** ....I've now thought about it - maybe next time!

  7. #7
    Join Date
    Jan 2008
    Location
    Pennsylvania
    Posts
    113


    Did you find this post helpful? Yes | No

    Default Debugging code

    Hank, it sounds like something similiar to what I have been working on as well with regards to working with an ADC in value. I've been using a serial connection to my 16F877/16F877A. Just like you at first I had a little LED turn on with my ADC value coming in from a pressure transducer. I set it up to turn on portc.0 at 1 psi then portc.1 at 3 psi etc... Like you said that just confirmed it worked. The real work was in taking the value and converting them to a PSI value. I got some great help with that calculation and ported my actual PSI to the serial port so I could see the actual value. I had a tone of SEROUT2 commands dumping everything to a hypertermial session.

    I have the schematic for the connection with the max232 rs232 chip if you need it.

    David

Similar Threads

  1. N-Bit_MATH
    By Darrel Taylor in forum Code Examples
    Replies: 38
    Last Post: - 16th December 2010, 14:48
  2. debug not working with MPASM assempler
    By santamaria in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 4th March 2009, 07:51
  3. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  4. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  5. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts