PDA

View Full Version : Pbp + Mplab + Icd2



eduardojx
- 26th December 2005, 20:05
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

Bruce
- 26th December 2005, 23:25
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.

ardhuru
- 27th December 2005, 14:59
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

chris vp
- 15th July 2009, 16:10
@ 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

Bruce
- 15th July 2009, 17:09
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.

chris vp
- 15th July 2009, 17:36
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.

Bruce
- 15th July 2009, 18:04
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.

chris vp
- 16th July 2009, 17:19
Bruce :confused:

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

Bruce
- 16th July 2009, 17:36
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}

chris vp
- 17th July 2009, 03:54
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