miro
Joined: 15 Jan 2011 Posts: 62
|
Programming with PICKIT2 off the IDE |
Posted: Thu Aug 31, 2023 11:15 am |
|
|
For those who want to directly flash off the compiler with the PicKit2 - here is the command you may enter into the Options-> IDE-> Tools-> Command, which works fine here:
Code: | "C:\Program Files (x86)\Microchip\PICkit 2 v2\pk2cmd.exe" "/P" "/M" "/W" "/R" "/F" "%H" |
"/P" - autodetect the mcu
"/M" - perform a complete erase/flash/verify
"/W" - ext power for the mcu
"/R" - run after programming (/MCLR enabled, also see the help)
"/F" "%H"- .hex file name
The pk2cmd.exe have to be placed in your pickit2 directory..
After the compiling the cmd window pops up briefly and you will see something like
Code: | Auto-Detect: Found part DSPIC33FJ128GP802.
Using PE
PICkit 2 Program Report
31-Aug-2023, 18:52:23
Device Type: DSPIC33FJ128GP802
Program Succeeded.
Operation Succeeded |
and the mcu starts to do its job after the flashing..
The prerequisite here is the mcu chip is powered during programming.
Without an external power the pickit2 programmer itself has to power the mcu chip and you have to remove related switch (/W) from the command.
Consult the pk2cmd help for the info related to your particular setup.
Warning: be careful with powering your entire design off the pickit2 programmer!
Disclaimer: use at your own risk |
|