CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Setting up CCS with PICKit2

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
trentonite



Joined: 06 Apr 2010
Posts: 7

View user's profile Send private message

Setting up CCS with PICKit2
PostPosted: Tue Apr 06, 2010 3:24 pm     Reply with quote

I've trolled the forums for a while and found one option, tried it, and failed. Does anybody have any idea on how to set up CCS to work with PICKit2?

With the method I've tried (using the cmdline thing for pickit2) it keeps saying the devicefile.dat hasn't been found, though I have clearly listed it in the environment options.

Thx
sniffer



Joined: 01 Apr 2010
Posts: 5

View user's profile Send private message

PostPosted: Tue Apr 06, 2010 7:57 pm     Reply with quote

You shouldn't have to configure CCS to use PICKit2. I've never used cmdline, all I usually do is compile the program, select the right chip on PICKit's home screen, then download the hex file and click on the 'On' button. I keep /MCLR checkbox unchecked. Hope that helps.
trentonite



Joined: 06 Apr 2010
Posts: 7

View user's profile Send private message

PostPosted: Wed Apr 07, 2010 8:07 am     Reply with quote

Yeah I've already done that and it worked fine, I guess what I'm trying to do is compile straight through CCS to the chip using the pickit2, similar to mplab. It works through mplab, but I'm not a fan of mplab what so ever.

Uploading the hex file works fine, but its just one of those annoyances for me since I know there's a way to use the cmd line but I can't figure it out Crying or Very sad, oh well. I guess I'll just stick with the hex method for now.

Thnx!
Mark W



Joined: 24 May 2009
Posts: 7
Location: Wellington NZ

View user's profile Send private message

Hex File
PostPosted: Wed Apr 07, 2010 7:01 pm     Reply with quote

Hi there,
I have the same setup and if I set the PICKIT2 to auto program everytime I compile using CCS, the program it automatically re programs my PIC.
Is this what you mean?

Cheers

Mark
trentonite



Joined: 06 Apr 2010
Posts: 7

View user's profile Send private message

PostPosted: Wed Apr 07, 2010 10:53 pm     Reply with quote

that is exactly what i am trying to set up to do. are you using the pk2cmd prog to do that, or do you have something else set up?

i've tried the cmd thing and it keeps saying the .dat file isn't found, though it is in the same directory and set up in the environments through windows.

the command line in ccs i have set up reads:

"C:\Program Files (x86)\Microchip\PICkit 2 v2\pk2cmd.exe" "-P%D" "-F%H" "-M" "-h3"

and the environment for windows reads:

Variable name: pickit
Variable value: C:\Program Files (x86)\Microchip\PICkit 2 v2

the location for the pickit and the cmd line program is the above line.


thanks for you help
dezso



Joined: 04 Mar 2010
Posts: 102

View user's profile Send private message

PostPosted: Wed Apr 07, 2010 11:38 pm     Reply with quote

I think Mark W means the "Auto Import Hex + Write Device" function in pickit2 itself.

trentonite



Joined: 06 Apr 2010
Posts: 7

View user's profile Send private message

PostPosted: Thu Apr 08, 2010 3:27 pm     Reply with quote

hrm.....haven't tried that out yet, but it seems like what Mark was saying is that when he hits compile in CCS it updates the chip, not doing so through pk2kit program.
Rohit de Sa



Joined: 09 Nov 2007
Posts: 282
Location: India

View user's profile Send private message Visit poster's website

PostPosted: Thu Apr 08, 2010 9:17 pm     Reply with quote

Clicking the "Auto Import Hex + Write Device" option allows you to select a hex file. Once the file is selected, the PICKit2 software constantly check for any changes to the hex file. If any changes are detected, the PICKit2 software will burn this (most recent) file onto the microcontroller.

The software doesn't check for hex file contents; it simply looks at the time/date of compilation. Thus the most recent file will be burnt.

Keep in mind that we are not actually 'invoking' the PICkit2 software from CCS.

Rohit
dezso



Joined: 04 Mar 2010
Posts: 102

View user's profile Send private message

Re: Hex File
PostPosted: Thu Apr 08, 2010 9:52 pm     Reply with quote

Mark W wrote:
Hi there,
I have the same setup and if I set the PICKIT2 to auto program everytime I compile using CCS, the program it automatically re programs my PIC.
Is this what you mean?

Cheers

Mark


trentonite wrote:
hrm.....haven't tried that out yet, but it seems like what Mark was saying is that when he hits compile in CCS it updates the chip, not doing so through pk2kit program.


I'm sure he is using pickit2 and not the pk2cmd.
In case if you figure it out how to use pk2cmd, then update us, I would like to use it more than pickit2 autoimport.
_________________
I'm could be wrong many time's, at least I know what I'm doing Smile
Mark W



Joined: 24 May 2009
Posts: 7
Location: Wellington NZ

View user's profile Send private message

PICKIT2
PostPosted: Wed Jun 09, 2010 11:00 pm     Reply with quote

Hi All,
Just to clarify, the example used by Rohit is exactly what I am doing.

Cheers

Mark
LazBoy



Joined: 17 Oct 2006
Posts: 8

View user's profile Send private message

PostPosted: Thu Jul 15, 2010 7:34 am     Reply with quote

I am using this with CCS v3.249

Code:

c:\PICKit2\pk2cmd.exe -P%D -F%H -M -H3 -X
gmua



Joined: 07 Feb 2011
Posts: 11

View user's profile Send private message

PostPosted: Tue Jan 31, 2012 7:28 pm     Reply with quote

Guys, check out this tutorial, it worked for me.

http://skippyrecords.wordpress.com/2008/01/02/pickit2-command-line-setup-in-ccs-compiler-ide/

Cheers.
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Wed Feb 01, 2012 10:22 am     Reply with quote

I realize this thread is a couple of years old, however, for anyone that is referencing this, be aware that there is a problem with the PICKIT2 - there is some sort of issue with the HID structure or something (I forget the exact details). What it will do is cause some other programs to fail (Sony Vegas for example) with a strange error. If you run the dxdiag for testing the direct-X it will also fail with a strange error. The simple cure is that if you run into this issue, simply unplug the pickit2 when using those programs. Just thought I would mention it again since the issue is not even a little bit "intuitively obvious" when you run into it. :-) I would hope the PICKIT3 does not have this issue, but have not tried it.

More details here if interested:
www.ccsinfo.com/forum/viewtopic.php?t=44471

mikey
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
gmua



Joined: 07 Feb 2011
Posts: 11

View user's profile Send private message

PostPosted: Thu Feb 02, 2012 8:09 am     Reply with quote

Rohit de Sa wrote:
Clicking the "Auto Import Hex + Write Device" option allows you to select a hex file. Once the file is selected, the PICKit2 software constantly check for any changes to the hex file. If any changes are detected, the PICKit2 software will burn this (most recent) file onto the microcontroller.


I'm so glad I found this post, I tried the "Auto Import Hex + Write Device" like some of you suggested, and it works great with CCS C, there's no need to configure PK2CMD at all (unless you don't want to program your PIC every time you re-compile your code).

Thanks Guys.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group