Download dsPICFlash Programmer User Manual

Transcript
Programmer
If you have any questions, comments or business proposals, do not hesitate to contact us at [email protected]
If you are experiencing some problems with any of our products or just need additional information, please place your ticket at
www.mikroe.com/en/support
If you want to learn more about our products, please visit our website at www.mikroe.com
dsPicFLASH
™
User manual
Flash program is used to transfer a .hex file from a PC to the
microcontroller memory by means of the appropriate hardware.
Every flash program includes numerous options used for setting the
microcontroller’s configuration bits.
DISCLAIMER
All the products owned by MikroElektronika are protected by copyright law and international copyright treaty.
Therefore, this manual is to be treated as any other copyright material. No part of this manual, including
product and software described herein, may be reproduced, stored in a retrieval system, translated or
transmitted in any form or by any means, without the prior written permission of MikroElektronika. The
manual PDF edition can be printed for private or local use, but not for distribution. Any modification of this
manual is prohibited.
TO OUR VALUED CUSTOMERS
I want to express my thanks to you for being interested in our products and for having confidence in
Mikroelektronika.
The primary aim of our company is to design and produce high quality electronic products and to constantly
improve the performance thereof in order to better suit your needs.
Nebojsa Matic
General Manager
MikroElektronika provides this manual ‘as is’ without warranty of any kind, either expressed or implied,
including, but not limited to, the implied warranties or conditions of merchantability or fitness for a particular
purpose.
MikroElektronika shall assume no responsibility or liability for any errors, omissions and inaccuracies that may
appear in this manual. In no event shall MikroElektronika, its directors, officers, employees or distributors be
liable for any indirect, specific, incidental or consequential damages (including damages for loss of business
profits and business information, business interruption or any other pecuniary loss) arising out of the use
of this manual or product, even if MikroElektronika has been advised of the possibility of such damages.
MikroElektronika reserves the right to change information contained in this manual at any time without prior
notice, if necessary.
HIGH RISK ACTIVITIES
The products of MikroElektronika are not fault – tolerant nor designed, manufactured or intended for use or
resale as on – line control equipment in hazardous environments requiring fail – safe performance, such as
in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct
life support machines or weapons systems in which the failure of Software could lead directly to death,
personal injury or severe physical or environmental damage (‘High Risk Activities’). MikroElektronika and its
suppliers specifically disclaim any expressed or implied warranty of fitness for High Risk Activities.
TRADEMARKS
The Mikroelektronika name and logo, the Mikroelektronika logo, mikroC, mikroC PRO, mikroBasic, mikroBasic PRO, mikroPascal, mikroPascal PRO, AVRflash, PICflash, dsPICprog, 18FJprog, PSOCprog, AVRprog, 8051prog, ARMflash, EasyPIC5, EasyPIC6, BigPIC5, BigPIC6, dsPIC PRO4, Easy8051B, EasyARM,
EasyAVR5, EasyAVR6, BigAVR2, EasydsPIC4A, EasyPSoC4, EasyVR Stamp LV18FJ, LV24-33A, LV32MX,
PIC32MX4 MultiMedia Board, PICPLC16, PICPLC8 PICPLC4, SmartGSM/GPRS, UNI-DS are trademarks
of Mikroelektronika. All other trademarks mentioned herein are property of their respective companies.
All other product and corporate names appearing in this manual may or may not be registered trademarks
or copyrights of their respective companies, and are only used for identification or explanation and to the
owners’ benefit, with no intent to infringe.
The Microchip name and logo, the Microchip logo, Accuron, dsPIC, KeeLoq, microID, MPLAB, PIC, PICmicro, PICSTART, PRO MATE,
PowerSmart, rfPIC and SmartShunt are registered trademarks of Microchip Technology Incorporated in the U.S.A and other countries.
©MikroelektronikaTM, 2010, All Rights Reserved.
page
dsPicFLASH
TABLE OF CONTENTS
1.0. Introduction to dsPICprog Programmer .................................................................................... 4
2.0. Programming Microcontrollers .................................................................................................. 5
3.0. dsPicFLASH Program ............................................................................................................... 6
4.0. Software Installation ................................................................................................................. 7
5.0. Practical Example of Using dsPicFLASH Program ................................................................... 9
6.0. Keyboard Shortcuts and Command Line Parameters ...............................................................10
MikroElektronika
page
dsPicFLASH
1.0. Introduction to dsPICprog Programmer
The dsPICprog™ programmer is a great tool used for programming dsPIC® microcontrollers from Microchip®. As a low-consumption
device, it is ideal to be used with notebooks. It’s unique design and simplicity make it a very popular tool among beginners and
professional users alike. The dsPICprog programmer communicates to the microcontroller through a USB cable which is also used
for powering the programmer. In order to use this programmer, it is necessary to have the dsPicFLASH program and the appropriate
driver, provided on the product CD, installed on your PC. After that, you can use the dsPICprog programmer and a hex code generated
in any dsPIC compiler to load the program into a dsPIC microcontroller.
The dsPICprog programmer is built into all Mikroelektronika’s dsPIC development systems. The same programmer is also available as a
stand-alone device used for programming dsPIC microcontrollers built into (soldered on) the target device.
The dsPICprog programmer is built into all
Mikroelektronika’s development systems designed for
working with dsPIC microcontrollers.
The dsPICprog programmer is also available as a standalone device used for programming dsPIC microcontrollers
built into (soldered on) the target device.
Figure 1-1: On-board dsPICprog programmer
Figure 1-2: Stand-alone dsPICprog programmer
The dsPicFLASH program contains an
option for selecting the microcontroller to
be programmed. The latest version of this
software with updated list of supported
microcontrollers can be downloaded
free of charge from our website at
www.mikroe.com
Figure 1-3: dsPicFLASH program’s window
MikroElektronika
page
dsPicFLASH
2.0. Programming Microcontrollers
The process of programming microcontrollers starts by writing a program in one of dsPIC compilers (mikroC PRO for dsPIC,
mikroBASIC PRO for dsPIC, mikroPASCAL PRO for dsPIC etc.). When the program is correctly written, it should be compiled into
a format that can be loaded into the microcontroller. The program to be loaded into the microcontroller has the .hex extension. As
soon as the .hex file is generated, the program can be loaded into the microcontroller.
Compiling
program
Loading hex code
1
3
2
1 Write a code in one of dsPIC compilers and generate
a .hex file;
2 In the dsPicFLASH program’s main window select
the microcontroller and load the hex code into the
programmer’s buffer;
3 Click the Write button to program the microcontroller.
On the right side of the dsPicFLASH program’s window there
are several options which make the programming process
easier, whereas, on the left side of the window there are a
number of options for microcontroller settings. Positioned
in the bottom right corner of the window, the Progress bar
enables you to monitor the programming process.
MikroElektronika
page
dsPicFLASH
3.0. dsPicFLASH Program
The dsPicFLASH program is easy to use as all the options necessary for its operation are provided in a simple window which will
appear either by clicking on the dsPICFLASH icon or automatically by starting the programming process (Build And Program option)
in one of dsPIC compilers.
The options used for setting configuration bits are provided on the left side of the window, whereas the options for loading .hex file into
the programmer and microcontroller are provided on the right side of the window.
The left side of the window can be different depending on the type of the microcontroller in use and its configuration bits.
To load the program into the microcontroller,
do the following:
1
3
2
1
Select the microcontroller to be programmed
and the dsPicFLASH will automatically
set default parameters for working with the
respective microcontroller.
2 Click the Load HEX option to open the window
to select the hex code to be loaded into the
microcontroller.
3
Click the Write option
programming process.
to
start
the
The Progress bar shows the programming
progress expressed in a percentage.
Figure 3-1: dsPicFLASH program’s main window
The dsPicFLASH program enables a hex code, generated in one of dsPIC compilers, to be loaded into the microcontroller. The hex code
should be loaded first into the programmer’s buffer by clicking the Load HEX option, then into the microcontroller by clicking the Write
option within the programmer’s main window. The programming progress will be shown in the Progress bar positioned in the bottom right
corner of the same window.
MikroElektronika
page
dsPicFLASH
4.0. Software Installation
Before you start up the dsPicFLASH program, it is necessary to install the appropriate driver. For more information refer to quick guide
for installing USB drivers.
Step 1: Start installation
Insert the product CD into a CD drive. After a few seconds, a list with
all Mikroelektronika’s products will appear on the screen. To start the
process of installing the dsPicFLASH software, click on the setup icon
provided in the dsPICprog section on the product CD:
CD Drive:/zip/dspicprog2_programmer_v402.zip
You can also download the dsPicFLASH free of charge from our website.
In this case the installation starts from your hard drive. A welcome window
appears. Click Next to proceed.
Step 2: License Agreement
Before you start the installation process, please review the license
agreement terms. To accept them, select the option I accept the terms in
the License Agreement and click Next.
Step 3: Choose Components
To make your choice simple, this installation step offers you only one
component to choose. Click Next.
MikroElektronika
page
dsPicFLASH
Step 4: Choose Installation Location
Now, you should specify the folder to install the dsPicFLASH program
into. If you want to install it in a folder different from default, click Browse
and select another folder on your hard disc. Then click Next. If you
choose the default folder, the program will be installed on the following
location:
C:\Program Files\Mikroelektronika\dsPICFLASH\
Step 5: Installation Details
The installation of the dsPicFLASH program starts immediately. The
installation progress will be shown on the screen. If you are interested
in details about the installation, click the Show details button.
Step 6: Completing Installation
Windows will inform you in the window, as shown in figure on the right,
that the dsPicFLASH program has been successfully installed. Click
Finish to complete the installation.
MikroElektronika
page
dsPicFLASH
5.0. Practical Example of Using dsPicFLASH Program
After the software installation is complete, connect the programmer to your development system using a USB cable. The USB
connection will be automatically established, which is indicated by the USB LINK LED’s illumination.
Step 1: Start up the dsPicFLASH program
Start up the dsPicFLASH program installed on your PC. Click
the Device option in order to select the microcontroller to be
programmed. The dsPicFLASH program will automatically
set default parameters for working with the respective
microcontroller.
Step 2: Load a hex code into programmer’s buffer
Click the Load HEX option to open the Open window, as shown in figure
on the right. Select the relevant file with the .hex extension and click the
Open button. The file will be automatically loaded into the programmer’s
buffer.
Step 3: Write the hex code into the microcontroller
Click the Write option in the upper right corner of the main window
to start programming the microcontroller. The programming
progress will be shown in the bottom right corner of the same
window.
MikroElektronika
page
10
dsPicFLASH
6.0. Keyboard Shortcuts and Command Line Parameters
Keyboard Shortcuts:
Alt-E Alt-B Alt-W Alt-V Alt-R Alt-D Ctrl-S Ctrl-O Ctrl-R Command Line:
The dsPicFLASH program may also be activated from the command line, thus enabling you to use it from some other software, compiler etc. Here is a list of the command line parameters:
-w -v -e -r -p -f -b
-q
Example 1:
dsPicFLASH.exe -w -pdsPIC30F4013 -v -f”C:\somefile.hex”
Erase the content of microcontroller’s memory
Program memory blank check (whether it is empty)
Write a hex code into a dsPIC microcontroller
Verify the loaded hex code
Program memory reading
Change microcontroller type
Save hex code
Open (Load) file with hex code
Reload hex code
Write to dsPIC microcontroller
Verify
Erase program from dsPIC microcontroller
Read program from dsPIC microcontroller
Type of microcontroller (for example, dsPIC30F4013, dsPIC30F5011 etc.)
.hex file name (FLASH) “[<name must be enclosed in quotation marks>]”
Memory blank check (whether it is empty)
Close the dsPicFLASH program after programming
This command is used for loading C:\somefile.hex into the dsPIC30F4013 microcontroller. This file will be verified immediately after being loaded into the microcontroller.
Example 2:
dsPicFLASH.exe -r -pdsPIC30F4013
This command is used for reading the content of the dsPIC30F4013 microcontroller’s program memory.
Example 3:
dsPicFLASH.exe -e -pdsPIC30F4013
This command is used to erase program from the dsPIC30F4013 microcontroller.
MikroElektronika
DISCLAIMER
All the products owned by MikroElektronika are protected by copyright law and international copyright treaty.
Therefore, this manual is to be treated as any other copyright material. No part of this manual, including
product and software described herein, may be reproduced, stored in a retrieval system, translated or
transmitted in any form or by any means, without the prior written permission of MikroElektronika. The
manual PDF edition can be printed for private or local use, but not for distribution. Any modification of this
manual is prohibited.
TO OUR VALUED CUSTOMERS
I want to express my thanks to you for being interested in our products and for having confidence in
Mikroelektronika.
The primary aim of our company is to design and produce high quality electronic products and to constantly
improve the performance thereof in order to better suit your needs.
Nebojsa Matic
General Manager
MikroElektronika provides this manual ‘as is’ without warranty of any kind, either expressed or implied,
including, but not limited to, the implied warranties or conditions of merchantability or fitness for a particular
purpose.
MikroElektronika shall assume no responsibility or liability for any errors, omissions and inaccuracies that may
appear in this manual. In no event shall MikroElektronika, its directors, officers, employees or distributors be
liable for any indirect, specific, incidental or consequential damages (including damages for loss of business
profits and business information, business interruption or any other pecuniary loss) arising out of the use
of this manual or product, even if MikroElektronika has been advised of the possibility of such damages.
MikroElektronika reserves the right to change information contained in this manual at any time without prior
notice, if necessary.
HIGH RISK ACTIVITIES
The products of MikroElektronika are not fault – tolerant nor designed, manufactured or intended for use or
resale as on – line control equipment in hazardous environments requiring fail – safe performance, such as
in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct
life support machines or weapons systems in which the failure of Software could lead directly to death,
personal injury or severe physical or environmental damage (‘High Risk Activities’). MikroElektronika and its
suppliers specifically disclaim any expressed or implied warranty of fitness for High Risk Activities.
TRADEMARKS
The Mikroelektronika name and logo, the Mikroelektronika logo, mikroC, mikroC PRO, mikroBasic, mikroBasic PRO, mikroPascal, mikroPascal PRO, AVRflash, PICflash, dsPICprog, 18FJprog, PSOCprog, AVRprog, 8051prog, ARMflash, EasyPIC5, EasyPIC6, BigPIC5, BigPIC6, dsPIC PRO4, Easy8051B, EasyARM,
EasyAVR5, EasyAVR6, BigAVR2, EasydsPIC4A, EasyPSoC4, EasyVR Stamp LV18FJ, LV24-33A, LV32MX,
PIC32MX4 MultiMedia Board, PICPLC16, PICPLC8 PICPLC4, SmartGSM/GPRS, UNI-DS are trademarks
of Mikroelektronika. All other trademarks mentioned herein are property of their respective companies.
All other product and corporate names appearing in this manual may or may not be registered trademarks
or copyrights of their respective companies, and are only used for identification or explanation and to the
owners’ benefit, with no intent to infringe.
The Microchip name and logo, the Microchip logo, Accuron, dsPIC, KeeLoq, microID, MPLAB, PIC, PICmicro, PICSTART, PRO MATE,
PowerSmart, rfPIC and SmartShunt are registered trademarks of Microchip Technology Incorporated in the U.S.A and other countries.
©MikroelektronikaTM, 2010, All Rights Reserved.
Programmer
If you have any questions, comments or business proposals, do not hesitate to contact us at [email protected]
If you are experiencing some problems with any of our products or just need additional information, please place your ticket at
www.mikroe.com/en/support
If you want to learn more about our products, please visit our website at www.mikroe.com
dsPicFLASH
™
User manual
Flash program is used to transfer a .hex file from a PC to the
microcontroller memory by means of the appropriate hardware.
Every flash program includes numerous options used for setting the
microcontroller’s configuration bits.