Using ICD2 to Program from inside the IDE

Discuss the Integrated Development Environment (IDE)

Moderators: David Barker, Jerry Messina

Post Reply
dman776
Posts: 115
Joined: Mon May 28, 2007 3:59 pm
Location: Texas

Using ICD2 to Program from inside the IDE

Post by dman776 » Sat Mar 15, 2008 3:08 am

Here is a command line utility that will drive the ICD2!
Seems to work pretty good.

http://piklab.sourceforge.net/

It does require this lib to function...
http://libusb.wiki.sourceforge.net/

then, just add a new programmer into SF IDE (ie. Microchip ICD2)
program name: piklab-prog.exe
parameters: -p icd2 -d $target-device$ -t usb -c program $hex-filename$

I know it doesn't support debugging, but, it saves time so that I no longer have to switch to MPLAB to import the hex file and then program it.

enjoy

User avatar
octal
Registered User
Registered User
Posts: 586
Joined: Thu Jan 11, 2007 12:49 pm
Location: Paris IDF
Contact:

Post by octal » Sat Mar 15, 2008 8:58 am

Hi dman776,

For development purpose, the piklab's ICD2 utility works fine, but you must be carefull: with some PICs, some users on forums reported having CONFIG word wrongly programmed. This is especially important for PROTECTION FUSES ;)

If I had to recommand a programmer, if you do not need debug possibility, is to buy instead a PikKit2 from Microchip. It costs less than 30 euros, and Microchip provides a command line utility to manage it. It's also very well supported and integrated in MPLab, and it uses the same connectors as ICD2 (if you need later to use this one to debug final program).

Regards
octal

User avatar
RadioT
Registered User
Registered User
Posts: 157
Joined: Tue Nov 27, 2007 12:50 pm
Location: Winnipeg, Canada

Post by RadioT » Sat May 10, 2008 1:49 pm

Hi Octal,

What would you recommend if you had to do debugging? I am using the ICD2 in MPLAB but I hit the 64K limit.

-Tom

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Sat May 24, 2008 7:38 pm


User avatar
RadioT
Registered User
Registered User
Posts: 157
Joined: Tue Nov 27, 2007 12:50 pm
Location: Winnipeg, Canada

Post by RadioT » Sun May 25, 2008 12:24 am

That's Good News!! Thanks, David!

-Tom

dman776
Posts: 115
Joined: Mon May 28, 2007 3:59 pm
Location: Texas

Post by dman776 » Sun May 25, 2008 4:01 am

Brilliant work! THANK YOU!

xor
Posts: 286
Joined: Sun Nov 05, 2006 1:15 pm
Location: NYC
Contact:

Post by xor » Sun May 25, 2008 8:51 pm

Dave... This is great news!

Warren

User avatar
RadioT
Registered User
Registered User
Posts: 157
Joined: Tue Nov 27, 2007 12:50 pm
Location: Winnipeg, Canada

Post by RadioT » Sat Jun 28, 2008 9:15 pm

OK...downloaded the new SF version 2.1.0.0...followed Wiki instructions to set up in MPLab...builds, programs and run OK using MPLAB and ICD 2...but can't get the breakpoints to work in the .bas file listing, just the .asm file listing. It would be nice to have them working on the .bas listing.

Also, I can see what the basic variables are in the Watch window along with the "raw" assembler variables - I haven't had a problem with not finding a variable but it's just unexpected.

Any suggestions? I'm using MPLab 8.1, 18F66J16 (which requires no RAM space to be reserved). I tried it with a program that uses 96K of program space and another that used 10K.

-Tom

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Mon Jun 30, 2008 2:38 pm

You will need to send me a sample program showing this problem. Include all your MPLAB project files. Importantly, email

SFBasis.mtc
TLSFBasic.ini

which can be found in your MPLAB "MTC Suites folder". For example,

C:\Program Files\Microchip\MPLAB IDE\Core\MTC Suites

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Tue Jul 01, 2008 1:48 pm

Your need to take a look at the following post

http://www.sfcompiler.co.uk/forum/viewtopic.php?t=721

particularly with reference to:
The problem is with your "TLSFBasic.ini" file, which is documented here:

http://www.sfcompiler.co.uk/wiki/pmwiki ... r.MPLABICD

under "Swordfish as a Language Toolsuite". In short, you need to download the new files from here

http://www.sfcompiler.co.uk/wiki/pmwiki ... User.MPLAB. Copy to your MTC folder and verify that "TLSFBasic.ini" now has "Debug=COF" AND NOT "Debug=COD"
Also note:
David, I got it to work. I had to run Swordfish.reg again after updating the .ini & .mct files
Let me know how it goes...

User avatar
RadioT
Registered User
Registered User
Posts: 157
Joined: Tue Nov 27, 2007 12:50 pm
Location: Winnipeg, Canada

Post by RadioT » Tue Jul 01, 2008 2:29 pm

Hi David,

Changing "COD" to "COF" did it! I had assumed that the change would have been in the file when I did the new version download, I didn't realize I would still have to make the change manually.

Thanks again, this is fantastic!!

73's,

de Tom

Post Reply