Pbp + Mplab + Icd2


Closed Thread
Results 1 to 10 of 10
  1. #1
    eduardojx's Avatar
    eduardojx Guest

    Question Pbp + Mplab + Icd2

    Have someone used PBP, MPLAB and ICD2 together? I need use a debbuger mode of ICD2 and have tried put on the microcontroler in debug mode (trhough this line __CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L & _DEBUG_ON_4L in .inc file, for example) but nothing at now.
    Please, someone have any idea? How I do to work ICD2 in this mode?

    Best Regards,

    eduardojx

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    You have to instruct PBP to reserve space for ICD variables. Look in your PBP directory for ICDDEFS.BAS (or one specifically for the target processor you're using). There are several. If there isn't one for the target you're using, it's simple enough to create your own.

    Include one for the target processor you're compiling for.

    INCLUDE "ICDDEFS4.BAS" would be for the 18F252/258/452/458 series.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default ICD2 against software ICD

    Hi,

    I too have been seeing several clone designs for the ICD2, and was toying with the idea of building one.

    This is where I need some advice; I currently use the ICD built into the Microcode Studio. What exactly are the advantages of using a hardware ICD?

    Also, can one use the hardware ICD2 with Microcode Studio effectively, or must one shift to MPLAB to achieve its fullest potential?

    Regards,

    Anand

  4. #4
    Join Date
    Jun 2009
    Posts
    17


    Did you find this post helpful? Yes | No

    Default

    @ Bruce

    I had read one topic here on how to use PBP in MPLAB under debug mode.
    He said to include "ICDDEFS*.bas for the program to run in debug mode under MPLAB.
    In relation to your comment above
    1.How can we create one?
    2.Do we need to see some specs from the datasheet?

    Bruce if you can provide some steps and samples on how to create one it would be more easy for me as a newbie to understand.

    Since lastweek Im planning to use mplab debugging feature for PIC18F2550 and 4550 can you give one sample for either of this pics in creating ICDDEFS?

    Thanks & regards

    Chris

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


    Did you find this post helpful? Yes | No

    Default

    Open ICDDEFS7.BAS

    This one reserves space for ICD vars for the 18F2220/2320/4220/4320.

    ICDRESERVED12 VAR BYTE(12) $1f4

    Now open your ICD2 help file, and look under "Resources Used By MPLAB ICD 2".

    Locate the 18F2220, and look under the "File Registers Used" column. See where it
    shows 0x1F4-0x1FF?

    So all the above is doing is reserving 12 bytes of RAM from 0x1F4-0x1FF.

    Now scroll down a bit and look for the RAM space you need to reserve for the 2550
    and 4550. Now create your new file with ICDRESERVED12 VAR BYTE(12) followed
    by the start address shown in the help file.

    I don't use ICD2 so I can't offer much help beyond this point, but that's all they appear
    to be including in these files.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #6
    Join Date
    Jun 2009
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Thanks

    Thanks Bruce,

    Just some background...In cooping with freinds who is using the other B compiler and ICD2. With some inputs from Charles L on SIM I have some small feel on how to go on to this. And now I read about the gentleman from central America (forget his name...still searching in my save forum folder)writing about MPLAB, ICD2 and PBP..and the ICDDEFS was he recommended to be place at the top of PBP program so it can run on debug mode in MPLAB environment.

    Ill try to work on your suggestion tomorrow night after office & hope to feedback on the update of this.

  7. #7
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Yes you want defs at the top so they get included before anything else. Let me know how
    you get on with ICD2. Maybe I'll knock the dust off mine & give it a try some day.

    Haven't used mine in several years. Good luck.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  8. #8
    Join Date
    Jun 2009
    Posts
    17


    Did you find this post helpful? Yes | No

    Question How about this one

    Bruce

    I didnt get to test the debugger mode of ICD2 using your recommendation coz my proto board was not working well maybe need to recheck the connections.

    But anyway...I just observed the format on how the 876 & 877 series ICDDEFS code vs the Program/data memory used was coded..see below.

    Any thought about this why? I understand the "reserving 12 bytes of RAM from 0x1F4-0x1FF" on the PIC18F2550 series" but this one seems different.
    Am I correct that it is 11bytes of ram was reserved? Why it is written "ICDRESERVED1 & ICDRESERVED11".

    Just some curiosity Bruce hope you can answer my questions in here still.

    Thanks in Advance

    Chris

    '************************************************* ***************
    '* ICDDEFS.BAS *
    '* *
    '* By : Leonard Zerman, Jeff Schmoyer *
    '* Notice : Copyright (c) 2003 microEngineering Labs, Inc. *
    '* All Rights Reserved *
    '* Date : 05/28/03 *
    '* Version : 2.44 *
    '* Notes : Reserve space for ICD variables - 16F876(A)/877(A)*
    '************************************************* ***************

    DEFINE ICD_USED 1

    ICDRESERVED1 VAR BYTE $70
    ICDRESERVED11 VAR BYTE(11) $1E5

    '*----------------------* EOF ICDDEFS.BAS *---------------------*


    from the help file:

    PIC16F876/876A 0x70, 0xF0
    PIC16F877/877A 0x1F00-0x1FFF 0x170, 0x1F0 0x1E5-0x1EF

  9. #9
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Chris,

    Check with meLabs on this one. Like I mentioned before, I have an ICD2, but I haven't
    used it in several years.

    I find it a lot less trouble & work to just build the circuit & test it directly rather than use
    some in-circuit debug hardware that eats up my time/resources.

    I'm not saying in-circuit debug is a bad thing - it's just that I've never been able to justify
    the additional time, effort, or cost requirements VS simply testing my code on the physical
    hardware in real-time operation, on the target hardware.

    I have just never had a reason to step line-by-line through any code that I already know
    what it's supposed to be doing. I think it's great for learning, but it's just not something I
    need for what I do here.

    I will run some sections of code through MPSIM just to find precise timing for some routines
    or functions, but I just don't need ICD, so I don't use it, and can't offer much help...;o}
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  10. #10
    Join Date
    Jun 2009
    Posts
    17


    Did you find this post helpful? Yes | No

    Thumbs up Thank you

    Thanks Bruce....

    I got your point & with the idea you presented seems was logical enough coz right now I find it easy to plug the chip into the demo board to debug the program.
    Your insight just supported my thought on ICD debugging.

    Regards

    Chris

Similar Threads

  1. MPLab and Picstart plus with PBP...
    By gregcan in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th October 2009, 14:36
  2. MPLAB and PBP ...
    By Acetronics2 in forum Off Topic
    Replies: 4
    Last Post: - 28th August 2008, 20:51
  3. pbp --> mplab broken again
    By kenif in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 11th December 2006, 18:57
  4. PBP in MPLAB
    By zagisrule! in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 29th December 2005, 01:58
  5. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2005, 23:30

Members who have read this thread : 1

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