Home

16-bit 28-pin Starter Development Board User's Guide

image

Contents

1. p 1 JONMIA asn NId9 LLPU ON on oLl Oonoasa FSI g N vivaason 1va INA tg H Dm 510010 d aaa Ka daN es y ONO gnmi r viva asol sr T el Ha een a XE SSA SA OSSZ48LOId ZN 404 B CO gen 0 000 i 43av3H 39NNId Z UNO e gen aga HN ddA E bA Er EN ddgz doz vu ZUHA NNOO Es yZOld J oldsP J0coldsP SLO Wd NOILJSNNOO Od ESN LM 404 HOLIANNOD WvsiSOMd ZOOI kaso zn i aso zn ZHNO Oc QN B06123 ASN 404 NMOQ 123135 HOLIMS T ZA WWHDOHd OL dN 123135 HOLIMS IO ANS en HONOMHL SNA ASN JHL Oe WE 94 HUN ONILVOINIWWOO 40 30IA3 DIdSP 3HL SNIWAVHOOHd NEME 193135 OL ZMS 4SN zk jugo G tt CL Uu b 2 SIAI v22ld J 2OIdSP X04 7 Z SNId dwar e l S391A30 4OEDIHSP NOs Z 7 SNId dani ZMS mele S3O0I 30 y2314 4 21d5P xti NE EA ONY 40E014SP N33ML3B LONAS OL df ISN GEN a eee yCOld 3 OldsP 2 ANI JOEDIASP 2 a E d A gt 98M joda Lda saugas s 2 ee eee dnb LEY 83M aoa GaAs aaa XL E r zoso d z9s0 zn L sad c4 rod pve one 2 BEI GND G SSA 1S0 5 950 zn zu EEI a EA 2104 paH anra A SN gt ep AO yoyo SMM aen Bei e SSA SSA ZOSO a ee 3 m gr eae cn svat EE oqqA aa bosol Losorg 1980 3 g gr E M jz o 8 Sau SSAj SSArg an9 s ECH rz zz 19 vas cay eaaeo u re deep
2. Represents code supplied by user void main void 2008 Microchip Technology Inc DS51656B page 3 16 Bit 28 Pin Starter Development Board User s Guide 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 RECOMMENDED READING This user s guide describes how to use the 16 Bit 28 Pin Starter Development Board Other useful documents are listed below The following Microchip documents are available and recommended as supplemental reference resources dsPIC30F Family Reference Manual DS70046 Refer this document for detailed information on dsPIC30F device operation This reference manual explains the operation of the dsPIC30F DSC family architecture and peripheral modules but does not cover the specifics of each device Refer to the appropriate device data sheet for device specific information dsPIC30F2010 Data Sheet DS70118 This data sheet summarizes the features of the dsPIC30F2010 and provides essential information needed to develop the software for this device dsPIC30F 33F Programmer s Reference Manual DS70157 This manual is a software developer s reference for the dsPIC30F 33F 16 bit DSC family of devices It describes the instruction set in detail and also provides general information t
3. 11 em ildina the C External Stimulus Switches ai ding t e ode BEE a e LU EE LED Indicators wa rettet Creating the Project MPLAB ICD 2 CONNECHONS mn GE Ce Code ka Reset Push Button quipment E ELLES POR Serial Communication Channels 11 Overview ubt hs EE EE Development Board Power SEL de Ge Se Development Board Schematic EE the Device for Stand alone 2 Device Clocking AE PAA ua eeraa 9 Documentation U EE 2 UART Communication Channel 11 12 Layout ENTERO 1 F W Warranty Registration sse eee nnneennnnnnnnnnnnnn nn mnn 4 Free Software Foundation se ennenenennnnennnnn 5 Watch Window G WWW Address A 6 GNU Language Tools seeeenne 5 H IR El EC 35 5V or 3 3V Jumper nn nn 36 Device Selection Jumper 37 LED Connect Jumper LED Indicators unen a MPLAB ICD 2 Connector 36 Oscillator nennen 37 Potentiometen ix xi sie iu en 37 Potentiometer Connect Jumper 37 Power On Indicator 36 Power Supply Connector 36 Power Supply or USB Jumper 36 Reset BU Ma ee Ed 37 SwWilchi RE 37 SWIA Z serere tee cba Cave bt A 37 USB Ge EE 36 2008 Microchip Technology Inc DS51656B page 45 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
4. while U1LSTAbits TRMT a ULRXREG ULTXREG a while ULSTAbits TRMT ULTXREG while UlSTAbits TRMT ULTXREG _ULBXIF 0 return 0 void attribute il interrupt _TlInterrupt void IFSObits TlIF 0 clear interrupt flag LATE OxF 4 b 2 Right click the line of code LATE OxF and select Run to Cursor The green arrow moves to the bracket below the line of code because it has executed the prior lines of code up to and including LATE OxF From the View menu select Watch to open a Watch window From the Add SFR pull down list display PC Click Add SFR to add the PC register to the Watch window Press F7 afew times and watch the PC value increment see Figure 2 14 PC is the repeat loop counter that increments with each step EI E FIGURE 2 14 WATCH WINDOW DISPLAY B watch ini x AddSFA ACCA Add Symboll SP Ox0001Ba Watch 1 Watch 2 Watch 3 Watch 4 2008 Microchip Technology Inc DS51656B page 27 16 Bit 28 Pin Starter Development Board User s Guide 2 8 3 Setting the Breakpoint 1 To set a breakpoint right click a line of code and select Set Breakpoint from the pop up menu Note An alternate method is to simply double click the line This feature may need to be enabled using the Edit gt Properties menu As an example find the following line of code and set a breakpoint on this line IFSO
5. EUH m ECT GC BS 38 va zaa DE 89 912 A baa IECH gay Lu voi KEE vai bay za 08M E aan AU oc SZ m i NANS SE ue gz obey eau Laal Lv Ceo 434A adoz adoz SSAY SSN ogy Gent TO 434 L TzwezeL Zi BB 4S wH pzy Ou TOW HON Qno een JC 1989 Ulu Ou LA gt pal 9dL Gal in DS51656B page 40 Drawings and Schematics 16 BIT 28 PIN STARTER DEVELOPMENT BOARD SCHEMATIC SHEET 2 OF 2 FIGURE A 3 Mao T Joo es ae Gar a LN SON M Lms Y wb 6M aVvd 1WS dl4 HAQVAH aan Losi vl Ls SC so 9 Ian dVd LWS dl4 asa x L el Long Pod x4 Bl LL anna ZX ano 6l el an 9031 gati Fan Vd lAS QH PS SC y so LC 8 fave awl al awl awl o fara Jzz zooj A IS Lo ez sao La 90 ca va zum Sol SLY SLY Gly GLY Jeu 267 teol CH va CH CH ra 19z szol aa bel LZ LOI E par f Sc ATIN Abt zr a ven EP Go ei ios ee ve ER eu d Tree bd Ag Taf Ag e A E SN ANDE Ed BS SHL 804 7 7 SNid dAnr An NI 33v SAMIYA JONVLIOVHVO SITOA E JHL 4047 X SNid dAnr e Sg NEES Sc TJONVHJIOL XL 34V SHOLISIS3H 71337 39VL10A 1937138 OL Zdf asn WOHH LNANI HIMOd 123738 OL Ldf ISN SWHO NI 3H SAMA SONVISISSY 1031419395 3SIMH3HIO SSTINN NIBQAE L ZITLOL QN
6. 2008 Microchip Technology Inc MICROCHIP 16 Bit 28 Pin Starter Development Board User s Guide 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 anv other semiconductor manufacturer can guarantee the securitv of their code Code protection does not mean that we are guaranteeing the product as unbreakable Code protection is constantiv evolving We at Microchip are committed to continuousiv 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 reli
7. Local Sales Office Field Application Engineer FAE Technical Support 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 DOCUMENT REVISION HISTORY Revision A March 2007 This is the initial release of this document Revision B December 2008 This revision includes the following updates Figures Updated the note at the bottom right of the device to Use JP3 to select between in Figure A 2 Updated the note to the right of switch SW2 to Use SW to select between in Figure A 2 Updated the value of the capacitor C17 to 10 uF in Figure A 2 Updated the value of pin 28 in J2 to 9V in Figure A 3 Sections Updated the description in Section 1 6 UART Communication Via USB Additional minor corrections such as language and formatting updates have been incorporated throughout the document E 2008 Microchip Technology Inc DS51656B page 7 16 Bit 28 Pin Starter Development Board User s Guide NOTES DS51656B page 8 2008 Microchip Technology Inc 16 BIT 28 PIN STARTER DEVELOPMENT BOARD MICROCHIP USER S GUIDE Chapter 1 Introduction 1 1 INTRODUCTION The 16 Bit 28 Pin Starter Development Board serv
8. 1 TSP P90R60 TP6 AGND ORN Digi Key 5013K ND 1 TSP P90R60 TP5 AVDD VEL Digi Key 5014K ND 2 TSP P90R60 TP3 GND BLK Digi Key 5011K ND TP4 GND BLK 1 VRG LM2937IMP SOT223 SMT VR1 5V Digi Key LM2937IMP 5 0CT ND 1 VRG TC1262IMP SOT223 SMT VR2 3 3V MCHP TC1262 3 3VDBTR 1 XTL 200LS PTH CAN Y1 7 3728 MHz Digi Key X1084 ND 1 XTL ABM8 SMT Y2 20 0 MHz Digi Key 535 9136 1 ND 1 SOC PIC 28 PIN SDIP SU1 SOCKET Digi Key ED90054 ND 1 PCB DSPICDEM 28 PIN PLUS DEMO PCB1 BLANK PCB 5 SHUNT 2 PIN SH1 5 Jameco 421454 DS51656B page 44 2008 Microchip Technology Inc MICROCHIP 16 BIT 28 PIN STARTER DEVELOPMENT BOARD USER S GUIDE Index B l Board esso a a i ee 35 en EE 37 Breakpoint 2 7 i nn nn Ernie sect 28 Internet Address ssssssssseseeeeeneneeeeneen 6 Breakpoint Set ciet Le cate tec epit 26 L C Language Toolsuite L nn 16 Communication Channel M UART to USB L nnnennnn mwiza 12 Configuration Bits Microchip Internet Web Gite nn 6 Connections P MPEAB IGD 2 roter te tier eene 11 Customer Notification Service 6 Project Wizard ss ssssssssrssssrsrsinssnieninsnrtesntnnnnnnnnnnnnnnene na 14 Customer Support 7 R D Reading Recommended nn 4 Debuggirig eere tre eee nin nta 26 S Demonstration Program Summaty e Schematics AAA 40 41 UART Communication T Development Board Features Tutorial Device Clocking
9. 4 2 HARDWARE OVERVIEW The numbered board components are described in Table 4 1 FIGURE 4 1 16 BIT 28 PIN STARTER DEVELOPMENT BOARD SE M me ow CR CH c 00000000300990 Ee ds RE wm Ee C6 C7 D 5555399309099999 9000580005807 2008 Microchip Technology Inc DS51656B page 35 16 Bit 28 Pin Starter Development Board User s Guide TABLE 4 1 16 BIT 28 PIN STARTER DEVELOPMENT BOARD HARDWARE ELEMENTS No Name Description 1 J3 USB Port 2 J4 MPLAB ICD 2 Connector 3 Ji Power Supply Connector 4 D3 Power on Indicator 5 JP2 5V or 3 3V Jumper 6 JP1 Power Supply or USB Jumper 7 D4 D7 LED Indicators 8 JP4 LED Connect Jumper 9 RESET Reset Button 10 SW1 Switch 1 11 SW2 Switch 2 12 RP1 Potentiometer 13 JP5 Potentiometer Connect Jumper 14 Y1 Oscillator 15 JP3 Device Selection Jumper 16 J2 1 0 Header 17 J6 PICkitTM 2 Connector 4 3 HARDWARE ELEMENTS 4 3 1 USB Port J3 The 16 Bit 28 Pin Starter Development Board provides one USB communication channel The USB communication channel is labeled J3 The device communicates using the UART to the on board PIC18 through the U1RX and U1TX pins which then communicates through the USB port The USB port can also be used to power the development board 4 3 2 MPLAB ICD 2 Connector J4 By way of this modular connector the MPLAB ICD 2 can be connected for low cost programming and debugging of
10. 86 29 8833 7252 Fax 86 29 8833 7256 China Zhuhai Tel 86 756 3210040 Fax 86 756 3210049 ASIA PACIFIC India Bangalore Tel 91 80 4182 8400 Fax 91 80 4182 8422 India New Delhi Tel 91 11 4160 8631 Fax 91 11 4160 8632 India Pune Tel 91 20 2566 1512 Fax 91 20 2566 1513 Japan Yokohama Tel 81 45 471 6166 Fax 81 45 471 6122 Korea Daegu Tel 82 53 744 4301 Fax 82 53 744 4302 Korea Seoul Tel 82 2 554 7200 Fax 82 2 558 5932 or 82 2 558 5934 Malaysia Kuala Lumpur Tel 60 3 6201 9857 Fax 60 3 6201 9859 Malaysia Penang Tel 60 4 227 8870 Fax 60 4 227 4068 Philippines Manila Tel 63 2 634 9065 Fax 63 2 634 9069 Singapore Tel 65 6334 8870 Fax 65 6334 8850 Taiwan Hsin Chu Tel 886 3 572 9526 Fax 886 3 572 6459 Taiwan Kaohsiung Tel 886 7 536 4818 Fax 886 7 536 4803 Taiwan Taipei Tel 886 2 2500 6610 Fax 886 2 2508 0102 Thailand Bangkok Tel 66 2 694 1351 Fax 66 2 694 1350 EUROPE Austria Wels Tel 43 7242 2244 39 Fax 43 7242 2244 393 Denmark Copenhagen Tel 45 4450 2828 Fax 45 4485 2829 France Paris Tel 33 1 69 53 63 20 Fax 33 1 69 30 90 79 Germany Munich 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 Spain Madrid Tel 34 91 708 08 90 Fax 34 91 708 08 91 UK Wokingham Tel 44 118 921 5869 Fax 44 118 921 5820
11. Development Board Schematics 40 Appendix B Bill of Materials BOM j EE 45 Worldwide Sales and Service sennnnnnnnnnzzzznzznnnnnnnnnanznnnnnnnnnnnnnnnznnnnnnnnnnzmmznznzzzznnz 46 NENNEN DS51656B page iv 2008 Microchip Technology Inc 16 BIT 28 PIN STARTER DEVELOPMENT BOARD 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 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 16 Bit 28 Pin Starter Development Board Items discussed in this chapter include Document Layout Conventions Used in this Guide Warranty Registration Re
12. ICD 2 In Circuit Debugger Program the chip with the MPLAB ICD 2 View the code execution in program memory and source code View registers in a Watch window Set a breakpoint and make the code halt at a chosen location Use the function keys to reset run halt and single step the code Program the device for Debugger mode or stand alone operation 2008 Microchip Technology Inc DS51656B page 29 16 Bit 28 Pin Starter Development Board User s Guide NOTES DS51656B page 30 2008 Microchip Technology Inc 16 BIT 28 PIN STARTER DEVELOPMENT BOARD MICROCHIP USER S GUIDE Chapter 3 Demonstration Program 3 1 INTRODUCTION This chapter provides an overview of the 16 Bit 28 Pin Starter Development Board demonstration program Hardware information of the 16 Bit 28 Pin Starter Development Board hardware is presented in Chapter 4 Development Hardware and Appendix A Drawings and Schematics Topics discussed in this chapter include Demonstration Program Summary Demonstration Program Description Demonstration Program Setup 3 2 DEMONSTRATION PROGRAM SUMMARY The 16 Bit 28 Pin Starter Development Board is shipped along with a simple demo application programmed into the dsPIC33FJ12GP202 device This program demonstrates the use of key functionality 3 3 DEMONSTRATION PROGRAM DESCRIPTION When power is applied to the 16 Bit 28 Pin Starter Development Board the device starts executing the demonstration program
13. PROGRAM MEMORY WINDOW lll Program Memory 040100 goto reset 000000 nop 000212 DefaultInterrupt 000212 DefaultInterrupt 000212 DefaultInterrupt 000212 DefaultInterrupt 000212 _DefaultInterrupt 000212 DefaultInterrupt 000212 DefaultInterrupt 000212 DefaultInterrupt 000212 DefaultInterrupt 000212 DefaultInterrupt 000212 DefaultInterrupt OOO1FE _Tilnterrupt 000212 _DefaultInterrupt 000212 _DefaultInterrupt 000212 _DefaultInterrupt 000212 _DefaultInterrupt 000212 DefaultInterrupt 000212 DefaultInterrupt 000212 DefaultInterrupt 000212 _DefaultInterrupt in pcode Hex i Symbolic PSV Mixed PSV Data 8 Press lt F5 gt to halt the processor and press lt F6 gt to reset the processor The program memory now displays a green arrow pointing to the line of code at address 00000 which is the reset location The instruction at this location is goto reset This code is added by the linker to make the program branch to the start of the code in the demo 33F c file DS51656B page 26 2008 Microchip Technology Inc Tutorial 2 8 2 Stepping the Program 1 After halting the program press lt F7 gt to single step the code Observe the location of the green arrow while single stepping In this demonstration the code will halt in the while loop of the UART as shown in Figure 2 13 FIGURE 2 13 SOURCE CODE WINDOW while 1 while _ULRXIF 0 int a while UlSTAbits TRMT ULTXREG
14. Select a Device Start MPLAB IDE Close any workspace that might be open File gt Close Workspace From the Project menu select Project Wizard On the Welcome screen click Next to display the Project Wizard Step One dialog see Figure 2 1 BO m c DS51656B page 14 2008 Microchip Technology Inc Tutorial FIGURE 2 1 PROJECT WIZARD STEP ONE SELECT A DEVICE xi Step One Select a device z Device dsPIC33FJ12GP202 e ee 5 From the Device drop down list select dsPIC33FJ12GP202 and click Next gt The Project Wizard Step Two dialog appears FIGURE 2 2 PROJECT WIZARD STEP TWO SELECT A LANGUAGE TOOLSUITE Step Two Select a language toolsuite Active Toolsuite Microchip C30 Toolsuite DI Toolsuite Contents MPLAB ASM30 Assembler pic30 as exe a MPLAB C30 C Compiler pic30 acc exe MPLAB UNK 20 Object Linker pic30 d exe EI LIR3N rchiwer nir IMl ar evel m Location C Program Files MicrochipsMPLAB C3 bin pic30 acc exe Browse Help My Suite Isn t Listed Show all installed toolsuites ted oe 2008 Microchip Technology Inc DS51656B page 15 16 Bit 28 Pin Starter Development Board User s Guide 2 4 2 Select a Language Toolsuite 1 From the Active Toolsuite drop down list select Microchip C30 Toolsuite This toolsuite includes the compiler and linker that will be used 2 Click Next to co
15. The program demonstrates the following functions UART Communication Timer Interrupt 3 3 1 UART Communication The program uses the UART peripheral to communicate with the PC HyperTerminal application via the on board UART to USB bridge The program waits for the character to be received from the PC and echoes it back to the PC enclosed in quotes 3 3 2 Timer Interrupt To illustrate interrupt processing the demonstration program uses Timer1 to generate interrupts which cause the LEDs to blink The clock prescaler and period register for Timer1 are configured to produce an interrupt on every 250 ms 2008 Microchip Technology Inc DS51656B page 31 16 Bit 28 Pin Starter Development Board User s Guide 3 4 DEMONSTRATION PROGRAM SETUP 3 4 1 Installing the USB Driver 1 Connect the power supply to the board Refer to Section 1 5 Power Selection for details 2 Select the dsPIC33F device configuration Refer to Section 1 7 Device Selection for details 3 Connectthe 16 Bit 28 Pin Starter Development Board to the PC with USB cable The Found New Hardware Wizard dialog appears as shown in Figure 3 1 FIGURE 3 1 FOUND NEW HARDWARE WIZARD Found New Hardware Wizard 7 l Welcome to the Found New G Hardware Wizard Windows will search for current and updated software by looking on your computer on the hardware installation CD or on the Windows Update Web site with your permission Read our pri
16. 01 02 08 DS51656B page 46 2008 Microchip Technology Inc
17. 1209 6 dWIZ 6cW1 S310N CAL eee di Gs KE B A mE Q0N 1 988 06p A9L ngi AQL AGL NASZ ang w iz anol ang 4U00L ano 7 Lol GO aND QNO YO o qND QNO eco LD cdi AG E l ina N 193735 eil A una NI gt E L L L dNIZ 6ZWI W W Ir APES A dAIZ 62W1 GHA LIA SE Lal AS SE E By SC za LO DS51656B page 41 2008 Microchip Technology Inc 16 Bit 28 Pin Starter Development Board User s Guide NOTES DS51656B page 42 2008 Microchip Technology Inc MICROCHIP 16 BIT 28 PIN STARTER DEVELOPMENT BOARD USER S GUIDE Appendix B Bill of Materials BOM TABLE B 1 BILL OF MATERIALS Qty Component Name Reference Value Vendor Vendor P N 1 CAP CRCWO805 C17 1uF Digi Key PCC2249CT ND 5 CAP CRCWO0805 C1 10 uF Digi Key 490 3886 1 ND C3 10 UF C4 10 UF C5 10 UF C11 10 uF 4 CAP CRCWO0805 C6 20 pF Digi Key 478 3735 1 ND C7 20 pF C14 20 pF C15 20 pF 8 CAP CRCWO0805 C2 100 nF Digi Key PCC1864CT ND C8 100 nF C9 100 nF C10 100 nF C12 100 nF C13 100 nF C16 100 nF C18 100 nF 1 CNN POWER IN MOD 2 5MM J1 2 5 MM Digi Key CP 102BH ND 1 CNN RJ11 ICSP 6 PIN PTH J4 RJ11 6 pin Digi Key A31417 ND 1 CNN USB TYPE B PTH J3 USB Digi Key A31725 ND 2 DIO 1N4148WS SOD 323 D1 1N4148 Digi Key 1N4148WS FDICT ND D2 1N4148 4 FOOT BUMPON RUBBER 0 375
18. 2 Select the dsPIC33F device configuration Refer to Section 1 7 Device Selection for details 3 Connect the 16 Bit 28 Pin Starter Development Board to the PC with the USB cable The Found New Hardware Wizard dialog appears as shown in Figure 2 8 2008 Microchip Technology Inc DS51656B page 21 16 Bit 28 Pin Starter Development Board User s Guide FIGURE 2 8 FOUND NEW HARDWARE WIZARD Found New Hardware Wizard Em Welcome to the Found New eS Hardware Wizard Windows wll search for current and updated software by looking on your computer on the hardware installation CD or on the Windows Update Web site with your permission Read our privacy policy Can Windows connect to Windows Update to search for software Yes this time only Yes now and every time connect a device No not this time Click Next to continue lt Back Cancel 4 Select No not this time then click Next to continue The Select Installation Location dialog appears 5 Select install from a list or specific location then click Next gt to continue The Search and Installation Options dialog appears as shown in Figure 2 9 DS51656B page 22 2008 Microchip Technology Inc Tutorial FIGURE 2 9 SEARCH AND INSTALLATION OPTIONS Found New Hardware Wizard Please choose your search and installation options a ta Y Search for the best driver in these locations Use the check boxes be
19. E Simulator Editor User s Guide DS51025 Refer this document for more information pertaining to the installation and implementation of the MPLAB Integrated Development Environment IDE software To obtain any of these documents visit the Microchip web site at www microchip com 2008 Microchip Technology Inc DS51656B page 5 16 Bit 28 Pin Starter Development Board User s Guide THE MICROCHIP WEB SITE Microchip provides online support via our web 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 FAQs 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 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
20. Je E J4 E eee Le TT ON pwr spry USB ALL soe JLO OD OS a zac 000 ninm oo A o 1 C1C2D1 D3 M NIS DCS L OO 000 O O Olu CONNECT O 5V O 3 3V 55 Aaspicser 000 o R2 D4 c11 Oavon CEN 900 Fra D UR ga LKA CSR Yrics3r Pic24 gp ORAN USB DEBUG Je R3 D5 R118 00000000000000 HM ooo ERN E AGNDO 5 dil ooo RA D6 U1 SW UN 3 Hooooooooooooo comm ERN B Ocno e vi Dh gm RESET TP4 B he oi RB O R7 m l R9 C14 el O Ofilicio MICROCHIP daal at SWI O0O00000000000000 Ol l2 oooooooooooooo N ENS s O Ofiliciz OO POTENTIOMETER e GND 3 3V 5V GND 00000000000000000000000000000000000 00000000000000000000000000000000000 00000000000000000000000000000000000 OOO000 000000000000000 00000 0000 E 000000000000000 00000 00000 000000 gs 000000 00000 00000 000000 EE 000000 00000 00000000000000000000000000000000000 00000000000000000000000000000000000 00S0000000009000900660000000090009000 2008 Microchip Technology Inc DS51656B page 39 16 BIT 28 PIN STARTER DEVELOPMENT BOARD SCHEMATIC GHEET 1 OF 2 16 BIT 28 PIN STARTER DEVELOPMENT BOARD SCHEMATICS 16 Bit 28 Pin Starter Development Board User s Guide FIGURE A 2 A3 2008 Microchip Technology Inc
21. ROUND BOM1 BUMPON Digi Key RBS 12 ND BOM2 BOM3 BOM4 1 HDR 2X14 IC STYLE J2 HEADER Digi Key 929665 09 36 ND 1 ICP DUAL PIC 28 PIN SDIP U1 dsPIC33F MCHP dsPIC33F 1 ICP PIC18F2450 ML QFN 28 PIN 6X6MM U2 PIC18F2450 ML MCHP PIC18F2450 ML 1 IND 1210 L1 60 Digi Key 240 2416 1 ND 2 JMP 2PIN VIAS JP4 1x2 Jameco 108337 JP5 1x2 3 JMP 3PIN CFG2 VIAS JP1 1x3 Jameco 109575 JP2 1x3 JP3 1x3 1 LED LTST C150XKT 1206 SMD D3 GRN Digi Key 160 1169 1 ND 2008 Microchip Technology Inc DS51656B page 43 16 Bit 28 Pin Starter Development Board User s Guide TABLE B 1 BILL OF MATERIALS CONTINUED Qty Component Name Reference Value Vendor Vendor P N 4 LED LTST C150XKT 1206 SMD D4 RED Digi Key 160 1167 1 ND D5 D6 D7 1 POT 3352E BOURNS 1T RP1 10K Digi Key 3352E 103LF ND 2 RES CRCWO805 R9 1K Digi Key RHM1 00KCCT ND R13 1K 1 RES CRCWO0805 R6 1M Digi Key RHM1 00MCCT ND 2 RES CRCWO0805 R10 10 Digi Key RHM10 0CCT ND R11 10 3 RES CRCW0805 R7 10K Digi Key RHM10 0KCCT ND R8 10K R12 10K 5 RES CRCWO0805 R1 475 Digi Key RHM475CCT ND R2 475 R3 475 R4 475 R5 475 2 SWT B3F1000 MOM NO PTH SW3 RESET Digi Key SW402 ND SW1 MOM NO 1 SWT E SWT EG2209 VERT PTH SW2 PROGRAM jJDigi Kev EG1907 ND 1 TSP P90R60 TP2 3 8V WHI Digi Key 5012K ND 1 TSP P90R60 TP1 5V RED Digi Key 5010K ND
22. Starter Development Board is an easy to use tool that allows you to start development with dsPIC30F dsPIC33F and PIC24 devices Following are the important features of the 16 Bit 28 Pin Starter Development Board e On board 5V regulator or 3 3V regulator for VDD and AVDD USB power source or 9V DC power source input jack Power on indicator LED MPLAB ICD 2 Connections MPLAB ICD 2 programming connector UART Communication Channel Single UART communication channel via USB bridge Device Clocking 7 37 MHz crystal Miscellaneous Reset push button for resetting the device Four LEDs for status indicators Push button switch SW1 Potentiometer RP1 for use with ADC All device I O pins are brought out to a header for test point and prototyping access 1 4 DEMONSTRATION PROGRAM The 16 Bit 28 Pin Starter Development Board is supplied with a preloaded device that demonstrates the following board functionality Interrupt handling using Timer1 to toggle the LEDs UART functionality using the on board USB to echo characters sent from a PC terminal programmed with a 9600 baud rate Refer to Chapter 3 Demonstration Program for additional information 1 5 POWER SELECTION The 16 Bit 28 Pin Starter Development Board has the option of being powered by a 9V DC power supply or by the USB bus The position of jumper JP1 determines which power source is used Connect jumper pins 1 and 2 for the 9V power supply or jumper pin
23. There should now be two files in the project 5 Click Next gt to continue 6 When the summary screen appears click Finish Now the MPLAB IDE project window shows the demo_33F c file in the Source Files folder and the p33 j129p202 g1d file in the Linker Scripts folder see Figure 2 5 2008 Microchip Technology Inc DS51656B page 17 16 Bit 28 Pin Starter Development Board User s Guide FIGURE 2 5 MPLAB IDE PROJECT WINDOW BER E MyProject mcp Cl Source Files S demo 33F c CI Header Files CI Object Files CI Library Files Z3 Linker Scripts 7 pa3fjt2gp202 gld C Other Files Symbols A project and workspace have now been created in MPLAB IDE MyProject mcw is the workspace file and MyProject mcpis the project file Double click the demo 33F c file in the project window to open the file DS51656B page 18 2008 Microchip Technology Inc Tutorial 2 5 BUILDING THE CODE 1 From the Project menu select Build All The Build Output window appears FIGURE 2 6 BUILD OUTPUT WINDOW CCR joixi Build Version Control Find in Files Clean Deleting intermediary and output files Clean Deleted file CXTutorialdemo 33F o Clean Deleted file MyProject cof Clean Deleted file MyProjecthex Clean Done Executing C Program Files Microchip MPLAB COON Executing C Program Files Microchip MPLAB COON Executing C Program Files M
24. 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 Compilers The latest information on Microchip C compilers and other language tools These include the MPLAB C18 and MPLAB C30 C compilers MPASMTM and MPLAB ASM30 assemblers MPLINKTM 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 MPLAB SIM simulator 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 and PICkit 1 development programmers DS51656B page 6 2008 Microchip Technology Inc Preface CUSTOMER SUPPORT Users of Microchip products can receive assistance through several channels Distributor or Representative
25. ation Note SW2 must be switched to the Program position for dsPIC30F devices when the application is being programmed into a device with MPLAB ICD 2 Once programming is complete SW2 must be switched back to the USB Debug position for UART communication via the USB bridge See Figure 4 1 for the location of this switch Select Debugger gt Run to execute the code All four LEDs on the development board should start blinking twice per second If using a dsPIC30F device switch SW2 to USB after executing the code 2008 Microchip Technology Inc DS51656B page 25 16 Bit 28 Pin Starter Development Board User s Guide 2 8 DEBUGGING THE CODE The MPLAB ICD 2 In Circuit Debugger can be used to run halt and step the code A breakpoint can be set to halt the program once the code has executed the instruction at the breakpoint The contents of the RAM and registers can be viewed whenever the processor has been halted The MPLAB ICD 2 In Circuit Debugger uses the following function keys to access the main debugging functions F5 Halt F6 Reset F7 Single Step F9 Run In addition there are more functions available by right clicking on a line of source code The most important of these are Set Breakpoint and Run to Cursor 2 8 1 Displaying the Code 1 From the View menu select Program Memory 2 Inthe Program Memory window select the Symbolic tab as shown in Figure 2 12 FIGURE 2 12
26. bits T1IF 0 A red stop sign appears in the gutter gray bar on the left of the source code window 2 Press F6 to reset the device then lt F9 gt to execute the code The program halts on the instruction next to the breakpoint as shown in Figure 2 15 When MPLAB ICD 2 is halted the next instruction is executed Observe that the LEDs on the development board remain lit Note The instruction on which the code halts could be elsewhere in the code if the breakpoint is set on a branch or call instruction Refer to Section 12 Important Notes in the readme file MPLAB ICD 2 txt located in the C MPLAB IDENREADM ES directory for operational information on the MPLAB ICD 2 FIGURE 2 15 SETTING BREAKPOINT int a while UlSTAbits TRMT ULTXREG while U1LSTAbits TRMT a ULRXREG ULTXREG a while U1STAbits TRMT ULTXREG while UlSTAbits TRMT ULTXREG C _ULRXIF 0 return 0 void _ attribute lil interrupt _TlInterrupt void 1 IFSObits TIIF 0 LATE OxF clear interrupt flag DS51656B page 28 2008 Microchip Technology Inc Tutorial 29 PROGRAMMING THE DEVICE FOR STAND ALONE OPERATION The previous example provided the basics of code debugging using the MPLAB ICD 2 When you have fully debugged your application you will want to run the code without using the MPLAB ICD 2 In the following example th
27. commended Reading The Microchip Web Site Development Systems Customer Change Notification Service Customer Support Document Revision History DOCUMENT LAYOUT This document describes how to use the 16 Bit 28 Pin Starter Development Board as a development tool to emulate and debug firmware on a target board The manual layout is as follows Chapter 1 Introduction This chapter introduces the 16 Bit 28 Pin Starter Development Board and provides a brief description of the hardware Chapter 2 Tutorial This chapter provides a step by step process for getting the 16 Bit 28 Pin Starter Development Board up and running with the MPLAB ICD 2 in circuit debugger Chapter 3 Demonstration Program This chapter describes the operational functionality of the sample code which is preprogrammed in the dsPIC33F device 2008 Microchip Technology Inc DS51656B page 1 16 Bit 28 Pin Starter Development Board User s Guide Chapter 4 Development Hardware This chapter describes the hardware on the 16 Bit 28 Pin Starter Development Board Appendix A Drawings and Schematics This appendix illustrates the hardware layout and schematic diagrams for the 16 Bit 28 Pin Starter Development Board Appendix B Bill of Materials BOM This appendix lists the parts used in the 16 Bit 28 Pin Starter Development Board zz l DS51656B page 2 2008 Microchip Technology Inc CONVENTIONS USED IN THIS GUIDE Preface Th
28. e MPLAB ICD 2 is enabled as a device programmer instead of a debugger 1 Starting with the project you have created in this tutorial select MPLAB ICD 2 as the device programmer From the Programmer menu select the Select Programmer MPLAB ICD 2 option If you were previously using the MPLAB ICD 2 as a debugger tool you will receive a warning message indicating that the tool cannot be enabled as a programmer and a debugger at the same time Click OK in the warning message to continue Note SW2 must be switched to the Program position for dsPIC30F devices when the application is being programmed into a device with MPLAB ICD 2 Once programming is complete SW2 must be switched back to the USB Debug position for UART communication via the USB bridge See Figure 4 1 for the location of this switch 2 Fromthe Program menu select Program option to program the part The output window will look similar to Figure 2 11 except that the debugging features of the device will not be enabled 3 Remove the MPLAB ICD 2 programming cable connected to J4 When the cable is unplugged the device begins to run the application 2 10 SUMMARY This tutorial demonstrates the main features of the MPLAB IDE and MPLAB ICD 2 as they are used with the 16 Bit 28 Pin Starter Development Board Upon completing this tutorial you should be able to Create a project using the Project Wizard Set the Configuration bits Set up MPLAB IDE to use the MPLAB
29. ef 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 WARRANTIES 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 devices in life support and or safety applications is entirely at the buyer s risk and the buyer agrees to defend indemnify and hold harmless Microchip from any and all damages claims Suits or expenses resulting from such use 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 KEELOQ logo MPLAB PIC PICmicro PICSTART rfPIC SmartShunt and UNI O are registered trademarks of Microchip Technology Incorporated in the U S A and other countries FilterLab Linear Active Thermistor MXDEV MXLAB SEEVAL SmartSensor and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in
30. es as a development kit and evaluation tool for Microchip s 16 bit digital signal controllers and microcontrollers Topics discussed in this chapter include Development Kit Contents Development Board Functionality and Features Demonstration Program Power Selection UART Communication Via USB Device Selection On Board Peripheral Selection 2008 Microchip Technology Inc DS51656B page 9 16 Bit 28 Pin Starter Development Board User s Guide 1 2 DEVELOPMENT KIT CONTENTS The 16 Bit 28 Pin Starter Development Board kit consists of the following items Printed circuit 16 Bit 28 Pin Starter Development Board see Figure 1 1 e Preprogrammed dsPIC33FJ12GP202 device 16 Bit 28 Pin Starter Development Board CD ROM containing this manual 16 bit documentation and demonstration program code FIGURE 1 1 16 BIT 28 PIN STARTER DEVELOPMENT BOARD x o JPI o RS e ds d l Je v 2 Ja sn tidem di IC3 HE r kolt D3 IE ar T O ia Jl WA S Deen E eg PROGRAM USBDEBUG wb H RITE 8000000000000 Sw wett E il j OMM o y KI J2 P re E 3 CIS vu s MA 7 fri a uta T r 2E ee ee e el Cp Gm e e e e e e For information on the components used on the 16 Bit 28 Pin Starter Development Board see Chapter 4 Development Hardware NE DS51656B page 10 2008 Microchip Technology Inc Introduction 1 3 DEVELOPMENT BOARD FUNCTIONALITY AND FEATURES The 16 Bit 28 Pin
31. g the code 3 Programming the chip with the MPLAB ICD 2 4 Debugging the code with the MPLAB ICD 2 2008 Microchip Technology Inc DS51656B page 13 16 Bit 28 Pin Starter Development Board User s Guide 2 3 PRODUCT PACKAGE For this tutorial you will need the following items 16 Bit 28 Pin Starter Development Board 9V 500 mA Plug in Power Supply with barrel style plug optional MPLAB ICD 2 In Circuit Debugger USB cable PC running Microsoft Windows with MPLAB IDE 7 52 or later versions MPLAB C30 Compiler RD gum o D 2 4 CREATING THE PROJECT The first step is to create a project and a workspace in MPLAB IDE In any particular folder one project and one workspace are present A project contains the files that are used to build an application source code linker script files and so on along with their association to various build tools and build options The workspace consists of the following features One or more projects Information on the selected device Debug tool and or programmer open windows and their location Other MPLAB IDE configuration settings MPLAB IDE contains a Project Wizard to help create new projects Before starting create a folder for the project files for this tutorial C Tutorial is assumed in the instructions that follow From the Example Code directory on the 16 Bit 28 Pin Starter Development Board Kit CD copy the demo 33F c file into the C NTutorial folder 2 4 1
32. hdog timer will be disabled Using these configuration settings will ensure that the device runs at maximum speed FIGURE 2 7 CONFIGURATION SETTINGS ixi F80000 F80004 F80006 F50008 FS0002 F8000C F8000E Category Boot Segment Write Protect Boot Segment Program Flash Code Protection General Code Segment Write Protect General Segment Code Protection Oscillator Mode Two speed Oscillator Start Up Enable Clock Switching and Monitor Peripheral Pin Select Configuration OSCI OSCO Pin Function Primary Oscillator Source Watchdog Timer Postscaler WDT Prescaler Watchdog Timer Window Watchdog Timer Enable POR Timer Value Alternate I2C pins Comm Channel Select JT G Port Enable Set Clip On Emulation Mode setting Boot Segment may be written No Boot Segment General Segment may be written Disabled Internal Fast RC FRC w PLL Start up with FRC then switch Sw Disabled Mon Disabled Allow Only One Re configuration OSCO pin has clock out function Primary Oscillator Disabled 1 32 768 1 128 Non Window mode Disable 128ms I2C mapped to ASDA1 ASCL1 Use PGC1 EMUC1 and PGD1 EMUD1 Disabled Reset Into Operational Mode DS51656B page 20 2008 Microchip Technology Inc Tutorial 2 6 2 Selecting the MPLAB ICD 2 Communication Pins All dsPIC30F 33F and PIC24 devices use a pair of I O pins PGCx EMUCx and PGDx EMUDX for initially loading your application program
33. icrochip MPLAB COON Loaded C Tutorial MProject cof BUILD SUCCEEDED Thu Jan 25 09 33 48 2007 2 Observe the progress of the build 3 Whenthe BUILD SUCCEEDED message appears you are ready to program the device 2008 Microchip Technology Inc DS51656B page 19 16 Bit 28 Pin Starter Development Board User s Guide 2 6 PROGRAMMING THE CHIP The MPLAB ICD 2 In Circuit Debugger can be used to program and debug the device on the 16 Bit 28 Pin Starter Development Board For this demonstration we will use the Debug option From the MPLAB IDE main screen click the drop down list and change Release to Debug Note Before proceeding ensure that the USB driver for the MPLAB ICD 2 has been installed on your PC Refer to the MPLAB ICD 2 User s Guide DS51331 for more details regarding the installation of the MPLAB ICD 2 Use the following MPLAB IDE procedures to program the dsPIC30F 33F and PIC24 devices 2 6 1 Use the Configure Configuration Bits menu to display the configuration settings The Configuration Bits window is shown in Figure 2 7 Setting Up the Device Configuration The device Configuration bits determine global device operating parameters such as clock source brown out threshold voltage and so on For this code example the following configuration settings will be defined The oscillator source will be set to internal FRC with PLL The primary oscillator will be disabled The Watc
34. into the device and for communicating with the MPLAB ICD 2 In Circuit Debugger Typically these pins can be used by your application program for other functions after your program is loaded into the device However the application functions are not available while you are connected to the MPLAB ICD 2 for debugging To avoid this issue most dsPIC30F 33F and PIC24 devices use one or more sets of alternate pins for MPLAB ICD 2 communication These alternate pins are identified as EMUOCx and EMUDx where x designates the number of the pin pair By selecting an alternate set of pins for the MPLAB ICD 2 you can safely use the original I O pins for your application For this development board the pin pairs PGCx EMUCx on device pins 4 5 11 and 12 are used for debugging Note SW2 must be switched to the Program position for dsPIC30F devices when the application is being programmed into a device with MPLAB ICD 2 Once the programming is complete SW2 must be switched back to the USB Debug position for UART communication via the USB bridge See Figure 4 1 for the location of this switch To select the MPLAB ICD 2 communication pins 1 Onthe Configuration Bits screen Figure 2 7 move to the Comm Channel Select category 2 Inthe Setting column set the parameter to Use PGC1 EMUC1 and PGD1 EMUD1 2 6 3 Installing the USB Driver 1 Connect the power supply to the board Refer to Section 1 5 Power Selection for details
35. is manual uses the following documentation conventions DOCUMENTATION CONVENTIONS Description Represents Examples Arial font Italic characters Referenced books MPLAEP 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 Text in angle brackets gt Underlined italic text with A menu path File gt Save right angle bracket Bold characters A dialog button Click OK A tab Click the Power tab onnnn A binary number where nis a 000100 b10 digit A key on the keyboard Press lt Enter gt lt F1 gt Courier New font Plain Courier New Sample source code define START Filenames autoexec bat File paths c mcec18 h Keywords _asm _endasm static Command line options Opa Opa Bit values 0 1 Italic Courier New A variable argument file o Where file can be any valid filename Oxnnnn A hexadecimal number where nis a hexadecimal digit OxFFFF 0x007A Square brackets Optional arguments mcc18 options file options Curly brackets and pipe character Choice of mutually exclusive arguments an OR selection errorlevel 0 1 Ellipses Replaces repeated text var_name var_name
36. low to limit or expand the default search which includes local paths and removable media The best driver found will be installed IV Search removable media floppy CD ROM Include this location in the search C Documents and Settingssx10757 Desktop C Don t search will choose the driver to install Choose this option to select the device driver from a list Windows does not guarantee that the driver you choose will be the best match for your hardware lt Back Cancel Note Before continuing to the next step make sure that the 16 Bit 28 Pin Starter Development Board CD ROM is inserted in the CD ROM drive 6 Selectthe Search for the best driver in these locations radio button and then select the Search removable media floppy CD ROM check box and then click Next to continue 7 Windows installs the USB driver Select Finish to close the Found New Hardware Wizard 2 6 4 Connecting the MPLAB ICD 2 In Circuit Debugger 1 Connect the MPLAB ICD 2 to the PC with the USB cable 2 Connectthe MPLAB ICD 2 to J4 on the 16 Bit 28 Pin Starter Development Board with the short RJ 11 telephone cable 3 For dsPIC30F devices only verify that SW2 is in the Program position 2008 Microchip Technology Inc DS51656B page 23 16 Bit 28 Pin Starter Development Board User s Guide 2 6 5 Enabling the MPLAB ICD 2 Connection 1 From the Debugger menu click Select Tool gt MPLAB ICD 2 to desig
37. microchip com Atlanta Duluth GA Tel 678 957 9614 Fax 678 957 1455 Boston Westborough MA Tel 774 760 0087 Fax 774 760 0088 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 2260 Kokomo Kokomo IN Tel 765 864 8360 Fax 765 864 8387 Los Angeles Mission Viejo CA Tel 949 462 9523 Fax 949 462 9608 Santa Clara Santa Clara CA Tel 408 961 6444 Fax 408 961 6445 Toronto Mississauga Ontario Canada Tel 905 673 0699 Fax 905 673 6509 ASIA PACIFIC Asia Pacific Office Suites 3707 14 37th Floor Tower 6 The Gateway Harbour City Kowloon Hong Kong Tel 852 2401 1200 Fax 852 2401 3431 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 8665 5511 Fax 86 28 8665 7889 China Hong Kong SAR Tel 852 2401 1200 Fax 852 2401 3431 China Nanjing Tel 86 25 8473 2460 Fax 86 25 8473 2470 China Qingdao Tel 86 532 8502 7355 Fax 86 532 8502 7205 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 Wuhan Tel 86 27 5980 5300 Fax 86 27 5980 5118 China Xiamen Tel 86 592 2388138 Fax 86 592 2388130 China Xian Tel
38. nate the MPLAB ICD 2 as the debug tool in MPLAB IDE 2 Fromthe Debugger menu select Connectto connect the debugger to the device The MPLAB IDE should report that it found the device as shown in Figure 2 10 Note MPLAB IDE may need to download new firmware if this is the first time the MPLAB ICD 2 is being used with a dsPIC30F device Allow it to do so If any errors are shown double click the error message to get more information FIGURE 2 10 ENABLING MPLAB ICD 2 ji Output ini x Build Findin Files MPLAB ICD 2 Connecting to MPLAB ICD 2 Connected Setting Vdd source to target Target Device dsPIC33FJ12GP202 found revision 0x0 Reading ICD Product ID Running ICD Self Test Passed MPLAB ICD 2 Ready 2 6 6 Programming the Device Note SW2 must be switched to the Program position for dsPIC30F devices when the application is being programmed into a device with MPLAB ICD 2 Once programming is complete SW2 must be switched back to the USB Debug position for UART communication via the USB bridge See Figure 4 1 for the location of this switch From the Debugger menu select Program to program the part The output window Figure 2 11 displays the program status as they appear DS51656B page 24 2008 Microchip Technology Inc Tutorial 2 7 FIGURE 2 11 PROGRAMMING THE DEVICE CEE 0 x Build Version Control Find in Fies MPLAB ICD 2 Reading ICD Product ID R
39. ntinue The Project Wizard Step Three dialog appears FIGURE 2 3 PROJECT WIZARD STEP THREE NAME YOUR PROJECT Step Three B Name your project e Project Name M yProject M Project Directory CAT utorial Browse lt Back Next gt Cancel Help 2 4 3 Name Your Project 1 Inthe Project Name text box type MyProject 2 Click Browse and navigate to C Tutorial to place your project in the Tutorial folder 3 Click Next gt to continue The Project Wizard Step Four dialog appears DS51656B page 16 2008 Microchip Technology Inc Tutorial FIGURE 2 4 PROJECT WIZARD STEP FOUR ADD FILES TO PROJECT x Step Four B Add any existing files to your project ee Documents and Settin 4 DRIVERS Add IBMTOOLS Lotus NotesSQL _ Remove orant Program Files SUPPORT Temp TM157 E rali 33F c Check the box to copy the file to the AF xl O C Tutorial demo_33F c HE ee ka U E EH project directory Click the filename to edit the name of the local copy tea mm 2 4 4 Add Files to the Project 1 Locate the C VN Tutorial folder and select the demo 33r c file 2 Click Add gt gt to include the file in the project 3 Expandthe C Program Files Microchip MPLAB C30 support gld folder and select the p33f 12g9p202 gla file 4 Click Add gt gt to include this file in the project
40. nts ad i l 1 e EE A E AAA AA A 1 Chapter 1 Introduction UP M MMPOG lenire o eC 9 1 2 Development Kit Contents ss 10 1 3 Development Board Functionality and Features 11 1 4 Demonstration Program Seed eee ean ei esu i ed eier 11 1 5 Power Selection etre Mine nine 11 1 6 UART Communication Via USB 4 eei teet eod edd 12 1 7 Device Selection E 12 1 8 On Board Peripheral Selection s imam 12 Chapter 2 Tutorial d M a ee UTA ilo EE 13 2 2 Tutorial OVS NI ec e 13 2 9 Product Package into eredi teo ieu Poe opo acta Pr Fastest 14 2A Creating the te e EE 14 2 5 Building the Code cc 19 2 6 Programming the Chip EE 20 2 7 Running the Application E 25 2 8 Debugging the COde E 26 2 9 Programming the Device for Stand alone Operation 29 210 SUMMA Eeer ee b 29 Chapter 3 Demonstration Program Sat IRILPOQ e ee EE 31 3 2 Demonstration Program Summary issue 31 3 3 Demonstration Program Description cena 31 3 4 Demonstration Program Setup 32 Chapter 4 Development Hardware 4 17 IntroductlOri 3 oe ene OH E e eR ia 35 4 2 Hardware erleedegen 35 4 3 Hardware Elements E 36 2008 Microchip Technology Inc DS51656B page iii 16 Bit 28 Pin Starter Development Board User s Guide Appendix A Drawings and Schematics AMIN UU ic c 39 A 2 16 Bit 28 Pin Starter Development Board Layout sen 39 A 3 16 Bit 28 Pin Starter
41. o assist in developing software for the dsPIC30F 33F DSC family dsPIC33FJ12MC201 202 Data Sheet DS70265 This data sheet summarizes the features of the dsPIC33FJ12MC201 202 It provides essential information needed to develop software for these devices PIC24HJ12GP201 202 Data Sheet DS70282 This data sheet summarizes the features of the PIC24HJ12GP201 202 It provides essential information needed to develop software for these devices PIC24FJ64GA004 Data Sheet DS39881 This data sheet summarizes the features of the PIC24FJ64GA004 It provides essential information needed to develop software for this device MPLAB ASM30 MPLAB LINK30 and Utilities User s Guide DS51317 This document details Microchip Technology s language tools for dsPIC DSC devices based on GNU technology The language tools discussed are e MPLAB ASM30 Assembler e MPLAB LINK30 Linker e MPLAB LIB30 Archiver Librarian Other Utilities DS51656B page 4 2008 Microchip Technology Inc Preface MPLAB C30 C Compiler User s Guide DS51284 This document details the use of Microchip s MPLAB C30 C Compiler for dsPIC DSC devices to develop an application MPLAB C30 is a GNU based language tool based on source code from the Free Software Foundation FSF For more information about the FSF visit www fsf org Other GNU language tools available from Microchip are e MPLAB ASM30 Assembler e MPLAB LINK30 Linker e MPLAB LIB30 Librarian Archiver MPLAB ID
42. s 2 and 3 for the USB In addition jumper JP2 selects either 5V or 3 3V power source for the targeted device For dsPIC30F devices connect jumper pins 1 and 2 for the 5V operation For dsPIC33F and PIC24 devices connect jumper pins 2 and 3 for the 3 3V operation 2008 Microchip Technology Inc DS51656B page 11 16 Bit 28 Pin Starter Development Board User s Guide 1 6 UART COMMUNICATION VIA USB The dsPIC30F dsPIC33F and PIC24 devices use an on board PIC18 and USB interface for UART communications With switch SW2 in the USB position the PIC18 device communicates with the target device through the UART module The PIC18 will then complete the UART to USB bridge The appropriate USB device driver must be installed prior to UART to USB communication See Section 2 6 3 Installing the USB Driver for details 1 7 DEVICE SELECTION The position of jumper JP3 determines which family of device dsPIC30F dsPIC33F PIC24 to use 1 8 ON BOARD PERIPHERAL SELECTION All on board peripherals such as LEDs potentiometers and the PIC18 USB bridge can be disconnected from the target devices through JP4 JP5 and SW2 respectively DS51656B page 12 2008 Microchip Technology Inc 16 BIT 28 PIN STARTER DEVELOPMENT BOARD MICROCHIP USER S GUIDE Chapter 2 Tutorial 2 1 INTRODUCTION This chapter is a self paced tutorial to get you started using the 16 Bit 28 Pin Starter Development Board Topics covered in this chap
43. t Jumper JP5 This jumper allows the use of the potentiometer 4 3 14 Oscillator Y1 A crystal oscillator 7 37 MHz is supplied The crystal oscillator can be used with the on chip PLL circuit to provide internal instruction execution frequencies 4 3 15 Device Selection Jumper JP3 This jumper determines whether the dsPIC30F or dsPIC33F PIC24 device is used 4 3 16 I O Header J2 All device I O pins are brought out to this header for test points and prototyping access 4 3 17 PICkit 2 Connector J6 By way of this modular connector the PICkit 2 can be connected for low cost programming and debugging of the device 2008 Microchip Technology Inc DS51656B page 37 16 Bit 28 Pin Starter Development Board User s Guide NOTES DS51656B page 38 2008 Microchip Technology Inc 16 BIT 28 PIN STARTER DEVELOPMENT BOARD MICROCHIP USER S GUIDE Appendix A Drawings and Schematics A 1 INTRODUCTION This appendix contains the following layouts and schematics for the 16 Bit 28 Pin Starter Development Board e 16 Bit 28 Pin Starter Development Board Layout 16 Bit 28 Pin Starter Development Board Schematics A 2 16 BIT 28 PIN STARTER DEVELOPMENT BOARD LAYOUT FIGURE A 1 16 BIT 28 PIN STARTER DEVELOPMENT BOARD LAYOUT e Ev 565 Ma
44. t driver in these locations radio button and then select the Search removable media floppy CD ROM check box now click Next to continue 7 Windows installs the USB driver Select Finish to close the Found New Hardware Wizard 3 4 2 Configuring the UART to USB Connection 1 Onthe PC right click My Computer and select Properties 2 Select the Hardware tab and click Device Manager 3 Inthe Ports group verify that an additional COM port is mapped This COM port is from the PCB to the PC and is used in the HyperTerminal demonstration 4 Open the HyperTerminal program from the CD ROM select the File gt Properties menu and verify that the correct COM port is selected for the USB cable from the PCB The COM settings for this port are 9600 bits per second no parity eight data bits and one stop bit When a character is entered on the keyboard it should be echoed enclosed in quotes i e input a output a on the HyperTerminal display when the demonstration program is running 2008 Microchip Technology Inc DS51656B page 33 16 Bit 28 Pin Starter Development Board User s Guide NOTES DS51656B page 34 2008 Microchip Technology Inc 16 BIT 28 PIN STARTER DEVELOPMENT BOARD MICROCHIP USER S GUIDE Chapter 4 Development Hardware 4 1 INTRODUCTION This chapter describes the 16 Bit 28 Pin Starter Development Board hardware under the following topics Hardware Overview Hardware Elements
45. ter include Tutorial Overview Product Package Creating the Project Building the Code Programming the Chip Running the Application Debugging the Code Programming the Device for Stand alone Operation Summary 2 2 TUTORIAL OVERVIEW The tutorial program is located on the CD ROM provided with the development kit in the demo 33F c file The tutorial program is written in C code therefore the C30 compiler is required This program echoes any characters that are sent to the 16 Bit 28 Pin Starter Development Board from the PC via the USB interface In addition the program toggles four LEDs Timer1 is used to create a periodic interrupt which toggles the LEDs The source file is used with a linker script file c33f j12gp202 g1d and a header file p33fj12gp202 h to form a complete project This simple project uses a single source code file However more complex projects might use multiple assembler and compiler source files as well as library files and precompiled object files Note The CD ROM provided with the development kit also includes tutorial programs for dsPIC30F dsPIC33F and PIC24 devices This chapter makes reference to the files used for dsPIC33F devices only If you want to apply the tutorial to dsPIC30F or PIC24 devices simply substitute the files mentioned in this text with the appropriate device related file There are four steps to this tutorial 1 Creating a project in MPLAB IDE 2 Assembling and linkin
46. the U S A Analog for the Digital Age Application Maestro CodeGuard dsPICDEM dsPICDEM net dsPICworks dsSPEAK ECAN ECONOMONITOR FanSense In Circuit Serial Programming ICSP ICEPIC Mindi MiWi MPASM MPLAB Certified logo MPLIB MPLINK mTouch PICkit PICDEM PICDEM net PICtail PIC3 logo PowerCal Powerlnfo PowerMate PowerTool REAL ICE rfLAB Select Mode Total Endurance WiperLock and ZENA 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 2008 Microchip Technology Incorporated Printed in the U S A All Rights Reserved e Printed on recycled paper Microchip received ISO TS 16949 2002 certification for its worldwide headquarters design and wafer fabrication facilities in Chandler and Tempe Arizona Gresham Oregon and design centers in California and India The Company s quality system processes and procedures are for its PIC MCUs and dsPIC DSCs KEELOG 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 DS51656B page ii 2008 Microchip Technology Inc 16 BIT 28 PIN STARTER DEVELOPMENT BOARD MICROCHIP USER S GUIDE Table of Conte
47. the device 4 3 3 Power Supply Connector J1 The 16 Bit 28 Pin Starter Development Board can be powered by a 9V AC DC wall adapter with a standard 2 1 mm barrel plug 4 3 4 Power on Indicator D3 A green LED is connected to the output of the regulators to indicate the presence of power 4 3 5 5V or 3 3V Jumper JP2 This jumper is used at 5V when a dsPIC30F family device is being used and at 3 3V when a dsPIC33F or PIC24 family device is being used 4 3 6 Power Supply or USB Jumper JP1 This jumper allows the circuit to be powered by a 9V power supply J1 or by the USB port J3 DS51656B page 36 2008 Microchip Technology Inc Development Hardware 4 3 7 LED Indicators D4 D7 LEDs are connected to the device for user operations 4 3 8 LED Connect Jumper JP4 If removed this jumper restricts the use of the LEDs 4 3 9 Reset Button RESET The MCLR Reset button is connected to the processor MCLR pin which provides a hard Reset to the device 4 3 40 Switch 1 SW1 This switch is connected to the devices for user operations 4 3 11 Switch 2 SW2 This switch when used with a dsPIC30F family device programs the device to communicate with the PC via USB If you are using a dsPIC33F or PIC24 family device this switch should be in the USB position at all times 4 3 12 Potentiometer RP1 This potentiometer is connected to the device for the use of the ADC peripheral 4 3 18 Potentiometer Connec
48. unning ICD Self Test Passed MPLAB ICD 2 Ready Programming Target Validating configuration fields Erasing Part Programming Programming Executive Verifying Programming Executive Programming Program Memory 0x0 0x23F Verifying Program Memory Verity Succeeded Loading DebugExecutive Programming DebugExecutive Debug Executive Programming Debug Vector Debug Vector Programming Configuration Bits Config Memory Verifying configuration memory Connecting to debug executive Programming succeeded 25 Jan 2007 09 41 19 MPLAB ICD 2 Ready RUNNING THE APPLICATION 2 7 1 Configuring the UART to USB Connection 1 On the PC right click My Computer and select Properties 2 Select the Hardware tab and click Device Manager 3 Inthe Ports group verify that an additional COM port is mapped This COM port is from the PCB to the PC and will used in the Windows HyperTerminal demonstration 4 Open the HyperTerminal program from the CD ROM and select the File gt Properties menu and verify that the correct COM port is selected for the USB cable from the PCB The COM settings for this port are 9600 bits per second no parity eight data bits and one stop bit When a character is entered on the keyboard it should be echoed enclosed in quotes i e input a output a on the HyperTerminal display when the demonstration program is running 2 7 2 Executing the Applic
49. vacy policy Can Windows connect to Windows Update to search for software Yes this time only C Yes now and every time connect a device No not this time Click Next to continue Back Cancel 4 Select No not this time and then click Next to continue 5 Select install from a list or specific location then click Next gt to continue The Found New Hardware Wizard Search and Installation Options dialog appears as shown in Figure 3 2 DS51656B page 32 2008 Microchip Technology Inc Demonstration Program FIGURE 3 2 SEARCH AND INSTALLATION OPTIONS Found New Hardware Wizard E Please choose your search and installation options a ta Search for the best driver in these locations Use the check boxes below to limit or expand the default search which includes local paths and removable media The best driver found will be installed N Search removable media floppy CD ROM Include this location in the search C Documents and Settings 10757 Desktop C Don t search will choose the driver to install Choose this option to select the device driver from a list Windows does not guarantee that the driver you choose will be the best match for your hardware Back Cancel Note Before continuing to the next step make sure that the 16 Bit 28 Pin Starter Development Board CD ROM is inserted in the CD ROM drive 6 Selectthe Search for the bes

Download Pdf Manuals

image

Related Search

Related Contents

Istruzioni d`uso e di installazione Lavatrice PW 5064  特許庁総務部企画調査課 先使用権制度の円滑な活用に向けて −戦略的  RadiSys ARTIC960 Programmer`s Reference  Instalación - CCTV Center  DinoCapture User Guide - Dino-Lite  Exakta 36mm User's Manual  HP Deskjet 1280 User's Manual  Taylor 811 Gas Grill User Manual  Minka Lavery 5310-1-299 Installation Guide  Manual de instrucciones  

Copyright © All rights reserved.
Failed to retrieve file