PDA

View Full Version : MicroCode Studio Plus - adding Easypic5 as programmer



david1800
- 15th August 2010, 15:14
I have an Easypic5 board that I purchased before deciding to buy PBPro. I would like to use the Easypic5 on board USB programmer with MCS+ if possible. I have found reference here to adding PICkit 2 as an additional programmer (under Wiki as below) but don't understand the final entry "pPIC$target-device$ -f$hex-filename$ -M -R -T -h2"

Grateful for any advice

Thanks

David

Wiki reference:-

In Microcode Studio View | Compile and Program Options... | programmer tab,
click Add New Programmer, select "Create a custom programmer entry" then click "Next".
Enter any name you wish to call it and click "Next".
Enter pk2cmd.exe as the "Programmer Filename" and click "Next".
Click the "Find Manually" button and point it to C:\Program Files\Microchip\PICkit 2 v2 and click "Next".
Enter this parameter line

-pPIC$target-device$ -f$hex-filename$ -M -R -T -h2

Then click Finished.

Pressing Compile and Program or F10 in MicroCode Studio will now do it all.

ScaleRobotics
- 15th August 2010, 15:49
When you add your Pickit2 as a programmer for MCS, you get to a window that lets you add parameters. Here is that window:

4703

I have not heard of anyone trying to add the USB programmer for the EasyPic board, but let us know how it goes.

Walter

Edit:
Well, seeing as the wiki example has it laid out with pictures http://www.picbasic.co.uk/forum/content.php?r=104-Installing-the-PICkit2-Command-Line-Interface
I take it you want an understanding of what the line command does.

The pickit2 has command line options, which allow you to control it using text.

Here is a list:


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 voltage Device Specific
B
Specify the path to PK2DeviceFile.dat Searches PATH
and calling dir
C Blank Check Device No 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')
H<value> Delay before Exit Exit immediately
K = Wait on keypress before exit
1 to 9 = Wait <value> seconds
before exit
I Display Device ID & silicon revision Do Not Display
J<newlines> Display operation percent complete Rotating slash
N = Each update on newline
K Display Hex File Checksum Do Not Display
L<rate> Set programming speed Fastest
<rate> is a value of 1-16, with 1 being
the fastest.
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 erased & programmed.
If a region is entered, no erase
is performed and only the given
region is programmed.
All programmed regions are verified.
(serial EEPROM memory is 'P')
N<string> Assign Unit ID string to first found None
PICkit 2 unit. String is limited to 14
characters maximum. May not be used
with other options.
Example: -NLab1B
P
Part Selection. Example: -PPIC16f887 (Required)
P Auto-Detect in all detectable families
PF List auto-detectable part families
PF<id> Auto-Detect only within the given part
family, using the ID listed with -PF
Example: -PF2
Q Disable PE for PIC24/dsPIC33 devices Use PE
R Release /MCLR after operations Assert /MCLR
S<string #=""> Use the PICkit 2 with the given Unit ID First found unit
string. Useful when multiple PICkit 2
units are connected.
Example: -SLab1B
If no <string> is entered, then the
Unit IDs of all connected units will be
displayed. In this case, all other
options are ignored. -S# will list units
with their firmware versions.
See help -s? for more info.
T Power Target after operations Vdd off
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
X Use VPP first Program Entry Method VDD first
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 </memory> and options must be separated
by a single space.

