Home

MPLAB IDE PICSTART Plus User's Guide

image

Contents

1. DEVELOPMENT SYSTEMS CUSTOMER CHANGE NOTIFICATION SERVICE Microchip s customer notification service helps keep customers current on Microchip products Subscribers will receive e mail notification whenever there are changes updates revisions or errata related to a specified product family or development tool of interest To register access the Microchip web site at www microchip com click on Customer Change Notification and follow the registration instructions The Development Systems product group categories are D Compilers The latest information on Microchip C compilers and other language tools These include the MPLAB C17 MPLAB C18 and MPLAB C30 C compilers MPASM and MPLAB ASM30 assemblers MPLINK and MPLAB LINK30 object linkers and MPLIB and MPLAB LIB30 object librarians Emulators The latest information on Microchip in circuit emulators This includes the MPLAB ICE 2000 and MPLAB ICE 4000 In Circuit Debuggers The latest information on the Microchip in circuit debugger MPLAB ICD 2 MPLAB IDE The latest information on Microchip MPLAB IDE the Windows Integrated Development Environment for development systems tools This list is focused on the MPLAB IDE and MPLAB SIM simulators MPLAB IDE Project Manager and general editing and debugging features Programmers The latest information on Microchip programmers These include the MPLAB PM3 and PRO MATE II device programmers and the PICSTART Plus
2. E Program Memory Address o000 0010 0020 0030 0040 0050 0060 0070 0080 0090 DOA0 DOBO ooco DODO pcodeHex Machine 2004 Microchip Technology Inc DS51028F page 37 MPLAB PICSTART Plus User s Guide 4 3 5 3 FILE FORMATS USED BY PICSTART PLUS The PICSTART Plus programmer can use information directly from the MPLAB IDE projects without any intermediate steps The MPASM assembler can be used separately from the MPLAB IDE to produce hex files for the PICSTART Plus programmer Alternatively devices can be programmed with hex files from any PICmicro microcontroller compatible cross assembler or cross compiler If you are using MPASM assembler separate from the MPLAB IDE or are generating hex files from within the MPLAB IDE for use later with PICSTART Plus programmer you should use IINHX32 hex format MPASM assembler s default output format for hex files is INHX32 4 3 6 Changing the Configuration Bits Settings If you need to change the configuration bits for a device from the factory default settings or if you want to see the configuration bits settings select Configure Configuration Bits see Figure 4 13 FIGURE 4 13 CONFIGURATION BITS WINDOW PIC18F452 E Configuration Bits Address Value Category Setting Osc Switch Enable Disabled 300002 OF Power Up Timer Disabled Brown Out Detect Enabled Brown Out Voltage 2 5V 300003 Watchdog Timer Enabled Watchdog Postscaler 1 128 300
3. CONFIG directive to set the configuration bits for the device to be pro grammed Each time you rebuild your project or reload your hex file the configuration bits will be set according to the values from this directive If you do not set configuration bits in your source code then these bits will not be changed If you manually change these bits from their default values using this dialog they will be programmed into the device when you program the microcontroller A configuration bit s value manually set in the configuration window after a project is built will override the value s set by the project 4 3 7 Using the User ID Memory If needed an ID can be generated for the device by using the ID Option The ID can be an unprotected checksum derived from the contents programmed into the device or a value designated by the user The limitations on the value are determined by the device s memory size Select Configure gt ID Memory see Figure 4 15 to open the User ID Memory dialog Use this dialog to enter a user ID for devices that provide this functionality Also select whether or not to Use Unprotected Checksum Figure 4 16 FIGURE 4 15 CONFIGURING ID MEMORY MPLAB IDE File Edit View Project Debugger Programmer Tools RSC Window Help T Select Device D cL i 9 Checl dabis E e Gy Ds Da De D Configuration Bits ma Untitled Wor Umsss Hier Settings Build Version Control Find in Files PICSTART PICSTAR
4. 2004 Microchip Technology Inc MICROCHIP MPLAB IDE PICSTART PLUS USER S GUIDE DS51028F Note the following details of the code protection feature on Microchip devices Microchip products meet the specification contained in their particular Microchip Data Sheet Microchip believes that its family of products is one of the most secure families of its kind on the market today when used in the intended manner and under normal conditions There are dishonest and possibly illegal methods used to breach the code protection feature All of these methods to our knowledge require using the Microchip products in a manner outside the operating specifications contained in Microchip s Data Sheets Most likely the person doing so is engaged in theft of intellectual property Microchip is willing to work with the customer who is concerned about the integrity of their code Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code Code protection does not mean that we are guaranteeing the product as unbreakable Code protection is constantly evolving We at Microchip are committed to continuously improving the code protection features of our products Attempts to break Microchip s code protection feature may be a violation of the Digital Millennium Copyright Act If such acts allow unauthorized access to your software or other copyrighted work you may have a right to sue for r
5. Tutorial Now add the second file for our project the linker script There is a linker script for each device These files define the memory configuration and register names for the part The linker scripts are in the folder named LKR under the MCHIP Tools folder Use the file named 18F452 1kr The full path is C Program Files MPLAB IDE MCHIP_Tools LKR 18F452 1kr Also click on its check box so we can copy this into our project FIGURE 3 7 PROJECT WIZARD SELECT LINKER SCRIPT Project Wizard Step Four Add any existing files to your project 18f4439 lkr C Program Files MPLAB IDESMC Add gt gt 18f4439i lkr _Add gt gt 18 448 lkr 18f448i lkr Remove 18f4515 lkr aa lugens C Program Files MPLAB IDESMC 18f4515_e lkr 184525 kr 18 4525 e lkr 18f452i lkr 18 4538 lkr TAFAAAGI Ikr H d h E Check the box to copy the file to the project directory lt Back Cancel Help Make sure that your dialog looks like the picture above with both check boxes checked then press Next gt to finish the Project Wizard The final screen of the Project Wizard is a summary showing the selected device the toolsuite and the new project file name FIGURE 3 8 PROJECT WIZARD SUMMARY Project Wizard Summary Click Finish to create the project with these parameters Project Parameters Device PIC18F452 Toolsuite Microchip MPASM Toolsuite File C My ProjectsV18F452Proj
6. 2 10 ENABLING THE PICSTART PLUS You should select a device that is supported by the firmware in use before enabling the programmer Select Configure gt Select Device and choose a device supported by the PICSTART Plus To check that the PC and the programmer are communicating properly select Programmer Enable Programmer see Figure 2 6 enable the PICSTART Plus programmer FIGURE 2 6 ENABLING THE PICSTART PLUS MPLAB IDE File Edit View Project Debugger Be Tools Configure Window Help nz Select Programmer Bo Pass 0 Fait 0 Total 0 Tuus Checksum 028208 ERE W Untitled Wor DIS Build Version Control Find in Download PICSTART OS Settings PICSTARTPlus PIC1 novzdcc If PICSTART Plus is not found on the selected COM port a dialog similar to Figure 2 7 appears FIGURE 2 7 COMMUNICATIONS ERROR DIALOG Build Version Control Find in Files PICSTART Cannot Transmit Please verify connection and retry the previous operation If you cannot establish communications between the PC and PICSTART Plus make sure you have installed the hardware and software correctly see Section 2 4 Installing PICSTART Plus Hardware and Section 2 3 Installing MPLAB IDE Software If you still cannot establish communications between the PC and PICSTART Plus please see Appendix B Troubleshooting If you have been using another programmer e g PRO MAT
7. 3 Make sure that a COM port is properly set up exclusively for use by the programmer Check the resources to ensure they are operating properly and that there are no conflicts with other devices If other hardware is detected on the designated COM port or the COM port is being used by software at the time communication is attempted it will fail Consult your Windows manual or other reference literature You can try removing reconfiguring or disabling the conflicting device or software but do so only if you are familiar with those procedures See Section B 2 1 2 COM Port Setup 4 Some system errors are caused by driver and hardware incompatibility See Section B 2 1 2 COM Port Setup 2004 Microchip Technology Inc DS51028F page 69 MPLAB PICSTART Plus User s Guide 5 Make sure you are not using a third party communications driver See Section B 2 2 4 Third Party Communications Drivers for more information 6 Ifa virtual serial port is in use such as that generated by a USB to Serial Adapter ensure that the properties for the assigned COM port have been properly set See Section B 2 1 2 COM Port Setup 7 Firmware version is less than 2 01 MPLAB IDE versions require that firmware 2 01 or higher be used 8 MPLAB 5 61 or lower is in use with firmware version 3 11 or higher Use of firmware version 3 11 or higher with the 16 bit version of MPLAB requires version 5 62 or higher For more information see Sect
8. Checking if the PICSTART Plus Has a PUM Determining the Need for a PUM Installing the PUM Verifying the PUM is Working Correctly Downloading New Firmware Verifying the PICSTART Plus Firmware Update 5 8 1 Checking if the PICSTART Plus Has a PUM PICSTART Plus units that have a revision letter of R20 or higher already come equipped with the PUM or have a PIC18F6720 already built into its PCB The revision letter of a PICSTART Plus unitis the letter R followed by a number which can be found on back on the bottom of the plastic enclosure next to the serial number Another way to determine the firmware OS in use is to select Help gt About after enabling the PICSTART Plus in the MPLAB IDE If the firmware OS version is not 4 0 5 or higher the PICSTART Plus does not contain a PUM 5 8 2 Determining the Need for a PUM Device support is the key item to consider when determining whether or not a PUM is needed The need for newer firmware OS can by indicated by the following Consult the Readme for PICSTART Plus file which is found in the MPLAB IDE Readme directory where the MPLAB IDE application is installed on the workstation This file details the minimum firmware OS version needed to support a device If the firmware OS version in the PICSTART Plus does not support the desired device it will need to be upgraded Enable the PICSTART Plus in the MPLAB IDE If you receive a message stating the device requires a particular ver
9. ECAN ECONOMONITOR FanSense FlexROM fuzzyLAB In Circuit Serial Programming ICSP ICEPIC Migratable Memory MPASM MPLIB MPLINK MPSIM PICkit PICDEM PICDEM net PICLAB PICtail PowerCal Powerlnfo PowerMate PowerTool rfLAB rfPICDEM Select Mode Smart Serial SmartTel and Total Endurance are trademarks of Microchip Technology Incorporated in the U S A and other countries SQTP is a service mark of Microchip Technology Incorporated in the U S A All other trademarks mentioned herein are property of their respective companies 2004 Microchip Technology Incorporated Printed in the U S A All Rights Reserved gt Printed on recycled paper Microchip received ISO TS 16949 2002 quality system certification for its worldwide headquarters design and wafer fabrication facilities in Chandler and Tempe Arizona and Mountain View California in October 2003 The Company s quality system processes and procedures are for its PICmicro 8 bit MCUs KEELOQ code hopping devices Serial EEPROMs microperipherals nonvolatile memory and analog products In addition Microchip s quality system for the design and manufacture of development systems is ISO 9001 2000 certified DS51028F page ii 2004 Microchip Technology Inc MPLAB PICSTART PLUS MICROCHIP USER S GUIDE Table of Contents Pr face Geleet umane st can MA Redi ER LI E LI eL NE 1 Chapter 1 PICSTART Plus Overview WANAOHUS codo donent nuce db en
10. MPLAB PICSTART Plus User s Guide If these do not assemble and link successfully check the following items and then build the project again Check the spelling and format of the code entered in the editor window Make sure the new variables and the special function registers TRISC and PORTO are in upper case If the assembler reported errors in the Output window double click on the error and MPLAB IDE will open the corresponding line in the source code with a green arrow in the left margin of the source code window Check that the correct assembler MPASM assembler and linker for PICmicro devices is being used Select Project Set Language Tool Locations Click on the plus boxes to expand the Microchip MPASM toolsuite and its executable files Click MPASM Assembler mpasmwin exe and review their location in the dis play If the location is correct click Cancel If it is not change it and then click OK The default search paths can be empty Upon a successful build the output file generated by the language tool will be loaded This file contains the object code that can be programmed into a PICmicro MCU and debugging information so that source code can be debugged and source variables can be viewed symbolically in Watch windows Now that you ve built your project successfully you can prepare for programming your device 3 12 ENABLING THE PICSTART PLUS If you haven t already started the PICSTART Plus device programmer selec
11. assembler the MPLINK object linker and the MPLIB object librarian MPLAB IDE On line Help In Circuit Serial Programming ICSP Guide DS30277 This document contains helpful design guidelines to follow for successful ICSP programming It includes application notes on hardware designs and the ICSP programming specifications THE MICROCHIP WEB SITE Microchip provides online support via our WWW site at www microchip com This web site is used as a means to make files and information easily available to customers Accessible by using your favorite Internet browser the web site contains the following information Product Support Data sheets and errata application notes and sample programs design resources user s guides and hardware support documents latest software releases and archived software General Technical Support Frequently Asked Questions FAQ technical support requests online discussion groups Microchip consultant program member listing Business of Microchip Product selector and ordering guides latest Microchip press releases listing of seminars and events listings of Microchip sales offices distributors and factory representatives irm 2004 Microchip Technology Inc DS51028F page 3 MPLAB PICSTART Plus User s Guide
12. Hardware Installation eesssssssss 10 Reading Hex File Re 46 Loading into Program Memory 37 89 2325 antt a tad a evento al 10 13 S ID Locations Serial Pom Aa 10 13 Pro Verif 42 47 Software Installation MPLAB eeese 9 SE EE System Requirements Host Computer 9 EE 38 y q i P Installation VW Hardware EE 10 Windowed Device ccccccccsesscesescesscesesestseesesesseees 45 MPLAB Software En 9 WWW Address s 3 Internet Address 3 J BU Ree e eee Eee A0 L Loading a Hex File oe dese 37 M Microchip Web Gute 3 MPASM sieve Lie e RUE B 7 38 MPLAB enee ees Ee Ri eet enn dei 7 MPLAB CXX ia 7 2004 Microchip Technology Inc DS51028F page 77 MPLAB PICSTART Plus User s Guide NOTES DS51028F page 78 2004 Microchip Technology Inc Index NOTES 2004 Microchip Technology Inc DS51028F page 79 MICROCHIP WORLDWIDE SALES AND SERVICE AMERICAS Corporate Office 2355 West Chandler Blvd Chandler AZ 85224 6199 Tel 480 792 7200 Fax 480 792 7277 Technical Support http support microchip com Web Address www microchip com Atlanta Alpharetta GA Tel 770 640 0034 Fax 770 640 0307 Boston Westford MA Tel 978 692 3848 Fax 978 692 3821 Chicago Itasca IL Tel 630 285 0071 Fax 630 285 0075 Dallas Addison TX Tel 972 818 7423 Fax 972 818 2924 Detroit Farmington Hills MI Tel 248 538 2250 Fax 248 538 22
13. M Untitled Wor ENEJ Porn gt Read Blank Check All Blank Check OTP Abort Operation Build Version Control Find in Reset Program Statistics Erase Flash Device Download PICSTART OS Settings PICSTART Plus PICi8F452 f novzdcc 4 5 READING A DEVICE To read the entire device e g all of program memory configuration bits etc select Programmer gt Read in MPLAB IDE To selectively read part of program memory only configuration bits etc 1 Select Programmer gt Settings and click on the Memory Ranges tab Figure 4 23 FIGURE 4 23 MEMORY RANGES TAB Programmer EEN Memory Ranges Communications Read all on auto select Manually enter memory areas and range Program memory start address Program memory end address DS51028F page 46 2004 Microchip Technology Inc Using the PICSTART Plus 2 Ifthe Auto select memory areas and range option is enabled checked disable uncheck the option If this option is enabled you will not be able to manually select the specific memory areas and range 3 Selectthe memory areas and ranges to be read Click OK Refer to Table 4 2 for descriptions of the manual settings TABLE 4 2 MEMORY RANGES MANUAL SETTINGS Program memory start address The starting address in program memory for programming or verification Program memory end address The ending address in program memory for programming or verification Pr
14. MEMORY WINDOW When you select View gt Program Memory from the MPLAB IDE menu the Program Memory window Figure 5 5 opens in machine code view FIGURE 5 5 PROGRAM MEMORY WINDOW E Program Memory pcode Hex Machine Symbolic You can view the Program Memory as hex code machine code or disassembled with symbols if available Change display mode by clicking on the display option button in the lower left corner of the window When a Read is performed a project built or an Import performed that is using this memory area the program memory window will be overwritten If the MPLAB Simulator is in use along with the PICSTART Plus be sure that the contents of the MPLAB IDE are those you wish to have programmed into the device before using the Program option 5 5 3 Disable Programmer To disable the PICSTART Plus programmer select Programmer gt Disable Programmer 5 5 4 Program Select Programmer gt Program to program the entire device i e all of the program memory configuration bits etc If you want to program selectively e g part of program memory only configuration bits select Programmer gt Settings to open the Programmer Settings dialog Click the Memory Ranges tab and select the options for programming Areas that are grayed out are not available on the device Click OK Then select Programmer gt Program to program the device The memory area corresponding to the checked boxes will be programmed Af
15. Select the PSPLS HEX file you wish to download and click Open When finished the system displays a Download Complete message 5 5 13 About Select Programmer gt About to display version of the PICSTART Plus OS firmware version in the programmer 2004 Microchip Technology Inc DS51028F page 57 MPLAB PICSTART Plus User s Guide 5 6 PROGRAMMER SETTINGS Select Programmer gt Settings to display the Programmer Settings dialog The dialog has tabs for setting memory ranges and communications 5 6 1 Memory Ranges Tab Select Programmer gt Settings and click on the Memory Ranges tab to select device memory areas for programming see Table 5 5 TABLE 5 5 MEMORY RANGES OPTIONS Selection Description Auto select memory areas and range The default is enabled checked see Section 5 6 1 1 Auto Option Enabled When enabled the memory areas and ranges for the selected device are automatically selected by the MPLAB IDE The corresponding memory areas and range information are displayed as checked but unavailable in the manual fields If the auto select option is disabled unchecked see Section 5 6 1 2 Auto Option Disabled you can specify memory areas and ranges Read all on auto select The default is enabled checked This option is only available if the Auto select memory areas and range option is enabled When this option is enabled a Read operation reads the entire device If d
16. Windows operating system Third party drivers may or may not work Check the driver designated for the COM port in use If it is not the driver provided by Microchip it will need to be changed B 2 3 No Programmer Options Visible You must select a device supported by the firmware in use then select the programmer before the programmer options are available Select Programmer gt Select Programmer and choose PICSTART Plus from the list El 2004 Microchip Technology Inc DS51028F page 71 MPLAB PICSTART Plus User s Guide B 2 4 Incompatible Software and Operating System Versions The versions of software and operating system are mixed The PICSTART Plus programmer and the MPLAB IDE software include compatibility checks to ensure that version requirements are met The latest PICSTART Plus software and OS firmware are included in the installation of the MPLAB IDE Be sure to use the latest version of the MPLAB IDE B 2 5 Blank Check Problems Some blank check problems you may experience include PIC16C73 PIC16C74 Known Blank Part Shows To Be Non blank When Reading A Blank PIC16C55A PIC16C57C or PIC16C57 Program Memory Values Of OxBFF Are Reported B 2 5 1 PIC16C73 PIC16C74 KNOWN BLANK PART SHOWS TO BE NON BLANK When programming some PIC16C7X PIC16C73 PIC16C74 devices a known blank part will show to be not blank and will not program properly The problem occurs because the rise time of VPP is too fast to prop
17. download if needed When the download completes Disable then Enable the programmer so that the change in firmware versions will be fully recognized by the MPLAB IDE Perform a Programmer About to confirm the version now in use More details on downloading newer firmware can be found in Section 5 8 5 Downloading New Firmware B 3 5 Could Not Open The Communications Port If the communications port cannot be opened it is because either another application has opened the port or the port does not exist Make sure the port number is valid and that no other application is using it such as another instance of MPLAB IDE aa c c H dns MM P 2 DS51028F page 74 2004 Microchip Technology Inc Troubleshooting B 3 6 Program Memory Contains Code Protected Data When a Read is performed on a device in which an area of its EEPROM or Program memory has been code protected a message will be displayed stating that the infor mation may not be valid A code protected OTP or EPROM device cannot be erased Flash devices however can be erased or over programmed The data in the memory area that have been code protected may be scrambled or show zeroes The areas of the device that have not been code protected may be available for programming Some devices require that the entire device be prog
18. firmware versions Download should only be per formed if a different version of the firmware is needed to support a device or it contains a fix to a problem About Displays the programmer s firmware OS version information Settings Opens the Programmer dialog which allows you to set the memory ranges and the communica tions port Programmer options Program Read and Verify are controlled by these settings 2004 Microchip Technology Inc DS51028F page 53 MPLAB PICSTART Plus User s Guide 5 5 1 Select Programmer To select the PICSTART Plus programmer choose Select Programmer gt PICSTART Plus Once the programmer is selected the Output window opens 5 5 2 Enable Programmer To enable the PICSTART Plus programmer select Programmer gt Enable Programmer When attempting to enable the PICSTART Plus the following can occur D Communication is successful the device is supported by the firmware version in use and the firmware version in use is the latest available as detected by the MPLAB IDE No messages will be displayed The PICSTART Plus toolbar will be made available and the Programmer menu will be updated to the items associated with the use of the PICSTART Plus The version of the firmware detected by the MPLAB IDE is older than that known to be the latest version The PICSTART Plus will be made ready for use but a newer firmware message will be displayed It is not necessary to download th
19. hardware and MPLAB IDE software Chapter 2 PICSTART Plus Installation Turned on the PICSTART Plus programmer Section 2 6 Turning the PICSTART Plus On Off Established communications between the PC and the PICSTART Plus programmer Section 2 9 Configuring the Serial Port for PICSTART Plus 4 3 PROCEDURE FOR PROGRAMMING A DEVICE Follow this list of steps to program a device Step Description See 1 Select the device Section 4 3 1 Selecting the Device 2 Select the PICSTART Plus Section 4 3 2 Selecting the Programmer programmer 3 Programmer Settings Section 4 3 3 Configuring Programmer Settings 4 Enable the PICSTART Plus Section 4 3 4 Enabling the Programmer programmer 5 Load a hex file into program Section 4 3 5 Loading a Hex File into memory or assemble compile one Program Memory in program memory from your source code 6 Set up the Configuration Bits Section 4 3 6 Changing the Configuration dialog Bits Settings 7 Edit User ID Memory if needed Section 4 3 7 Using the User ID Memory 8 Check that your device is blank Section 4 3 8 Checking For a Blank Device 9 Program the device Section 4 3 9 Programming a Device 2004 Microchip Technology Inc DS51028F page 31 MPLAB PICSTART Plus User s Guide 4 3 1 Selecting the Device Select Configure Select Device to select the device you wish to progra
20. s Guide for additional information on the wi 15 features of the assembler and linker x 16 17 Refer to the PICISFXX2 Data Sheet for additional information on the E 18 architecture and instruction set i 19 lt Gen LEE EE EE EE e e e EE dad d d RH RU EE EE EE EE EE E 21 3 lez H Filename 23 Date 24 H File Version v gt Scroll down to the bottom of the file The code in the first part of the file is mainly for more advanced things such as setting up interrupts and configuration bits in a final application We can ignore those details for now and just write the code Our code will go into the file at the point after the symbol Main is defined FIGURE 3 12 TEMPLATE FILE MAIN Will MPLAB IDE Editor f452tmpo asm LEE Start of main program The main program code is placed here Main main code goes here QEATAGO OR AAAS EASE AAA EAA AAA EASE ESA REE AREER AURORA RH End of program END 2004 Microchip Technology Inc DS51028F page 25 MPLAB PICSTART Plus User s Guide When any source file is opened you are automatically in the editor Type in this code Main clrf WREG movwf PORTC clear PORTC movwf TRISC configure PORTC as all outputs Init clrf COUNT IncCount incf COUNT movf COUNT W movwf PORTC display COUNT on PORTC callDelay goto IncCount infinite loop Delay movlw 0x40 set outer delay loop movwf DVAR2 DelayO mo
21. the MPLAB IDE documentation Refer to the MPLAB IDE documentation for more detailed instructions Insert the MPLAB IDE CD ROM into your CD ROM drive Example drive D The CD will automatically begin the setup Follow the on screen instructions to install the MPLAB IDE 2004 Microchip Technology Inc DS51028F page 9 MPLAB PICSTART Plus User s Guide 2 4 INSTALLING PICSTART PLUS HARDWARE The PICSTART Plus hardware is simple to set up First the communications cable is attached and then the power supply is connected 2 4 1 Installing the Communications Cable PICSTART Plus provides communications with the host PC via an RS 232 9 pin D type connector PICSTART Plus is Data Communication Equipment DCE and hardware handshaking is via Clear To Send CTS and Request To Send RTS A 6 foot data cable with DB 9 connectors is supplied with PICSTART Plus All lines on the data cable are wired straight through This cable is NOT a null modem cable To install the serial communications cable 1 Connect one end of the cable to an available COM port on your PC Check your PC setup to see which communications port is available 2 Connect the cable from your COM port to the PICSTART Plus development programmer 2 4 2 Installing the Power Supply The PICSTART Plus comes with a 9V input power supply PICSTART Plus requires 9 volts x1096 at 500 mA max on the center positive 2 5 mm terminal To install the power suppl
22. the memory cells 3 When the UV eraser indicates completion remove the device 4 3 10 4 RESTORING CALIBRATION DATA 1 Insert the erased windowed device into the PICSTART Plus programmer socket 2 Select Programmer gt Blank Check to ensure that the device is blank If the device is not blank it has not been erased 3 If the device is blank restore the saved calibration data by either a Manually entering the saved calibration value into the last address of the program memory window or b Select File Importto import the calibration value from the hex file that contains the information Browse to the location and select the file Click Open 4 Once hex that contains the calibration data has been imported program the device 2004 Microchip Technology Inc DS51028F page 45 MPLAB PICSTART Plus User s Guide 4 4 VERIFYING THE PROGRAMMING Select Programmer gt Verify see Figure 4 22 to verify that the contents of the device match the program memory EEPROM data calibration memory ID locations and configuration bits in the MPLAB IDE If the device s contents do not match what is currently in the MPLAB IDE displayed in the memory area windows for the device the Verify will fail FIGURE 4 22 VERIFY COMMAND m MPLAB IDE File Edit View Project Debugger Baisse Configure Window Help D a Ba g e Select programmer Oo Pass 0 Fail 0 Total 0 Checksum 0x82d8 Disable Programmer
23. used in the interrupt routines UDATA Add WREG TEMP RES 1 variable in RAM for context saving STATUS TEMP RES 1 variable in RAM for context saving these BSR TEMP RES 1 variable in RAM for context saving three o UDATA ACS lines QAGORGURGURROOR TUR UR UURAUEAUOR UE RUE EEEE EEEE EEEE EEEE EEEE EEEE EEEE EEEE E EEEE EE UR AUG RUE ER EEPROM data Data to be programmed into the Data EEPROM is defined here DATA EEPROM CODE Oxf00000 3 11 BUILDING THE PROJECT Select Project gt Build All to assemble and link the code If the code assembled with no errors the Output Window will look like Figure 3 15 FIGURE 3 15 BUILD OUTPUT WINDOW L Output Build Version Control Find in Files Clean Deleting intermediary and output files Clean Done Executing C Program Files MPLAB IDE MCHIP_Tools mpasmwin exe Jo p18F 452 f452tm Executing C Program Files MPLAB IDE MCHIP_Tools mplink exe C Program Files MPL MPLINK 3 80 Linker Copyright c 2004 Microchip Technology Inc Errors SH MP2COD 3 80 COFF to COD File Converter Copyright c 2004 Microchip Technology Inc Errors gt B MP2HEX 3 80 COFF to HEX File Converter Copyright c 2004 Microchip Technology Errors B Loaded CAMy PrajectsVl 8F452Proj cof BUILD SUCCEEDED Tue Jul 13 10 15 46 2004 Save your project by selecting File gt Save Workspace 2004 Microchip Technology Inc DS51028F page 27
24. with devices that contain calibration memory These devices are set at the factory with the calibration parameters stored in a last address of program memory This value is not the same for all calibration devices Calibration memory devices can come in OTP non windowed EEPROM windowed and Flash packages Non windowed OTP calibration devices can only be programmed once and cannot be erased EEPROM calibration devices in a windowed CERDIP JW or windowed CERQUAD CL package can be erased using an Ultraviolet UV EPROM Eraser If these devices are erased all memory areas including the calibration data will be erased Before programming an erased windowed device that contains calibration memory the correct calibration values must be restored Flash calibration devices can be erased using the MPLAB IDE software and their calibration data is automatically retained They do not require any special preparation to reprogram them Note A windowed device that has been code protected cannot be properly erased Programming or reprogramming a windowed calibration device includes Reading a Calibration Device Saving the Calibration Data Erasing a Windowed Device Restoring Calibration Data 4 3 10 1 READING A CALIBRATION DEVICE 1 Before you begin uniquely label each device 2 Use Configure Select Device to choose the needed calibration memory device 3 Select Programmer gt Select Programmer gt PICSTART Plus 4 Ensure tha
25. 004 Microchip Technology Inc Troubleshooting B 2 2 Advanced Serial Communications Help Here are some areas that can cause serial communications problems Modem Interaction Problems With A Serial Mouse Interrupt Conflicts Third Party Communications Drivers B 2 2 1 MODEM INTERACTION The programmer cannot be on the same communications port or the same interrupt as a modem or any other hardware To rectify the problem either disable the other hardware move one or the other to a different communications port or remove the hardware B 2 2 PROBLEMS WITH A SERIAL MOUSE If you have a serial mouse make sure you are not accidentally specifying that communications port as your programmer port B 2 2 3 INTERRUPT CONFLICTS Check that your system has no interrupt conflicts Make sure that only one device is using each interrupt Windows 98 ME 1 Select Settings Control Panel from the Start menu 2 Select System and click on the Device Manager tab 3 Expand the Ports selection and make sure there are no conflict indicators Windows NT 2000 XP Select Settings Control Panel from the Start menu Select System and expand the Ports list Click on a COM port from the list then click the Port Settings tab In the Port Settings dialog click Advanced 5 Make sure there are no IRQ conflicts Pooh B 2 2 4 THIRD PARTY COMMUNICATIONS DRIVERS The programmers are designed to run with the drivers shipped with the
26. 005 CCPZ Mux BCL 300006 Stack Overflow Reset Enabled Low Voltage Program Enabled 300008 Code Protect O00200 01FFF Disabled Code Protect 02000 03FFF Disabled lt The configuration bits shown in Figure 4 13 are for a PIC18F452 device The type and number of configuration bits depend on the device selected For more information on the functions of configuration bits for a particular device refer to the specific device data sheet Note Changing the configuration bits in the window after building a project or importing a hex file will supersede the values set by these two methods DS51028F page 38 2004 Microchip Technology Inc Using the PICSTART Plus To change a configuration bits setting 1 Click on the setting you want to change and a down arrow appears to the right of the setting If you cannot see the down arrow increase the width of the Configuration Bits window until the down arrow appears 2 Clickthe down arrow to view the setting options and select the one you want see Figure 4 14 FIGURE 4 14 CHANGING CONFIGURATION BITS SETTINGS RW Configuration Bits Address Category Setting 300001 Oscillator RC OSC2 as RA6 Osc Switch Enable Disabled 300002 Power Up Timer Brown Out Detect Enabled Brown Out Voltage Eu Watchdog Timer Enabled Watchdog Postscaler CCPZ Mux Stack Overflow Reset You can also specify the configuration bit values in your source code Use the MPASM assembler
27. 2 When you select a device indicators next to the Microchip Tools names show the level of support for that device green supports the device yellow limited support and red no support If the selected device is supported by PICSTART Plus click OK If you select a device that is incompatible with PICSTART Plus a warning displays stating PICSTART Plus does not support that device FIGURE 2 2 SELECT DEVICE DIALOG Select Device Device PIC18F452 X Microchip Programmer Tool Support PICSTART Plus MPLAB ICD 2 PRO MATE II Pickit1 MPLAB PM3 Microchip Debugger Tool Support MPLAB SIM MPLABICD 2 MPLAB ICE 2000 MPLAB ICE 4000 pcm1sxc1 ps SwCO QPCMI18XH0 Cancel Help DS51028F page 12 2004 Microchip Technology Inc PICSTART Plus Installation 2 8 SELECTING THE PICSTART PLUS PROGRAMMER Select Programmer gt Select Programmer gt PICSTART Plus from the MPLAB IDE menu to select the programmer Figure 2 3 Once the programmer is selected PICSTART Plus appears at the bottom of the screen FIGURE 2 3 SELECT PROGRAMMER MPLAB IDE DEK File Edit View Project Debugger Bs Tools Configure Window Help met DIE 3 MPLAB PM 3 L Output 4 PRO MATE II DER Build Version Control Find in Files J PIC18F452 novzdcc 2 9 CONFIGURING THE SERIAL PORT FOR PICSTART PLUS To configure the serial port for the PICSTART Plus select Programmer S
28. 60 Kokomo Kokomo IN Tel 765 864 8360 Fax 765 864 8387 Los Angeles Mission Viejo CA Tel 949 462 9523 Fax 949 462 9608 San Jose Mountain View CA Tel 650 215 1444 Fax 650 961 0286 Toronto Mississauga Ontario Canada Tel 905 673 0699 Fax 905 673 6509 ASIA PACIFIC Australia Sydney Tel 61 2 9868 6733 Fax 61 2 9868 6755 China Beijing Tel 86 10 8528 2100 Fax 86 10 8528 2104 China Chengdu Tel 86 28 8676 6200 Fax 86 28 8676 6599 China Fuzhou Tel 86 591 8750 3506 Fax 86 591 8750 3521 China Hong Kong SAR Tel 852 2401 1200 Fax 852 2401 3431 China Shanghai Tel 86 21 5407 5533 Fax 86 21 5407 5066 China Shenyang Tel 86 24 2334 2829 Fax 86 24 2334 2393 China Shenzhen Tel 86 755 8203 2660 Fax 86 755 8203 1760 China Shunde Tel 86 757 2839 5507 Fax 86 757 2839 5571 China Qingdao Tel 86 532 502 7355 Fax 86 532 502 7205 ASIA PACIFIC India Bangalore Tel 91 80 2229 0061 Fax 91 80 2229 0062 India New Delhi Tel 91 11 5160 8632 Fax 91 11 5160 8632 Japan Kanagawa Tel 81 45 471 6166 Fax 81 45 471 6122 Korea Seoul Tel 82 2 554 7200 Fax 82 2 558 5932 or 82 2 558 5934 Singapore Tel 65 6334 8870 Fax 65 6334 8850 Taiwan Kaohsiung Tel 886 7 536 4818 Fax 886 7 536 4803 Taiwan Taipei Tel 886 2 2500 6610 Fax 886 2 2508 0102 Taiwan Hsinchu Tel 886 3 572 9526 Fax 886 3 572 6459 EUROPE Austria Weis Tel 43
29. 7242 2244 399 Fax 43 7242 2244 393 Denmark Ballerup Tel 45 4420 9895 Fax 45 4420 9910 France Massy Tel 33 1 69 53 63 20 Fax 33 1 69 30 90 79 Germany Ismaning Tel 49 89 627 144 0 Fax 49 89 627 144 44 Italy Milan Tel 39 0331 742611 Fax 39 0331 466781 Netherlands Drunen Tel 31 416 690399 Fax 31 416 690340 England Berkshire Tel 44 118 921 5869 Fax 44 118 921 5820 10 20 04 DS51028F page 80 2004 Microchip Technology Inc
30. CHIP FIGURE A 2 PICSTART PLUS BACK VIEW Power Input Serial Port OCHO i oooo Jj DS51028F page 68 2004 Microchip Technology Inc MPLAB PICSTART PLUS MICROCHIP USER S GUIDE Appendix B Troubleshooting B 1 INTRODUCTION This appendix provides information for troubleshooting the PICSTART Plus programmer including Common Problems Error Messages Warnings and Announcements Limitations B 2 COMMON PROBLEMS Failure to Establish Communication with PICSTART Plus Advanced Serial Communications Help No Programmer Options Visible Incompatible Software and Operating System Versions Blank Check Problems LED Indicators Flicker or Do Not Light Device Pin Damage Download Not Successful B 2 1 Failure to Establish Communication with PICSTART Plus MPLAB IDE attempts to establish communication with the PICSTART Plus device programmer when you enable the programmer If communication cannot be established no programming can occur A message appears in the Output window if the attempt to establish communication fails General Communications Troubleshooting COM Port Setup B 2 1 1 GENERAL COMMUNICATIONS TROUBLESHOOTING 1 Make sure that the RS 232 cable is connected the power supply is connected and the power LED on the programmer is on 2 Try connecting the programmer to a different serial port If your PC has a 25 pin serial port you will need a 25 to 9 serial port adapter
31. E II with a device that is not supported by the PICSTART Plus the PICSTART Plus programmer menu might not be available Ensure that the device currently selected is supported by the PICSTART Plus and the firmware in use see Section 2 7 Selecting the Device Select Programmer Select Programmer and choose PICSTART Plus from the list then select Programmer gt Enable Programmer to enable the PICSTART Plus 2004 Microchip Technology Inc DS51028F page 15 MPLAB PICSTART Plus User s Guide NOTES DS51028F page 16 2004 Microchip Technology Inc MPLAB PICSTART PLUS MICROCHIP USER S GUIDE Chapter 3 Tutorial 3 1 INTRODUCTION The tutorial in this chapter leads you through the steps involved in programming the PIC18F452 PlCmicro device using MPLAB IDE Project Wizard 3 2 BEFORE YOU BEGIN Before you can begin this tutorial you must 1 Install the MPLAB IDE software See Section 2 3 Installing MPLAB IDE Software 2 Install the PICSTART Plus hardware See Section 2 4 Installing PICSTART Plus Hardware 3 Make sure you have read and completed all the instructions in Section 2 6 Turning the PICSTART Plus On Off and Section 2 9 Configuring the Serial Port for PICSTART Plus 4 Make sure that your PC and PICSTART Plus are communicating and the PICSTART Plus menu appears on the MPLAB menu before you begin this tutorial 3 3 PROGRAMMING OVERVIEW Programming a mid range PlCmicro device involves
32. HE PICSTART PLUS PROGRAMMER HELPS YOU The PICSTART Plus development programmer has the following features D Programs PICmicro microcontrollers including program memory configuration bits and ID locations Operates as a Windows application on a PC compatible host system within the MPLAB Integrated Development Environment IDE Communicates with the PC via a standard RS 232 cable With MPLAB IDE the user can create display and edit data to be programmed into PlCmicro microcontrollers MCUs In addition you can verify that PICmicro MCUs are blank verify that code in the target microcontroller matches your firmware and you can read code from an unprotected PlCmicro MCU into the MPLAB IDE program memory window for debugging and programming into other PlCmicro MCU devices D D D DS51028F page 6 2004 Microchip Technology Inc PICSTART Plus Overview 1 6 MPLAB INTEGRATED DEVELOPMENT ENVIRONMENT The MPLAB desktop provides an environment for developing and debugging your application PICSTART Plus is integrated into the MPLAB IDE This document covers the basic setup and operation of the PICSTART Plus device programmer but it does not cover all functions of the MPLAB IDE Read the MPLAB IDE documentation to get a full understanding of the features and debug capabilities of the MPLAB IDE 1 7 MPLAB DEVELOPMENT TOOLS The MPLAB IDE integrates several tools to provide a complete development environment MPLAB Project M
33. PICSTART Plus software check the Start and End addressed entered in the Memory Range text box in the Settings dialog A message will be displayed if the entry is improper for the device D DS51028F page 76 2004 Microchip Technology Inc MICROCHIP MPLAB PICSTART PLUS USER S GUIDE Index Symbols MPLAB Development Tools sss 7 CONFIG oe dun Mte dena acerca decebat 39 MPLAB Elton 7 MPLAB IGE i teniente n M 7 B MPLAB IDE Blank Check AN 40 Installirig seins Sie Leti eus 9 Blank Check OTP sse 40 Sa creed 11 C MPELEAB Projects eei iege ete brit 7 MPLAB SIM tpe nee erinnere 7 Calibration Memory EE 7 Programming En 42 47 MREINK i Dane Sa nse edie NU 7 Communications Port 10 13 Configuration Bits o Dialog Eee leet de ID dus 38 Operating System LUlpoorade n 62 Program Verify seen 42 47 OTP Customer Notification Genlce 4 Blank Check 40 Customer Support 4 P D PICSTART PIOS inimi Deme ti epe 7 Document Conventtons mma 2 PICSTART Plus Toolbar seesesessse 49 Power Supply 2 cccceseeceeeeeeeeecaeeeeeseeseeeeeeeesenaes 10 E Program Memory ssssssseeeeenne 35 EEPROM Importing a Hex File 37 Programming Data 42 47 Program Memory Wimdow 55 EPROM cde ee Re ie eee oce et dert e 40 Programming F Calibration Memor 42 47 File Formats pu enc eiue 38 EERROM Ee T suere st se ee 40 GE M H
34. Pru DER M bete 49 5 3 Configure On 50 5 4 Debugger Menu sssssssssss eene eene nennen enn nnns nnns 51 5 5 PICSTART Plus Programmer Menu ssss n 52 5 6 Programmer Settings ssssssssssss ee 58 5 7 Files Used by the PICSTART Plus Programmer sssssssssesrieerrerrrrrrrrrrrnnene 61 5 8 Upgrading the PICSTART Plus Firmware OS see 62 Appendix A Hardware Specifications AM AA Ko To JU LG io E o WAUWAWA 67 A 2 Connecting to a PC via the Serial Port iamini naniii ama nimamia 67 A 3 Physical Dimensions and Layout eene 67 Appendix B Troubleshooting BANA WO EE 69 Eent BEE 69 B 3 Error Messages Warnings and Announcements ssesssssusss 73 LE Mic PT m 76 IT os oa rne AAA AAA AAA 77 Worldwide Sales and Service eres 80 DS51028F page iv 2004 Microchip Technology Inc MPLAB PICSTART PLUS MICROCHIP USER S GUIDE Preface NOTICE TO CUSTOMERS All documentation becomes dated and this manual is no exception Microchip tools and documentation are constantly evolving to meet customer needs so some actual dialogs and or tool descriptions may differ from those in this document Please refer to our web site www microchip com to obtain the latest documentation available Documents are identified with a DS number This number is located on the bottom of each page in front of the page number
35. Puton the back cover making sure to align the hole in the Processor Upgrade Kit with the plastic support in the back cover 6 Insertthe Phillips head screws into the holes in the back cover Carefully tighten each screw slowly as the plastic housing can be damaged if too much torque is applied to the screws 7 Reconnect the PICSTART Plus programmer to the computer serial port and power supply 5 8 4 Verifying the PUM is Working Correctly When the PUM is used to replace a PIC17C44 or the very first time a PICSTART Plus is used proper functioning of the hardware should be ensured Check the physical connection of the serial cable to the workstation and hardware Make sure the communication port selected in the MPLAB IDE matches the one in use Select a device Configure2 Select Device that is supported by the earliest version of firmware OS 2 01 that can be used with the MPLAB IDE such as the PIC16F84A Select Programmer gt Select Programmer gt PICSTART Plus as the programmer Select Programmer gt Enable Programmer If you can successfully enable the programmer without receiving communication error messages the hardware is working properly e Note Anannouncement that newer firmware is available is not a communication error message No action is required E DS51028F page 64 2004 Microchip Technology Inc PICSTART Plus MPLAB IDE Reference 5 8 5 Downloading New Firmware New firmware OS should only
36. RT Plus Programmer Helps You 1 2 WHAT IS PICSTART PLUS PROGRAMMER The PICSTART Plus is a Microchip microcontroller development programmer that enables you to program user software into PICmicro microcontroller devices Devices in non DIP packages that are supported by the PICSTART Plus require the use of an adapter Those currently available are listed on the Microchip web site Note The PICSTART Plus programmer is designed for use in firmware development and is not intended for production use 1 3 PICSTART PLUS SYSTEM COMPONENTS The PICSTART Plus development programmer system includes PICSTART Plus development programmer Figure 1 1 RS 232 Interface cable to connect to any standard PC serial port 9V power supply MPLAB IDE software an Integrated Development Environment as detailed in Section 1 7 MPLAB Development Tools Blank chip for programming 2004 Microchip Technology Inc DS51028F page 5 MPLAB PICSTART Plus User s Guide FIGURE 1 1 PICSTART PLUS DEVELOPMENT PROGRAMMER 1 4 PICSTART PLUS CE COMPLIANCE The PICSTART Plus development system is designed tested and certified to meet the Electromagnetic Compatibility requirements known as the CE compliance directives These standards set by the European Union EU countries include limiting radiated emission reducing susceptibility to radiated emission and reducing susceptibility to Electrostatic Discharge ESD 1 5 HOW T
37. START PLUS MICROCHIP USER S GUIDE Appendix A Hardware Specifications A 1 INTRODUCTION This appendix covers Connecting to a PC via the Serial Port Physical Dimensions and Layout A 2 CONNECTING TO A PC VIA THE SERIAL PORT The PICSTART Plus programmer interfaces to the PC via a standard RS 232 port with a DB9 connector The unit defaults to a 19 2K baud rate Serial port communications is as follows 8 data bits 1 stop bit no parity Hardware flow control FIFO Buffers should be disabled Table A 1 provides the data for connecting the PICSTART Plus programmer 9 pin straight through to a 25 pin serial port Connect the corresponding terminals indicated on each line of the table TABLE A 1 PC HOST TO PICSTART PLUS SIGNALS 25 pin PC Host 9 pin PICSTART Plus 2 TX gt 2 RX 3 RX Ak 3 TX 20 DTR gt 4 DTR 7 Common 5 Common 6 DSR lt gt 6 5 volts pulled up 4 RTS gt 7 CTS 5 CTS gt 8 RTS A 3 PHYSICAL DIMENSIONS AND LAYOUT The PICSTART Plus programmer has the physical dimensions of 6 inches x 4 inches x 14 16 inch Top and back views of the programmer are shown in Figure A 1 and Figure A 2 respectively 2004 Microchip Technology Inc DS51028F page 67 MPLAB PICSTART Plus User s Guide FIGURE A 1 PICSTART PLUS TOP VIEW PICSTART Plus Development Programmer LEDs POWER O ACTIVE O Socket Module Connector MICRO
38. START Plus development programmer system Refer to the MPLAB IDE documentation or on line help for additional information Topics covered in this chapter PICSTART Plus Toolbar Configure Menu Debugger Menu PICSTART Plus Programmer Menu Programmer Settings Files Used by the PICSTART Plus Programmer Upgrading the PICSTART Plus Firmware OS 5 2 PICSTART PLUS TOOLBAR The PICSTART Plus toolbar Figure 5 1 consists of icons for some of the programmer functions and a program statistics display FIGURE 5 1 PICSTART PLUS TOOLBAR Program Program Statistics Dy Da O3 Oy Da Pass 0 Fail 0 Total 0 Blank Check Erase Flash All Device 2004 Microchip Technology Inc DS51028F page 49 MPLAB PICSTART Plus User s Guide Position the mouse pointer over the toolbar item to display the name The items on the toolbar are shown in Table 5 1 TABLE 5 1 PICSTART PLUS TOOLBAR COMMANDS Symbol Command Description Blank Check All Checks that the device is completely blank all bits are set to 5 a a 1 This will also check that all configuration bits are set to didit a T unprogrammed state Same as Programmer gt Blank Check All 3 Read Reads the device Same as Programmer gt Read oe 3 Program Programs the device Same as Programmer gt Program db Verify Verifies that the device was programmed properly Same as 3 V Programmer Verify Erase Flash Devi
39. T Plus PICi8F452 novzdcc 2004 Microchip Technology Inc DS51028F page 39 MPLAB PICSTART Plus User s Guide FIGURE 4 16 USER ID MEMORY DIALOG User ID Memory User ID FFFFFFFF C Use Unprotected Checksum Cancel Help You can also use the __IDLOCS directive to set the ID bytes from the MPASM assembler Each time you rebuild your project or reload your hex file the ID locations will be set according to the values from the __IDLOCS directive Any ID value manually set using the ID memory dialog after a project is built will override the value set by the project Click OK to set the option or click Cancel to cancel the entry 4 3 8 Checking For a Blank Device Before performing a Blank Check ensure that the device is aligned Pin 1 to Pin 1 of the PICSTART Plus ZIFF socket the silver lever is pulled down to secure the device in the ZIFF socket Select Programmer gt Blank Check All to verify that the device is completely blank all bits are set to a 1 This will also verify that all configuration bits are set to a 1 unprogrammed state If you are using a one time programmable OTP device some configuration bits might already be programmed from the factory e g oscillator bits Use the Configuration Bits dialog Configure2 Configuration Bits to set the configuration bits to the factory settings then select Programmer Blank Check OTP This will check that all pr
40. Technology Inc Errors B MP2HEX 3 80 COFF to HEX File Converter Copyright c 2004 Microchip Technology Errors 2D Loaded C My Projects 1 8F452Proj cof BUILD SUCCEEDED Mon Jul 12 15 33 28 2004 lt i DS51028F page 24 2004 Microchip Technology Inc Tutorial 3 10 CREATING CODE Open the template file in the project by double clicking on its name in the Project Window see Figure 3 11 The file has some comments at the beginning and this area can be used as a standard comment information header for the file For now you ll leave this as it is but if this were a real project you could put information about your design here FIGURE 3 11 TEMPLATE FILE 1 EE EE AUA le This file is a basic template for creating relocatable assembly code for Ia a PICISF452 Copy this file into your project directory and modify or 4 add to it as needed Create a project with MPLINK as the language tool x 5 for the hex file Add this file and the 18F452 LKR file to the project le 7 The PICISFXXX architecture allows two interrupt configurations This e template code is written for priority interrupt levels and the IPEN bit k 2 H in the RCON register must be set to enable priority levels If IPEN is 10 H left in its default zero state only the interrupt vector at 0x008 will zi 11 be used and the WREG_TEMP BSR_TEMP and STATUS_TEMP variables will not 12 H be needed x 13 e 14 Refer to the MPASM User
41. The numbering convention for the DS number is DSXXXXXA where XXXXX is the document number and A is the revision level of the document For the most up to date information on development tools see the MPLAB IDE on line help Select the Help menu and then Topics to open a list of available on line help files INTRODUCTION This chapter contains general information that will be useful to know before using the PICSTART Plus device programmer Items discussed in this chapter include About This Guide Warranty Registration Recommended Reading The Microchip Web Site Development Systems Customer Change Notification Service Customer Support ABOUT THIS GUIDE Document Layout This document describes how to use PICSTART Plus as a development tool to program firmware to a target device The manual layout is as follows Chapter 1 PICSTART Plus Overview Describes the PICSTART Plus and how it works Chapter 2 PICSTART Plus Installation How to install PICSTART Plus hardware and MPLAB software Chapter 3 Tutorial Contains tutorials for programming calibration memory devices memory devices and other PICmicro MCU devices Chapter 4 Using the PICSTART Plus How to use PICSTART Plus to program devices Chapter 5 PICSTART Plus MPLAB IDE Reference PICSTART Plus options available through the PICSTART Plus menu and Options menu 2004 Microchip Technology Inc DS51028F pag
42. ables you to program PlCmicro microcontroller devices Adapters can be purchased for certain package types Consult the Microchip web site for availability View the readme p1s file for a list of currently supported devices The PICSTART Plus programmer is designed for use in firmware development and is not intended for production use PICSTART Plus does not support ICSP For all memory except configuration bits that are not code protected you may program from 1 to O but not from O to 1 i e you must erase and then program D D B 4 2 Device Specific Limitations In addition to the general limitations listed above some PlCmicro MCUs may have device specific limitations PICSTART Plus Limitations for PIC16F87X 87XA First program memory location address 0x0000 must be a NOP instruction PICSTART Plus Limitations for PIC18F2331 2431 All power supply VDD and AVDD and ground Vss and AVSS pins must be used in order for these devices to program PICSTART Plus will handle VDD Vss and AVSS properly but you must place a 1kOhm resistor between Pin 7 AVDD and Pin 11 in the socket with the device for proper operation There are other devices that may require the use of all power supply and ground pins Consult the data sheet if an unexplained programming problem occurs such as inconsistent programming Boundary Constraints Several devices have constraints on how ranges of program memory can be specified for programming The
43. anager The Project Manager is used to create a project and work with the specific files related to the project When using a project source code is rebuilt and downloaded to the simulator or emulator with a single mouse click MPLAB Editor The MPLAB Editor is used to create and edit text files such as source files code and linker script files MPLAB SIM Simulator The software simulator models the instruction execution and UO of the PlCmicro MCUs MPLAB ICD 2 Microchip s In Circuit Debugger that works with MPLAB IDE for PIC18FXXX devices MPLAB ICE Emulator The MPLAB ICE emulator uses hardware to emulate PICmicro MCUs in real time either with or without a target system MPASM Universal Assembler MPLINK Relocatable Linker MPLIB Librarian The MPASM assembler allows source code to be assembled without leaving the MPLAB IDE MPLINK creates the final application by linking relocatable modules from MPASM MPLAB C17 and MPLAB C18 MPLIB manages custom libraries for maximum code reuse MPLAB C17 MPLAB C18 and C30 C Compilers The MPLAB C17 MPLAB C18 and MPLAB C30 C Compilers provide ANSI based high level source code solutions Complex projects can use a combination of C and assembly source files to obtain the maximum benefits of speed and maintainability MPLAB PM3 PRO MATE Il PICSTART Plus and PICkit Programmers Develop code with the simulator or an emulator assemble or compile it then use one of these tools to program devices Th
44. atistics 5 5 11 With the device inserted the socket select Programmer Erase Flash Memory from the PICSTART Plus menu Then select Programmer gt Blank Check All from the PICSTART Plus menu This check will verify that the device is completely blank all bits are set to a 1 and all configuration bits are set to a 1 unprogrammed state Erase Flash Device Note OTP devices cannot be erased EPROM devices cannot be erased using the Erase Flash Memory option See Section 4 3 10 3 Erasing a Windowed Device 5 5 12 Download PICSTART OS To download firmware you must have PICSTART Plus that has been upgraded to use the PUM PICSTART Plus of Revision 20 or higher MPLAB IDE 6 40 or higher MPLAB IDE 6 61 or higher is preferable When you select the Download PICSTART OS option a dialog similar to Figure 5 6 displays FIGURE 5 6 DOWNLOAD PICSTART PLUS OS MPLAB IDE File Edit View Project Debugger Rou Tools Configure Window Help za DG Checksum Oxabd2 el ma Untitled HESE Build Version Control Find in A newer version ofthe PICS PICSTARTPlus PICi8F452 Select Programmer O Pass 0 Fail 0 Total 0 Disable Programmer Program Verify Read Blank Check All Blank Check OTP Abort Operation Reset Reset Program Statistics Erase Flash Device Download PICSTART OS About ting system is available and may t Settings novzdcc
45. b Select File gt Export to open the Export Hex File dialog On the Memory Areas tab check only the Calibration checkbox to save the data for this memory area only see Figure 4 19 FIGURE 4 19 MEMORY AREAS TAB Export Hex File Memory Areas File Format Program Memory Areas C Program Memory i Start End Start End Oxa Do C Configuration Bits C User ID On the File Format tab set or allow the default to remain at INHX32 see Figure 4 20 then click OK FIGURE 4 20 FILE FORMAT TAB Export Hex File eme Memory Areas File Format Format INHX32 OQ INHX8S 2 Once the calibration data has been saved it can be programmed back into the erased device This should be done before the device is used again to program source code DS51028F page 44 2004 Microchip Technology Inc Using the PICSTART Plus 4 3 10 3 ERASING A WINDOWED DEVICE To erase a windowed device 1 Remove any covering that is on top of the device s windows so that the ultraviolet light can flow through to the device See Figure 4 21 FIGURE 4 21 WINDOWED DEVICE 2 Place the device in an Ultraviolet UV EPROM Eraser Use the UV eraser as instructed per the equipment manufacturer s instructions The amount of time required to completely erase the device depends on the wavelength of the light its intensity distance from UV source and the process technology of the device the size of
46. be downloaded if it is needed for device support or if the newer firmware OS contains a fix to a known problem Firmware releases in the MPLAB IDE have backward compatibility it supports the devices that were included in the previous release of the firmware OS There are however some devices that are not supported by the MPLAB IDE To download firmware you must have PICSTART Plus that has been upgraded to use the PUM PICSTART Plus of Revision 20 or higher MPLAB IDE 6 40 or higher MPLAB IDE 6 61 or higher is preferable If you receive a message stating the device requires a particular version of the firmware OS it indicates that the firmware OS version detected by the MPLAB IDE is less than what is needed to support the selected device The PICSTART Plus will need to be upgraded to the firmware OS version that supports the desired device For information on the first supported release of a device in firmware OS refer to the Readme for PICSTART Plus txt Perform the following steps to ensure a successful download 1 In MPLAB IDE select Configure Select Device and choose a device that is supported by the earliest version of firmware OS 2 01 that can be used with the MPLAB IDE such as the PIC16F84A 2 Select Programmer gt Select Programmer gt PICSTART Plus Select Programmer Enable Programmer 4 Select Programmer gt Download PICSTART OS When the dialog is displayed select the needed version from the list of firmware OS f
47. ce Erase all memory on a Flash Device Same as 3 A Programmer gt Erase Flash Device d Program Statistics Provides the number of programming attempts passed failed and total To clear the values in this display select Programmer gt Reset Program Statistics 5 3 CONFIGURE MENU The Configure Menu is an MPLAB IDE menu that you use in conjunction with the PICSTART Plus Programmer Menu Refer to the MPLAB IDE documentation or on line help for detailed information on the Configure Menu The Configure Menu Figure 5 2 consists of five dialog selections listed in Table 5 2 FIGURE 5 2 CONFIGURE MENU OPTIONS MPLAB IDE DER File Edit View Project Debugger Programmer Tools KeS TGA Window Help Du Select Device Fail 0 Total 0 Configuration Bits Checksum 0x82d8 dug ID Memory W Untitled Y mu Output Settings Build Version Control Find in Files PICSTART PICSTARTPlus PIC18F452 novzdcc E DS51028F page 50 2004 Microchip Technology Inc PICSTART Plus MPLAB IDE Reference TABLE 5 2 CONFIGURE MENU Selection Description Select Device Select the supported device you wish to program Support for devices is indicated by green for supported yellow for limited support and red for no support Configuration Bits Select values for the device configuration bits Setting these values will affect both debugger and programmer operation External Memory Select wheth
48. ck and Erase options will be available on the Programmer menu and the PICSTART Plus toolbar However if one area of memory in the MPLAB IDE contains data either because a hex file was imported or a project was built the Program and Verify options will also be available on the Programmer menu and the PICSTART Plus toolbar The corresponding memory area and range information will display as checked and disabled on the Memory Ranges tab FIGURE 5 7 MEMORY RANGES TAB AUTO SELECT ENABLED Programmer Memory Ranges Communications Read all on auto select Manually enter memory areas and range f Program memory start address Program memory end address be a C Cf PP T TLSFP IITf C CC CTCf f TPE C LTTIZN P AA AA AA 2004 Microchip Technology Inc DS51028F page 59 MPLAB PICSTART Plus User s Guide 5 6 1 2 AUTO OPTION DISABLED If the Auto select memory areas and range is disabled it automatically disables the Read all on auto select option Memory areas and ranges can then be manually spec ified see Figure 5 8 The selection of the memory areas and ranges not the presence of data in the MPLAB IDE memory controls the availability of the Program and Verify options on the Programmer menu and the PICSTART Plus toolbar The memory area check boxes and range selection will still control what will be Read Programmed and Verified No message will be posted to the Output window stating whic
49. ct They have the essential sections for any source file and have information in them that will help you write and organize your code These files are the MPLAB IDE folder which by default is in the Program Files folder on your PC There is one template file for each Microchip PlCmicro and dsPIC device Scroll to the Program Files folder on Drive C open it and scroll down to the MPLAB IDE folder Open the MPLAB IDE folder and scroll down to the Mchip Tools direc tory Open the Mchip Tools directory and get a template from the Object folder in the Template folder and choose the file named 452tmpo asm If you installed MPLAB IDE in the default location the full path to the file will be C Program Files MPLAB IDE MCHIP_Tools TEMPLATE Object f452tmpo asm FIGURE 3 6 PROJECT WIZARD SELECT TEMPLATE FILE Project Wizard Step Four B Add any existing files to your project e Add gt gt C Program Files MPLAB IDE MCt f458tmpo asm f627Atempo asm f627tmpo asm f6284tempo asm _ Remove f628tmpo asm f629tempo asm f630tempo asm f6484tempo asm f675tempo asm f676tempo asm f684tempo asm gt Check the box to copy the file to the project directory v Press Add gt gt to move the file name to the right panel and click on the check box at the start of the line with the file name to enable this file to be copied to our project directory DS51028F page 22 2004 Microchip Technology Inc
50. development programmer e e e e CUSTOMER SUPPORT Users of Microchip products can receive assistance through several channels Distributor or Representative Local Sales Office Field Application Engineer FAE Technical Support Development Systems Information Line Customers should contact their distributor representative or field application engineer FAE for support Local sales offices are also available to help customers A listing of sales offices and locations is included in the back of this document Technical support is available through the web site at http support microchip com In addition there is a Development Systems Information Line which lists the latest versions of Microchip s development systems software products This line also provides information on how customers can receive currently available upgrade kits The Development Systems Information Line numbers are 1 800 755 2345 United States and most of Canada 1 480 792 7302 Other International Locations DS51028F page 4 2004 Microchip Technology Inc MPLAB PICSTART PLUS MICROCHIP USER S GUIDE Chapter 1 PICSTART Plus Overview 1 1 INTRODUCTION This chapter presents an overview of the features and requirements of the PICSTART Plus development programmer Topics covered in this chapter include What is PICSTART Plus Programmer PICSTART Plus System Components PICSTART Plus CE Compliance How the PICSTA
51. e 1 MPLAB PICSTART Plus User s Guide Appendix A Hardware Specifications Provides information on the 25 pin serial port changing voltages and programmer dimensions Appendix B Troubleshooting How to solve common problems Conventions Used in this Guide This User s Guide uses the following documentation conventions DOCUMENTATION CONVENTIONS Description Represents Examples Arial font Italic characters Referenced books MPLAB IDE User s Guide Emphasized text is the only compiler Initial caps A window the Output window A dialog the Settings dialog A menu selection select Enable Programmer Quotes A field name in a window or Save project before build dialog Underlined italic text with A menu path File Save right angle bracket Bold characters A dialog button Click OK A tab Click the Power tab bnnnn A binary number where n is a b00100 b10 digit Text in angle brackets lt gt A key on the keyboard Press Enter F1 Courier font Plain Courier Sample source code define START Filenames autoexec bat File paths c mec18 h Keywords asm _endasm static Command line options Opat Opa Bit values 0 1 Italic Courier A variable argument file o where file can be any valid filename Oxnnnn A hexadecimal number where OxFFFF 0x007A nis a hexadecimal digit Square brackets Optional arguments mcc18 options file optio
52. e is not blank Make sure the configuration bits are set to the factory settings and select Programmer gt Blank Check OTP This will check that all program memory bits are set to 1 and that the configuration bits match the value in the dialog If an EPROM device that has not been code protected is found not to be blank it can be erased See Section 4 3 10 3 Erasing a Windowed Device 5 5 8 Abort Operation When selected it will abort a Program Verify or Read operation that is in progress For example if you selected Programmer gt Program then decided to cancel that operation by selecting Programmer gt Abort Operation you can cancel the Program command Aborting a program operation can leave a device in an unknown state as some programming will probably have already taken place DS51028F page 56 2004 Microchip Technology Inc PICSTART Plus MPLAB IDE Reference 5 5 9 If you experience a loss of power to the programmer during operation you may need to reset the PICSTART Plus programmer Select Programmer gt Reset to reset the pro grammer hardware and reestablish RS 232 communications Reset does not clear the data in the MPLAB IDE or the contents of the device Reset 5 5 10 To reset all the program statistics select Programmer gt Reset Program Statistics This command will reset the display that keeps track of passes and fails when the device is programmed Reset Program St
53. e pliers to straighten the pins and attempt to program the device again DS51028F page 72 2004 Microchip Technology Inc Troubleshooting B 2 8 Download Not Successful If there is an interruption to the power the serial communication or the state of the MPLAB IDE while a firmware download is in progress the download may fail Some of the error messages which may be displayed include PICSTART Plus Firmware has been corrupted You must download a new operating system PICSTART Plus not found Please verify serial connection and try the current operation again Download Firmware not successful Download Firmware not successful Number of bytes not echoed properly The communication between the MPLAB IDE and the PICSTART Plus begins as soon as the download option is selected Always make sure that there are no communica tions problems with the PICSTART Plus before attempting to use the option to down load firmware To ensure this perform a Programmer gt Enable If this is successful without communication errors the PICSTART Plus is ready for further communication Perform the firmware download if needed When the download completes Disable then Enable the programmer so that the change in firmware versions will be fully recognized by the MPLAB IDE Perform a Programmer About to confirm the version now in use More details on downloading newer firmware can be found in Section 5 8 5 Downloading New Firmware Note An e
54. elect memory areas and range option is enabled When this option is enabled a Read operation reads the entire device If disabled only those areas indicated by the data present in the MPLAB IDE will be read Manually enter memory areas and range Program memory start address The starting address in program memory for programming or verification Program memory end address The ending address in program memory for programming or verification Program Memory Program or verify the program memory for the range specified by Start Address and End Address Configuration Bits Program or verify the configuration bits ID Location Program or verify the User ID You can set the User ID by selecting Configure gt ID Memory EEPROM Data For devices with data EEPROM program or verify the data memory from data in the EEPROM Memory window Calibration Memory For devices with calibration memory program or verify the calibration memory from data in the Calibration Memory window For more information on memory areas their windows and dialogs in the MPLAB IDE refer to the MPLAB IDE documentation Select the options for programming and click OK Then select Programmer gt Program to program the device as set in the Memory Ranges dialog DS51028F page 42 2004 Microchip Technology Inc Using the PICSTART Plus 4 3 10 Programming Calibration Memory Devices Special caution should be exercised when working
55. elief under that Act Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates It is your responsibility to ensure that your application meets with your specifications MICROCHIP MAKES NO REPRESENTATIONS OR WAR RANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED WRITTEN OR ORAL STATUTORY OR OTHERWISE RELATED TO THE INFORMATION INCLUDING BUT NOT LIMITED TO ITS CONDITION QUALITY PERFORMANCE MERCHANTABILITY OR FITNESS FOR PURPOSE Microchip disclaims all liability arising from this information and its use Use of Microchip s products as critical components in life support systems is not authorized except with express written approval by Microchip No licenses are conveyed implicitly or otherwise under any Microchip intellectual property rights QUALITY MANAGEMENT SYSTEM CERTIFIED BY DNV ISO TS 16949 2002 Trademarks 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 AmpLab FilterLab MXDEV MXLAB PICMASTER SEEVAL SmartSensor and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U S A Analog for the Digital Age Application Maestro dsPICDEM dsPICDEM net dsPICworks
56. er to use external memory or not Also specify external memory range ID Memory Enter value into ID memory Settings Enter default setting for the workspace debugger program loading hot keys and project 5 4 DEBUGGER MENU The Debugger Menu is an MPLAB IDE menu that contains options to selected the MPLAB Simulator Emulator and Debugging tools however it also has options under Debugger gt Clear Memory see Figure 5 3 that can be used with the PICSTART Plus to clear the MPLAB IDE memory areas and their associated windows see Table 5 3 It sets the particular memory area to the values seen when the device is blank FIGURE 5 3 DEBUGGER CLEAR MEMORY MENU OPTIONS MPLAB IDE File Edit View Project Rezoee Programmer Tools Configure Window Help Due Select Tool Pass 0 Fail 0 Total 0 All Memory Checksum 0x82d8 Program Memory GPRS EEPROM Configuration Bits ME Untitled m Output Build Version Control Em PICSTARTPlus PICi8F452 H novzdcc TABLE 5 3 DEBUGGER MENU Selection Description All Memory Clears the MPLAB IDE memory areas of all data and associated windows Program Memory Clears the MPLAB IDE program memory data and its window GPR Clears the MPLAB IDE general purpose register data and its window EEPROM Clears the MPLAB IDE EEPROM data and its window Configuration Bits Clears the MPLAB IDE configuration bit data and its window Note Using
57. erly set the part into programming mode This occurs only on certain date codes of parts and only on non PIC16C7XA parts Insert a 0 01 mF capacitor between VPP Pin 1 and ground Pin 8 of the socket before inserting part This will slow the VPP rise time and allow the device to enter programming mode B 2 5 2 WHEN READING A BLANK PIC16C55A PIC16C57C OR PIC16C57 PROGRAM MEMORY VALUES OF OXBFF ARE REPORTED The oscillator circuit for these devices is different from that of previous devices and can cause contention during the read operation Use a stand off socket with OSC2 pin 26 clipped B 2 6 LED Indicators Flicker or Do Not Light This could be the result of the thermal fuse being blown This may be due to either the wrong part being selected or the device was improperly placed in the ZIFF socket Remove the device and cycle power on the PICSTART Plus programmer to reset the internal thermal fuse Make sure the device is aligned Pin 1 to Pin 1 in the PICSTART Plus ZIFF socket The LEDs may flicker or fail to light as a result of an Incompatible power supply or power supply polarity is reversed Make certain the power supply used is the one included with the PICSTART Plus programmer or a compatible one If the unit still does not turn on contact Microchip support B 2 7 Device Pin Damage On the smaller device packages SSOP PQFP and SOIC the pins can bend easily and cause problems when programming the devices Use small needle nos
58. es MPLAB IDE MCHIP_Tools mplink exe If these do not show up correctly use the browse button to set them to the proper files in the MPLAB IDE subfolders FIGURE 3 4 SETTING LANGUAGE TOOL LOCATION Project Wizard Step Two Select a language toolsuite Active Toolsuite Microchip MPASM Toolsuite Toolsuite Contents MPASM Assembler mpasmwin exe MPLINK Object Linker mplink exe MPLIB Librarian mplib exe Location Help My Suite Isn t Listed Show all installed toolsuites When you are finished click Next Then click OK DS51028F page 20 2004 Microchip Technology Inc Tutorial 3 7 NAMING THE PROJECT Step Three of the wizard allows you to name the project and put it into a folder This sample project will be called 18F452Proj and using the Browse button go to the C drive and make a new folder called My Projects Click Next FIGURE 3 5 PROJECT WIZARD NAME PROJECT Project Wizard Step Three Name your project Project Name 18F452Proj Project Directory C My Projects lt Back Next gt Cancel Help 2004 Microchip Technology Inc DS51028F page 21 MPLAB PICSTART Plus User s Guide 3 8 ADDING FILES TO THE PROJECT Step Four of the Project Wizard allow us to select files for the project We do not have a source file yet so we will use an MPLAB IDE template file The template files are simple files that can be used to start a proje
59. ettings Figure 2 4 and click on the Communications tab A dialog similar to the one shown in Figure 2 5 will appear FIGURE 2 4 PROGRAMMER SETTINGS w MPLAB IDE DoR File Edit View Project Debugger RA GUU Tools Configure Window Help D Li Xm amp s Select Programmer B gt Pass 0 Fail 0 Total 0 Enable Programmer Checksum 0x82d8 gj II Untitled Wor CR Build Version Control Find in Download PICSTART OS Settings PICSTART Plus PICi8F452 novzdcc 2004 Microchip Technology Inc DS51028F page 13 MPLAB PICSTART Plus User s Guide FIGURE 2 5 COMMUNICATIONS PORT SETUP DIALOG Programmer Memory Ranges Communications Com Port GEUME OcoM3 OCO0M2 Ocom4 OTHER The Communications tab shows the possible PC serial communication ports Select the COM port used for the PICSTART Plus If a COM port number between 4 and 255 has been configured for use on the workstation type the number in the Other text box Click OK to set the COM port or click Cancel if you want to close the dialog without selecting a COM port Note The programmer uses COM 1 as the default serial port If you change your serial port selection then the next time you run your programmer the host software will use the same serial port used in the previous session DS51028F page 14 2004 Microchip Technology Inc PICSTART Plus Installation
60. f a COM port number between 4 and 255 has been configured for use on the workstation type the number in the Other text box Click OK to set the COM port or click Cancel if you want to close the dialog without selecting a COM port Note The programmer uses COM 1 as the default serial port If you change your serial port selection then the next time you run you programmer the host software will use the same serial port used in the previous session 2004 Microchip Technology Inc DS51028F page 33 MPLAB PICSTART Plus User s Guide 4 3 4 Enabling the Programmer To enable the PICSTART Plus programmer select Programmer Enable Programmer see Figure 4 4 FIGURE 4 4 ENABLING THE PICSTART PLUS MPLAB IDE File Edit View Project Debugger Bou Tools Configure Window Help Da Select Programmer B gt Pass 0 Fail 0 Total 0 Checksum 0x82d8 jj E ma Untitled ger DS Build Version Control Find in Download PICSTART OS Settings PICSTARTPlus PIC1 novzdcc If the device you selected is not supported by the OS firmware version detected on the PICSTART Plus a message similar to the one in Figure 4 5 will be displayed This indicates that the device is not supported by the firmware version in use See Section 5 8 Upgrading the PICSTART Plus Firmware OS FIGURE 4 5 FIRMWARE ERROR MESSAGE E Output Build Version Control Find in Files PICSTART This de
61. h memory areas will be included in the Read operation FIGURE 5 8 MEMORY RANGES TAB AUTO SELECT DISABLED Programmer pm Memory Ranges Communications C Auto select memory areas and range Manually enter memory areas and range Program memory start address Program memory end address Program Memory Configuration Bits ID Location E DS51028F page 60 2004 Microchip Technology Inc PICSTART Plus MPLAB IDE Reference 5 6 2 Communications Tab To set the port for communications between the programmer and the PC select Programmer gt Settings and click on the Communications tab Communications between the programmer and the PC is via an RS 232 serial connection Select the PC COM port you want to use COM1 COM2 COM3 COMM or type in a port number up to 255 in the OTHER field Figure 5 9 COM is the default Click OK Note Any port designated for use must have the properties set for proper communication with the PICSTART Plus See Section B 2 1 2 COM Port Setup FIGURE 5 9 COMMUNICATIONS TAB Programmer Memory Ranges Communications OCOM 3 OcomM2 OCOM4 OTHER To make sure the port is set up properly follow the instructions in Section 2 4 1 Installing the Communications Cable 5 7 FILES USED BY THE PICSTART PLUS PROGRAMMER The PICSTART Plus programmer can use information directly from the MPLAB IDE projects without any intermediate steps T
62. he MPASM assembler can be used sepa rately from the MPLAB IDE to produce hex files for the PICSTART Plus programmer Alternatively devices can be programmed with hex files from any PICmicro microcontroller compatible cross assembler or cross compiler If you are using MPASM assembler separate from the MPLAB IDE or are generating hex files from within the MPLAB IDE for use later with PICSTART Plus programmer you should use either INHX8M or INHX32 hex formats MPASM assembler s default output format for hex files is INHX32 If you are programming PIC17CXXX or PIC18XXX devices you should use INHX32 format 2004 Microchip Technology Inc DS51028F page 61 MPLAB PICSTART Plus User s Guide 5 8 UPGRADING THE PICSTART PLUS FIRMWARE OS To support new devices you may need to upgrade the PICSTART Plus firmware OS How you upgrade the firmware OS will depend on whether or not you have the PICSTART Plus Flash Upgrade Module PUM installed in your programmer The PUM is a printed circuit board PCB that contains a PIC18F6720 device pro grammed with the firmware OS needed to provide support to a specific set of devices in the MPLAB IDE The PUM is used to replace the PIC17C44 device inside the PICSTART Plus The PIC17C44 device can only support up to firmware OS V3 11 The PUM uses Flash technology to upgrade the PICSTART Plus firmware OS when new device support is available through the MPLAB IDE This section provides information on
63. he PICSTART Plus 4 3 5 2 LOADING A HEX FILE INTO PROGRAM MEMORY If you have a hex file e g code hex ready for programming into a PICmicro microcontroller select File gt import and navigate to the location of your hex file Select your hex file and click Open see Figure 4 11 to load your hex code into the MPLAB IDE Program Memory window If the Program Memory window is not open select View gt Program Memory to open it If you do not have a hex file to program your device you can build one using MPLAB IDE Projects The MPLAB IDE provides a text editor for generating source code and is compatible with various assemblers compilers for assembling compiling your source code into hex code in MPLAB IDE program memory See the MPLAB IDE Project Tutorial to see how to use MPLAB IDE Projects to develop your own source code Each time you rebuild your project the Program Memory window will be updated FIGURE 4 11 IMPORT HEX FILE Look in Programmers Oms 2 E 17P60000 HEX it 3 ie 18P63007 hex My Recent ll D5C59060 hex Documents amp jpsceo101 hex 24 D5C63000 hex 2 PIC63017 hex E psf31100 hex pspls42003 hex My Documents File name My Computer Files of type Hex Files T hex The Program Memory window should now contain the hex code from the hex file Figure 4 12 Click on the Opcode Hex button to view the hex code FIGURE 4 12 PROGRAM MEMORY HEX CODE DISPLAY
64. iles OS files are of the form psplsversion hex where versionis the OS version number Full release versions end in 00 e Note If MPLAB IDE detects an OS that is less than v4 00 it will not download an upgraded OS 5 Click Open to start the download process Note While the download is taking place do not attempt to perform other tasks in the MPLAB IDE When the download completes a message regarding its status will be displayed in the Output window 6 Select Programmer gt Disable Programmer to disable the PICSTART Plus 7 Then select Programmer gt Enable Programmer so the change in the firmware OS version will be recognized by the MPLAB IDE d O O E EEEE T c Umm RUM 2004 Microchip Technology Inc DS51028F page 65 MPLAB PICSTART Plus User s Guide 5 8 6 Verifying the PICSTART Plus Firmware Update 1 Start the MPLAB IDE v6 xx software 2 Select Programmer gt Select Programmer PICSTART Plus to select the PICSTART Plus programmer 3 Select View gt Output to open the Output window 4 Select Programmer gt Enable Programmer to begin using the PICSTART Plus programmer 5 Select Programmer gt About to display the PICSTART Plus firmware OS version DS51028F page 66 2004 Microchip Technology Inc MPLAB PIC
65. ion B 2 2 Advanced Serial Communications Help B 2 1 2 COM PORT SETUP Windows COM port setup requires special attention If you suspect a driver hardware incompatibility go through the Control Panel and try changing Flow Control to Hardware and or turning off the FIFO for the serial port Follow the instructions for your PC s operating system Windows 98 ME 1 Click the System icon 2 Click the Device Manager tab 3 Click on Ports If necessary expand the Ports selection by clicking the sign next to it Double click the COM port to which the programmer is connected Set the Flow control to Hardware Click on Advanced uncheck the Use FIFO buffers checkbox and click OK Reboot the PC to implement the change Windows NT 1 Click the Ports Icon 2 Select the COM port click Settings Set the Flow Control to Hardware 3 Click on Advanced uncheck the FIFO Enabled checkbox and click OK 4 Reboot the PC to implement the change WEEN Windows 2000 XP Click the System Icon Click the Hardware tab Click on Device Manger If necessary expand the Ports selection by clicking the sign next to it Double click the COM port to which the programmer is connected Set Flow control to Hardware Click the Port Settings tab and click on Advanced Uncheck the Use FIFO buffers checkbox and click OK Reboot the PC to implement the change O ANOA PWN gt DS51028F page 70 2
66. is newer firmware version to make the PICSTART Plus work The version of the firmware in use does not support the selected device A firm ware required message will be displayed The PICSTART Plus cannot be used until the version of the firmware that supports the selected device is downloaded See Section 5 8 Upgrading the PICSTART Plus Firmware OS Communication errors are received See Appendix B Troubleshooting Section B 2 Common Problems D D D 5 5 2 1 OUTPUT WINDOW When you select Programmer gt Select Programmer gt PIC START Plus from the PIC START Plus menu or select View gt Output from the MPLAB IDE menu the Output win dow opens This window contains tabbed information about program output Refer to the MPLAB IDE documentation for more information The menu items in the Output window available from the right mouse button menu are D Select All Selects all text and graphics in the Edit window Copy Copies the selected text in the current window onto the clipboard After this operation you can paste the copied text into another MPLAB Editor window into another location in the same MPLAB Editor window or into another Windows application Clear Page Clears the contents of the Output window Note Itis best to keep the Output window open as all message are posted here D D DS51028F page 54 2004 Microchip Technology Inc PICSTART Plus MPLAB IDE Reference 5 5 2 2 PROGRAM
67. is can all be accomplished with the MPLAB IDE Third Party Tools Many other companies have development tools for Microchip products that work with the MPLAB IDE Consult the Microchip web site for additional information 2004 Microchip Technology Inc DS51028F page 7 MPLAB PICSTART Plus User s Guide NOTES DS51028F page 8 2004 Microchip Technology Inc MPLAB PICSTART PLUS MICROCHIP USER S GUIDE Chapter 2 PICSTART Plus Installation 2 1 INTRODUCTION The PICSTART Plus development system requires connecting the hardware to the PC and the installation of the MPLAB IDE software This chapter covers Host Computer System Requirements Installing MPLAB IDE Software Installing PICSTART Plus Hardware Starting MPLAB IDE Turning the PICSTART Plus On Off Selecting the Device Selecting the PICSTART Plus Programmer Configuring the Serial Port for PICSTART Plus Enabling the PICSTART Plus 2 2 HOST COMPUTER SYSTEM REQUIREMENTS The following minimum configuration is required to run the MPLAB IDE PC compatible Intel Pentium class system Microsoft Windows 98 SE Windows ME Windows XP Windows NT 4 0 SP6a Workstations NOT Servers or Windows 2000 SP2 Windows 32 MB memory 128 MB recommended 85 MB of hard disk space Internet Explorer 5 0 or greater for installation and on line Help One serial port 2 3 INSTALLING MPLAB IDE SOFTWARE Install the MPLAB IDE software by following the instructions in
68. isabled only the memory areas and ranges indi cated by the data in the MPLAB IDE will be read See Section 5 6 1 1 Auto Option Enabled and Section 5 6 1 2 Auto Option Disabled for further explanation Manually enter memory areas and range Program memory start address Type the start address for the range of program memory in hex Program memory end address Type the end address for the range of program memory in hex Program Memory Select this check box if you want to program Program Memory The program memory range is determined by the Program memory start and end address fields Configuration Bits Select this check box if configuration memory is to be programmed ID Location Select this check box if the ID location is to be programmed EEPROM Data Select this check box if the EEPROM data memory is to be programmed Calibration Memory Select this check box if calibration memory to be programmed Note Only those memory areas which are applicable to the device will be available for selecting DS51028F page 58 2004 Microchip Technology Inc PICSTART Plus MPLAB IDE Reference 5 6 1 1 AUTO OPTION ENABLED The Auto select memory areas and range and the Read all on auto select options will be enabled by default when the MPLAB IDE is installed Figure 5 7 Changes are saved when the workspace is saved If no data is present in the MPLAB IDE only the Blank Che
69. isplay of these items is also controlled by the workspace and other configuration settings Ensure that the COM port in use with the PICSTART Plus is the proper one selected in the MPLAB IDE Select Programmer gt Settings then click on the Communications tab Select the port you wish Note The Debugger selection should be set to None while the PICSTART Plus is selected as a Programmer DS51028F page 32 2004 Microchip Technology Inc Using the PICSTART Plus 4 3 3 Configuring Programmer Settings If you need to configure the serial communications port for the PICSTART Plus select Programmer gt Settings Figure 4 2 and click on the Communications tab A dialog similar to the one shown in Figure 4 3 will appear FIGURE 4 2 PROGRAMMER SETTINGS MPLAB IDE DoK File Edit View Project Debugger Bou Tools Configure Window Help DG Select Programmer Bo Pass 0 Fail Total 0 a Enable P Checksum 0x82d8 REEL uf ma Untitled Wor DIN Build Version Control Find in Download PICSTART OS PICSTARTPlus PICi8F452 wo novzdcc FIGURE 4 3 COMMUNICATIONS PORT SETUP DIALOG Programmer Memory Ranges Communications Com Port DONT OcomM3 Ocom2 Ocom4 OTHER The Communications tab shows the possible PC serial communication ports Select COM port 1 4 or type the port number 5 255 to which you connected the PICSTART Plus and click OK I
70. m from the list of available devices see Figure 4 1 When you select a device indicators next to the Microchip Tools names show the level of support for that device green supports the device yellow limited support and red no support If the selected device is supported by PICSTART Plus click OK If a device is selected that is not supported by the PICSTART Plus the programmer cannot be enabled An error message will be displayed and the PICSTART Plus will be come unavailable on the Select Programmer list FIGURE 4 1 SELECT DEVICE DIALOG Select Device Device PIC18F 452 X Microchip Programmer Tool Support PICSTART Plus MPLAB ICD 2 PRO MATE II Pickit1 MPLAB PM3 Microchip Debugger Tool Support MPLAB SIM MPLAB ICD 2 MPLAB ICE 2000 MPLAB ICE 4000 QPcM18xC1 PMF18WCO QQPCMI18XH0 Gee Heb The device list shows the device that is currently selected in MPLAB IDE Devices that are not listed are not supported by any tool in the version of the MPLAB IDE in use 4 3 2 Selecting the Programmer Select Programmer gt Select Programmer gt PICSTART Plus to select PICSTART Plus from the list of available programmers After PICSTART Plus is selected The Programmer menu changes to include the items applicable to the PICSTART Plus The Programmer Toolbar is displayed The programmer selected For more information on menus toolbars and the status bar see the MPLAB IDE help as the d
71. mcp A new workspace will be created and the new project added to that workspace Cancel Help 2004 Microchip Technology Inc DS51028F page 23 MPLAB PICSTART Plus User s Guide After clicking Finish look at the Project Window on the MPLAB IDE desktop It should look like Figure 3 9 If the Project Window is not open select View gt Project FIGURE 3 9 PROJECT WINDOW m 18F452Proj mew DIN 18F452Proj mcp Source Files f452tmpo asm Header Files Object Files Library Files Linker Scripts 18f452 lkr Other Files 3 9 BUILDING THE INITIAL PROJECT From the Project menu we can assemble and link the current files They don t have any of our code in them yet but this just assures that the project is set up correctly Click back on the 18f452Proj mcw window to make it the active window Now build the project by selecting Project gt Build All The Build Results window displays as shown in Figure 3 10 FIGURE 3 10 INITIAL BUILD RESULTS WINDOW Car Build version Control Find in Files Clean Deleting intermediary and output files Clean Done Executing C Program Files MPLAB IDE MCHIP_Tools mpasmwin exe q p18F452 f452tm Executing C Program Files MPLAB IDE MCHIP_Tools mplink exe C Program Files MPL4 MPLINK 3 80 Linker Copyright c 2004 Microchip Technology Inc Errors SU MP2COD 3 80 COFF to COD File Converter Copyright c 2004 Microchip
72. n be done by setting up Settings below Blank Check All Checks that the device is completely blank all 3 7 bits are set to a 1 This will also check that all Ge configuration bits are set to a 1 unprogrammed state DS51028F page 52 2004 Microchip Technology Inc PICSTART Plus MPLAB IDE Reference TABLE 5 4 PICSTART PLUS MENU CONTINUED Programmer Menu Option big Function Blank Check OTP This function is intended for use with OTP devices that come with factory programmed con figuration bits Before using this function set the displayed configuration bits to match the factory programmed settings The function verifies that all program memory bits are set to 1 and that the configuration bits match the settings displayed in the Configuration Bits dialog Abort Operation Cancels a Program Verify or Read operation in progress Reset Resets the programmer hardware and reestab lishes RS 232 communications Use this option if power has been disconnected from the program mer This option does not reset programming information in the Program Memory window configuration bits or IDs Reset program statistics Resets the counters in the Program Statistics area Erase Flash Device Available for flash devices only Erases the flash kk memory in the device Download PICSTART OS Opens the Download PICSTART Plus Operating System dialog displaying a listing of the available
73. no longer need to open the PICSTART Plus burn a new device and replace the microcontroller in the socket to upgrade the firmware OS Future firmware OS upgrades can be accomplished by MPLAB IDE reprogramming the FLASH memory of the microcontroller on this upgrade PC board via the existing serial port An upgraded PICSTART Plus unit will function with MPLAB version 5 62 or higher All MPLAB IDE versions To install the upgrade PCB if the PICSTART Plus contains a PIC17C44 follow the directions below 5 8 8 1 REQUIRED EQUIPMENT To install the processor upgrade you will need PICSTART Plus Processor Upgrade Module supplied with kit Phillips head screwdriver 5 8 8 2 INSTALLATION 1 Disconnect the PICSTART Plus from the computer serial port and power supply 2 Carefully remove the four Phillips head screws from the back of the PICSTART Plus Remove the back cover 3 Carefully remove the PIC17C44 microcontroller from the U21 socket 4 Carefully insert the PICSTART Plus Processor Upgrade Kit into the U21 socket making sure that Pin 1 is properly oriented Pin 1 should be close to the serial port connector 2004 Microchip Technology Inc DS51028F page 63 MPLAB PICSTART Plus User s Guide FIGURE 5 10 PROCESSOR UPGRADE MODULE PICSTART Plus Development Programmer PCB component side PICSTART Plus Processor Upgrade Kit Pin 1 on component side Serial of upgrade kit Pg Port Cnx 5
74. ns Curly brackets and pipe Choice of mutually exclusive errorlevel 0 1 character arguments an OR selection Ellipses Replaces repeated text var_name var_name Represents code supplied by void main void user WARRANTY REGISTRATION Please complete the enclosed Warranty Registration Card and mail it promptly Sending in the Warranty Registration Card entitles users to receive new product updates Interim software releases are available at the Microchip web site DS51028F page 2 2004 Microchip Technology Inc Preface RECOMMENDED READING This user s guide describes how to use MPLAB PICSTART Plus programmer Other useful documents are listed below The following Microchip documents are available and recommended as supplemental reference resources README for PICSTART Plus For the latest information on using the PICSTART Plus read the Readme for PICSTART Plus txt file an ASCII text file in the Readmes subdirectory of the MPLAB IDE installation directory The Readme file contains update information and known issues that may not be included in this user s guide PICSTART Plus On line Help MPLAB IDE V6 XX Quick Start Guide DS51281 Describes how to set up the MPLAB IDE software and use it to create projects and program devices MPASM User s Guide with MPLINK Linker and MPLIB Librarian DS33014 This user s guide describes how to use the Microchip PlCmicro MCU MPASM
75. ogram memory bits are set to 1 and that the configuration bits match the value in the dialog Flash devices are automatically erased before programming OPT devices can be erased however and EPROM device cannot be erased unless it is in a JW package type windowed or a CERQUAD CL package type and has not been code protected See Section 4 3 10 3 Erasing a Windowed Device DS51028F page 40 2004 Microchip Technology Inc Using the PICSTART Plus 4 3 9 Programming a Device To program the entire device i e all of program memory configuration bits etc select Programmer gt Program Figure 4 17 FIGURE 4 17 PROGRAMMING A DEVICE m MPLAB IDE File Edit View Project Debugger Re Configure Window Help DEH X Me me S ame O Pass 0 Fail 0 Total 0 Checksum 0x82d8 qj Disable Programmer W Untitled Wor DIS r 1 Verify L Output Read Blank Check All Blank Check OTP Abort Operation Build Version Control Find in Reset Reset Program Statistics Erase Flash Device Download PICSTART OS About Settings PICSTARTPlus PICi8F452 H novzdcc To selectively program part of program memory first select Programmer gt Settings and click on the Memory Ranges tab to open the Memory Ranges dialog Figure 4 18 FIGURE 4 18 SETTING MEMORY RANGES Programmer Memory Ranges Communications Read all on auto select Manually enter memory area
76. ogram Memory Program or verify the program memory for the range specified by Start Address and End Address Configuration Bits Program or verify the configuration bits ID Location Program or verify the User ID You can set the User ID by selecting Configure gt ID Memory EEPROM Data For devices with data EEPROM program or verify the data memory from data in the EEPROM Memory window Calibration Memory For devices with calibration memory program or verify the calibration memory from data in the Calibration Memory window 4 Select Programmer gt Read The memory area corresponding to the checked boxes will be read Once the Read is complete the memory area windows will display the data read from the device You can then Modify the data in the Program Memory before you save to a hex file or program another device e Save the data as a hex file by selecting File Export Insert a new device into PICSTART Plus to program the data into it If you have any problems when attempting to read a device refer to Appendix B Troubleshooting 2004 Microchip Technology Inc DS51028F page 47 MPLAB PICSTART Plus User s Guide NOTES DS51028F page 48 2004 Microchip Technology Inc MPLAB PICSTART PLUS MICROCHIP USER S GUIDE Chapter 5 PICSTART Plus MPLAB IDE Reference 5 1 INTRODUCTION This chapter describes the dialogs windows and menu items of the PIC
77. ogram Memory Figure 4 7 FIGURE 4 7 VIEWING PROGRAM MEMORY an MPLAB IDE File Edit YER Project Debugger Programmer Tools Configure Window Help Checksum 0x82d8 qi gg E D Bg BR DD Toolbars 1 Disassembly Listing 2 Hardware Stack 3 m Memory 4 File Registers 5 EEPROM 7 Watch 8 Special Function Registers PICSTART Plus PIC18F452 H novzdcc AA AA AA AA o O 2004 Microchip Technology Inc DS51028F page 35 MPLAB PICSTART Plus User s Guide The Program Memory window opens in the Machine mode Figure 4 8 FIGURE 4 8 MACHINE MODE s Program Memory pcode Hex Machine Symbolic To change display mode click on a system button in the lower left corner of the window and select the display mode from the system menu Clicking the Opcode Hex button changes the program memory display to be similar to Figure 4 9 FIGURE 4 9 OPCODE HEX MODE E Program Memory Address oo 0000 0010 0020 0030 0040 0050 0060 pcode Hex Clicking the Symbolic button changes the program memory to be similar to Figure 4 10 FIGURE 4 10 SYMBOLIC MODE Program Memo Des S IE 1 0000 FFFF pcode Hex i Symbolic Note After building a project MPLAB IDE makes a hex file and loads it into program memory This data can then be programmed into the PICSTART Plus DS51028F page 36 2004 Microchip Technology Inc Using t
78. ory Ranges to display the Memory Ranges dialog see Section 5 6 1 Memory Ranges Tab Select the memory areas to be read then click OK in this dialog Areas that are grayed out are not available on the device Then select Programmer gt Read The memory area corresponding to the checked boxes will be read Once the Read is complete the Program Memory window will display the data read You can save that data as a hex file insert a new device into PICSTART Plus to copy that same data into a new device this is known as programming from a Master Device or modify the data in MPLAB IDE before you save to a hex file or program another device If you attempt to read a code protected device you will get a warning indicating that the device is code protected and that the program memory may be invalid 5 5 7 Blank Check All After inserting the device in the socket select Programmer gt Blank Check All from the PICSTART Plus menu This check will verify that the device is completely blank all bits are set to a 1 and all configuration bits are set to a 1 unprogrammed state When complete the results will be displayed in the Output window for example Configuration memory is blank EEData memory is blank ID memory is blank Program memory is blank If you are using a one time programmable OTP device some configuration bits e g oscillator bits might have already been programmed at the factory and report that the devic
79. rammed if code protection is detected Consult the data sheet for the device to determine how code protection is handled if certain memory areas are exempt etc B 3 7 Framing Error This error indicates a hardware problem occurred while trying to read from the programmer It is not a very common error It usually indicates some sort of problem with the communication hardware on either the PC or the programmer B 3 8 Parity Error Found In Program Memory Several devices have a configuration bit to request the calculation of parity When the bit is set to ON the contents of the program memory are compared and assigned even or odd parity When set to OFF the device does not perform a comparison On a blank device the parity configuration bit is set to ON by default If the device is programmed with the parity configuration bit set to ON any reprogramming of the device may result in a parity error being displayed This occurs because a mismatch has been detected between the current parity and the parity last programmed Receiving a parity error however does not stop the device from being programmed However if the device is programmed with the parity bit set to OFF no comparison of the program memory contents for parity will take place The device can be reprogrammed without receiving a message regarding parity All OTP devices including those that have the parity configuration bit cannot success fully rep
80. reen Figure 3 2 Note Before using the Project Wizard check that the option to associate the project with the workspace is enabled Select Configure Settings then click on the Projects tab Select the check box for Use one to one project workspace model and click OK FIGURE 3 2 PROJECT WIZARD WELCOME SCREEN Project Wizard Welcome This wizard helps you create and configure a new MPLAB project To continue click Next E Cancel Help Click on Next gt to advance to the next dialog in the Project Wizard This dialog Figure 3 3 allows you to select the device which we ve already done Make sure PIC18F452 is selected Otherwise select the PIC18F452 device Click Next gt FIGURE 3 3 PROJECT WIZARD SELECT DEVICE Project Wizard Step ne Select a device Device PICT8F452 lt Back Next gt Cancel Help 2004 Microchip Technology Inc DS51028F page 19 MPLAB PICSTART Plus User s Guide 3 6 SETTING UP LANGUAGE TOOLS In Step Two of the Project Wizard select Microchip MPASM Toolsuite in the Active Toolsuite list box Then you should see MPASM and MPLINK show up in the Toolsuite Contents box You can click on each one to see its location If you installed MPLAB IDE into the default directory the MPASM assembler executable will be C Program Files MPLAB IDE MCHIP_Tools mpasmwin exe and the MPLINK linker executable will be C Program Fil
81. repancies 3 15 TUTORIAL SUMMARY We have done the major steps for creating building and programming our simple project We selected the device the PIC18F452 We used the Project wizard to create a project and while using the wizard we selected the MPLAB IDE built in MPASM assembler and MPLINK linker language tools added files for the project a template file for the device we ve selected and a linker script to build it properly We wrote some simple code to send a changing value out an I O port Then we built the project And finally we programmed the PIC18F452 device These are the essential steps for programming a device with the MPLAB IDE and the PICSTART Plus 2004 Microchip Technology Inc DS51028F page 29 MPLAB PICSTART Plus User s Guide NOTES DS51028F page 30 2004 Microchip Technology Inc MPLAB PICSTART PLUS MICROCHIP USER S GUIDE Chapter 4 Using the PICSTART Plus 4 1 INTRODUCTION This chapter describes the steps required to program and read a device using the PIC START Plus development programmer Preparation for Programming a Device Procedure for Programming a Device Verifying the Programming Reading a Device 4 2 PREPARATION FOR PROGRAMMING A DEVICE Before you begin to program a device you need to have A hex file to program into the PlCmicro MCU device e A blank PlCmicro MCU device to program You also need to have already e Installed the PICSTART Plus
82. rogram any bit value of 0 to a 1 If a device has been programmed with the parity configuration bit set to OFF the parity checking cannot be turned back to ON A blank device will have to be used B 3 9 Send Receive Errors Send errors can occur because the MPLAB IDE is attempting to communicate with the PICSTART Plus on the designated COM port and not getting a response This error is usually followed by a No programmer detected message Ensure that the PICSTART Plus power is physically connected and that the serial cable is connected from the workstation to the PICSTART Plus Make sure the COM port designated in the MPLAB IDE is actually the one use A receive error such as serial time out scan occurs while a device is being read or programmed It can be caused by losing a serial connection in the middle of an operation or the device not being properly aligned in the PICSTART Plus ZIFF socket Though the problem is not common the problem has been seen more often on Windows ME and 98 SE operating systems If the problem cannot be resolved by programming the device using a smaller program memory range or specific memory areas another Windows operating system may have to be used 2004 Microchip Technology Inc DS51028F page 75 MPLAB PICSTART Plus User s Guide BA LIMITATIONS General Limitations Device Specific Limitations B 4 1 General Limitations PICSTART Plus development programmer en
83. rror message will be received if an attempt is made to download onto a PICSTART Plus that contains a PIC17C44 BA ERROR MESSAGES WARNINGS AND ANNOUNCEMENTS These are some error messages warning or announcements you may receive Cannot Transmit Receive Newer Firmware Required New Firmware Available Download Not Successful Could Not Open The Communications Port Program Memory Contains Code Protected Data Framing Error Parity Error Found In Program Memory Send Receive Errors B 3 1 Cannot Transmit Receive Cannot Transmit This is the most common error It indicates that the PC cannot send any information to the programmer Cannot Receive The software is able to send information to the programmer but the programmer is not responding Refer to Section B 2 1 Failure to Establish Communication with PICSTART Plus and Section B 2 2 Advanced Serial Communications Help KEREN 2004 Microchip Technology Inc DS51028F page 73 MPLAB PICSTART Plus User s Guide B 3 2 Newer Firmware Required If a message This device requires firmware xx is displayed after using the option Programmer Enable it indicates that the firmware currently in use does not support the selected device The minimum firmware needed to support the device is stated in the message The firmware that supports the device will need to be downloaded before the PICSTART Plus an be used See Section 5 8 5 Downloading New Firmware for instruction
84. s B 3 3 New Firmware Available If a message is displayed announcing that newer firmware is available after using the option Programmer gt Enable there is nothing wrong with the PICSTART Plus The message is just to announce the fact that a newer version firmware is available in this version of the MPLAB IDE If you plan to use a device whose support is new to the PICSTART Plus you will want to download the newer firmware Otherwise there is no need to download the newer firmware B 3 4 Download Not Successful If there is an interruption to the power the serial communication or the state of the MPLAB IDE while a firmware download is in progress the download may fail Some of the error messages which may be displayed include PICSTART Plus Firmware has been corrupted You must download a new operating system PICSTART Plus not found Please verify serial connection and try the current operation again Download Firmware not successful Download Firmware not successful Number of bytes not echoed properly The communication between the MPLAB IDE and the PICSTART Plus begins as soon as the download option is selected Always make sure that there are no communica tions problems with the PICSTART Plus before attempting to use the option to down load firmware To ensure this perform a Programmer Enable If this is successful without communication errors the PICSTART Plus is ready for further communication Perform the firmware
85. s and range Program memory start address Program memory end address 2004 Microchip Technology Inc DS51028F page 41 MPLAB PICSTART Plus User s Guide The Auto select memory areas and range option will be enabled by default when the MPLAB IDE is installed To selectively program the memory ranges etc you must disable this option Only those memory areas which are applicable to the device will be enabled for selection To selectively program the memory ranges configuration bits etc adjust the settings in the Memory Ranges dialog see Table 4 1 The memory area corresponding to the checked boxes will be programmed Note Programming specific memory areas and ranges may not be available if the device has been code protected For Flash devices this action may cause the excluded memory areas and ranges to lose any existing contents TABLE 4 1 MEMORY RANGES DIALOG OPTIONS Auto select memory areas and The default is enabled checked When enabled the range memory areas and ranges for the selected device are automatically selected by the MPLAB IDE based on the data in its memory The corresponding memory areas and range information are displayed as checked but unavailable in the manual fields If the auto select option is disabled unchecked you can specify memory areas and ranges Read all on auto select The default is enabled checked This option is only available if the Auto s
86. sion of the firmware it indicates that the firmware OS version detected by the MPLAB IDE is less than what is needed to support the selected device The PICSTART Plus will need to be upgraded to the firmware OS version that supports the desired device If the PICSTART Plus uses a PUM or has a PIC18F6720 already built into its PCB the newer firmware OS can be downloaded using a Programmer menu option in the MPLAB IDE If not the PIC17C44 inside of the PICSTART Plus will need to be replaced DS51028F page 62 2004 Microchip Technology Inc PICSTART Plus MPLAB IDE Reference It is highly advisable to purchase a PUM to use with an older PICSTART Plus for the following reasons The PICSTART Plus firmware OS version is earlier than 2 01 and the MPLAB IDE needs to be used There will be no more firmware OS releases based on the PIC17C44 These releases ended with firmware OS version 3 11 found in file ps 31100 hex As newer devices become available for use and are added to the MPLAB IDE selection list their support will be added to the PICSTART Plus firmware OS Thus the PUM will provide ongoing use of the PICSTART Plus Firmware files applicable to the PUM are named psplsxxxxx hex where xxxxx is the version 5 8 3 Installing the PUM The PICSTART Plus Flash Upgrade Module PUM PCB replaces the existing PIC17C44 microcontroller in the U21 socket inside your PICSTART Plus enclosure Once this processor upgrade is installed you will
87. ssssessssssssssssssseene enne nennen nennen nnns 17 3 4 Selecting the Device eene 18 3 5 Creating the Project AAA 19 3 6 Setting Up Language Tools wwwwwwmekamanananananananunanzanunananunuzizw wwa 20 3 7 Naming the Project miendo iee aa a a a hai aa e aS 21 3 8 Adding Files to the Project ssseeessssssssssssssssssssssseeseeeeeeeennr nennen 22 3 9 Building the Initial Project iii 24 3 10 Creating Code WAA a a Tea Ea a k aiant raia adah 25 3 11 Building the Project ccceseesssesseneenneeneeaeeeaeeeeeeeeeeeaeaeeaeeeeeeceeeeeeeeeeeeess 27 3 12 Enabling the PIGS DART CET 28 3 13 Programming the Device essssessssssssssssssssseesseeene enne 29 3 14 Verifying the Programming ssesessssssssesssssseesseseneeenernn nnns 29 3 15 Tutorial S mmaly EE 29 2004 Microchip Technology Inc DS51028F page iii MPLAB PICSTART Plus User s Guide Chapter 4 Using the PICSTART Plus 4 1 Ya LA CoYe LO Taa fo qt E rr 31 4 2 Preparation for Programming a Device wwwwwwwwewemimimimimimimwmwwa 31 4 3 Procedure for Programming a Device ssssssssRe 31 4 4 Verifying the Programming esesssesesses wwa 46 4 5 Reading a Device essssssssssssssseneneen eene nne n nnns nennen nenne 46 Chapter 5 PICSTART Plus MPLAB IDE Reference GE Mu uge SULO LO a m E 49 5 2 PICSTART Plus Toolbar oni tad a er
88. t Program mer Enable Programmer The PICSTART Plus toolbar will appear when the program mer is enabled Select View gt Program Memory and click on Opcode Hex at the bottom of the window see Figure 3 16 to view the hex code you ve just built You can resize or move the Program Memory window on your display You may wish to close the Build Results window FIGURE 3 16 VIEWING PROGRAM MEMORY E Program Memory Address 0000 0010 0020 0030 0040 0050 0060 0070 0080 0090 0040 OOBO ooco DODO OOEO Opeode Hex Machine Symbolic DS51028F page 28 2004 Microchip Technology Inc Tutorial 3 13 PROGRAMMING THE DEVICE Now that you have your data in program memory you can program the device Make sure your PIC18F452 device is properly inserted and latched into the PICSTART Plus socket Then select Programmer gt Program The MPLAB IDE window will indicate the progress and when finished the Output window will display the results see Figure 3 17 FIGURE 3 17 PROGRAMMING RESULTS Build Version Control Find in Files PICSTART PICSTART Error Log File 13 Jul 2004 16 09 59 Device Type PIC18F452 Address Range 0 7fff Programming Verification completed successfully 3 14 VERIFYING THE PROGRAMMING Select Programmer gt Verify to double check the programming in the device If any address locations on the device do not match program memory an error log will display the disc
89. t the PICSTART Plus hardware has been connected and has the correct socket module for the device Insert the device into the socket module Select Programmer Enable Programmer to enable the PICSTART Plus 6 Open the windows associated with the device memory areas i e the Program Memory and Configuration Bits windows By default the memory area windows are cleared by the MPLAB IDE when the device was selected If not select Debugger gt Clear Memory gt Program Memory to clear the window 7 Select View gt Output to open the Output window 8 Select Programmer gt Read The current values in each of the device areas will be displayed 9 f you know the device is blank or not code protected but the Read command displays a message with values that indicate code protection double check the PICSTART Plus hardware especially the positioning of the device in the PICSTART Plus ZIFF socket Additional help information can also be found in the Troubleshooting section under Help Topics PICSTART Plus 10 If the Read command was successful go to the last available address in the Program Memory window to view the calibration value o 2004 Microchip Technology Inc DS51028F page 43 MPLAB PICSTART Plus User s Guide 4 3 10 2 SAVING THE CALIBRATION DATA 1 Ifthe device is in a windowed package the calibration data must be saved by doing one of the following a Write down the calibration value and keep it in a safe place or
90. ter PICSTART Plus programs a device it automatically performs a verify operation and displays any errors found An additional verify operation may be done via selecting Programmer gt Verify 5 5 5 Verify To verify the programming on the device select Programmer gt Verify This verifies that the programming on the device matches the program memory configuration bits ID locations EEPROM and calibration memory values in MPLAB IDE those currently displayed in the memory area windows and in the Settings dialog If there are more errors than expected and those errors claim that the bad data is all zeros 0000 the device may not be seated properly in the PICSTART Plus or aligned Pin 1 to Pin 1 in the ZIFF socket It is always a good practice to insert a known blank device and do a blank check whenever the socket module is changed 2004 Microchip Technology Inc DS51028F page 55 MPLAB PICSTART Plus User s Guide When the programming is finished Programming Verification completed successfully will be displayed in the Output window If the programming failed an error message will appear showing the good expected data and the bad actual data for the memory areas it attempted to program 5 5 6 Read To read the entire device i e all of program memory configuration bits etc select Programmer gt Read To read selectively e g part of program memory only configuration bits select Programmer gt Settings gt Mem
91. teu e Seas i er 5 1 2 What is PICSTART Plus Programmer seeeeeeeeeeeeeeseeeneeneeenseeeeeeees 5 1 3 PICSTART Plus System Components ssesssssssssssssssseeseeeeeeeeees 5 1 4 PICSTART Plus CE Compliance esses 6 1 5 How the PICSTART Plus Programmer Helps You ueueeesesssse 6 1 6 MPLAB Integrated Development Environment 7 1 7 MPLAB Development Tools eere nente nennen nnne nnn 7 Chapter 2 PICSTART Plus Installation ZA MOU CHA ein irrien aeaa todo tdeo e Medea ftot ci de 9 2 2 Host Computer System Requirements essssssssssssssssssssesee 9 2 3 Installing MPLAB IDE Software sssssssssssssssssssssssesee eene 9 2 4 Installing PICSTART Plus Hardware ssssssssssssssssssseeeeeerreeennee 10 2 5 Starting MPLAB IDE wi o ior E ott riu ta ee Cel EE ED a uU E UE 11 2 6 Turning the PICSTART Plus On Off AA 11 2 7 Selecting the Device wwwma wanan aa mwanana nana awa manana wananunua na kuwana 12 2 8 Selecting the PICSTART Plus Programmer s sssssssererernrrnnrrnnnrrennnnsneesnnsn 13 2 9 Configuring the Serial Port for PICSTART Plus 13 2 10 Enabling the PICS TART PIS s eei et poem EE eegen Eeb en 15 Chapter 3 Tutorial S T AAA Ko Yo JE La fo KAA P LE 17 3 2 Before You Begin sesssssssssssssssesseeeeeee nennen nennen nnne nnns 17 3 3 Programming Overview ssss
92. the Clear Memory options does not erase the contents of the device 2004 Microchip Technology Inc DS51028F page 51 MPLAB PICSTART Plus User s Guide 5 5 PICSTART PLUS PROGRAMMER MENU Once you select the PICSTART Plus programmer the full programmer menu displays see Figure 5 4 and Table 5 4 You must enable the programmer to make additional menu items available Some of the PICSTART Plus menu items are accessible through the PICSTART Plus toolbar FIGURE 5 4 PICSTART PLUS PROGRAMMER MENU w MPLAB IDE Dc LL m amp Checksum 0x82d8 L Output Build Version Control Find in PICSTART Plus File Edit View Project Debugger Bis PIC18F452 Configure Window Help 03 Pass 0 Fail 0 Total 0 Select Programmer Disable Programmer Program Verify Read Blank Check All Blank Check OTP Abort Operation aai Reset Reset Program Statistics Erase Flash Device Download PICSTART OS About Settings novzdcc TABLE 5 4 PICSTART PLUS MENU Programmer Menu Option Josibar Function Icon Select Programmer Lists the available programmers Enable Programmer Enables the programmer Disable Programmerr Disables the programmer Program 1 Programs the device Laud Verify Verifies that the device was programmed 3 4 properly Read Reads the device content Selective read e g 3 part of program memory only configuration bits of the device ca
93. the following steps Selecting the Device Creating the Project Setting Up Language Tools Naming the Project Adding Files to the Project Building the Initial Project Creating Code Building the Project Enabling the PICSTART Plus Programming the Device Verifying the Programming 2004 Microchip Technology Inc DS51028F page 17 MPLAB PICSTART Plus User s Guide 3 4 SELECTING THE DEVICE If you have not already selected the device in MPLAB IDE do so by selecting Configure Select Device to open the Select Device dialog Figure 3 1 and select the PIC18F452 device Under Microchip Programmer Tool Support verify that this device is supported green light by the PICSTART Plus Click OK FIGURE 3 1 SELECTING THE DEVICE Select Device Device SSES x Microchip Programmer Tool Support PICSTARTPlus g MPLABICD 2 PRO MATE II Q Pickit1 MPLAB PM Microchip Debugger Tool Support MPLAB SIM MPLABICD 2 MPLAB ICE 2000 MPLAB ICE 4000 pcmiexct QPMF18wWCO pcm1sxHo Cancel Help E DS51028F page 18 2004 Microchip Technology Inc Tutorial 3 5 CREATING THE PROJECT In order to program the device you ll need a hex file In this example we ll create a project to generate the hex file using the Project Wizard We will use a single assembly file for this project and a linker script Choose the Project Project Wizard to begin using the Project Wizard and display the Welcome sc
94. vice requires firmware version 4 30 0 or higher DS51028F page 34 2004 Microchip Technology Inc Using the PICSTART Plus If communication cannot be established due to problems with the serial connection a message similar to the one in Figure 4 6 will be displayed Communications errors can also be caused by the device not being properly aligned in the ZIFF socket FIGURE 4 6 COMMUNICATIONS ERROR MESSAGE EER Build Version Control Find in Files PICSTART Cannot Transmit Please verify connection and retry the previous operation If you cannot establish communications between the PC and PICSTART Plus make sure you have installed the hardware and software correctly see Section 2 4 Installing PICSTART Plus Hardware and Section 2 3 Installing MPLAB IDE Software If you still cannot establish communications between the PC and PICSTART Plus please see Appendix B Troubleshooting Where possible new device support on previous versions of the PICSTART Plus firmware OS is allowed However some new devices require updates to the PICSTART Plus firmware OS See Section 5 8 Upgrading the PICSTART Plus Firmware OS for information on upgrading the PICSTART firmware OS 4 3 5 Loading a Hex File into Program Memory 4 3 5 1 ABOUT PROGRAM MEMORY You can view the Program Memory as hex code machine code or disassembled with symbols if available To view program memory select View gt Pr
95. vlw OxFF movwf DVAR set inner delay loop Delayl decfsz DVAR goto Delayl decfsz DVAR2 goto DelayO return The template file should now look like Figure 3 13 FIGURE 3 13 TEMPLATE FILE ADD CODE Wil MPLAB IDE Editor f452tmpo asm Main clrf movwf clear PORTC mert configure PORTC as all outputs Init clrf COUNT IncCount incf COUNT movf COUNT movit PORTC display COUNT on PORTC call Delay goto IncCount infinite loop Delay moviw 0x40 set outer delay loop movwt DVARZ DelayO moviw OxFF movvrf DVAR set inner delay loop Delayl decfsz DVAR goto Delayl decfsz DVARZ goto DelayO return QAEGOUORGUROROOR TOR GR EE EE EE AUR EE EE EE EE EE EE EE EE EE EE EE End of program DS51028F page 26 2004 Microchip Technology Inc Tutorial In this bit of code we used three variables named COUNT DVAR and DVAR2 We need to define those in the template file in the section for uninitialized data a section named UDATA There are already three variables in this section of the template file so we can just add ours after them using the same format Each variable is an 8 bit variable so they only need to reserve 1 byte each FIGURE 3 14 TEMPLATE FILE ADD VARIABLES Wil MPLAB IDE Editor f452tmpo asm Variable definitions These variables are only needed if low priority interrupts are used More variables may be needed to store other special function registers
96. y 1 Plug the power cable attached to the power supply into a power outlet 2 Connectthe thin power supply cable to the PICSTART Plus This supplies power to the PICSTART Plus programmer The green power light will come on DO NOT connect power with a device in the socket Damage to the device may result a Ur Ieri i eee NN IEIUNII LLLLLLLULL LOMaSGM H Ja M f DS51028F page 10 2004 Microchip Technology Inc PICSTART Plus Installation 2 5 STARTING MPLAB IDE To start the MPLAB IDE double click on the icon installed on the desktop after installation or select Start Programs Microchip MPLAB IDE gt MPLAB IDE A screen will display the MPLAB IDE logo followed by the MPLAB IDE desktop The MPLAB IDE desktop should look similar to Figure 2 1 FIGURE 2 1 MPLAB IDE DESKTOP a MPLAB IDE File Edit View Project Debugger Programmer Tools Configure Window Help Deum SMe Checksum Ox82d8 oi ag e su Output DER Build Version Control Find in Files PIC18F452 i novzdcc 2 6 TURNING THE PICSTART PLUS ON OFF Simply plug in or unplug the PICSTART Plus power supply to turn the programmer on or off respectively 2004 Microchip Technology Inc DS51028F page 11 MPLAB PICSTART Plus User s Guide 2 7 SELECTING THE DEVICE Select Configure Select Device to select a device from the list of available devices see Figure 2

Download Pdf Manuals

image

Related Search

Related Contents

22 Debugging  scaricare il manuale completo qui  Untitled - Dea System  Installation Manual  ONKYO CS-255DAB  リシェルSI取扱説明書 02-11 cs3.indd  GPS Receiver A1084      Veranda 73013136 Installation Guide  

Copyright © All rights reserved.
Failed to retrieve file