Hi whayden1,
whayden1 wrote:Just for the record I tried the -T option. It had no effect.
Odd since I can confirm
Code: Select all
-BC:\Program Files (x86)\Flowcode\V5\Tools\PICkit2\ -PPIC%p -F%f.hex -M -A5 -R -T
Does keep target powered up for me.
It maybe you have a different firmware version in your PICkit2.
Here is something to try:
At the end of -BC:\Program Files (x86)\Flowcode\V5\Tools\PICkit2\ -PPIC%p -F%f.hex -M -A5 -R -T just place /?
So you have got -BC:\Program Files (x86)\Flowcode\V5\Tools\PICkit2\ -PPIC%p -F%f.hex -M -A5 -R -T /?
Then program to chip.
You should get all the switches displayed:
Code: Select all
Launching the programmer...
C:\Program Files (x86)\Flowcode\V5\Tools\PICkit2\pk2cmd.exe -BC:\Program Files (x86)\Flowcode\V5\Tools\PICkit2\ -PPIC16F887 -FReversible Variable Speed Rotate.hex -M -A5 -R -T /?
PICkit 2 COMMAND LINE HELP
Options Description Default
----------------------------------------------------------------------------
A<value> Set Vdd voltage Device Specific
B<path> 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> 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 hexadecimal 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 </> 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>.
Special thanks to the following individuals for their critical
contributions to the development of this software:
Jeff Post, Xiaofan Chen, and Shigenobu Kimura
Operation Succeeded
Return code = 0
FINISHED
Just for the demo board I have created a flowchart that will rotate LED's in one direction until SW is pressed, then will cause LED's to rotate in the reverse direction.
Using interrupt method since the switch is connected to INT (Edge triggered Interrupt pin RB0)
The ADC component is used to change speed of chasing LED's
Martin