Example: PK2CMD /PPIC16F887 /Fc:\mycode /M
or
PK2CMD -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)
-B
-S
-D
-N
-P
-A -F -J -L -Q -V -W -X -Z
-C
-U
-E
-M
-Y
-G
-I -K
-R -T
-H (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.

type -?V on the command line for version information.

type -?L on the command line for license information.

type -?P on the command line for a listing of supported devices.
type -?P<string> to search for and display a list of supported devices
beginning with <string>.
So basically, this parameters line is taking information from MCS, like processor, hexfile etc, and entering this info into the PicKit 2 command line. That is the extent of my guesswork. Er I mean knowledge.

</string></string></value></value></value></string></string></id></string></memory></rate></rate></newlines></value></value></range></type></file></file></value>-pPIC$target-device$ -f$hex-filename$ -M -R -T -h2
<value>
<file><file><type><range path=""><value><value><newlines><rate><rate><memory region=""><string>
<id><string #=""><string><value><value><value><string><string>So -P is pic device type, the MCS shared parameter for this is $target-device$
-f is hex file MCS calls $hex-filename$
-M means program device
-R </string></string></value></value></value></string></string></id></string></memory></rate></rate></newlines></value></value></range></type></file></file></value>Release /MCLR after operations Assert /MCLR<value><file><file><type><range path=""><value><value><newlines><rate><rate><memory region=""><string>
<id><string #=""><string><value><value><value><string><string>-T Release power to device
-h2 , delay 2 seconds for exit

But these are all specific for the Pickit 2 device (Well except for the target-device and hex-filename. These two will be useful to make other programers work with MCS.

</string></string></value></value></value></string></string></id></string></memory></rate></rate></newlines></value></value></range></type></file></file></value>

Acetronics2
- 15th August 2010, 16:05
I have not heard of anyone trying to add the USB programmer for the EasyPic board, but let us know how it goes.

Walter

Hi, Walter

Very simple with the EasyPic 6 : just use an ICD2 or 3 in the External ICD Plug ...

like this you can program your chip straight from MPLAB ...

Alain

ScaleRobotics
- 15th August 2010, 16:21
But is there a way to program it straight from MCS with the compile and program button?

Acetronics2
- 15th August 2010, 16:59
But is there a way to program it straight from MCS with the compile and program button?

No soucy ...

Programmer file :


PicFlash.exe


Location:


"C:\Program Files\Mikroelektronika\PICFLASH-mikroICD"


Parameter line:


-pPIC$target-device$ -f$hex-filename$ -e -w


This one perfectly works ...

Alain

ScaleRobotics
- 16th August 2010, 01:45
Perfect Alain,

You just saved David and I thousands of unnecessary mouse clicks (in the long run). Is that working for your EasyPic5 David? My EasyPic6 likes it, and so do I.

Walter

david1800
- 16th August 2010, 05:46
Perfect Alain,

You just saved David and I thousands of unnecessary mouse clicks (in the long run). Is that working for your EasyPic5 David? My EasyPic6 likes it, and so do I.

Walter

Yes, it works! Many thanks to Alain and you.

Regards

David

Acetronics2
- 16th August 2010, 13:23
Yes, it works! David

Hi, David

For Pickit2 and MCS ... I do not know why the EDIT button doesn't change anything to what you had liked to modify ...

BUT begin by supressing the Pickit2 entry and THEN re-create the full entry for PicKit2 ...

It will work properly, then.

May be Darrel should add this "little detail" to the wiki ... :rolleyes:

Alain

david1800
- 17th August 2010, 02:07
Thanks Alain

I am probably being a bit stupid, but I am new to this and am not sure what you mean by suppressing the Pickit2 entry (where) and then recreating the full entry for the PicKit2 (where?).

Many thanks

David


Hi, David

For Pickit2 and MCS ... I do not know why the EDIT button doesn't change anything to what you had liked to modify ...

BUT begin by supressing the Pickit2 entry and THEN re-create the full entry for PicKit2 ...

It will work properly, then.

May be Darrel should add this "little detail" to the wiki ... :rolleyes:

Alain

Acetronics2
- 17th August 2010, 09:55
Thanks Alain

I am probably being a bit stupid, but I am new to this and am not sure what you mean by suppressing the Pickit2 entry (where) and then recreating the full entry for the PicKit2 (where?).

Many thanks

David

Just freshly fallen from bed, might be ... :D

just re-read your first post ... and the wiki extract !

Alain

PS: see here : http://www.picbasic.co.uk/forum/showthread.php?t=9521&p=68470#post68470

david1800
- 18th August 2010, 01:13
I don't need to have just got out of bed to be confused, it comes naturally! Thanks for the link, I'm at the steep learing curve stage.

Regards

David


Just freshly fallen from bed, might be ... :D

just re-read your first post ... and the wiki extract !

Alain

PS: see here : http://www.picbasic.co.uk/forum/showthread.php?t=9521&p=68470#post68470