View previous topic :: View next topic |
Author |
Message |
trentonite
Joined: 06 Apr 2010 Posts: 7
|
Setting up CCS with PICKit2 |
Posted: Tue Apr 06, 2010 3:24 pm |
|
|
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
|
|
Posted: Tue Apr 06, 2010 7:57 pm |
|
|
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
|
|
Posted: Wed Apr 07, 2010 8:07 am |
|
|
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 , 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
|
Hex File |
Posted: Wed Apr 07, 2010 7:01 pm |
|
|
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
|
|
Posted: Wed Apr 07, 2010 10:53 pm |
|
|
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
|
|
Posted: Wed Apr 07, 2010 11:38 pm |
|
|
I think Mark W means the "Auto Import Hex + Write Device" function in pickit2 itself.
|
|
|
trentonite
Joined: 06 Apr 2010 Posts: 7
|
|
Posted: Thu Apr 08, 2010 3:27 pm |
|
|
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
|
|
Posted: Thu Apr 08, 2010 9:17 pm |
|
|
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
|
Re: Hex File |
Posted: Thu Apr 08, 2010 9:52 pm |
|
|
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 |
|
|
Mark W
Joined: 24 May 2009 Posts: 7 Location: Wellington NZ
|
PICKIT2 |
Posted: Wed Jun 09, 2010 11:00 pm |
|
|
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
|
|
Posted: Thu Jul 15, 2010 7:34 am |
|
|
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
|
|
|
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Wed Feb 01, 2012 10:22 am |
|
|
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
|
|
Posted: Thu Feb 02, 2012 8:09 am |
|
|
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. |
|
|
|