PICkit programmer

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

PICkit programmer

Post by saschech@gmx.de »

Hallo Steve

In the moment i program my pic`s with a MPLABΒ® ICD 2 kompatibler In-Circuit
Debugger/Programmer .

I show,in the v4 setup "pickit 2 programmer " and i found on the microchip homepage,
a PICkit 3 Debug express programmer complete with a demo board 18F45k20.
To day i become this programmer , but the pic is not in the device list v4.
I copy PiCkit3 folder in the tool folder of v4 and change the compiler-option to the pickit 3 directory,but i become
an error.
V4 is a new software,pickit3 also.I want not buy an old programmer.
Please can jou build a 18F45k20.fcd file? and add in the setup PICkit3 programmer?

Very hopeful for these

Regards Wolfgang

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PICkit programmer

Post by Benj »

Hello Wolfgang

I have created the new definitions for the 18F45K20 family of devices. Please extract the archive into your Flowcode V4 folder, restart Flowcode and the new devices should appear. Note that PPP will not currently support these new devices.
Attachments
Flowcode4.zip
(21.54 KiB) Downloaded 433 times

User avatar
Steve
Matrix Staff
Posts: 3426
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: PICkit programmer

Post by Steve »

Hi Wolfgang,

PICkit3 does not seem to have a command-line interface to allow us to use it with Flowcode - it only seems to work with MPLAB. While researching this I found the following on the Microchip forum:
For the moment, the PICkit2 will give you less headache and more features.

Fully agree. I needed a programmer and bought Pickit 3, hoping it would have more features and less headache, because of its higher price and because it was a newer model. It looks that I was wrong.

I've been using simple PICkit 2 programmer tool before and loved it's simple interface and logic / serial tools, but it seems that it just isn't available for PICkit 3 (yet?).

I hope we get more tools for PICkit 3 soon.

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: PICkit programmer

Post by saschech@gmx.de »

Hallo Steve , Benj

thanks for the files , works pefect in v4.

Are the files also for v3? becouse i become in v3 a error no fcd file...

Regards Wolfgang

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: PICkit programmer

Post by saschech@gmx.de »

Hallo Steve
To day i have install the Pickit2.It works with the MPLab.
If i want program with v4,i receive returncode: 32.
Please help.

regards wolfgang

User avatar
Steve
Matrix Staff
Posts: 3426
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: PICkit programmer

Post by Steve »

Hello Wolfgang,

I'm sorry, but that is not a valid return code from the PICkit2 programmer application. Here are the expected return codes:

Code: Select all

// Return Codes
#define OPSUCCESS                   0  // operation completed as expected
#define VOLTAGE_ERROR               5  // Vdd or vpp error detected
#define OPFAILURE                   7  // operation failed
#define NO_PROGRAMMER               10 // Unable to find a PICkit 2 programmer
#define WRONG_OS                    11 // OS firmware must be upgraded
#define FILE_OPEN_ERROR             15 // returned if a file to read to (-gf..) cannot be opened.
#define DEVICEFILE_ERROR            24 // the device file was not found or an error occured while loading.
#define UPDGRADE_ERROR              28 // returned when OS upgrade fails. 
#define PGMVFY_ERROR                34 // returned if program or verify operation fails.
#define INVALID_CMDLINE_ARG         36
#define INVALID_HEXFILE             37 // Error reading hex file.
One thing to note is that the firmware in the PICkit2 may need to be upgraded - you could try this first (it needs to be v2.32 or later). Instructions on how to do this are in the "readme" file for the PICkit2.

If you are still having problems, please post the output from Flowcode here - it may help to see what is returning this error message.

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: PICkit programmer

Post by saschech@gmx.de »

Hallo Steve
Sorry it is ret.code : 36


File name: D:\sachs_work\ECIO\V4\sa_ecio\sa_ecio.c
Generated by: Flowcode v4.0.0.53
Date: Tuesday, June 30, 2009 17:04:38
Licence: 30-Day Trial

***DEMO VERSION***


NICHT FÜR KOMMERZiELLE ANWENDUNGEN

http://www.matrixmultimedia.com


Launching the compiler...
C:\Program Files\Matrix Multimedia\Flowcode V4\BoostC\boostc.pic18.flowcode.exe -v -t PIC18F8722 "sa_ecio.c"

***************************************
Additional Debug info
sShortAppPath: C:\PROGRA~1\MATRIX~1\FLOWCO~1\BoostC\BOOSTC~1.EXE
sAppPath: C:\Program Files\Matrix Multimedia\Flowcode V4\BoostC\boostc.pic18.flowcode.exe
sAppFullSwitches: C:\PROGRA~1\MATRIX~1\FLOWCO~1\BoostC\BOOSTC~1.EXE -v -t PIC18F8722 "sa_ecio.c"
sWorkingDir: D:\sachs_work\ECIO\V4\sa_ecio
lengths = 79, 78, 29
***************************************

.........................................................
Return code = 0

Launching the linker/assembler...
C:\Program Files\Matrix Multimedia\Flowcode V4\BoostC\boostlink.pic.exe -ld "C:\Program Files\Matrix Multimedia\Flowcode V4\BoostC\lib" libc.pic18.lib flowcode.pic18.lib rand.pic18.lib float.pic18.lib "sa_ecio.obj" -t PIC18F8722 -d "D:\sachs_work\ECIO\V4\sa_ecio" -p "sa_ecio"

***************************************
Additional Debug info
sShortAppPath: C:\PROGRA~1\MATRIX~1\FLOWCO~1\BoostC\BOOSTL~1.EXE
sAppPath: C:\Program Files\Matrix Multimedia\Flowcode V4\BoostC\boostlink.pic.exe
sAppFullSwitches: C:\PROGRA~1\MATRIX~1\FLOWCO~1\BoostC\BOOSTL~1.EXE -ld "C:\Program Files\Matrix Multimedia\Flowcode V4\BoostC\lib" libc.pic18.lib flowcode.pic18.lib rand.pic18.lib float.pic18.lib "sa_ecio.obj" -t PIC18F8722 -d "D:\sachs_work\ECIO\V4\sa_ecio" -p "sa_ecio"
sWorkingDir: D:\sachs_work\ECIO\V4\sa_ecio
lengths = 71, 254, 29
***************************************

...................
Return code = 0

Launching the programmer...
C:\Program Files\Matrix Multimedia\Flowcode V4\tools\PICkit2\pk2cmd.exe -PPIC18F8722 -Fsa_ecio.hex -M -A5 -H -BC:\Program Files\Matrix Multimedia\Flowcode V4\tools\PICkit2\

***************************************
Additional Debug info
sShortAppPath: C:\PROGRA~1\MATRIX~1\FLOWCO~1\tools\PICkit2\pk2cmd.exe
sAppPath: C:\Program Files\Matrix Multimedia\Flowcode V4\tools\PICkit2\pk2cmd.exe
sAppFullSwitches: C:\PROGRA~1\MATRIX~1\FLOWCO~1\tools\PICkit2\pk2cmd.exe -PPIC18F8722 -Fsa_ecio.hex -M -A5 -H -BC:\Program Files\Matrix Multimedia\Flowcode V4\tools\PICkit2\
sWorkingDir: D:\sachs_work\ECIO\V4\sa_ecio
lengths = 71, 155, 29
***************************************

...................
Return code = 36

Flowcode konnte das Flussdiagramm nicht in den Microcontroller übertragen. Überprüfen Sie die Optionen der Programmer-Software und die physikalischen Verbindungen.

FINISHED

Regards wolfgang

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PICkit programmer

Post by Benj »

Hello Wolfgang

There is a fix for the PICkit command line detailed here.
http://www.matrixmultimedia.com/support ... .php?t=554

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: PICkit programmer

Post by saschech@gmx.de »

Hallo Benj
After i do these,the Pickct2 works ok.

One more question over compiler option:
The programmer must have correct links.....but in the c-compiler option i view .....boostc.pic16.flowcode.exe
and my project with a 18F8722,compiling is ok?????????

Flowcode automatically converts between "16" and "18" depending on the target chip. It does not matter whether the options say "16" or "18".Steve Tandy,
Matrix Multimedia Ltd.

For what i have these option ????????

Regards Wolfgang

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PICkit programmer

Post by Benj »

Hello Wolfgang

Glad the PICkit is working correctly for you now, thanks for letting me know.

If the compilation is working correctly then you do not have to worry about the compiler and linker settings. These are just there to allow Flowcode to be installed in a folder other then the default folder.

Also yes the 16 / 18 parameter is swapped automatically depending on the target you are using.

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: PICkit programmer

Post by medelec35 »

Benj wrote:Hello Wolfgang

There is a fix for the PICkit command line detailed here.
http://www.matrixmultimedia.com/support ... .php?t=554
Fix works great!
However Can you please add (in you own words :P) :
If you want PICkit to keep target power applied, then -T is required
i.e -BC:\Program Files\Matrix Multimedia\Flowcode V4\Tools\PICkit2\ -PPIC%p -F%F.hex -M -A5 -R -T
Martin

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: PICkit programmer

Post by saschech@gmx.de »

Hallo All

Is there also a way switch on " Preserve device EEPROM " ?

Regards Wolfgang

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: PICkit programmer Error 37

Post by medelec35 »

If anyone has error 37:

Look at Complier messages at the line which shows
pk2cmd.exe -BC:\Program Files\Matrix Multimedia\Flowcode V4\Tools\PICkit2\File Name

If this file name is not exactly same as file you are compiling then change
-BC:\Program Files\Matrix Multimedia\Flowcode V4\Tools\PICkit2\ -PPIC%p -F%F.hex -M -A5 –R

to

-BC:\Program Files\Matrix Multimedia\Flowcode V4\Tools\PICkit2\ -PPIC%p -F%f.hex -M -A5 –R

Thanks to Steve for solving that and -T option

Benj would it be a good idea to permanently change -F%F to -F%f when any information is posted regarding settings. That is assuming it works on every PC , even those PC where is it not required?
Martin

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: PICkit programmer

Post by saschech@gmx.de »

Hallo Benj

I found these but if i put in ........-MPIC......... i become on compiler a error 34

----------------------------------------------------------------------------
9. Command Line Options
----------------------------------------------------------------------------
The following commands are available in the command line interface.

PICkit 2 COMMAND LINE HELP
Options Description Default
----------------------------------------------------------------------------
A<value> Set Vdd Device Specific
C Blank Check Device Do not Blank Check
D<file> OS Download None
E Erase Flash Device Do Not Erase
F<file> Hex File Selection None
G<Type><range/path> Read functions None
Type F: = read into hex file,
path = full file path,
range is not used
Types P,E,I,C: = ouput read of Program,
EEPROM, ID and/or Configuration
Memory to the screen. P and E
must be followed by an address
range in the form of x-y where
x is the start address and y is
the end address both in hex,
path is not used
(Serial EEPROM memory is 'P')
I Display Device ID Do Not Display
K Display Hex File Checksum Do Not Display
M<memory region> Program Device Do Not Program
memory regions:
P = Program memory
E = EEPROM
I = ID memory
C = Configuration memory
If no region is entered, the entire
device will be programmed.
(serial EEPROM memory is 'P')
P<part> Part Selection. Example: PIC16f887 None
U<value> Program OSCCAL memory, where: Do Not Program
<value> is a hexidecimal number
representing the OSCCAL value to be
programmed. This may only be used in
conjunction with a programming
operation.
V<value> Vpp override Device Specific
W Externally power target Power from Pk2
Y<memory region> Verify Device Do Not Verify
P = Program memory
E = EEPROM
I = ID memory
C = Configuration memory
If no region is entered, the entire
device will be verified.
(Serial EEPROM memory is 'P')
Z Preserve EEData on Program Do Not Preserve
? Help Screen Not Shown

Each option must be immediately preceeded by a switch, Which can
be either a dash <-> or a slash </> and options must be separated
by a single space.

Example: PK2CMD /1 /PPIC16F887 /Fc:\mycode /M
or
PK2CMD -1 -PPIC16F887 -Fc:\mycode -M

Any option immediately followed by a question mark will invoke
a more detailed description of how to use that option.

Commands and their parameters are not case sensitive. Commands will
be processed according to command order of precedence, not the order
in which they appear on the command line.
Precedence:
-? (first)
-D
-P
-A -F -V -W -X -Z
-C
-U
-E
-M
-Y
-G
-I -K (last)


The program will return an exit code upon completion which will
indicate either successful completion, or describe the reason for
failure. To view the list of exit codes and their descriptions,
type -?E on the command line.

----------------------------------------------------------------------------

Regards Wolfgang

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: PICkit programmer

Post by saschech@gmx.de »

Hallo everybody

Thankyou for the help!
So i program my board outside v4 with pickit2,there i can do it!!!!!!!

Regards Wolfgang

Post Reply