Home
dsPICDEM™ 2 Development Board User's Guide
Contents
1. 54 3 6 EINEN ee E e 55 BT OUI ES dec ere ceo del axe ita adr ale meas as quali cuba cuta eee ad 56 Chapter 9 Using the dsPIC30F3013 SE aide ee ee poet ee ME 57 P FONIO PR a da 57 9 3 Board Setup for the dsPIC30F3013 Sample Application 57 OFA Device elei lun le e EE 59 9 5 Observing the Sample Application 60 9 6 InsCirc lt DeDUOGIFG Est uuu hernie Med tea 61 STS UII AY Er 62 Chapter 10 Using the dsPIC30F3014 1588 MMLFOCUGTION cre ERR 63 10 2 HONIM S rnei a a 63 10 3 Board Setup for the dsPIC30F3014 Sample Application 63 104 DEVICE Progremimilig es u fedes tinci redo 5 rent ie amie 65 10 5 Observing the Sample Application 66 RRC aere LA DEBUGGING EE ETE LETS 67 blei EE 68 PEE II D uu Chapter 11 Using the dsPIC30F401 1 Nr Ellen ee Ee HOME Ra ne sit oti nee Ch it tn 69 Jb alise RS ea a a a one 69 11 3 Board Setup for the dsPIC30F4011 Sample Application 69 11 4 Device Programming E 71 11 5 Observing the Sample Application 72 11 6 InsClreuit Deb ggllg ones noue teta co a Oei EOD vb oue note 73 aw ey oU AE 0 A1 ia aa 74 Chapter 12 Using the dsPIC30F4012 Re tele te LS Rr 75 2 ee ei ele
2. 88 Analog Potentiometer 88 B Board Configuration For dsPIC30F2010 21 45 51 57 63 69 75 81 For dsPIC30F2011 27 For dsPIC30F2012 33 For dsPIC30F3010 39 Elle L en 19 C Klee 88 ROCK cic 0 2 EE 88 CAN Transceiver 88 Code Debugging weisvnnscnrasevenacesdeaxtnasceescnnantcocadencnocenss 20 Crystal Oscillator For General Purpose Devices 88 For Motor Control Devices esse eeee 88 Customer Notification Service cece seen seen 5 Customer Support 6 D Debug Selector DIP Switch 88 Demonstration Programs ss ssssessssereerrrrsrrenerrreenee 14 Development Board Devices Gupported 8 Features Analog and Digital Inputs 11 CAN Interface 7 10 Device Clocking 11 Digital Outputs oaennnaeennnnennnnennneeenr rennene 11 External Connections 11 ICD 2 and ICE4000 Connections 10 CD upas anasta 7 Multiple Sockets 7 9 Power Supply Circuit 10 RS 232 Interface
3. Poteniometer His GPALL 4 ANEGSULVDINCMRER Su ne jore mme oos mem 2 ANOWEMONDRBD Since only one DB 9 connector is provided for RS 232 communication you can select either UART1 primary or alternate pins or UART2 but not both 5 Connect the RS 232 cable from the PC to the UART connector J2 6 Reapply power to the DC IN connector J4 The PWR ON LED should illuminate 7 Load the sample application program for the dsPIC30F4013 see Section 13 4 Device Programming wis D uu Using the dsPIC30F4013 13 4 DEVICE PROGRAMMING Load the sample application program for the dsPIC30F4013 using this process 1 Plugthe RJ11 telephone cable from the MPLAB ICD 2 into the ICD header J1 Make sure the USB cable from the MPLAB ICD 2 is connected to your PC 2 Start MPLAB IDE 3 Open the dsPIC30F4013 sample project File gt Open Workspace from path dsPICDEM 2 Development Kit Example Soft ware 30F4013 Demo mcw Note For detailed information and procedures on using the MPLAB IDE and ICD 2 refer to Chapter 2 Getting Started 4 Build the sample project in MPLAB IDE Project gt Build All 5 Onthe dsPICDEMTM 2 board set all positions on switches S3 and S4 to off Then set switch S2 to GP 40 The MPLAB ICD 2 is now connected to the PGC and PGD pins on the dsPIC30F4013 6 Download the sample application Programmer gt Program The Output window Figure 13
4. 7 10 Sensor and Switches esses 7 Layout 95 POCONO m T 8 CHOEUR eee nana ce eee 96 Documentation Conventions 3 Eod fu 1 dsPIC30F Device Headers s 88 dsPIC30F4011 Device 88 N un uu B aum N E External Connection Headers 88 External Power Supply Inputs 88 F Free Software Foundatlion 5 G Getting Started Process 13 Debugging 20 Out of the Box Demo 16 Programming 19 GNU Language Tools 5 H Hardware Components Alternate UART 1 header 88 Analog Pot Header 88 Analog Potentiometer 88 CAN Connector 88 CAN leader 88 CAN Transceiver 88 Crystal Oscillator for General Purpose amp Sensor Devices 88 Crystal Oscillator for Motor Control Dev
5. Disconnect the MPLAB ICD 2 cable from the ICD header The program is now ready to run see Section 3 5 Observing the Sample Application dsPICDEM 2 Development Board User s Guide 3 5 OBSERVING THE SAMPLE APPLICATION 1 Press RESET ALL The program begins to run 2 Setup a HyperTerminal session on the PC to run with these parameters Port Setting Value Bits per second 9600 Data bits 8 Parity None Stop bits 1 Flow control None As a shortcut you can launch the Hyperterminal RS232 dsPICDEM2 ht file in the dsPICDEM 2 Development Kit Example Software 30F2010 folder 3 See information on LCD Note that the HyperTerminal displays the same information Adjust temperature and note LCD and HyperTerminal readings Adjust potentiometer and note LCD and HyperTerminal readings Observe the rate at which LEDs D3 and D4 blink Press S6 INT1 and note the affect on D3 and D4 Gp OE w N D uu Using the dsPIC30F2010 3 6 IN CIRCUIT DEBUGGING The sample application program is intended to illustrate how the processor and peripheral modules handle the functionality provided on the dsPICDEM 2 Development Board The MPLAB ICD 2 In Circuit Debugger was used to program the sample application into the dsPIC30F device You can also use the MPLAB ICD 2 In Circuit Debugger to examine this baseline code to determine specific applicability to your application The examination process requires that three changes be made to t
6. EMUDISOSCWTZCKUIATKCNVROIS Atemate VARTI Re Jun MALL EMUCI SOSCOITICKIUTARXICNORCIA ummre Je jm ummRe Je open On this device multiplexing of various peripherals on the pins does not allow the simultaneous use of Switch S5 and LCD Primary UART1 pins and LCD Since only one DB 9 connector is provided for RS 232 communication you can select either UART1 primary or alternate pins or UART2 but not both 5 Connect the RS 232 cable from the PC to the UART connector J2 Heapply power to the DC IN connector J4 The PWR ON LED should illuminate 7 Load the sample application program for the dsPIC30F4011 see Section 11 4 Device Programming D PEN I D uu Using the dsPIC30F401 1 11 4 DEVICE PROGRAMMING Load the sample application program for the dsPIC30F4011 using this process 1 2 3 Plug the RJ11 cable from the MPLAB ICD 2 into the ICD header J1 Make sure the USB cable from the MPLAB ICD 2 is connected to your PC Start MPLAB IDE Open the dsPIC30F4011 sample project File gt Open Workspace from path dsPICDEM2 Development Kit Example Soft ware 30F4011 Demo mcw Note For detailed information and procedures on using the MPLAB IDE and ICD 2 refer to Chapter 2 Getting Started 4 Build the sample project in MPLAB IDE Project gt Build All 5 Program the dsPIC30F4011 Programmer gt Program The Output window Figure 11 2
7. dsPIC30F devices may send serial clock and data signals on 2 pins to the dsPIC30F2011 device that controls the 2x16 LCD B 2 LCD HARDWARE SETUP To enable communication between your dsPIC30F device and the dsPIC30F2011 LCD controller simply jumper the appropriate pair of pins on the header H1 For example in order to enable communication between the dsPIC30F2010 device and the LCD jumpers on the pin pair labelled M28 need to be installed on header H1 B 3 LCD SOFTWARE SPECIFICATION The following power up sequence should be observed by the user s application firmware when writing characters to the LCD 1 Afterany reset operation wait 500 milliseconds to allow the LCD to begin normal operation The cursor on the LCD will be positioned at the top row on the left most column 2 Configure SPI1 module on your dsPIC30F device to operate in 8 bit Master mode The serial clock may be set for any frequency up to 1 MHz 3 To write an ASCII character to the LCD at the location pointed to by the cursor load the SPIBUF register with the ASCII character byte 4 Afterthe character is displayed on the LCD the cursor is automatically relocated to the next position on the LCD 5 Toreposition the cursor to another column on any of the two rows write the address of the desired location to the SPIBUF register Addresses in the first row of the LCD range from 0x80 to Ox8F while addresses on the second row range from OxCO through OxCF
8. dsPICDEM 2 Development Board User s Guide 5 5 OBSERVING THE SAMPLE APPLICATION 1 Press RESET ALL The program begins to run 2 Setup a HyperTerminal session on the PC to run with these parameters Port Setting Value Bits per second 9600 Data bits 8 Parity None Stop bits 1 Flow control None As a shortcut you can launch the Hyperterminal RS232 dsPICDEM2 ht file in the dsPICDEM 2 Development Kit Example Software 30F2012 folder 3 See information on LCD Note that the HyperTerminal displays the same information Adjust temperature and note LCD and HyperTerminal readings Adjust potentiometer and note LCD and HyperTerminal readings Observe the rate at which LEDs D3 and D4 blink Press S6 INT1 and note the affect on D3 and D4 Gp OE PEN a I NH mmm uu Using the dsPIC30F2012 5 6 IN CIRCUIT DEBUGGING The sample application program is intended to illustrate how the processor and peripheral modules handle the functionality provided on the dsPICDEM 2 Development Board The MPLAB ICD 2 In Circuit Debugger was used to program the sample application into the dsPIC30F device You can also use the MPLAB ICD 2 In Circuit Debugger to examine this baseline code to determine specific applicability to your application The examination process requires that three changes be made to the sample application setup e The dsPIC30F2012 device must be reprogrammed to recognize the MPLAB ICD 2 as a debugger rather than as a
9. 6 After 16 characters are written to the first row on the LCD it is necessary for the user s application to write the address OxCO of the second row to the SPIBUF in order to roll the cursor over to the second row 7 The user application must wait for a minimum of 5 milliseconds between writing two successive characters in the first row of the LCD 8 The user application must wait for a minimum of 250 microseconds after writing an address byte 9 The user application must wait for a minimum of 250 microseconds between writing two successive characters in the second row of the LCD i un w B w mu ww 8 dsPICDEM 2 Development Board User s Guide B 4 LCD FIRMWARE PROGRAMMING The LCD firmware resident on the dsPIC30F2011 device may be reprogrammed at any time using the MPLAB IDE project and workspace provided in this folder In order to reprogram the firmware the following steps need to be performed in sequence 1 2 3 4 e o9 PEN 8 mum m NU anus mE ana All switches on blocks S2 S3 and S4 should be turned OFF All jumpers on header H1 should be removed Install jumpers on header H11 Connect MPLAB ICD 2 Programming Header to the dsPICDEM 2 Development Board at J1 Install jumpers JP1 and JP2 and supply power to the board at J4 Open the MPLAB IDE workspace from the folder path dsPICDEM 3 Development Kit LCD Controller Build the project Project gt gt Build All Download the hex file into th
10. A variable argument file o where file can be any valid filename A hexadecimal number where OxFFFF 0x007A n is a hexadecimal digit Optional arguments mcci8 options file options Choice of mutually exclusive errorlevel 0 1 arguments an OH selection Replaces repeated text var name var name s Represents code supplied by void main void Opa Opa l m w ws E ws dsPICDEM 2 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 dsPICDEM 2 Development Board Other useful documents are listed below The following Microchip documents are available and rec ommended as supplemental reference resources dsPIC30F Family Reference Manual DS70046 Consult this document for detailed information on the dsPICSOF device operation The manual explains the operation of the dsPIC30F MCU family architecture and peripheral modules but does not cover the specifics of each device Refer to the appropriate device data sheet mentioned below for device specific information dsPIC30F Data Sheet Motor Control and Power Conversion Family DS70082 Consult this document for information regarding the dsPIC30F Motor Control and
11. TABLE 14 1 dsPICDEM 1 1 DEVELOPMENT BOARD HARDWARE No Hardware Element No Hardware Element 1 CAN Port 19 Switch S6 header see Section 14 1 6 see Section 14 1 8 2 CAN Transceiver 20 Analog Potentiometer see Section 14 1 6 see Section 14 1 12 3 CAN Header 21 Analog Potentiometer Header see Section 14 1 6 see Section 14 1 12 4 External Power Supply Inputs 22 LCD Graphic Display see Section 14 1 1 see 5 Power On LED 23 SPI Controller for LCD see Section 14 1 1 see Section 14 1 5 Power Supply jumpers 24 SPI Programming Header see Section 14 1 1 see Section 14 1 5 7 Voltage Regulator 25 LCD Controller Header see Section 14 1 1 see Section 14 1 5 UART 1 Header 26 Temperature Sensor Header see Section 14 1 7 see Section 14 1 11 purpose device sockets see Section 14 1 11 8 see Section 14 1 4 10 Alternate UART 1 header 2 External Connection Headers see Section 14 1 7 see Section 14 1 10 Device Headers concentric sockets Crystal Oscillator for motor control DIP Switch debug selector for general Temperature Sensor for dsPIC30F devices devices see Section 14 1 2 see Section 14 1 3 Crystal Oscillator for General Purpose 30 DIP Switch Debug Selector for motor Devices control device sockets see Section 14 1 3 see Section 14 1 4 Reset Pushbutton Switch 31 dsPIC30F4011 Device see Section 14 1 13 see Section 14 1 2 UART 2 header 32 Progra
12. dsPICDEM 2 Development Board User s Guide Headers Analog Potentiometer 88 CAN ER 88 External Connection 88 LCD Controller cccccccseececeeeeeeeeeesseseeeeeaees 88 LED SCO CUO y u msn nec icto donee mets 88 Host System Environment 12 l Internet Address 5 K wll EE 7 L LCD Controller 88 LCD Controller Header 88 LCD Graphic DIS u u k uu ot un ex 88 LED Selection Header 88 M Make PrOJe6l uy u Et 19 Microchip Internet Web Site 5 MPLAB IDE User s Guide 5 O Out of the Box Demo 16 Output LEDS uuu u HE 88 P Power Om PE Dio u p IM nr dE 88 Power Supply jumpers 88 Programming Selector DIP Switch 88 Programming Debugging Connector 88 R Recommended Reading 4 mises le eme URP en su 88 93 RS 232 Serial Port cccccccecccsseeecseeeeesseeeeeeeeees 88 S Sample Application For dSPIG30E2010 uu Rs ete 21 For dSPIGSOE20 TT aic ns nan 27 F r dSPIG3O0E2012 em 33 Sage lee Ta LE 39 For d
13. 2005 Microchip Technology Inc MICROCHIP dsPICDEM 2 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 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
14. dsPICDEM 2 Development Board User s Guide 13 7 SUMMARY This chapter has provided specific instructions for using the dsPICDEM 2 Development Board with a dsPIC30F4013 device If you have reviewed this process you should be able to e Configure the dsPICDEM 2 Development Board for the dsPIC30F4013 device Setup MPLAB IDE to use the MPLAB ICD 2 In Circuit Debugger e Locate the sample application for the dsPIC30F4013 device e Program the chip with the MPLAB ICD 2 e Examine the sample application and identify applicable code for your embedded solution PEN D uu dsPICDEM 2 0 DEVELOPMENT BOARD MICROCHIP USER S GUIDE apter 14 Hardware 14 1 HARDWARE OVERVIEW This chapter describes the dsPICDEMTM 2 Development Board hardware which fea tures the components shown in Figure 14 1 FIGURE 14 1 dsPICDEM 2 DEVELOPMENT BOARD A pm KE RK TPS 20 Tedia EN Re MED pobo s c e SEL CAN GND BE n TEI Ob d sPICDEM 2 JE KE MD JP1 I yuu 02 01814 Rev E no rz www microchip com LU an pas P EN R17 C27 star JP2 lt 1 A e el POEL GB OS4_EMUD1 EMUD2 GE o s Lo U1B1 o 00 B EL 2A1 SEL UART Z Gs S B MUD1 EMUD2 MOTOR a e eme neca e OO fidi ooo VA SEL UART 2 H5 2029929999299 st La jo O SSS8S5555558586855555885 o E RI EL dsPICDEM 2 Development Board User s Guide
15. H13 allows the potentiometer output to be fed to dsPIC30F devices in the Motor Control family M ALL position or the General Purpose and Sensor family GP ALL position The schematic of the analog potentiometer circuit is shown in Figure A 6 dsPICDEM 2 Development Board Schematic Sheet 5 of 7 14 1 13 Reset Switch The Reset switch S1 is connected to the MCLR pin on all device sockets as well as the LCD and LCD controller dsPIC30F2011 The Reset switch circuit is shown in Figure A 7 dsPICDEM 2 Development Board Schematic Sheet 6 of 7 l m w ws E BE i dsPICDEM 2 Development Board User s Guide NOTES PEN B I NH mmm uu dsPICDEM 2 0 DEVELOPMENT BOARD MICROCHIP USER S GUIDE ppendix ardware Drawings and Schematics A 1 INTRODUCTION This Appendix provides a layout drawing of the printed circuit board followed by schematics for the dsPICDEM 2 Development Board FIGURE A 1 dsPICDEM 2 DEVELOPMENT BOARD LAYOUT dsPICDEM a Er Le 02 01814 Rev F WWW microchip com SEL UART S4 EE GP o d iE DE D CG SEL ALT UART 1 General Purpose EMUD1 a EMUD2 EMUC2 EMUD2 EMUC2 EMUD2 EMUC2 GP 40 cp 28 GP 18 GP49 GP28 GP18 M ALL SEL 56 LCD2 pin 1 1 v pin 1 LCD1 N O amp illlgllm 10 3eeus Seen v 4q UMD1Q PINSBA H Bug ue Jaen y 810 0 PWDE SQQZ Z APW NUL 93oq g TINS Sldid ZI S L1I0212S
16. J1 Make sure the USB cable from the MPLAB ICD 2 is connected to your PC Start MPLAB IDE Open the dsPIC30F2011 sample project File gt Open Workspace from path dsPICDEM 2 Development Kit Example Soft ware 30F2011 Demo mcw Note Fordetailed information and procedures on using the MPLAB IDE and ICD 2 refer to Chapter 2 Getting Started 4 Build the sample project in MPLAB IDE Project gt Build All 5 Onthe dsPICDEMTM 2 board set all positions on switches S3 and S4 to off Then set switch S2 to GP 18 The MPLAB ICD 2 is now connected to the PGC and PGD pins on the dsPIC30F2011 6 Download the sample application Programmer gt Program The Output window Figure 4 2 displays the status as the download occurs and indicates when the programming has succeeded FIGURE 4 2 PROGRAMMING THE dsPIC30F2011 DEVICE Selig Build Version Control Find in Files MPLAB ICD d 0 0o 0 0 0 0 Connecting to MPL MPLABICD2 220200 Connected Seting Vdd source to target L dsPICSOF2011 found revision mse al Reading ICD Product ID Running ICD Self Test Fassed MPLAB ICD 2 Ready Programming Target Validating configuration fields Erasing Fart Programming Programming Executive verifying Programming Executive Programming Program Memory 0x0 0x5FF verifying Program Memory verity succeeded Pragramming Configuration Bits f Contig Memory Verifying configuration memory Fragramming succeeded IMP
17. J1 Make sure the USB cable from the MPLAB ICD 2 is connected to your PC Start MPLAB IDE Open the dsPIC30F2010 sample project File gt Open Workspace from path dsPICDEM 2 Development Kit Example Soft ware 30F2010 Demo mcw Note Fordetailed information and procedures on using the MPLAB IDE and ICD 2 refer to Chapter 2 Getting Started 4 Build the sample project in MPLAB IDE Project gt Build All 5 On the dsPICDEM 2 board set all positions on switches S3 and S4 to OFF Then set switch S2 to M ALL The MPLAB ICD 2 is now connected to the PGC and PGD pins on the dsPIC30F2010 6 Download the sample application Programmer Program The Output window Figure 3 2 displays the status as the download occurs and indicates when the programming has succeeded FIGURE 3 2 PROGRAMMING THE dsPIC30F2010 DEVICE l m w ws E EN Build Version Control Find in Files MPLAB ICD 2 Connecting to MPLAB ICD 2 Connected Seting Vdd source to target Target Device dsPICSOF2010 found revision mma al Reading ICD Product ID Running ICD Self Test Passed MPLAB ICD 2 Ready Programming Target Validating configuration fields Erasing Part Programming Programming Executive _ Vertying Programming Executive Programming Program Memory 0x0 Ox5FF Verifying Program Memory veriye succeeded Programming Configuration Bits Contig Memory Verifying configuration memory Programming succeeded MPLAB ICD 2 Ready
18. Then set switch S2 to GP 18 The MPLAB ICD 2 is now connected to the PGC and PGD pins on the dsPIC30F3012 6 Download the sample application Programmer gt Program The Output window Figure 8 2 displays the status as the download occurs and indicates when the programming has succeeded FIGURE 8 2 PROGRAMMING THE dsPIC30F3012 DEVICE Build Version Control Find in Files MPLAB ICD 2 Connecting to MPLAB ICD 2 Connected Setting Vdd source to target eee Device dsPICSOF301 2 found revision Rev Ox1001 Reading ICD Product ID pe ICD Self Test Passed MPLAB ICD 2 Ready dus Target validating configuration fields Erasing Fart Programming Frogramming Executive Merifying Frogramming Executive Programming Frogram Memory 0x0 Ox5FF Verifying Program Memory avery succeeded Programming Configuration Bits Contig Memor Verifying configuration memory Programming succeeded MPLAB ICD 2 Ready 7 Disconnect the MPLAB ICD 2 cable from the ICD header The program is now ready to run see Section 8 5 Observing the Sample Application l m w ws E PEN a dsPICDEM 2 Development Board User s Guide 85 OBSERVING THE SAMPLE APPLICATION 1 Press RESET ALL The program begins to run 2 Setup a HyperTerminal session on the PC to run with these parameters Port Setting Value Bits per second 9600 Data bits 8 Parity None Stop bits 1 Flow control None As a shortcut
19. displays the status as the download occurs and indicates when the programming has succeeded FIGURE 11 2 PROGRAMMING THE dsPIC30F4011 DEVICE Build Version Control Find in Files MPLAB ICD 2 Connecting to MPLAB ICD 2 Connected setting vdd source to target Target Device dsPIC30F4011 found revision mm1 al Reading ICD Product ID Running 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 Ox5FF Verifying Program Memory Verify Succeeded Programming Configuration Bits Contig Memory Verifying configuration memory Programming succeeded MPLAB ICD 2 Ready 6 Disconnect the MPLAB ICD 2 cable from the ICD header The program is now l m w ws E BE ready to run see Section 11 5 Observing the Sample Application dsPICDEM 2 Development Board User s Guide 11 5 OBSERVING THE SAMPLE APPLICATION 1 Press RESET ALL The program begins to run 2 Setup a HyperTerminal session on the PC to run with these parameters Port Setting Value Bits per second 9600 Data bits 8 Parity None Stop bits 1 Flow control None As a shortcut you can launch the Hyperterminal RS232 dsPICDEM2 ht file in the dsPICDEM 2 Development Kit Example Software 30F2010 folder 3 See information on LCD Note that the HyperTerminal disp
20. 2 displays the status as the download occurs and indicates when the programming has succeeded FIGURE 13 2 PROGRAMMING THE dsPIC30F4013 DEVICE Build Version Control Find in Files MPLAB ICD 2 Connecting ta MPLAB ICD 2 Connected Setting Vdd source to target b Device dsPICSOF401 3 found revision Rev Ox1001 Reading ICD Product ID unama ICD Self Test F assed MPLAB ICD 2 Ready Frogramming Target Validating configuration fields Erasing Fart Programming Frogramming Executive verifying Frogramming Executive Programming Frogram Memory 0x0 Ox5FF Verifying Program Memory Verify succeeded Programming Configuration Bits Contig Memory serving configuration memory Programming succeeded MPLAB ICD 2 Ready 7 Disconnect the MPLAB ICD 2 cable from the ICD header The program is now ready to run see Section 13 5 Observing the Sample Application l m w ws E BE dsPICDEM 2 Development Board User s Guide 13 5 OBSERVING THE SAMPLE APPLICATION 1 Press RESET ALL The program begins to run 2 Setup a HyperTerminal session on the PC to run with these parameters Port Setting Value Bits per second 9600 Data bits 8 Parity None Stop bits 1 Flow control None As a shortcut you can launch the Hyperterminal RS232 dsPICDEM2 ht file in the dsPICDEM 2 Development Kit Example Software 30F4013 folder 3 See information on LCD Note that the HyperTerminal
21. All 5 Onthe dsPICDEMTM 2 board set all positions on switch S4 to off Then set switch S2 to M ALL The MPLAB ICD 2 is now connected to the PGC and PGD pins on the dsPIC30F3010 6 Download the sample application Programmer gt Program The Output window Figure 6 2 displays the status as the download occurs and indicates when the programming has succeeded FIGURE 6 2 PROGRAMMING THE dsPIC30F3010 DEVICE Build Version Control Find in Files MPLAB ICD 2 Connecting ta MPLAB ICD 2 Connected Setting Vdd source to target Target Device dsPIC30F3010 found revision mm al Reading ICD Product ID Running ICO Self Test F assed MPLAB ICD 2 Ready Frogramming Target Validating configuration fields Erasing Fart Programming Programming Executive Merifying Programming Executive Programming Program Memory 0x0 Ox5FF verifying Program Memory V arify succeeded Programming Configuration Bits l Contig Memory Verifying configuration memory Pragramming succeeded MPLAB ICD 2 Ready 7 Disconnect the MPLAB ICD 2 cable from the ICD header The program is now ready to run see Section 6 5 Observing the Sample Application l m w ws E DEN dsPICDEM 2 Development Board User s Guide 65 OBSERVING THE SAMPLE APPLICATION 1 Press RESET ALL The program begins to run 2 Setup a HyperTerminal session on the PC to run with these parameters Port Setting Value Bits per s
22. D4 blink Press S5 INTO and note the affect on D3 and D4 Press S6 INT1 and note the affect on D3 and D4 Ot ww D uu Using the dsPIC30F3014 10 6 IN CIRCUIT DEBUGGING The sample application program is intended to illustrate how the processor and peripheral modules handle the functionality provided on the dsPICDEM 2 Development Board The MPLAB ICD 2 In Circuit Debugger was used to program the sample application into the dsPIC30F device You can also use the MPLAB ICD 2 In Circuit Debugger to examine this baseline code to determine specific applicability to your application The examination process requires that the dsPIC30F3014 device be reprogrammed to recognize the MPLAB ICD 2 debugger rather than a programmer 10 6 1 Setting Up MPLAB ICD 2 for Debugging To change MPLAB ICD 2 from a programmer to a debugger 1 From the Debugger menu click Select Tool MPLAB ICD 2 to designate the MPLAB ICD 2 as the debug tool in MPLAB IDE 2 Reprogram the dsPIC30F device Debugger Program menu 3 Resetthe program and run it From the Debugger menu select Heset Processor Reset Then select Debugger Run Figure 10 3 shows the configuration bits for this set up FIGURE 10 3 CONFIGURATION BITS WINDOW M Configuration Bits Address Category setting Fsoo000 Clock Switching and Monitor au Disabled Mon Disabled Oscillator Source Primary O Millator Primary Oscillator Mode XT wf PLL 8x FSOO E Watchdog Timer D
23. Files MPLAB ICD 2 Connecting ta MPLAB ICD 2 Connected Setting Vdd source to target Target Device dsPIC3S0F301 4 found revision Rev Ox1001 Reading ICD Product ID Running ICD Self Test Fassed MPLAB ICD 2 Ready Frogramming Target validating configuration fields _Erasing Fart Programming Frogramming Executive Verifying Frogramming Executive Programming Program Memory 0x0 0x5FF Verifying Een Memory verity Succeeded Programming Configuration Bits i Contig Memor Verifying configuration memory Pragramming succeeded MPLAB ICD 2 Ready 7 Disconnect the MPLAB ICD 2 cable from the ICD header The program is now ready to run see Section 10 5 Observing the Sample Application l m w ws E PEN E dsPICDEM 2 Development Board User s Guide 10 5 OBSERVING THE SAMPLE APPLICATION 1 Press RESET ALL The program begins to run 2 Setup a HyperTerminal session on the PC to run with these parameters Port Setting Value Bits per second 9600 Data bits 8 Parity None Stop bits 1 Flow control None As a shortcut you can launch the Hyperterminal RS232 dsPICDEM2 ht file in the dsPICDEM 2 Development Kit Example Software 30F3014 folder 3 See information on LCD Note that the HyperTerminal displays the same information Adjust temperature and note LCD and HyperTerminal readings Adjust potentiometer and note LCD and HyperTerminal readings Observe the rate at which LEDs D3 and
24. He E LED DS H12 GP DS H12 m ee On this device multiplexing of various peripherals on the pins does not allow the simultaneous use of Switch S5 and LCD Primary UART1 pins and LCD Since only one DB 9 connector is provided for RS 232 communication you can select either UART1 primary or alternate pins or UART2 but not both 5 Connect the RS 232 cable from the PC to the UART connector J2 Reapply power to the DC IN connector J4 The PWR ON LED should illuminate 7 Load the sample application program for the dsPIC30F3012 see Section 8 4 Device Programming LED D4 GP D4 3 4 H11 H2 H2 H3 H3 H4 H4 H5 H5 H10 H6 H7 H12 H12 H1 D PEN D uu Using the dsPIC30F3012 8 4 DEVICE PROGRAMMING Load the sample application program for the dsPIC30F3012 using this process 1 Plugthe RJ11 telephone cable from the MPLAB ICD 2 into the ICD header J1 Make sure the USB cable from the MPLAB ICD 2 is connected to your PC 2 Start MPLAB IDE 3 Open the dsPIC30F3012 sample project File gt Open Workspace gt path dsPIC30F4013 Sample Project from path dsPICDEM 2 Development Kit Example Soft ware 30F3012 Demo mcw Note Fordetailed information and procedures on using the MPLAB IDE and ICD 2 refer to Chapter 2 Getting Started 4 Build the sample project in MPLAB IDE Project gt Build All 5 Onthe dsPICDEMTM 2 board set all positions on switches S3 and S4 to off
25. If you have reviewed this process you should be able to e Configure the dsPICDEM 2 Development Board for the dsPIC30F3011 device Set up MPLAB IDE to use the MPLAB ICD 2 In Circuit Debugger Locate the sample application for the dsPIC30F3011 device e Program the chip with the MPLAB ICD 2 e Examine the sample application and identify applicable code for your embedded solution mu D ana dsPICDEM 2 DEVELOPMENT BOARD MICROCHIP USER S GUIDE 3 n up mm 8 1 INTRODUCTION This chapter assumes you have chosen the dsPIC30F3012 for your application The dsPICDEM 2 Development Board supports a dsPIC30F3012 device in an 18 pin PDIP package as shown in Figure 8 1 This device provides eight 12 bit A D 100 ksps channels a UART an SPI module an IC module and 12 I O pins A sample applica tion program provides a software baseline for building your own embedded solution FIGURE 8 1 18 PIN PDIP dsPIC30F3012 AVDD AVSS ANG SCK1 INTO OCFA RB6 EMUD2 ANT7 OC2 IC2 INT2 RB7 VDD Vos PGC EMUC AN5 U1RX SDI1 SDA CN7 RB5 PGD EMUD AN4 U1TX SDO1 SCL CN6 RB4 EMUC2 OC1 IC1 INT1 RDO AN3 CN5 RB3 15 OSC1 CLKI 16 OSC2 CLKO RC15 7 EMUD1 SOSCI T2CK U1ATX CN1 RC13 18 EMUC1 SOSCO T1CK U1ARX CNO RC14 19 cN T e co LL e ce Q A o oO 8 2 HIGHLIGHTS This chapter discusses e Board Setup for the dsPIC30F3012 Sample Application e Device Programming Observing the Sample Application e
26. In Circuit Debugging Summary 8 3 BOARD SETUP FOR THE dsPIC30F3012 SAMPLE APPLICATION The dsPICDEM 2 Development Board supports dsPIC30F devices that have multiple peripheral devices multiplexed on some pins Therefore the jumper set up of various headers depends on which of the dsPIC30F peripherals are used by the application This section demonstrates how the board is set up for the dsPIC30F3012 device to support the dsPIC30F3012 example software in the dsPICDEM 2 Development Kit CD Follow these steps to configure the hardware on the dsPICDEM 2 Development Board for the sample application 1 Disconnect the power source 2 Remove any dsPIC30Fxxxx device currently plugged into the dsPICDEM 2 Development Board 3 Plug the dsPIC30F3012 into socket U1C1 4 Configure the hardware components as shown in Table 8 1 un m aues I dsPICDEM 2 Development Board User s Guide TABLE 8 1 dsPIC30F3012 CONFIGURATION SETTINGS Component Imperat Ue Jemer 6 VOC jumperinstaled Jumper P Les Jumper 5 VOC jumperinstaled SEMEN j Selector Switch PGM U3 CAN Tx CE HI ER s CAN Fi me ES SSS CE CE ma GRAL Hs Hs ez SE EZ EI im UART1 Rx pen CNN NEC ox lel Oa C cel GP ALL 5 UN Alternate UART1 Tx GP ALL Alternate UART1 Rx UART2 Tx UART2 Rx Temperature Sensor H10 GP ALL Potentiometer GP ALL Switch S6 GP 18
27. LCD1 LCD2 1 4 9 1 LED INDICATORS LEDs D3 and D4 are connected to port pins RBO and RB1 respectively on the installed dsPIC DSC device via header H12 The LED anodes are tied to VDD through a 1 2K resistor 1 4 9 2 LCD DISPLAY A 2 x 16 character dot matrix LCD display is provided on the development board The installed dsPIC30F device writes characters to the LCD via the clock SCK1 and data SDO1 pins on the device s SPI1 module 1 4 10 External Connections Prototyping areas H8 and H9 provide external connections from the motor control and general purpose devices respectively These connections allow you to use hardware and test equipment not provided on the dsPICDEM 2 board l m w ws EN dsPICDEM 2 Development Board User s Guide 1 5 SAMPLE APPLICATION PROJECTS The dsPICDEM 2 Development Kit CD contains sample projects for each of the dsPIC DSC devices supported by the dsPICDEM 2 Development Board These sam ple programs are intended to jump start your application development by showing you how to implement and configure dsPIC30F peripherals such as A D converters exter nal interrupts timers SPI and UART interfaces and I O ports Complete C source code is provided that shows how to how to write interrupt service routines and how to use device control register structures for configuring peripherals and I O ports These sam ple C files are bundled into MPLAB IDE projects that let you begin work out of the
28. MPLAB ICD 2 e Examine the sample application and identify applicable code for your embedded solution w E I D ana dsPICDEM 2 DEVELOPMENT BOARD MICROCHIP USER S GUIDE wem up METER 13 1 INTRODUCTION This chapter assumes you have chosen the dsPIC30F4013 for your application The dsPICDEM 2 Development Board supports a dsPIC30F4013 device in a 40 pin PDIP package as shown in Figure 13 1 This device provides thirteen 12 bit A D 100 ksps channels two UARTs an SPI module an C module a CAN module and 30 I O pins A sample application program provides a software baseline for building your own embedded solution FIGURE 13 1 40 PIN PDIP dsPIC30F4013 MCLR Nc AVDD ANO VREF CN2 RBO AVss ANT VREF CN3 RB1 AN9 CSCK RB9 AN2 SS1 LVDIN CN4 RB2 AN10 CSDI RB10 ANS CN5 RB3 AN11 CSDO RB11 AN4 IC7 CN6 RB4 AN12 COFS RB12 AN5 IC8 CN7 RB5 EMUC2 OC1 RDO PGC EMUC ANG OCFA RB6 EMUD2 OC2 RD1 PGD EMUD AN7 RB7 VDD AN8 RB8 Vss VDD C1RX RFO Vss C1TX RF1 OSC1 CLKI U2RX CN17 RF4 OSC2 CLKO RC15 U2TX CN18 RF5 EMUD1 SOSCI T2CK U1ATX CN1 RC13 U1RX SDI1 SDA RF2 EMUC1 SOSCO T1CK U1ARX CNO RC14 EMUDS U1TX SDO1 SCL RF3 INTO RA11 O 17 EMUC3 SCK1 RF6 IC2 INT2 RD9 18 IC1 INT1 RD8 OCA RD3 19 OC3 RD2 VDD dsPIC30F4013 13 2 HIGHLIGHTS This chapter discusses e Board Setup for the dsPIC30F4013 Sample Application e Device Programming e Observing the Sample Application e In Circuit Debugging e Summary 13 3 BOA
29. NV LEH ENO IJ9JN NV DEH ZNO 93N 0NV SION TINS Grad FL C AE L kAoE Ode PPA CcQ 20 8OM LINIZ LOI 938 L49S OnW3 44 105 LOGQS XLIO anW3 C34 VOS LIQS X n S3H X1cn y34u XMc L38 XLLO G T XH L2 SSA PPA qu 290 eanW3 ed23 90 7 c9nNW3 C 88 S3JOO 2INV 4783 00827 1 L NY 01894 1059 014 NY 644 H959 6NY SSAV PPAV Aja Da J0SS990J4 JOSU9S S xU y MAMIE Su om s QN TO x D O KF D oO SSA EQH Y90 BIS ZINV Z3I FEVS OIN Y IOS UNO XUV T0 117005057 na O8 IND XIV LY XOZ1 10805 HIR SGLOH OX 10 2080 M107 1980 SSA PPA BEN ENV 887 ZNV anW3 d9d 98 Y300 9NY 9nW3 99d GEU7 ZNO BOI7SNV VEU INO LOI VNV LEN SN9 ENV ZBH YNO NIONV 1887ZNV LEN END Je4N INY DBH ZNO Je4N 0NV HJN LYLA T e e o o Y a a o d d I al lo ol Ial d tc EI jae o te t mi a z T o e T a a oc oc x e s 2050 1050 qvo Q o Q o e tr N ta oc o m oc iD em oc Tt a ac e te ac E a m e oc oc o a ac ICS Hardware Drawings and Schemat dsPICDEM 2 DEVELOPMENT BOARD SCHEMATIC SHEET 2 OF 7 FIGURE A 3 JD Z US sos y 4q uMpaQg PINSDA H Du H a z H E D a gt q9874 eH Y 810 0 sugue GDOZ CL 20W nul eyog a ezis e IN3QOIdSP eni B7dIGS 010 210v 0102zJ0 9ldSO Yy LLNI O17 4OO COIW3 B33 V4320 LMO9S ULNI VE T4 JM I0S LOQS XLI
30. OF 7 FIGURE A 5 Z JO y jeeus Seen v Aq UMo1Q PINSDA H bu3 GMS LMV ipuul4d ppy 931oN uos Aen y 8 0 0 euDue S00Z 4 Jo NUL eyog c WO det eni L 28H N3G Nid B d i zonW3 zanWa 135 Com L 28H L SCH bay AAG Nid 87 dd ZINNWI ZANNI TAS A30 Nid 8Y dd ZINNWI ZANNI TAS Nid 81 82 0y 3OI 3 dd OL LOnW3 LANNE 13S LFL L OCH FELH Fos yS 130 WAYON AAG d9 Q nA3 LANANG Nid 8c 0y A0 YOLON conWa canNa3 TAS Nid 8 v 39IA3Q MHOLON OL LOnW3 LANAA TAS 430 WAYON AAG YOLOW ZanW3 LONWS Gol SY 4j S630 097 3SOVCECXVN 440 IVWNHON 19314S EE CLYYN 19313S CH 6 Z S E n LINYN 103 13S PH L S LLNYN 31VNH3IELTV 193 13S TY 39IA3Q YOLOW OL 39IN3Q Nid 8I YOSNAS d9d OL 39IA3Q Nid BZ HOSN3S 4d9 OL 3OIA3Q Nid Oy YOSNAS dd OL 39IA3Q Nid y YOLOW OL 39IA3Q Nid Y dd OL JOA Nid 8c 0y SOLON OL FOIA Nid 8I dd OL JOA Nid 82 87 d OL 14930 Nid 82 07 YOLOW OL JONAA Nid 81 82 87 dI OL lev dsPICDEM 2 Development Board User s Guide dsPICDEM 2 DEVELOPMENT BOARD SCHEMATIC SHEET FIGURE A 6 Z 40 G jesus uos JAY 71 8 8 20 zeuiDue see y Aq uMpag GOOZ CL 40 PINSDA H bu3 e WOCH a Lea N out eyoq dSP
31. Power Conversion devices Reference information found in this data sheet includes e Device memory map e Device pinout and packaging details e Device electrical specifications e List of peripherals included on the device dsPIC30F Data Sheet General Purpose and Sensor Families DS70083 Consult this document for information regarding the dsPIC30F General Purpose and Sensor devices Reference information found in this data sheet includes e Device memory map e Device pinout and packaging details e Device electrical specifications e List of peripherals included on the device dsPIC30F Programmer s Reference Manual DS70030 This manual is a software developer s reference for the dsPIC30F 16 bit MCU family of devices This manual describes the instruction set in detail and also provides general information to assist the user in developing software for the dsPIC30F MCU family dsPIC30F Family Overview dsPIC High Performance 16 bit Digital Signal Controller DS70043 This document provides an overview of the features and functionality of the dsPIC DSC product family It helps determine how the dsPIC 16 bit Digital Signal Controller Family fits a specific product application For detailed information about any of the functionality refer to the dsPIC30F Family Reference Manual DS70046 MPLAB ASM30 MPLAB LINK30 and Utilities User s Guide DS51317 This document details Microchip Technology s language tools for dsPIC DSC devices
32. TABLE 5 1 BE M S SETTINGS Header Socket IBY U1B1 corr me sort Jee Pi LE Jumper 5VDGjumperinstalled HumperiP2 uP2 Jumper SVDCjumperinstaled Selector Switch e OFF Notusedin this configuration Selector Switch Sa OFF Notusedinthis configuration PGMUS HW Open Nojumperconneaions GANE He Om CAN Ha Open wamne Im Om ARTI s Om Ummm Im Open uann Jm Om Swehss HS Gel nts o Granze 17 PGDIEMUDUTXSDOSCURFS On this device multiplexing of various peripherals on the pins does not allow the simultaneous use of Switch S5 and LCD Primary UART1 pins and LCD Since only one DB 9 connector is provided for RS 232 communication you can select either UART1 primary or alternate pins or UART2 but not both 5 Connect the RS 232 cable from the PC to the UART connector J2 Heapply power to the DC IN connector J4 The PWR ON LED should illuminate 7 Load the sample application program for the dsPIC30F2012 see Section 5 4 Device Programming D PEN p I NH mmm uu Using the dsPIC30F2012 5 4 DEVICE PROGRAMMING Load the sample application program for the dsPIC30F2012 using this process 1 Plugthe RJ11 telephone cable from the MPLAB ICD 2 into the ICD header J1 Make sure the USB cable from the MPLAB
33. THE dsPIC30F4012 SAMPLE APPLICATION The dsPICDEM 2 Development Board supports dsPIC30F devices that have multiple peripheral devices multiplexed on some pins Therefore the jumper set up of various headers depends on which of the dsPIC30F peripherals are used by the application This section demonstrates how the board is set up for the dsPIC30F4012 device to support the dsPIC30F4012 example software in the dsPICDEM 2 Development Kit CD Follow these steps to configure the hardware on the dsPICDEM 2 Development Board for the sample application 1 Disconnect the power source un m uem dsPICDEM 2 Development Board User s Guide 2 Remove any dsPIC30Fxxxx device currently plugged into the dsPICDEM 2 Development Board 3 Plug the dsPIC30F4012 into socket U2B1 4 Configure the hardware components as shown in Table 12 1 TABLE 12 1 HARDWARE Xl 3 SETTINGS Header SocketU2B1 U2B1 EEN Jee Pi LE Jumper 5VDCjumpermstaed HumperiP2 uP2 Jumper SVDCiumeristled Selector Switch e OFF Notusedin this configuration Selector Switch Sa OFF Notusedinthis configuration ramus fm Om S wamne Ha Open ummme s Om uane Im Om LCD SPI Clock H1 M28 16 FLTA INTO SCK1 OCFA RE8 LCD SPI Data Hi M28 17 PGD EMUD U1TX SDO1 SCL RF3 On this device multiplexing of various peripherals on the p
34. arranged headers that allow supported devices in DIP packages to be plugged directly into the development board Table 14 2 lists the devices accommodated by each socket TABLE 14 2 DEVICE SOCKET LOCATIONS The schematic for the general purpose and sensor device sockets is shown in Figure A 2 dsPICDEM 2 Development Board Schematic Sheet 1 of 7 The schematic for the motor control device socket is shown in Figure A 3 dsPICDEM 2 Development Board Schematic Sheet 2 of 7 14 1 3 Oscillators Device clocking is provided by on board crystal oscillators A 7 3728 MHz crystal oscillator Y2 provides a system clock for the Motor Control family of devices Another 7 3728 MHz crystal oscillator Y5 provides a system clock for the General Purpose and Sensor family of devices Through holes and pads are provided for a user furnished watch type crystal and two capacitors Y3 and Y6 connected across pins SOSC1 and SOSC2 on the dsPIC30F device Such crystals may be used for real time clock operation External clock connections are available for motor control devices at Y1 and general purpose and sensor devices at Y4 The schematics showing resistor and capacitor values for all oscillator options are provided in Figure A 6 dsPICDEM 2 Development Board Schematic Sheet 5 of 7 14 4 4 Programming Debugging An RJ11 header has been provided on the dsPICDEM 2 Development Board in order to interface with device programmers
35. based on GNU technology The language tools discussed are e MPLAB ASM30 Assembler e MPLAB LINK30 Linker e MPLAB LIB30 Archiver Librarian e Other Utilities mE I NH mmm uu Preface MPLAB C30 C Compiler User s Guide DS51284 The purpose of this document is to help you use Microchip s MPLAB C30 C compiler for dsPIC DSC devices to develop your application MPLAB C30 is a GNU based lan guage tool based on source code from the Free Software Foundation FSF For more information about the FSF see 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 IDE Simulator Editor User s Guide DS51025 Consult this document for more information pertaining to the installation and features of the MPLAB Integrated Development Environment IDE Software To obtain any of these documents contact the nearest Microchip sales location see back page or visit the Microchip web site at www microchip com 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 docu
36. connected to the PGC and PGD pins on the dsPIC30F3013 6 Download the sample application Programmer gt Program The Output window Figure 9 2 displays the status as the download occurs and indicates when the programming has succeeded FIGURE 9 2 PROGRAMMING THE dsPIC30F3013 DEVICE Build Version Control Find in Files MPLAB ICD 2 Connecting to MPLAB ICD 2 Connected Getting Vdd source to target arget Device dsPICS0F3013 found revision Rew 051 001 Reading ICD ProductID Running ICD Self Test Passed MPLAB ICD 2 Ready Programming Target Validating configuration fields Erasinc Fart Programming Frogramming Executive Verifving Frogramming Executive Programming Program Memory 0x0 Ox5FF Verifying Program Memory Verify succeeded Programming Configuration Bits S Config Memory erifying configuration memory Programming succeeded MPLAB ICD 2 Ready 7 Disconnect the MPLAB ICD 2 cable from the ICD header The program is now ready to run see Section 9 5 Observing the Sample Application l m w ws E PEN dsPICDEM 2 Development Board User s Guide 9 5 OBSERVING THE SAMPLE APPLICATION 1 Press RESET ALL The program begins to run 2 Setup a HyperTerminal session on the PC to run with these parameters Port Setting Value Bits per second 9600 Data bits 8 Parity None Stop bits 1 Flow control None As a shortcut you can launch the Hyperterminal RS232 dsPICDEM
37. control None As a shortcut you can launch the Hyperterminal RS232 dsPICDEM2 ht file in the dsPICDEM 2 Development Kit Example Software 30F3011 folder 3 See information on LCD Note that the HyperTerminal displays the same information Adjust temperature and note LCD and HyperTerminal readings Adjust potentiometer and note LCD and HyperTerminal readings Observe the rate at which LEDs D3 and D4 blink Press S5 INTO and note the affect on D3 and D4 Press S6 INT1 and note the affect on D3 and D4 Ot ww D uu Using the dsPIC30F301 1 7 6 IN CIRCUIT DEBUGGING The sample application program is intended to illustrate how the processor and I O modules handle the functionality provided on the dsPICDEM 2 Development Board The MPLAB ICD 2 In Circuit Debugger was used to program the sample application into the dsPIC30F device You can also use the MPLAB ICD 2 In Circuit Debugger to examine this baseline code to determine specific applicability to your application The examination process requires that three changes be made to the sample application setup e he dsPIC30F3011 device must be reprogrammed to recognize the MPLAB ICD 2 as a debugger rather than as a programmer e MPLAB IDE must be reconfigured to specify the pins on the dsPIC30F3011 device to be used for debugging e The dsPICDEM 2 board must be physically reconfigured to ensure that it connects the MPLAB ICD 2 debugger to the pins on the dsPIC30F3011 devi
38. control device sockets U2A1 and U2B1 The schematic of the LED indicator circuits is shown in Figure A 7 dsPICDEM 2 Development Board Schematic Sheet 6 of 7 wi D uu Hardware 14 1 10 External Connection Headers Two 40 pin headers H8 and H9 allow the user to connect hardware external to the dsPICDEM 2 Development Board into the circuit The schematic of the external connection headers is shown in Figure A 6 dsPICDEM 2 Development Board Schematic Sheet 5 of 7 14 1 11 Analog Temperature Sensor Temperature sensor U5 is a 40 C to 125 C linear output TC1047A connected to analog channel ANS of the dsPIC30F device through header H10 The header H10 allows the temperature sensor output to be fed to dsPIC30F devices in the Motor Control family M ALL position or the General Purpose and Sensor family GP ALL position The output of the temperature sensor is fed directly to the dsPIC DSC device The output voltage range for the TC1047A is typically 750 mV at 25 C The TC1047A exhibits a typical 10 mV C voltage slope The schematic of the temperature sensor is shown in Figure A 6 dsPICDEMTM 2 Development Board Schematic Sheet 5 of 7 14 1 12 Analog Potentiometer Potentiometer R15 is connected to analog channel AN2 of the dsPIC30F devices via header H13 The voltage output range for the potentiometer is between OVDC and VDD 5VDC The voltage source is provided by VR1 or TP1 The header
39. device currently plugged into the dsPICDEM 2 Development Board un m ws e dsPICDEM 2 Development Board User s Guide 3 Plug the dsPIC30F2010 into socket U2B1 4 Configure the hardware components as shown in Table 3 1 TABLE 3 1 dsPIC30F2010 CONFIGURATION SETTINGS Component umperJe1 uei Jumper 5 VOC jumper istaled Jumper JP2 L Jumper 5 VDCjumperinsialed SelectorSwich ss OFF Notuseditisconfgaion Selector Swich Je OFF Notused in tris configuration pomus Im om umnre us open umnme us om ummre us Open On this device multiplexing of various peripherals on the pins does not allow the simultaneous use of Switch S5 and LCD Primary UART1 pins and LCD Since only one DB 9 connector is provided for RS 232 communication you can select either UART1 primary or alternate pins or UART2 but not both 5 Connect the RS 232 cable from the PC to the UART connector J2 Heapply power to the DC IN connector J4 The PWR ON LED should illuminate 7 Load the sample application program for the dsPIC30F2010 see Section 3 4 Device Programming D PEN J I NH mmm uu Using the dsPIC30F2010 3 4 DEVICE PROGRAMMING Load the sample application program for the dsPIC30F2010 using this process 1 2 3 Plug the RJ11cable from the MPLAB ICD 2 into the ICD header
40. dsPIC30F device in the general purpose socket U1A1 2 GP 28 Connects ICD to programming pins on the 28 pin dsPIC30F device in the general purpose socket U1B1 Connects ICD to programming pins on the 18 pin dsPIC30F device in the general purpose socket U1C1 M ALL Connects ICD to programming pins on the NN Connects ICD to debug pins EMUD1 and UMUC1 on the dsPIC3O0F device in either motor control Socket Connects ICD to debug pins EMUD2 and UMUC2 on the dsPICSOF device in either motor control Socket GP ALL EMUD1 Connects ICD to debug pins EMUD1 and EMUC1 GP ALL EMUC1 on the dsPIC30F device in any general purpose socket GP 40 EMUD2 Connects ICD to debug pins EMUD2 and EMUC2 GP 40 EMUC2 on the 40 pin dsPIC30F device in general purpose socket U1A1 GP 28 EMUD2 Connects ICD to debug pins EMUD2 and EMUC2 GP 28 EMUC2 on the 28 pin dsPIC30F device in general purpose socket U1B1 GP 18 EMUD2 Connects ICD to debug pins EMUD2 and EMUC2 GP 18 EMUC2 on the 18 pin dsPIC30F device in general purpose socket U1C1 Note 1 Indicates the path established when that switch is in the ON position All other switches must be in the OFF position 14 1 5 LCD The LCD supports 2 rows and 16 columns of ASCII text characters and is controlled by a dsPIC30F2011 device The dsPIC30F devices may write ASCII character data and cursor position information via an SPI interface to the LCD controller Header H1 con nects the SPI pins SCK1 and SDO1 on
41. dsPIC30F3013 device Set up MPLAB IDE to use the MPLAB ICD 2 In Circuit Debugger e Locate the sample application for the dsPIC30F3013 device e Program the chip with the MPLAB ICD 2 e Examine the sample application and identify applicable code for your embedded solution w I D ana dsPICDEM 2 DEVELOPMENT BOARD MICROCHIP USER S GUIDE n up VIS Cer ID E 10 1 INTRODUCTION This chapter assumes you have chosen the dsPIC30F3014 for your application The dsPICDEM 2 Development Board supports a dsPIC30F3014 device in a 40 pin PDIP package as shown in Figure 10 1 This device provides thirteen 12 bit A D 100 ksps channels two UARTs an SPI module an I C module and 20 I O pins A sample appli cation program provides a software baseline for building your own embedded solution FIGURE 10 1 18 PIN PDIP dsPIC30F3014 MCLR AVDD ANO VREF CN2 RBO AVss AN1 VREF CN3 RB1 AN9 RB9 AN2 SS1 LVDIN CN4 RB2 AN10 RB10 AN3 CN5 RB3 AN11 RB11 AN4 CN6 RB4 AN12 RB12 AN5 CN7 RB5 EMUC2 OC1 RDO PGC EMUC AN6 OCFA RB6 EMUD2 OC2 RD1 PGD EMUD AN7 RB7 VDD AN8 RB8 VDD Vss OSC1 CLKIN U2RX CN17 RF4 OSC2 CLKO RC15 U2TX CN18 RF5 EMUD1 SOSCI T2CK U1ATX CN1 RC13 U1RX SDI1 SDA RF2 EMUC1 SOSCO T1CK U1ARX CNO RC14 EMUC3 U1TX SDO1 SCL RF3 INTO RA11 EMUC3 SCK1 RF6 dsPIC30F3014 IC2 INT2 RD9 IC1 INT1 RD8 RD3 RD2 Vss VDD 10 2 HIGHLIGHTS This chapter discusses e Board Setup for the dsPIC30F3014 Sample Application
42. e Device Programming e Observing the Sample Application e In Circuit Debugging e Summary 10 3 BOARD SETUP FOR THE dsPIC30F3014 SAMPLE APPLICATION The dsPICDEM 2 Development Board supports dsPIC30F devices that have multiple peripheral devices multiplexed on some pins Therefore the jumper set up of various headers depends on which of the dsPIC30F peripherals are used by the application This section demonstrates how the board is set up for the dsPIC30F3014 device to support the dsPIC30F3014 example software in the dsPICDEM 2 Development Kit CD Follow these steps to configure the hardware on the dsPICDEM 2 Development Board for the sample application 1 Disconnect the power source N un w B Hu I dsPICDEM 2 Development Board User s Guide 2 Remove any dsPIC30Fxxxx device currently plugged into the dsPICDEM 2 Development Board 3 Plug the dsPIC30F3014 into socket U1A1 4 Configure the hardware components as shown in Table 10 1 TABLE 10 1 HARDWARE CONFIGURATION SETTINGS oHm Ser Component mpera Ue Jumper 6 VOOjumperinstaled Jumper P Les Jumper 5 VOC jumperinstaled Selector Swich se GP40ON 89 Pecar Selector Swten ss OFF Notusedin this configuration Selector pu sa OFF Notusedin this configuration eamus Jl open Van Je Igel uxmnme Je Igel ummre Je Open Since only one DB 9 connector is provided f
43. n nWa3 09d C34 VOS LOS X3 n onW3 99d SSA PPA G34H H WMd y34 T WMd JH HCWMd C34 lc WMd 38 HIAMd 034 711 AMd SSAY PPAY 10 7ZINI ZOl Z00 canna PPA Y 198 0ND 7X3 V 10730 11 00808 ONNI O8 INO XIY 173021 10805 FN S104707 10 2080 Dr19 1980 SSA GEH ZNO 89I 830 5NY y83 8N9 Z0VY307YNV CSR SNO XONI ENV ZHS YNO NIONT 1S87ZNV LEN END JeJA INV OnW3 EEGEN ECH CANNA EW Lacn a gt O a e a a zoso 1080 INO Es c vau Es xau CS Eva EN D 2 N qQ Q B ii H tr amp be LL tr N N H tr N to H tr N i tr DN 8 S 2 Le S 6 t y fe ite wW ul tr tr N N N o N v DI Lu DI amp tr tr tr PPA ZQ8 20 dU TINI 01 1 00 7 conn 9144 1195 38 198 OQS XLL NINN Add 7AU VOS7 VOSZX3 Lon W3 29d ESO y38 Xuzn ESO 038 XHT2 SSA PPA S3H HENMd Y3H E AE 3H HZ Wd Z3H NMa 3H HI NMd 24 11 Nid SSAV PPAY UOISJ9 UO2 JOMOd B O0J1u025 10JOW be eh Wee TNI Ordid LIQS L10 18S914SQ G e N rm N BOR om Oo Ke KH q QN TO D KR 00 Om e SSA H y20 LIM ZINI Z9I 790 canW3 834 01NI VLT4 Y VOWH ONO XUV LT 11 09850S 7 LONNI 9U INO X1Y L7392 1 08057 ANN S 94 01 19 6950 19 1950 SSA PPA Bau 8NY Z834 NV 98H Y390 9NY GEM LNO 89I H30 SNV y88 9N9 49I V3O TNY 8
44. overview of the sample application Flowcharts illustrate each of these processes e Startup and initialization e Main loop processing e A D conversion processing e External interrupt processing The dsPICDEM 2 Development Kit Example Software 30F2011 folder contains fully annotated code files that you can examine compare and copy 47 SUMMARY This chapter has provided specific instructions for using the dsPICDEM 2 Development Board with a dsPIC30F2011 device If you have reviewed this process you should be able to e Configure the dsPICDEM 2 Development Board for the dsPIC30F2011 device Set up MPLAB IDE to use the MPLAB ICD 2 In Circuit Debugger e Locate the sample application for the dsPIC30F2011 device e Program the chip with the MPLAB ICD 2 e Examine the sample application and identify applicable code for your embedded solution mu I D ana dsPICDEM 2 DEVELOPMENT BOARD MICROCHIP USER S GUIDE o n up RICH 5 1 INTRODUCTION This chapter assumes you have chosen the dsPIC30F2012 for your application The dsPICDEM 2 Development Board supports a dsPIC30F2012 device in an 28 pin SPDIP package as shown in Figure 5 1 This device provides ten 12 bit A D 100 ksps channels a UART an SPI module an IC module and 20 I O pins A sample applica tion program provides a software baseline for building your own embedded solution FIGURE 5 1 28 PIN SPDIP dsPIC30F2012 MCLR EMUD3 ANO VREF CN
45. programmer e MPLAB IDE must be reconfigured to specify the pins on the dsPIC30F2012 device to be used for debugging e The dsPICDEM 2 board must be physically reconfigured to ensure that it connects the MPLAB ICD 2 debugger to the pins on the dsPIC30F2012 device that were specified in MPLAB IDE The primary programming and debugging functions PGC EMUC PGD EMUD on the dsPIC30F device are multiplexed with other peripheral modules on the device used by the sample application Thus it is necessary to use an alternate pair of debugging pins EMUC1 EMUD1 EMUC2 EMUD2 or EMUC3 EMUD3 to examine the baseline code provided in the sample application 5 6 1 Setting Up MPLAB ICD 2 for Debugging To change MPLAB ICD 2 from a programmer to a debugger 1 From the Debugger menu click Select Tool MPLAB ICD 2 to designate the MPLAB ICD 2 as the debug tool in MPLAB IDE 2 From the Configure menu select Configuration Bits The Configuration Bits window displays the current configuration settings for the device as shown in Figure 5 3 3 Change the Comm Channel Select parameter to Use EMUC2 and EMUD2 On the dsPICDEM 2 board change the setting on switch S4 to turn on EMUC2 and EMUD 2 for GP 28 Remove any jumpers on headers H6 and H7 Reprogram the dsPIC30F device Debugger Program menu On the dsPICDEM 2 board turn off GP 28 on switch S2 Reset the program and run it From the Debugger menu select Heset Processor Reset Then
46. relief 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 PlCmicro PICSTART PRO MATE PowerSmart rfPIC and SmartShunt are registered trademarks of Microchip Technology Incorporated in the U S A and other countries AmpLab FilterLab Migratable Memory 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 ds
47. should be turned off during device programming and turned on during debugging if needed 1 4 3 UART Connection A DB9 connector J2 facilitates external RS 232RS 232 communication Headers H3 H4 and H5 connect this interface to the UART peripheral in the dsPIC DSC device Header H3 selects UART1 Header H4 selects alternate pins for UART1 in all dsPIC30F devices supported by this board Header H5 selects UART2 in dsPIC30F devices that provide two UARTS dsPIC30F3011 3013 3014 4011 and 4013 1 4 4 CAN Connection A second DB9 connector J3 is used for CAN communication Header H2 selects the dsPIC DSC device for the CAN interface The CAN interface is supported by dsPIC30F4011 4012 and 4013 devices 1 4 5 Power Supply The dsPICDEM 2 power supply IS powered from an AC DC wall adapter that furnishes 9 VDC to the PWR jack J4 The power supply is split at the regulator to provide a separate de coupled analog supply voltage useful in designs taking advantage of the dsPIC30F A D converters The power supply includes an on board 5V regulator for supplying VDD and AVDD An LED indicates when the power is on Jumpers JP1 and JP2 let you disconnect the power supply from the board if you want to supply external DC power via terminals TP1 and TP2 PEN I D uu Introduction 1 4 6 Reset Switch This pushbutton switch S1 is tied to the MCLR pin on the dsPIC30F device It is used to reset the device regardless of the socket
48. the dsPIC30F2012 Digital Signal Controller It provides suggested procedures for device programming and in circuit debugging of the dsPIC30F2012 using the sample application Chapter 6 Using the dsPIC30F3010 This chapter describes how to configure the dsPICDEM 2 Development Board for use with the dsPIC30F3010 Digital Signal Controller It provides suggested procedures for device programming and in circuit debugging of the dsPIC30F3010 using the sample application Chapter 7 Using the dsPIC30F3011 This chapter describes how to configure the dsPICDEM 2 Development Board for use with the dsPIC30F3011 Digital Signal Controller It provides suggested procedures for device programming and in circuit debugging of the dsPIC30F3011 using the sample application Chapter 8 Using the dsPIC30F3012 This chapter describes how to configure the dsPICDEM 2 Development Board for use with the dsPIC30F3012 Digital Signal Controller It provides suggested procedures for device programming and in circuit debugging of the dsPIC30F3012 using the sample application Chapter 9 Using the dsPIC30F3013 This chapter describes how to configure the dsPICDEM 2 Development Board for use with the dsPIC30F3013 Digital Signal Controller It provides suggested procedures for device programming and in circuit debugging of the dsPIC30F3013 using the sample application Chapter 10 Using the dsPIC30F3014 This chapter describes how to configure the dsPICDEM 2 Deve
49. used 1 4 7 Device Clocking Device clocking can be provided by on chip RC oscillators on board crystal oscillators or external sources Crystal Y1 provides a 7 3728 MHz oscillator for the motor control device Crystal Y2 provides a 7 3728 MHz oscillator for the general purpose and sensor devices 1 4 8 Analog and Digital Inputs The dsPICDEM 2 provides the following sensors that can be used to provide input signals to your application program e Temperature sensor U5 e Potentiometer R15 e Pushbutton switches S5 and S6 1 4 81 TEMPERATURE SENSOR The temperature sensor is a TC1047A that provides an analog signal to analog channel AN3 in either the general purpose or motor control device via header H10 1 4 82 ANALOG POTENTIOMETER A 5 kOhm potentiometer provides an analog signal to analog channel AN2 in either the general purpose or motor control device via header H13 The voltage source to the potentiometer is provided by VR1 through a low pass filter VR1 is the main voltage regulator for all components on the development board 1 4 83 PUSHBUTTON SWITCHES Two pushbutton switches S5 and S6 are connected to external interrupt pins INTO and INT1 respectively on the dsPIC30F device via headers H6 and H7 respectively 1 4 9 Digital Outputs The dsPICDEM 2 provides the following output devices that can be used to display output information from your application program e LED Indicators D3 and D4 e LCD Display
50. you can launch the Hyperterminal RS232 dsPICDEM2 ht file in the dsPICDEM 2 Development Kit Example Software 30F3012 folder 3 See information on LCD Note that the HyperTerminal displays the same information Adjust temperature and note LCD and HyperTerminal readings Adjust potentiometer and note LCD and HyperTerminal readings Observe the rate at which LEDs D3 and D4 blink Press S6 INT1 and note the affect on D3 and D4 Gp OE w I NH mmm uu Using the dsPIC30F3012 8 6 IN CIRCUIT DEBUGGING The sample application program is intended to illustrate how the processor and peripheral modules handle the functionality provided on the dsPICDEM 2 Development Board The MPLAB ICD 2 In Circuit Debugger was used to program the sample application into the dsPIC30F device You can also use the MPLAB ICD 2 In Circuit Debugger to examine this baseline code to determine specific applicability to your application The examination process requires that three changes be made to the sample application setup e The dsPIC30F3012 device must be reprogrammed to recognize the MPLAB ICD 2 as a debugger rather than as a programmer e MPLAB IDE must be reconfigured to specify the pins on the dsPIC30F3012 device to be used for debugging e The dsPICDEM 2 board must be physically reconfigured to ensure that it connects the MPLAB ICD 2 debugger to the pins on the dsPIC30F3012 device that were specified in MPLAB IDE The primary programming
51. 080 SES e mrs zo Aes CR ES HR GA I 1 4 dsPICDEM 2 DEVELOPMENT BOARD RESOURCES The dsPICDEM 2 Development Board accommodates the devices listed in Table 1 1 TABLE 1 1 DEVICES SUPPORTED BY dsPICDEM 2 Motor Control Family 2010 28 U2B1 Six 10 bit A D 500 ksps channels UART SPI IZCTM and 20 I O pins 3010 28 U2B1 Six 10 bit A D 500 ksps channels UART SPI EC and 20 I O pins 3011 40 U2A1 Nine 10 bit A D 500 ksps channels two UARTS SPI EC and 30 I O pins 4011 40 U2A1 Nine 10 bit A D 500 ksps channels two UARTS SPI EC CAN and 30 I O pins 4012 28 U2B1 Six 10 bit A D 500 ksps channels UART SPI EC CAN and 20 I O pins General Purpose and Sensor Family 2011 18 U1C1 Eight 12 bit A D 100 ksps channels UART SPI lC and 12 I O pins 3012 18 U1C1 Eight 12 bit A D 100 ksps channels UART SPI EC and 12 I O pins 2012 28 U1B1 Ten 12 bit A D 100 ksps channels UART SPI EC and 20 I O pins 3013 28 U1B1 Ten 12 bit A D 100 ksps channels two UARTS SPI IC and 20 I O pins 40 U1A1 13 12 bit A D 100 ksps channels two UARTS SPI EC and 30 I O pins 40 U1A1 13 12 bit A D 100 ksps channels two UARTS SPI EC CAN and 30 I O pins Includes pins shared by the peripheral functions w I D ana 3014 4013 Introduction The dsPICDEM 2 must be configured for the device you have chosen for your appli cation Switches and headers are provided to connect ha
52. 0F device in either motor control socket to signify external interrupt INTO GP 40 28 Connects switch S6 to Port pin RD8 of the 28 or 40 pin dsPIC30F device in general purpose socket U1B1 or U1A1 to signify external interrupt INT1 GP 18 Connects switch S6 to Port pin RDO of the 18 pin dsPIC30F device in general purpose socket U1C1 to signify external interrupt INT1 either motor control socket to signify external interrupt INTO Note 1 Header H6 selects switch S5 INTO Header H7 selects switch S6 INT1 2 Indicates the path established when jumper is installed in that position The schematic of the pushbutton switches and selection headers that comprise the simulated external interrupt circuits is shown in Figure A 7 dsPICDEM 2 Development Board Schematic Sheet 6 of 7 14 1 9 LED Indicators Two LEDs D3 and D4 are provided on the dsPICDEM 2 Development Board These may be useful in monitoring the status of your application The LEDs D3 and D4 are connected to port pins RBO and RB1 on the dsPIC30F devices respectively These LEDs will illuminate if a high signal is fed to them but will turn off on a low signal Header H12 is used to connect the LEDs D3 and D4 into the circuit If the jumper is installed to connect the GP pins the LED is connected to the General Purpose and Sensor family device sockets U1A1 U1B1 and U1C1 If the jumper on H12 is installed to connect the M ALL pins the LED is connected to the motor
53. 1 SCL CN6 RB4 EMUC2 OC1 IC1 INT1 RDO AN3 CN5 RB3 5 OSC1 CLKI Ce OSC2 CLKO RC15 17 EMUD1 SOSCI T2CK U1ATX CN1 RC13 18 EMUC1 SOSCO T1CK U1ARX CNO RC14 19 N LL Sei o o 4 2 HIGHLIGHTS This chapter discusses e Board Setup for the dsPIC30F2011 Sample Application e Device Programming Observing the Sample Application e In Circuit debugging e Summary 4 3 BOARD SETUP FOR THE dsPIC30F2011 SAMPLE APPLICATION The dsPICDEM 2 Development Board supports dsPIC30F devices that have multiple peripheral devices multiplexed on some pins Therefore the jumper set up of various headers depends on which of the dsPIC30F peripherals are used by the application This section demonstrates how the board is set up for the dsPIC30F2011 device to support the dsPIC30F2011 example software in the dsPICDEM 2 Development Kit CD Follow these steps to configure the hardware on the dsPICDEM 2 Development Board for the sample application 1 Disconnect the power source 2 Remove any dsPIC30Fxxxx device currently plugged into the dsPICDEM 2 Development Board 3 Plug the dsPIC30F2011 into socket U1C1 un m uem dsPICDEM 2 Development Board User s Guide 4 Configure the hardware components as shown in Table 4 1 TABLE 4 1 dsPIC30F2011 CONFIGURATION SETTINGS wa Component eer uei Jumper 5 VOC umperinsiaied Jumper JP2 ura Jumper 5 VDC jumperinstae Selec
54. 1 device as an example 2 4 OUT OF THE BOX DEMO As the first phase of your getting started process you only need to connect your PC to the dsPICDEM 2 Development Board apply power to the board and observe the sample application on the board and on HyperTerminal 2 4 1 dsPICDEM 2 Configuration Out of the box the dsPICDEM 2 Development Board is configured to operate with the dsPIC304011 device When you use a different type of supported device you need to reconfigure the board for that device In general you follow this process to reconfig ure the dsPICDEM 2 Development Board For the out of the box configuration you simply can verify these settings 1 Select a supported dsPIC30F device and plug it into the appropriate socket not necessary out of the box 2 Note the hardware configuration for the dsPIC30F4011 device This functionality Is set up by this hardware component Program Debug device Switch S2 switched OFF Alternate Debugging Switch S3 or S4 all switches OFF Temperature A D H10 set to M ALL Potentiometer A D H13 set to M ALL CAN H2 open UART1 H3 open Alternate UART 1 H4 set to M ALL UART2 H5 open LCD SPI H1 set to M 40 SPITM Controller ProgrammingH11 open Switch S5 INTO H6 set to M ALL Switch S6 INT1 H7 set to M ALL External connections H8 or H9 open LEDs D3 and D4 I O H12 set to M Power Supply Jumpers JP1 and JP2 Note Chapters 3 13 provide specific set up instructions
55. 1z WDT Prescaler B 1 16 Feooo4 Master Clear Enable Enabled PUM Output Pin Reset Control with PORT TRIS regs High side EUM Output Polarity Active High Low side PUM Output Polarity Active High PBOR Enable Enabled Brown Out Voltage a Dv POR Timer Value Timer Disabled FSO0nD0A General Code Segment Code Protect Disabled General Code Segment Write Protect Disabled FSDDDC Comm Channel Select EHUCZ and EMUDZ PGC EMUC and PGD EMUD EMUC1I and EMUDP1 Use EMUCZ and EMUD2 EMUC3 and EM 9 6 2 Examining the Code After the application has been reprogrammed to use the MPLAB ICD 2 as a debugger you can use MPLAB IDE to run halt and step the program You can set breakpoints to halt the program and examine the actual code at any point You can also examine the contents of the RAM and registers whenever the processor is halted Hefer to Section 2 3 Getting Started for an overview of the sample application Flowcharts illustrate each of these processes e Startup and initialization e Main loop processing e A D conversion processing e External interrupt processing The dsPICDEM 2 Development Kit Example Software 30F3013 folder contains fully annotated code files that you can examine compare and copy 9 7 SUMMARY This chapter has provided specific instructions for using the dsPICDEM 2 Development Board with a dsPIC30F3013 device If you have reviewed this process you should be able to e Configure the dsPICDEM 2 Development Board for the
56. 2 RBO EMUC3 AN1 VREF CN3 RB1 AN2 SS1 LVDIN CN4 RB2 AN3 CN5 RB3 AN4 CN6 RB4 AN5 CN7 RB5 Vss OSC1 CLKI OSC2 CLKO RC15 EMUD1 SOSCI T2CK U1ATX CN1 RC13 EMUC1 SOSCO T1CK U1ARX CNO RC14 VDD IC2 INT2 RD9 dsPIC30F2012 AVDD AVSS ANG OCFA RB6 EMUD2 AN7 RB7 AN8 OC1 RB8 AN9 OC2 RB9 CN17 RF4 CN18 RF5 VDD Vss PGC EMUC U1RX SDI1 SDA RF2 PGD EMUD U1TX SDO1 SCL RF3 SCK INTO RF6 EMUC2A IC1 INT1 RD8 5 2 HIGHLIGHTS This chapter discusses e Board Setup for the dsPIC30F2012 Sample Application e Device Programming e Observing the Sample Application e In Circuit Debugging e Summary 5 3 BOARD SETUP FOR THE dsPIC30F2012 SAMPLE APPLICATION The dsPICDEM 2 Development Board supports dsPIC30F devices that have multiple peripheral devices multiplexed on some pins Therefore the jumper set up of various headers depends on which of the dsPIC30F peripherals are used by the application This section demonstrates how the board is set up for the dsPIC30F2012 device to support the dsPIC30F2012 example software in the dsPICDEM 2 Development Kit CD Follow these steps to configure the hardware on the dsPICDEM 2 Development Board 1 Disconnect the power source 2 Remove any dsPIC30Fxxxx device currently plugged into the dsPICDEM 2 Development Board 3 Plug the dsPIC30F2012 into socket U1B1 4 Configure the hardware components as shown in Table 5 1 un m ws I dsPICDEM 2 Development Board User s Guide
57. 2 ht file in the dsPICDEM 2 Development Kit Example Software 30F3013 folder 3 See information on LCD Note that the HyperTerminal displays the same information Adjust temperature and note LCD and HyperTerminal readings Adjust potentiometer and note LCD and HyperTerminal readings Observe the rate at which LEDs D3 and D4 blink Press S6 INT1 and note the affect on D3 and D4 Gp OE PEN D uu Using the dsPIC30F3013 9 6 IN CIRCUIT DEBUGGING The sample application program is intended to illustrate how the processor and I O modules handle the functionality provided on the dsPICDEM 2 Development Board The MPLAB ICD 2 In Circuit Debugger was used to program the sample application into the dsPIC30F device You can also use the MPLAB ICD 2 In Circuit Debugger to examine this baseline code to determine specific applicability to your application The examination process requires that three changes be made to the sample application setup e The dsPIC30F3013 device must be reprogrammed to recognize the MPLAB ICD 2 as a debugger rather than as a programmer e MPLAB IDE must be reconfigured to specify the pins on the dsPIC30F3013 device to be used for debugging e The dsPICDEM 2 board must be physically reconfigured to ensure that it connects the MPLAB ICD 2 debugger to the pins on the dsPIC30F3013 device that were specified in MPLAB IDE The primary programming and debugging functions PGC EMUC PGD EMUD on the dsPIC30
58. 3 SNO XQNI NV ZEN YN9 NIQNT LSS ZNY 8M N2 194 JNV O Y1N3 QBM ZNO 19JA 0NY QOnW3 ES N eo ul oc e Ka O 19 c DI IO z OI o a gt N Ee t tr N M a tr N N iD Es t t D oc N m tr N amp a bei t m oc tr N D tr D o t tr E Z 30 S Vos Jeu y 8L0 0 9uiDus 4 seey y 4q uMpag SpQZ 40N nu eiog ep H Bu e WOCH Z007 29 ER yu Gon eni 1021 49 HOLS YH yau 310N A3Q Nid BL d9 OL L 98H Add Nid Bg 40701 OL AAC Nid 40701 OL dsPICDEM 2 Development Board User s Guide dsPICDEM 2 DEVELOPMENT BOARD SCHEMATIC SHEET 3 OF 7 FIGURE A 4 4 EH AL 93H Je Nid 82 07 dd OL LH IN M N GIN 00 oF y06 IHNNW cIG AF AAA Oly 097 X04 dS 103135 l L04405 OCOAN ET YVAN aay CN YO4 950 puj lu esn 91ou Taxu ny Y su s5640 ON NVO Z edu Z 04H Nid BZ 39IA3Q MOLON OL Nid Oy 39IA3d HOLON OL 39IA3G d9 OL NVO 193135 ICS Hardware Drawings and Schemat dsPICDEM 2 DEVELOPMENT BOARD SCHEMATIC SHEET 4
59. 302 Other International Locations Customers may also exchange ideas with each other and with Microchip personnel by logging on to http forum microchip com DOCUMENT REVISION HISTORY Revision A June 2005 e Initial Release of this Document mE I NH mmm uu dsPICDEM 2 DEVELOPMENT BOARD MICROCHIP USER S GUIDE n 1 1 INTRODUCTION The dsPICDEMTM 2 Development Board is a development and evaluation tool that helps you create embedded applications using dsPIC3OF Digital Signal Controllers DSC in 18 pin PDIP 28 pin SPDIP and 40 pin PDIP packages The dsPICDEMTM 2 Development Board provides both a hardware and software baseline capability to help jump start your application Sockets are provided for 28 and 40 pin devices in the dsPIC30F Motor Control family and 18 28 and 40 pin devices in the dsPIC30F General Purpose and Sensor family For each device supported by the board the product CD includes a sample application program designed specifically for that device Thus regardless of the dsPIC30F device you choose for your application you also have sample code appropriate to that device 1 2 HIGHLIGHTS This chapter discusses e dsPICDEM 2 Development Board e dsPICDEM 2 Development Board Resources e Sample Application Projects e Host System Environment 1 3 dsPICDEM 2 DEVELOPMENT BOARD The dsPICDEM 2 Development Board Figure 1 1 includes a dsPIC30F4011 Digital Signal Proces
60. 770 640 0034 Fax 770 640 0307 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 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 8631 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
61. 82 2 558 5934 Malaysia Penang Tel 011 604 646 8870 Fax 011 604 646 5086 Philippines Manila Tel 011 632 634 9065 Fax 011 632 634 9069 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 7242 2244 399 Fax 43 7242 2244 393 Denmark Ballerup Tel 45 4450 2828 Fax 45 4485 2829 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 04 20 05 Preliminary DS51558A page 114 2005 Microchip Technology Inc
62. 914SQ wr LH LOCH z IN3aolasp Cou G LINI VOI 90 ZONNIG enu vae 44 9N9 195 LOGS XLLOZYNY ODW3 Q9d sb o oc 6 VlLOY ONO XYV1N MO1LL 09SO0S LONNI JOM INO XLV LAVNI CL IOSOS LANANG dsPICDEM 2 Development Board User s Guide dsPICDEM 2 DEVELOPMENT BOARD SCHEMATIC SHEET FIGURE A 2 oo c T o H t au LL t o Q Q m D a z tr tr tr gt o N m oc o m oc PG ee lly TINS EdIGS CLOL ZO74OCOldSA BOCH LLNI LOL ZONNE 9 3H 0LNI LAOS 4H 19S LOGQS XLI n anw3 d9d Zdd NOIS LIOS XHV 1 90 NW3 09d ESA PPA EE K 6au C90 6NY 804 1 90 8NY ZEIL LNY ZANNI 984 Y190 9NY SSAV PPAY 60Y ZLNI ZOl PPA y K9 0NO XMWV LOZ39 1LL 09808S LONWA OH LNO XLVLN MOZL IOSOS LONWA S 98 0X 10 C9S0 10 980 SSA Sg3 NO SNV y8 9NO TNY tH SNO ENY CHY PNO NIGA 1 SSZZNV L8M NO J9JA LNV OnW3 QBH CNO t J93A 0NV ZANNA M19 ign S84 ce 7 NOV S7 LOS XS LT SNV OnIN3 08d ONE OO L Zgu o a tr D a gt a a oc oo a tr e s s N Q a O iD H tr 9 p tr Q o D gt i t tr a z o t e a T e a tr N e tr S lo m Q tr tr m rs e tn rs o9 m oc o a tr SSA PPA 88 22V 290 INV ZanW3 883 V320 0INI D40S 9NY SEAN PPAV S108 0X 10 7080 51071980 BH SNO NY ZHH YND NKNT 1587
63. B ICD 2 In Circuit Debugger e Locate the sample application for the dsPIC30F4011 device e Program the chip with the MPLAB ICD 2 e Examine the sample application and identify applicable code for your embedded solution dsPICDEM 2 DEVELOPMENT BOARD MICROCHIP USER S GUIDE n up VS Cerne 12 1 INTRODUCTION This chapter assumes you have chosen the dsPIC30F4012 for your application The dsPICDEM 2 Development Board supports a dsPIC30F4012 device in a 40 pin PDIP package as shown in Figure 12 1 This device provides six 10 bit A D 500 ksps channels a UART an SPI module an EC module a CAN module and 20 I O pins A sample application program provides a software baseline for building your own embedded solution FIGURE 12 1 28 PIN PDIP dsPIC30F4012 AVDD EMUD3 ANO VREF CN2 RBO AVSS EMUC3 AN1 VREF CN3 RB1 PWM1L REO AN2 SS1 CN4 RB2 PWM1H RE1 AN3 INDX CN5 RB3 PWM2L RE2 ANA QEA IC7 CN6 RB4 PWM2H RES3 AN5 QEB IC8 CN7 RB5 PWMSL RE4 Vos PWMSH RE5 OSC1 CLKIN VDD OSC2 CLKO RC15 Vos EMUD1 SOSCI T2CK U1ATX CN1 RC13 PGC EMUC U1RX SDI1 SDA C1RX RF2 EMUC1 SOSCO T1CK U1ARX CNO RC 14 PGD EMUD U1TX SDO1 SCL C1TX RF3 VDD FLTA INTO SCK1 OCFA RE8 dsPIC30F4012 EMUD2 OC2 IC2 INT2 RD1 EMUC2 OC1 IC1 INT1 RDO 12 2 HIGHLIGHTS This chapter discusses e Board Setup for the dsPIC30F4012 Sample Application e Device Programming e Observing the Sample Application e In Circuit Debugging e Summary 12 3 BOARD SETUP FOR
64. Bits Address FOOOOO Category Setting au Disabled Mon Disabled Primary ZT w PLL amp x Clock Switching and Monitor Oscillator Source illator Primary Oscillator Mode Watchdog Timer Disabled WDT Prescaler 1 512 WDT Prescaler B 1 16 Master Clear Enable Enabled FUM Output Pin Reset Control with PORT TRIS regs Fan unzs Fan na Fan na High side PWM Output Polarity Low side PUM Output Polarity PBOR Enable Brown Out Voltage POR Timer Value General Code Segment Code Protect Active High Active High Enabled 2 0 V Timer Disabled Disabled General Code Segment Write Protect Disabled _ Use PGC EMUC and PGD EMUD Comm Channel Select 13 6 2 After the application has been reprogrammed to use the MPLAB ICD 2 as a debugger you can use MPLAB IDE to run halt and step the program You can set breakpoints to halt the program and examine the actual code at any point You can also examine the contents of the RAM and registers whenever the processor is halted Examining the Code Hefer to Section 2 3 Getting Started for an overview of the sample application Flowcharts illustrate each of these processes e Startup and initialization e Main loop processing e A D conversion processing e External interrupt processing The dsPICDEM 2 Development Kit Example Software 30F4013 folder contains fully annotated code files that you can examine compare and copy l m w ws E PEN
65. C File H File HyperTerminal File MCP File MCS File MCW File S File Text Document PROJECT WORKSPACE IN MPLAB IDE Date Modified 3 7 2005 12 41 PM 3 8 2005 12 54 PM 3 8 2005 12 54 PM 3 7 2005 3 19 AM 3 7 2005 10 38 AM 3 7 2005 3 19 AM 3 7 2005 10 45 AM 3 7 2005 3 19 AM 3 7 2005 3 19 AM 3 7 2005 9 54 AM 3 7 2005 3 19 AM 3 8 2005 2 36 PM 3 7 2005 3 05 AM 3 8 2005 4 02 PM 3 7 2005 3 34 PM 3 7 2005 3 19 AM 3 8 2005 2 35 PM Address Symbol Name MPLAB ICD 2 PWM Output Pin Reset High side PWM Output Polarity Low side PWM Output Polarity PBOR Enable Brown Out Voltage dsPIC30F401 1 oab sab IPO dcnov zc Control with PORT TRIS rec Active High Active High Enabled Zz 0V Potention TempSenso ADCBUFO ADCBUF1 0x0000 0x0000 0x0000 0x0000 Getting Started 2 5 3 Build the Project 1 Select Project gt Build All 2 Observe the progress of the build in the Output window 3 When BUILD SUCCEEDED displays you are ready to program the device 4 Program the dsPIC30F4011device Programmer Program 2 DA Run the Application 1 From the Programmer menu select Release from Reset to enable code exectution 2 Onthe board turn off the M ALL switch in S2 3 Asthe code begins executing note that the operation is identical to what you observed out of the box see Section 2 4 3 Observe Sample Application 2 6 IN CIRCUIT DEBUGGING PROCESS MPLAB IDE lets you run halt and step the pr
66. D1 1 4 1 dsPIC30F Device Sockets For convenience the board provides separate sockets for Motor Control family devices and general purpose sensor family devices As shown in Figure 1 3 the left side of the board includes concentric sockets U2B1 and U2A1 for 28 and 40 pin devices respec tively in the Motor Control family The right side includes concentric sockets U1C1 U1B1 and U1A1 for 18 28 and 40 pin devices respectively in the General Purpose and Sensor family l m w ws E ws FIGURE 1 3 Sockets for Motor Control Family Devices dsPIC30F2010 dsPIC30F3010 dsPIC30F3011 dsPIC30F4011 dsPIC30F4012 dsPICDEM 2 Development Board User s Guide dsPICDEM 2 DEVELOPMENT BOARD LAYOUT Sockets for General Purpose and Sensor Family Devices dsPIC30F2011 dsPIC30F3012 dsPIC30F2012 dsPIC30F3013 dsPIC30F3014 dsPIC30F4013 1 4 2 MPLAB ICD 2 Header An RJ11 connector J1 allows the MPLAB ICD 2 Debugger Programmer to be used with the dsPIC30F device you have plugged into the board Switches S2 S3 and S4 physically connect this interface to the device sockets Switch S2 connects the MPLAB ICD 2 interface to the default programming and debugging pins on the dsPIC30F devices PGC EMUC and PGD EMUD This switch should be turned on during programming Switches S3 and S4 connect the MPLAB ICD 2 interface to alternative debugging pins on the dsPIC30F devices EMUC1 EMUD1 and EMUC2 EMUD2 These switches
67. DEM 2 Development Kit Example Software 30F2012 folder contains fully annotated code files that you can examine compare and copy 5 7 SUMMARY This chapter has provided specific instructions for using the dsPICDEM 2 Development Board with a dsPIC30F2012 device If you have reviewed this process you should be able to e Configure the dsPICDEM 2 Development Board for the dsPIC30F2012 device Set up MPLAB IDE to use the MPLAB ICD 2 In Circuit Debugger e Locate the sample application for the dsPIC30F2012 device e Program the chip with the MPLAB ICD 2 e Examine the sample application and identify applicable code for your embedded solution m N I D ana dsPICDEM 2 DEVELOPMENT BOARD MICROCHIP USER S GUIDE o wem up mmm 6 1 INTRODUCTION This chapter assumes you have chosen the dsPIC30F3010 for your application The dsPICDEM 2 Development Board supports a dsPIC30F3010 device in a 28 pin SPDIP package as shown in Figure 6 1 This device provides six 10 bit A D 500 ksps channels a UART an SPI module an CT module and 20 I O pins A sample application program provides a software baseline for building your own embedded solution FIGURE 6 1 28 PIN SPDIP dsPIC30F3010 MCLR AVDD EMUD3 ANO VREF CN2 RBO AVss EMUC3 AN1 VREF CN3 RB1 PWM1L REO AN2 SS1 CNA RB2 PWM1H RE1 AN3 INDX CN5 RB3 PWM2L RE2 AN4 QEA IC7 CN6 RB4 PWM2H RE3 AN5 QEB IC8 CN7 RB5 PWM3L RE4 Vss PWM3H RES5 OSC1 CLKIN VDD OSC2 CLKO RC15 V
68. EE 75 12 3 Board Setup for the dsPIC30F4012 Sample Application 75 T2 4 Device Eelef le e RE 17 12 5 Observing the Sample Application 78 126 lac eui Ree e e osos cabo nera iatis nant lite 79 Dawes T 80 Chapter 13 Using the dsPIC30F4013 o Tiliqua UON Eee PT 81 CEA ele wi He QE PR 81 13 3 Board Setup for the dsPIC30F4013 Sample Application 81 3A DEVICE Programrillqg WEE 83 13 5 Observing the Sample Application 84 Too E erer EU RT e le Un e yasa Ra Es bo orae o bcp ein 85 E Ee le E 86 Chapter 14 Hardware t4 Hardware EE 87 Appendix A Hardware Drawings and Schematics AT MAG OGUCHOMN u un uuu uuu um R t wauu tissues 95 Appendix B Writing to LCD MEG II uu EE 103 B 2 LCD Hardware Setup a 103 BO LGD Solwale SPECICATION sten RS aerea boe co c nait 103 B 4 LCD Firmware Programming VV 104 Appendix C Board Errata CT HZ andiri6 Labelling EIOE saucius p dett ete a ovt Eug s ecu Cue 105 4 10 c M te 107 Worldwide Sales and Service eee eere ee reee Q 114 2005 Microchip Technology
69. EMUC2 EMUD2 or EMUC3 EMUD3 to examine the baseline code provided in the sample application 12 6 1 Setting Up MPLAB ICD 2 for Debugging To change MPLAB ICD 2 from a programmer to a debugger 1 From the Debugger menu click Select Tool MPLAB ICD 2 to designate the MPLAB ICD 2 as the debug tool in MPLAB IDE 2 Fromthe Configure menu select Configuration Bits The Configuration Bits window displays the current configuration settings for the device as shown in Figure 12 3 3 Change the Comm Channel Select parameter to Use EMUC2 and EMUD2 On the dsPICDEM 2 board change the setting on switch S3 to turn on EMUC2 and EMUDA Remove any jumpers on headers H6 and H7 Reprogram the dsPIC30F device Debugger Program menu On the dsPICDEM 2 board turn off M ALL on switch S2 Reset the program and run it From the Debugger menu select Heset Processor Reset Then select Debugger gt Run um ONO l m w ws E BE i dsPICDEM 2 Development Board User s Guide FIGURE 12 3 CONFIGURATION BITS WINDOW M Configuration Bits Address Category setting Fsan0n000 Clock Switching and Monitor Su Disabled Mon Disabled Oscillator Source Primary Oscillator Primary Oscillator Mode XT w PLL 8x F000 Watchdog Timer Disabled WOT Prescaler 1 51z WDT Prescaler B 1 16 Feooo4 Master Clear Enable Enabled PUM Output Pin Reset Control with PORT TRIS regs High side PUN Output Polarity Active High Low Side PUM Output Polarity Active
70. F device are multiplexed with other peripheral modules on the device used by the sample application Thus it is necessary to use an alternate pair of debugging pins EMUC1 EMUD1 EMUC2 EMUD2 or EMUC3 EMUD3 to examine the baseline code provided in the sample application 9 6 1 Setting Up MPLAB ICD 2 for Debugging To change MPLAB ICD 2 from a programmer to a debugger 1 From the Debugger menu click Select Tool MPLAB ICD 2 to designate the MPLAB ICD 2 as the debug tool in MPLAB IDE 2 From the Configure menu select Configuration Bits The Configuration Bits window displays the current configuration settings for the device as shown in Figure 9 3 3 Change the Comm Channel Select parameter to Use EMUC2 and EMUD2 On the dsPICDEM 2 board change the setting on switch S3 to turn on EMUC2 and EMUD2 for GP 28 Remove any jumpers on headers H6 and H7 Reprogram the dsPIC30F device Debugger Program menu On the dsPICDEM 2 board turn off GP 28 on switch S2 Reset the program and run it From the Debuggermenu select Reset Processor Reset Then select Debugger gt Run um ONO l m w ws E PEN E dsPICDEM 2 Development Board User s Guide FIGURE 9 3 CONFIGURATION BITS WINDOW M Configuration Bits Address Category Setting Fsoo000 Clock Switching and Monitor Su Disabled Mon Disabled Oscillator Source Primary Oscillator Primary Oscillator Mode XT w PLL 6x FSOOCE Watchdog Timer Disabled WOT Prescaler 1 5
71. High PBOR Enable Enabled Brown Out Voltage a Dv POR Timer Value Timer Disabled FS O0D0A General Code Segment Code Protect Disabled General Code Segment Write Protect Disabled FSDDDC Comm Channel Select Use EMUC2 and EMUDZ PGC EMUC and PGD EMUD EMUCL and EMUDi1 Use EMUC2 and EMUDZ EMUCS and EM 12 6 2 Examining the Code After the application has been reprogrammed to use the MPLAB ICD 2 as a debugger you can use MPLAB IDE to run halt and step the program You can set breakpoints to halt the program and examine the actual code at any point You can also examine the contents of the RAM and registers whenever the processor is halted Hefer to Section 2 3 Getting Started for an overview of the sample application Flowcharts illustrate each of these processes e Startup and initialization Main loop processing e A D conversion processing e External interrupt processing The dsPICDEM 2 Development Kit Example Software 30F4012 folder con tains fully annotated code files that you can examine compare and copy 12 7 SUMMARY This chapter has provided specific instructions for using the dsPICDEM 2 Development Board with a dsPIC30F4012 device If you have reviewed this process you should be able to e Configure the dsPICDEM 2 Development Board for the dsPIC30F4012 device Set up MPLAB IDE to use the MPLAB ICD 2 In Circuit Debugger e Locate the sample application for the dsPIC30F4012 device e Program the chip with the
72. IC30F motor control device in socket U2A1 GP 40 Connects the UART transceiver to the UART 2 module of the 40 pin dsPIC30F general purpose device in socket U1A1 Note 1 Headers are mutually exclusive Only one header can be used at a time 2 Pin position is the pair of pins with the indicated label 3 Indicates the path established when jumper is installed in that position Icrochip echnology Inc page dsPICDEM 2 Development Board User s Guide 14 1 8 External Interrupt Switches Switches S5 and S6 can be connected to the external interrupt pins INTO and INT1 respectively on all supported dsPIC30F devices Switches S5 and S6 are connected to the dsPIC DSC device through headers H6 and H7 respectively The signal lines are normally pulled up to 5V DC through 4 7 kOhm resistors Pressing the switch will short the line to ground Table 14 4 lists the connections set up by the jumper positions on headers H6 and H7 TABLE 14 5 EXTERNAL INTERRUPT HEADER SETTINGS H6 GP 40 Connects switch S5 to Port pin RA11of the 40 pin dsPIC30F device in general purpose socket U1A1 to signify external interrupt INTO GP 28 Connects switch S5 to Port pin RF6 of the 28 pin dsPIC30F device in general purpose socket U1B1 to signify external interrupt INTO Connects switch S5 to Port pin RB6 of the 18 pin dsPIC30F device in general purpose socket U1C1 to signify external interrupt INTO M ALL Connects switch S5 to Port pin RE8 of the dsPIC3
73. ICD 2 is connected to your PC 2 Start MPLAB IDE 3 Open the dsPIC30F2012 sample project File gt Open Workspace from path dsPICDEM 2 Development Kit Exam ple Software 30F2012 Demo mcw Note For detailed information and procedures on using the MPLAB IDE and ICD 2 refer to Chapter 2 Getting Started 4 Build the sample project in MPLAB IDE Project gt Build All 5 Onthe dsPICDEMTM 2 board set all positions on switches S3 and S4 to off Then set switch S2 to GP 28 The MPLAB ICD 2 is now connected to the PGC and PGD pins on the dsPIC30F2012 6 Download the sample application Programmer gt Program The Output window Figure 5 2 displays the status as the download occurs and indicates when the programming has succeeded FIGURE 5 2 PROGRAMMING THE dsPIC30F2012 DEVICE Ces Build Version Control Find in Files MPLAB ICD 2 Reading ICD Froduct ID Running ICO Self Test Passed MPLAB ICD 2 Ready Programming Target validating configuration fields Erasing Fart Programming Frogramming Executive Merfying Frogramming Executive Programming Frogram Memory 0x0 Ox56F Verifying Program Memory Verbe succeeded Programming Configuration Bits Config Memor Verifying configuration memor Programming succeeded MPLAB ICD 2 Ready 7 Disconnect the MPLAB ICD 2 cable from the ICD header The program is now ready to run see Section 5 5 Observing the Sample Application l m w ws E ws
74. INT2 RD1 EMUC2 OC1 IC1 INT1 RDO 4 RD3 Ge SS DD dsPIC30F3011 7 2 HIGHLIGHTS This chapter discusses e Board Setup for the dsPIC30F3011 Sample Application e Device Programming Observing the Sample Application e In Circuit Debugging e Summary 7 3 BOARD SETUP FOR THE dsPIC30F3011 SAMPLE APPLICATION The dsPICDEM 2 Development Board supports dsPIC30F devices that have multiple peripheral devices multiplexed on some pins Therefore the jumper set up of various headers depends on which of the dsPIC30F peripherals are used by the application This section demonstrates how the board is set up for the dsPIC30F3011 device to support the dsPIC30F3011 example software in the dsPICDEM 2 Development Kit CD Follow these steps to configure the hardware on the dsPICDEM 2 Development Board for the sample application 1 Disconnect the power source un m aues dsPICDEM 2 Development Board User s Guide 2 Remove any dsPIC30Fxxxx device currently plugged into the dsPICDEM 2 Development Board 3 Plug the dsPIC30F3011 into socket U2A1 4 Configure the hardware components as shown in Table 7 1 TABLE 7 1 NCC a SETTINGS Header Component sumper Device Functions see Figure 7 1 Setting mpera OPI Jumper 6 VOOjumperinstaled jumper P Les Jumper 5 VOC jumperinstaled Selector switch ss OFF Notusedin this configuration Selector pu sa OFF Notused
75. Inc DS51558A page iii dsPICDEM 2 Development Board User s Guide PEN IV I NH mmm uu dsPICDEM 2 DEVELOPMENT BOARD MICROCHIP USER S GUIDE TNT 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 including errata documents applicable to this product Also refer to the errata information in Appendix C 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 dsPICDEM 2 Development Board Items discussed in this chapter include Document Layout Conventions Used in this Guide Warranty Registration Hecommended Reading The Microchip Web Site Development Systems Customer Change Notification Service Customer Support Document Revi
76. LAB ICD 2 7 Disconnect the MPLAB ICD 2 cable from the ICD header The program is now ready to run see Section 4 5 Observing the Sample Application l m w ws E dsPICDEM 2 Development Board User s Guide 4 5 OBSERVING THE SAMPLE APPLICATION 1 Press RESET ALL The program begins to run 2 Setup a HyperTerminal session on the PC to run with these parameters Port Setting Value Bits per second 9600 Data bits 8 Parity None Stop bits 1 Flow control None As a shortcut you can launch the Hyperterminal RS232 dsPICDEM2 ht file in the dsPICDEM 2 Development Kit Example Software 30F2011 folder 3 See information on LCD Note that the HyperTerminal displays the same information Adjust temperature and note LCD and HyperTerminal readings Adjust potentiometer and note LCD and HyperTerminal readings Observe the rate at which LEDs D3 and D4 blink Press S6 INT1 and note the affect on D3 and D4 Gp OE PEN a I NH mmm uu Using the dsPIC30F201 1 4 6 IN CIRCUIT DEBUGGING The sample application program is intended to illustrate how the processor and I O modules handle the functionality provided on the dsPICDEM 2 Development Board The MPLAB ICD 2 In Circuit Debugger was used to program the sample application into the dsPIC30F device You can also use the MPLAB ICD 2 In Circuit Debugger to examine this baseline code to determine specific applicability to your application T
77. LL 8x FSOOCE Watchdog Timer Disabled WOT Prescaler T e E WDT Prescaler B 1 16 Feooo4 Master Clear Enable Enabled FUM Output Pin Reset Control with PORT TRIS regs High side PUM Output Polarity Active High Low Side PUM Output Polarity Active High PBOR Enable Enabled Brown Out Voltage a Dv POR Timer Value Timer Disabled FSO0nDD0A General Code Segment Code Protect Disabled General Code Segment Write Protect Disabled FSDDDC Comm Channel Select Use EMUCZ and EHUDZ PGC EMUC and PGD EMUD EMUC1 and EMUDI1 Use EMUC2 anc EMUD2 EMUC3 and EMUe3 8 6 2 Examining the Code After the application has been reprogrammed to use the MPLAB ICD 2 as a debugger you can use MPLAB IDE to run halt and step the program You can set breakpoints to halt the program and examine the actual code at any point You can also examine the contents of the RAM and registers whenever the processor is halted Hefer to Section 2 3 Getting Started for an overview of the sample application Flowcharts illustrate each of these processes e Startup and initialization e Main loop processing e A D conversion processing e External interrupt processing The dsPICDEM 2 Development Kit Example Software 30F3012 folder con tains fully annotated code files that you can examine compare and copy 8 7 SUMMARY This chapter has provided specific instructions for using the dsPICDEM 2 Development Board with a dsPIC30F3012 device If you have reviewed this process you sh
78. Open LOD SPI coot Hi aP a028 SCKVINTORF nts mi ar4nze i PGDIEMUDUTXSDOXSOURFS On this device multiplexing of various peripherals on the pins does not allow the simultaneous use of Switch S5 and LCD Primary UART1 pins and LCD Since only one DB 9 connector is provided for RS 232 communication you can select either UART1 primary or alternate pins or UART2 but not both 5 Connect the RS 232 cable from the PC to the UART connector J2 Heapply power to the DC IN connector J4 The PWR ON LED should illuminate 7 Load the sample application program for the dsPIC30F3013 see Section 9 4 Device Programming D wi D uu Using the dsPIC30F3013 9 4 DEVICE PROGRAMMING Load the sample application program for the dsPIC30F3013 using this process 1 Plugthe RJ11 telephone cable from the MPLAB ICD 2 into the ICD header J1 Make sure the USB cable from the MPLAB ICD 2 is connected to your PC 2 Start MPLAB IDE 3 Open the dsPIC30F3013 sample project File gt Open Workspace from path dsPICDEM 2 Development Kit Example Soft ware 30F3013 Demo mcw Note Fordetailed information and procedures on using the MPLAB IDE and ICD 2 refer to Chapter 2 Getting Started 4 Build the sample project in MPLAB IDE Project gt Build All 5 Onthe dsPICDEMTM 2 board set all positions on switches S3 and S4 to off Then set switch S2 to GP 28 The MPLAB ICD 2 is now
79. PIC30F3014 device e Set up MPLAB IDE to use the MPLAB ICD 2 In Circuit Debugger ocate the sample application for the dsPIC30F2010 device e Program the chip with the MPLAB ICD 2 e Examine the sample application and identify applicable code for your embedded solution ww I NH mmm uu dsPICDEM 2 DEVELOPMENT BOARD MICROCHIP USER S GUIDE wem up AS ORL 11 1 INTRODUCTION This chapter assumes you have chosen the dsPIC30F4011 for your application The dsPICDEM 2 Development Board supports a dsPIC30F4011 device in a 40 pin PDIP package as shown in Figure 11 1 This device provides nine 10 bit A D 500 ksps channels two UARTSs an SPI module an C module a CAN module and 30 I O pins A sample application program provides a software baseline for building your own embedded solution FIGURE 11 1 40 PIN PDIP dsPIC30F4011 MCLR a AVDD EMUD3 ANO VREF CN2 RBO AVSS EMUC3 AN1 VREF CN3 RB1 PWM1L REO AN2 SS1 CN4 RB2 PWM1H RE1 AN3 INDX CN5 RB3 PWM2L RE2 ANA QEA IC7 CN6 RB4 PWM2H RE3 AN5 QEB IC8 CN7 RB5 PWM3L RE4 AN6 OCFA RB6 PWMSH RE5 AN7 RB7 VDD AN8 RB8 Vss VDD C1RX RFO Vss C1TX RF1 OSC1 CLKIN U2RX CN17 RF4 OSC2 CLKO RC15 U2TX CN18 RF5 EMUD1 SOSCI T2CK U1ATX CN1 RC13 PGC EMUC U1RX SDI1 SDA RF2 EMUC1 SOSCO T1CK U1ARX CNO RC14 PGD EMUD U1TX SDO1 SCL RF3 FLTA INTO RE8 SCK1 RF6 dsPIC30F4011 EMUD2 OC2 IC2 INT2 RD1 EMUC2 OC IC1 INT1 RDO OC4 RD3 OC3 RD2 Vss VDD 11 2 HIGHLIGHTS This chapt
80. PICDEM 2 Development Board 7 1 4 dsPICDEM 2 Development Board Resources 8 15 Sample ADplicallonProle6lss vede deo ku mU n etre notes 12 T1 o Host System Been 12 Chapter 2 Getting Started Mg iere eue PS E UU mU 13 e Heel Lei Ee LU E S 13 29 GENG ET uu uu al 13 24 e ehn Rn Le BEEN 14 2 5 Device Programming Process saroi essensie etn erede pur eoe vi cue Rr aden 17 2 6 In Circuit Debugging Process RL 19 2 SUMAN RET IN E 20 Chapter 3 Using the dsPIC30F2010 Oe A POC CU ON MT ies Utd T 21 Se To LE lte LE 21 3 3 Board Setup for the dsPIC30F2010 Sample Application 21 SA DOVICO ProOgr lmiiilflg uuu u ass EE 23 3 5 Observing the Sample Application 24 20 In Cireult Debugging uu u uuu beoe Mn an u ga Sia usoq euis 25 237 OUI RT TOTUM 26 Chapter 4 Using the dsPIC30F2011 Misi 6 UT LT 1 u u uy Ee 27 zs sees a s mua am ss Su asua mus hades 27 4 3 Board Setup for the dsPIC30F2011 Sample Application 27 44A DEVICE Ge Leien ne Lean raser aa hsnaspas si 29 4 5 Observing the Sample Application 30 46 n GIreultEdeb gglng uuu u u entame 31 d NEEN uka wawana a EE A de ns us E 32 Chapter 5 Using the dsPIC30F2012 D let de La Ee de TENTI ER e
81. PICDEM net dsPICworks ECAN ECONOMONITOR FanSense FlexROM fuzzyLAB In Circuit Serial Programming ICSP ICEPIC Linear Active Thermistor MPASM MPLIB MPLINK MPSIM PICkit PICDEM PICDEM net PICLAB PICtail PowerCal Powerlnfo PowerMate PowerTool rfLAB rfPICDEM Select Mode Smart Serial SmartTel Total Endurance and WiperLock 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 2005 Microchip Technology Incorporated Printed in the U S A All Rights Reserved ES 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 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 DS51558A page ii 2005 Microchip Technology Inc dsPICDEM 2 DEVELOPMENT BOARD MICROCHIP USER S GUIDE able of Contents Chapter 1 Introduction D NI Idee LE sie EE 7 Te a To ll re a 7 1 3 ds
82. RD SETUP FOR THE dsPIC30F4013 SAMPLE APPLICATION The dsPICDEM 2 Development Board supports dsPIC30F devices that have multiple peripheral devices multiplexed on some pins Therefore the jumper set up of various headers depends on which of the dsPIC30F peripherals are used by the application This section demonstrates how the board is set up for the dsPIC30F4013 device to support the dsPIC30F4013 example software in the dsPICDEM 2 Development Kit CD Follow these steps to configure the hardware on the dsPICDEM 2 Development Board for the sample application N un w B Hum I dsPICDEM 2 Development Board User s Guide 1 Disconnect the power source 2 Remove any dsPIC30Fxxxx device currently plugged into the dsPICDEM 2 Development Board 3 Plug the dsPIC30F4013 into socket U1A1 4 Configure the hardware components as shown in Table 13 1 TABLE 13 1 HARDWARE LX ww SETTINGS Header Component sumper Device Functions see Figure 13 1 Setting am OPI Jumper PVbClumerwomied Uumperja L Jumper 5 VDCiumperinstale Seene se ees zz PGC aa PCD Selector pu So OFF Notuseditisconfguion Selector swten Je OFF Notused in tris configuration Seu m ope P cwm 2 a cwm ne a umnre us lopen bene Im jm T _ umen ewm ummRe ns oe
83. SPIGSOF 3011 uuu m uu eee sa 45 For dsPIG30F3012 u uu uu u tet 51 For dsPIC30F3013 oua cst ees 57 For dsPIC30F3014 63 For dsPIC30F4011 69 For dsPIC30F4012 75 For dSPICSOF4013 o oe ext 81 Sample Application Programs 13 Sample Application Projects 12 SPI programming header 88 Switch S5 header 88 Switch S6 header 88 T Temperature Sensor cccccccccseeecceeeeeaseeeeaseeeesaeees 88 Temperature Sensor header Hardware Components Temperature Sensor header 88 U UART Transceiver 88 UART1 header 88 UART2 header z yu uu uum A ne 88 V voltage regulator 88 W Warranty Registration 4 WWW EE 5 ww E D uu MICROCHIP ee AND mum ww sa 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
84. Swich Ja OFF Notusedin tris configuration Selector pu Je OFF Notused in tris configuration pomus Im om ll umnre us open umnme us om SS umm us Open Swess Im om Onthis device multiplexing of various peripherals on the pins does not allow the simultaneous use of Switch S5 and LCD Primary UART1 pins and LCD Since only one DB 9 connector is provided for RS 232 communication you can select either UART1 primary or alternate pins or UART2 but not both 5 Connect the RS 232 cable from the PC to the UART connector J2 Heapply power to the DC IN connector J4 The PWR ON LED should illuminate 7 Load the sample application program for the dsPIC30F3010 see Section 6 4 Device Programming D PEN E D uu Using the dsPIC30F3010 6 4 DEVICE PROGRAMMING Load the sample application program for the dsPIC30F3010 using this process 1 Plugthe RJ11 telephone cable from the MPLAB ICD 2 into the ICD header J1 Make sure the USB cable from the MPLAB ICD 2 is connected to your PC 2 Start MPLAB IDE 3 Open the dsPIC30F3010 sample project File Open Workspace from path dsPICDEM 2 Development Kit Example Soft ware 30F3010 Demo mcw Note For detailed information and procedures on using the MPLAB IDE and ICD 2 refer to Chapter 2 Getting Started 4 Build the sample project in MPLAB IDE Project gt Build
85. all positions on switches S3 and S4 to off Then set switch S2 to M ALL The MPLAB ICD 2 is now connected to the PGC and PGD pins on the dsPIC30F3011 6 Download the sample application Programmer gt Program The Output window Figure 7 2 displays the status as the download occurs and indicates when the programming has succeeded FIGURE 7 2 PROGRAMMING THE dsPIC30F3011 DEVICE Build Version Control Find in Files MPLAB ICD 2 Connecting to MPLAB ICD 2 onnected Setting Vdd source to target Target Device dsFIC3OF3011 found revision mme al Reading ICD Praduct ID Running ICD Self Test Passed MPLAB ICD 2 Ready Programming Target Validating configuration fields Erasing Fart Programming Frogramming Executive mit Frogramming Executive Programming Program Memory 0x0 Dx5FF1 Merifyving Program Memory Mari succeeded L Se Configuration Bits Contig Memory Merifying configuration memoary Programming succeeded MPLAB ICD 2 Ready lt I E 7 Disconnect the MPLAB ICD 2 cable from the ICD header The program is now ready to run see Section 7 5 Observing the Sample Application l m w ws E EMEN dsPICDEM 2 Development Board User s Guide 7 5 OBSERVING THE SAMPLE APPLICATION 1 Press RESET ALL The program begins to run 2 Setup a HyperTerminal session on the PC to run with these parameters Port Setting Value Bits per second 9600 Data bits 8 Parity None Stop bits 1 Flow
86. an CT module and 20 I O pins A sample application program provides a software baseline for building your own embedded solution FIGURE 3 1 28 PIN SPDIP dsPIC30F2010 MCLR AVDD EMUD3 ANO VREF CN2 RBO AVSS EMUC3 AN1 VREF CN3 RB1 PWM1L REO AN2 SS1 CN4 RB2 PWM1H RE1 AN3 INDX CN5 RB3 AN4 QEA IC7 CN6 RB4 AN5 QEB IC8 CN7 RB5 Vss PWM2L RE2 PWM2H RE3 PWMSL REA4 PWM3H RE5 OSC1 CLKI VDD OSC2 CLKO RC15 Vss EMUD1 SOSCI T2CK U1ATX CN1 RC13 PGC EMUC U1RX SDI1 SDA RF2 EMUC1 SOSCO T1CK U1ARX CNO RC14 PGD EMUD U1TX SDO1 SCL RF3 DD FLTA INTO SCK1 OCFA RE8 EMUD2 OC2 IC2 INT2 RD1 EMUC2 OC1 IC1 INT1 RDO dsPIC30F2010 3 2 HIGHLIGHTS This chapter discusses e Board Setup for the dsPIC30F2010 Sample Application e Device Programming Observing the Sample Application e In Circuit Debugging Summary 3 3 BOARD SETUP FOR THE dsPIC30F2010 SAMPLE APPLICATION The dsPICDEM 2 Development Board supports dsPIC30F devices that have multiple peripheral devices multiplexed on some pins Therefore the jumper set up of various headers depends on which of the dsPIC30F peripherals are used by the application This section demonstrates how the board is set up for the dsPIC30F2010 device to support the dsPIC30F2010 example software in the dsPICDEM 2 Development Kit CD Follow these steps to configure the hardware on the dsPICDEM 2 Development Board for the sample application 1 Disconnect the power source 2 Remove any dsPIC30Fxxxx
87. and debuggers like MPLAB ICD 2 and PRO MATETM 3 DIP switches in S2 S3 and S4 are provided to connect the PRO MATE 3 or MPLAB ICD 2 In Circuit Debugger to the programming and debugging pins on the installed dsPICS3OF device Switches within S2 should always be used to designate the device being programmed by MPLAB ICD2 These switches connect the clock and data lines from ICD 2 to the Programming and Default Debugging channels PGC EMUC and PGD EMUD on the dsPIC30F device In some instances users may find that their application uses certain peripherals multiplexed on either the PGC EMUC or the PGD EMUD pins In such cases they may avail of alternate debugging channels EMUC1 amp EMUD1 or EMUC2 amp EMUD2 or EMUC3 amp EMUDS The dsPICDEM 2 Development Board supports the l m w ws PEN i dsPICDEM 2 Development Board User s Guide EMUC1 amp EMUD 1 pin pair as well as the EMUC2 amp EMUD2 pin pair for alternate debugging channels This functionality has been provided by the DIP switches in S3 for Motor Control family and S4 for Sensor and General Purpose families Table 14 3 shows the various alternate debugging channel options available to the user These switches are represented in the schematics in Figure A 5 dsPICDEMTM 2 Development Board Schematic Sheet 4 of 7 TABLE 14 3 PROGRAMMING DEBUGGING PIN SELECTION Switch Position Label Function S2 1 GP 40 Connects ICD to programming pins on the 40 pin
88. and debugging functions PGC EMUC PGD EMUD on the dsPIC30F device are multiplexed with other peripheral modules on the device used by the sample application Thus it is necessary to use an alternate pair of debugging pins EMUC1 EMUD1 EMUC2 EMUD2 or EMUC3 EMUD3 to examine the baseline code provided in the sample application 8 6 1 Setting Up MPLAB ICD 2 for Debugging To change MPLAB ICD 2 from a programmer to a debugger 1 From the Debugger menu click Select Tool MPLAB ICD 2 to designate the MPLAB ICD 2 as the debug tool in MPLAB IDE 2 From the Configure menu select Configuration Bits The Configuration Bits window displays the current configuration settings for the device as shown in Figure 8 3 3 Change the Comm Channel Select parameter to Use EMUC2 and EMUD2 On the dsPICDEM 2 board change the setting on switch S4 to turn on EMUC2 and EMUD2 for GP 18 Remove any jumpers on headers H6 and H7 Reprogram the dsPIC30F device Debugger Program menu On the dsPICDEM 2 board turn off GP 18 on switch S2 Reset the program and run it From the Debugger menu select Heset Processor Reset Then select Debugger gt Run Nz O NDU l m w ws E MN dsPICDEM 2 Development Board User s Guide FIGURE 8 3 CONFIGURATION BITS WINDOW M Configuration Bits Address Category Setting Fsan0n000 Clock Switching and Monitor Su Disabled Mon Disabled Oscillator Source Primary Oscillator Primary Oscillator Mode XT w P
89. blinking alternately Getting Started 2 5 DEVICE PROGRAMMING PROCESS The second phase of the getting started process introduces the MPLAB Integrated Development Environment IDE and MPLAB ICD 2 In Circuit Debugger The emphasis in this phase is to program the sample application into a dsPIC30F4011 device After observing the demonstration this process gets you ready to examine what you observed 2 5 1 Connect MPLAB ICD 2 Follow the information in Figure 2 2 to set up the MPLAB ICD 2 for use asa programmer 1 With an RJ11 cable connect the MPLAB ICD 2 to the ICD header J1 on the board 2 Usea USB cable to connect the MPLAB ICD 2 to your PC Note Make sure that the USB driver for the MPLAB ICD 2 has been installed on your PC see the MPLAB ICD 2 User s Guide DS51331 for more details regarding the installation of MPLAB ICD 2 FIGURE 2 4 MPLAB ICD 2 CONNECTION DIAGRAM PC running MPLAB IDE MPLAB ICD 2 PSS 7 4 A Connect RJ 11 cable to ICD eege Connect RS 232 cable to e PC 9 VDC Power Cable dsPICDEM 2 Development Board running dsPIC30F4011 sample application Apply power to the board 2 5 2 Setting up MPLAB IDE The sample application program files on the dsPICDEM 2 CD contain a workspace and project information needed by MPLAB IDE MPLAB ICD 2 and MPLAB C30 The first step is to open the sample application project in MPLAB IDE Note These instructions pre
90. box The sample application projects and source code were created with e MPLAB IDE v7 11 e MPLAB C30 v1 32 The sample application projects for each dsPICSOF device are located in the folder path dsPICDEM 2 Development Kit Example Software 1 6 HOST SYSTEM ENVIRONMENT A host system is used to support the MPLAB IDE and ICD 2 development tools as well as HyperTerminal amp communication Minimum requirements are PC compatible system with an Intel Pentium class or higher processor or equivalent e A minimum of 16 MB RAM e A minimum of 40 MB available hard drive space e CD ROM drive e Microsoft Windows 98 Windows NT 4 0 Windows 2000 or Windows XP I D uu dsPICDEM 2 DEVELOPMENT BOARD MICROCHIP USER S GUIDE 2 1 INTRODUCTION The dsPICDEM 2 Development Board provides both a hardware and software base line capability to help jump start your application The board is pre configured for and populated with a dsPIC30F4011 Digital Signal Controller DSC The dsPIC30F4011 is preprogrammed with a sample application program ready to run out of the box This chapter describes how to run the application and evaluate the program to take advantage of the sample software 2 2 HIGHLIGHTS Items discussed in this chapter include e Getting Started e Out of the Box Demo e Device Programming Process e n Circuit Debugging Process e Summary 2 3 GETTING STARTED The dsPICDEM 2 sampl
91. ce that were specified in MPLAB IDE The primary programming and debugging functions PGC EMUC PGD EMUD on the dsPIC30F device are multiplexed with other peripheral modules on the device used by the sample application Thus it is necessary to use an alternate pair of debugging pins EMUC1 EMUD1 EMUC2 EMUD2 or EMUC3 EMUD3 to examine the baseline code provided in the sample application 7 6 1 Setting Up MPLAB ICD 2 for Debugging To change MPLAB ICD 2 from a programmer to a debugger 1 From the Debugger menu click Select Tool MPLAB ICD 2 to designate the MPLAB ICD 2 as the debug tool in MPLAB IDE 2 From the Configure menu select Configuration Bits The Configuration Bits window displays the current configuration settings for the device as shown in Figure 7 3 3 Change the Comm Channel Select parameter to Use EMUC2 and EMUD2 On the dsPICDEM 2 board change the setting on switch S3 to turn on EMUC2 and EMUDA Remove any jumpers on headers H6 and H7 Reprogram the dsPIC30F device Debugger Program menu On the dsPICDEM 2 board turn off M ALL on switch S2 Reset the program and run it From the Debugger menu select Heset Processor Reset Then select Debugger gt Run um ONO l m w ws E dsPICDEM 2 Development Board User s Guide FIGURE 7 3 CONFIGURATION BITS WINDOW NN Configuration Bits Address Category Setting Fsoo000 Clock Switching and Monitor Su Disabled Mon Disabled Oscillator S
92. cusses e Board Setup for the dsPIC30F3013 Sample Application e Device Programming e Observing the Sample Application e In Circuit Debugging Summary 9 3 BOARD SETUP FOR THE dsPIC30F3013 SAMPLE APPLICATION The dsPICDEM 2 Development Board supports dsPIC30F devices that have multiple peripheral devices multiplexed on some pins Therefore the jumper set up of various headers depends on which of the dsPIC30F peripherals are used by the application This section demonstrates how the board is set up for the dsPIC30F3013 device to support the dsPIC30F3013 example software in the dsPICDEM 2 Development Kit CD Follow these steps to configure the hardware on the dsPICDEM 2 Development Board for the sample application 1 Disconnect the power source 2 Remove any dsPIC30Fxxxx device currently plugged into the dsPICDEM 2 Development Board 3 Plug the dsPIC30F3013 into socket U1B1 un m ws I dsPICDEM 2 Development Board User s Guide 4 Configure the hardware components as shown in Table 9 1 TABLE 9 1 HARDWARE Pul wae 3 SETTINGS Header Socket UB U1B1 coro me aorta Jumpers JP Jumper SVDCjumperinstaled Selector Switch e OFF Notusedin this configuration Selector Switch S4 OFF Norusedinihis configuration PGMUS mm Open Nojumperconectons cwm e open uane HS Open UART2Ax H5 Open Swess me
93. displays the same information Adjust temperature and note LCD and HyperTerminal readings Adjust potentiometer and note LCD and HyperTerminal readings Observe the rate at which LEDs D3 and D4 blink Press INTO S5 and note the affect on D3 and D4 Press INT1 S6 and note the affect on D3 and D4 Ot PEN p I NH mmm uu Using the dsPIC30F4013 IN CIRCUIT DEBUGGING The sample application program is intended to illustrate how the processor and I O modules handle the functionality provided on the dsPICDEM 2 Development Board The MPLAB ICD 2 In Circuit Debugger was used to program the sample application into the dsPIC30F device You can also use the MPLAB ICD 2 In Circuit Debugger to examine this baseline code to determine specific applicability to your application 13 6 The examination process requires that the dsPIC30F4013 device be reprogrammed to recognize the MPLAB ICD 2 debugger rather than a programmer 13 6 1 Setting Up MPLAB ICD 2 to Examine Code To change MPLAB ICD 2 from a programmer to a debugger 1 From the Debugger menu click Select Tool MPLAB ICD 2 to designate the MPLAB ICD 2 as the debug tool in MPLAB IDE 2 Reprogram the dsPIC30F device Debugger Program menu 3 Resetthe program and run it From the Debugger menu select Heset Processor Reset Then select Debugger gt Run Figure 13 3 shows the configuration bits for this set up FIGURE 13 3 CONFIGURATION BITS WINDOW Configuration
94. dsPICDEM 2 development board for enabling HS 232 communication The transceiver interfaces a DB9 connector J2 and the UART Transmit and Receive pins on the active dsPIC30F via headers H3 H4 or H5 Header H3 enables a connection between the transceiver and the primary UART1 pins U1TX and U1RX on the active dsPIC30F device Header H4 enables a connection between the transceiver and the alternate UART1 pins U1ATX and U1ARX on the active dsPIC30F device H5 enables a connection between the transceiver and the UART2 pins U2TX and U2RX on the active dsPICSOF device At any time only one of the three headers H3 H4 and H5 may be populated with jumpers The schematic of the RS 232 circuits is shown in Figure A 5 dsPICDEMTM 2 Development Board Schematic Sheet 4 of 7 Table 14 4 lists the connections set up by each header pin position TABLE 14 4 UART HEADER SETTINGS 3 dsPIC30F device in either motor control socket 18 pin dsPIC30F device in general purpose socket U1C1 GP 40 28 Connects the UART transceiver to the UART 1 module in the 28 or 40 pin dsPIC30F device in general purpose socket U1A1 or U1B1 M ALL Connects the UART transceiver to the alternate pins for the UART 1 module in the dsPIC30F device in either motor control socket GP ALL Connects the UART transceiver to the alternate pins for the UART 1 module in the dsPIC30F device in any general purpose socket H5 EE aen the UART transceiver to the UART 2 module of the E dsP
95. e PUM Output Polarity Active High Low Side PUN Output Polarity Active High PROR Enable Enabled Brown Out Voltage z POR Timer value Timer Disabled FSO000 A General Code Segment Code Protect Disabled General Code Segment Write Protect Disabled FSDDDC Comm Channel Select use EHUCL and EMUD1 Use PGC EMUC and PGD EHUD Use EMUC and EHMUDI1 Use EMUCZ and EMUD2 Use EMUC3 and EMUD3 11 6 2 Examining the Code After the application has been reprogrammed to use the MPLAB ICD 2 as a debugger you can use MPLAB IDE to run halt and step the program You can set breakpoints to halt the program and examine the actual code at any point You can also examine the contents of the RAM and registers whenever the processor is halted Refer to Section 2 3 Getting Started for an overview of the sample application Flowcharts illustrate each of these processes e Startup and initialization Main loop processing e A D conversion processing e External interrupt processing The dsPICDEM 2 Development Kit Example Software 30F4011 folder con tains fully annotated code files that you can examine compare and copy 11 7 SUMMARY m j D ana This chapter has provided specific instructions for using the dsPICDEM 2 Development Board with a dsPIC30F4011 device If you have reviewed this process you should be able to e Configure the dsPICDEM 2 Development Board for the dsPIC30F4011 device e Set up MPLAB IDE to use the MPLA
96. e applicability to your need see Observe Sample Run the Application Application N un w B Hu dsPICDEM 2 Development Board User s Guide Out of the box you can power up the dsPICDEM 2 Development Board and run the sample application on the dsPIC30F4011 device The objective of this process is to acquaint you with the board and demonstrate how the dsPIC30F device interacts with the hardware components used for the demo see Section 2 4 Out of the Box Demo Eventually as you develop your own application you will need to program and debug the dsPIC30F device The second phase of the getting started process is programming the device for stand alone operation For this process you attach the MPLAB ICD 2 In Circuit Debugger to the dsPICDEM 2 board designate it as a programmer in MPLAB IDE build your program in MPLAB IDE and then program the device with MPLAB ICD 2 The procedures for this process are outline in Section 2 5 Device Programming Process using the dsPIC30F4011 device as an example To examine program operation on a step by step basis you need to set up MPLAB ICD 2 as a debugger For this process you attach the MPLAB ICD 2 In Circuit Debugger to the dsPICDEM 2 board designate it as a debugger in MPLAB IDE build your program in MPLAB IDE and then program the device for debug mode with MPLAB ICD 2 The procedures for this process are outline in Section 2 6 In Circuit Debugging Process using the dsPIC30F401
97. e application Thus it is necessary to use an alternate pair of debugging pins EMUC1 EMUD1 EMUC2 EMUD2 or EMUC3 EMUD3 to examine the baseline code provided in the sample application 11 6 1 Setting Up MPLAB ICD 2 for Debugging To change MPLAB ICD 2 from a programmer to a debugger 1 From the Debugger menu click Select Tool MPLAB ICD 2 to designate the MPLAB ICD 2 as the debug tool in MPLAB IDE 2 From the Configure menu select Configuration Bits The Configuration Bits window displays the current configuration settings for the device as shown in Figure 11 3 3 Change the Comm Channel Select parameter to Use EMUC2 and EMUD2 On the dsPICDEM 2 board change the setting on switch S3 to turn on EMUC2 and EMUDA Remove any jumper on header H7 Reprogram the dsPIC30F device Debugger Program menu On the dsPICDEM 2 board turn off M ALL on switch S2 Reset the program and run it From the Debugger menu select Heset Processor Reset Then select Debugger gt Run ONO l m w ws E PEN Jj dsPICDEM 2 Development Board User s Guide FIGURE 11 3 CONFIGURATION BITS WINDOW EL Configuration Bits SE Fsooo0o Clock Switching and Monitor Sw Disabled Mon Disabled Oscillator Source Primary Oscillator Primary Oscillator Mode ET w PLL 8x FSn0n00z Watchdog Timer Disabled ULCT Prescaler A 1 512 WDT Prescaler B 1 16 Fan na Master Clear Enable Enabled PUN Output Pin Reset Control with PORT TRIS regs High sid
98. e application program demonstrates key functionality of the dsPIC30F devices This sample application program processes analog data from a temperature sensor and potentiometer provided on the board It also processes interrupts generated from pushbutton switches on the board Based on the input data the program creates output in the form of LED indicators which blink in response to the pushbutton switches and an LCD screen which displays the temperature and potentiometer values The program also uses the dsPIC30F s UART module to mirror LCD information via RS 232 connection to a remote terminal The sample application is written in C language and tailored specifically for each dsPIC30F device supported by the dsPICDEM 2 Development Board Figure 2 1 outlines helpful processes to get you started using the dsPICDEM 2 board FIGURE 2 1 GETTING STARTED PROCESSES Out of the Box Demo Device Programming In Circuit Debugging Connect your PC to the Open the MPLAB IDE Select MPLAB ICD 2 as dsPICDEM 2 board workspace for selected Debugger build project and see Figure 2 2 dsPIC30F device see program device Setting up MPLAB IDE Launch HyperTerminal Build project and program Set breakpoint and see Connect PC and Start the dsPIC30F device examine application HyperTerminal Session see Build the Project program code Apply power to board and Release device from reset Evaluate program for run application amp observe application se
99. e dsPIC30F2011 device Programmer gt gt Program Remove jumpers from headee H11 dsPICDEM 2 0 DEVELOPMENT BOARD MICROCHIP USER S GUIDE vm umm n C 1 H7 AND H6 LABELLING ERROR This Appendix illustrates and explains a labeling error on Revisions E and F of the dsPICDEM 2 printed circuit board see Figure C 1 The SEL S6 and SEL S7 labels on Headers H6 and H7 respectively are reversed H7 actually enables S6 to be connected to INT1 and H6 enables S5 to be connected to INTO FIGURE C 1 Labelling Error on H7 and H6 dsPICDEM 2 ug D 02 01814 Rev F 3 3 WWW microchip com n 1 SEL UART LI N M uu DL O 1 EMUD1 EMUC1 EMUD2 EMUC2 EMUD2 EMUC2 EMUD2 EMUC2 C44 rhe ALT UART General t SERRE The SEL S5 and SEL S6 labels on Headers H6 and H7 respectively are reversed in Rev E amp Rev F of the dsPICDEM 2 board H7 actually enables S6 to be connected to INT1 and H6 enables S5 to be connected to RESET ALL GP ALL GP 42 cp 28 GP 18 a O Q 2 EX ALL on ALL LCD2 pin 17 SEL SPI LCD ROIS pin 1 LCD1 o Die gilllcliz Icrocnip I ecnnology INC page dsPICDEM 2 Development Board User s Guide Notes PEN us I NH mmm uu MICROCHIP dsPICDEM 2 DEVELOPMENT BOARD USER S GUIDE ex A Alternate UART1 header 88 Analog Pot Header
100. econd 9600 Data bits 8 Parity None Stop bits 1 Flow control None As a shortcut you can launch the Hyperterminal RS232 dsPICDEM2 ht file in the dsPICDEM 2 Development Kit Example Software 30F3010 folder 3 See information on LCD Note that the HyperTerminal displays the same information Adjust temperature and note LCD and HyperTerminal readings Adjust potentiometer and note LCD and HyperTerminal readings Observe the rate at which LEDs D3 and D4 blink Press S6 INT1 and note the affect on D3 and D4 Gp OE wi I NH mmm uu Using the dsPIC30F3010 6 6 IN CIRCUIT DEBUGGING The sample application program is intended to illustrate how the processor and peripheral modules handle the functionality provided on the dsPICDEM 2 Development Board The MPLAB ICD 2 In Circuit Debugger was used to program the sample application into the dsPIC30F device You can also use the MPLAB ICD 2 In Circuit Debugger to examine this baseline code to determine specific applicability to your application The examination process requires that three changes be made to the sample application setup e The dsPIC30F3010 device must be reprogrammed to recognize the MPLAB ICD 2 as a debugger rather than as a programmer e MPLAB IDE must be reconfigured to specify the pins on the dsPIC30F3010 device to be used for debugging e The dsPICDEM 2 board must be physically reconfigured to ensure that it connects the MPLAB ICD 2 debugger to the pins on
101. enu A Or 401 ZU989 L ZK Z vlOUu M3OV3H HOLON fa a gt N u tc N tc a DI N al al a A E e j I j gt N D D tc a a z o N e a ac a z N I A fa x a z S J 6 16 LE E N e z amp a re a c OIN e S c tt KW N o a m Q tc tc 2130 Coen zu Te Frau rza Seu A Tia avo avo o fa L rd al 3 gt T al lel fal ls O IL Jue Je T j oc E foo a T La a N N N a a a a Ke e ito m a e 9 jo B fe je 2 Sj Je u x j Iz oe o a z o T al a ito N m D gt c oc M3QV3H NHOSN3S d9 fa a gt 6 o a T ae a tc z o gt a o e le L H cJ D a E a z re a tc wi a tc tc e Q tc o EN a a r f o Q gt J x l O ZO 38490 ER dud NYO OSO d Y0s9 YOLOW dNON9 YOLOW OL Z eeu 919400 eee NYJ OSO df10H9 HOLON OL z ead em MOSN3S d9 OL dn039 YOSNAS d9 IIpysu jou op 849 dW3l TAS dn035 YOSNIS d9 OL eau V LO JosuegG eJnipJeduues Icrochip echnology Inc page Hardware D
102. er discusses e Board Setup for the dsPIC30F4011 Sample Application e Device Programming e Observing the Sample Application e In Circuit Debugging e Summary 11 3 BOARD SETUP FOR THE dsPIC30F4011 SAMPLE APPLICATION The dsPICDEM 2 Development Board supports dsPIC30F devices that have multiple peripheral devices multiplexed on some pins Therefore the jumper set up of various headers depends on which of the dsPIC30F peripherals are used by the application This section demonstrates how the board is set up for the dsPIC30F4011device to support the dsPIC30F4011 example software in the dsPICDEM 2 Development Kit CD Follow these steps to configure the hardware on the dsPICDEM 2 Development Board for the sample application N un w B ws I dsPICDEM 2 Development Board User s Guide 1 Disconnect the power source 2 Remove any dsPIC30Fxxxx device currently plugged into the dsPICDEM 2 Development Board 3 Plug the dsPIC30F4011 into socket U2A1 4 Configure the hardware components as shown in Table 11 1 TABLE 11 1 dsPIC30F4011 CONFIGURATION SETTINGS Header SocketU2A1 Component No Setting Pin Device Functions see Figure 11 1 Imperat Ur jumper 6 VOC jumperinstaled Jumper P Pe jumper 5 VOC jumperinstaled Selector pu Je OFF Netusedintisconigursion SR oae Il E Gap Je oe Jl Var Je open SSS umnme Je open ll Atemate VARTI Te Jun MALL
103. erature and note LCD and HyperTerminal readings Adjust potentiometer and note LCD and HyperTerminal readings Observe the rate at which LEDs D3 and D4 blink Press S6 INT1 and note the affect on D3 and D4 Gp OE w I D uu Using the dsPIC30F4012 12 6 IN CIRCUIT DEBUGGING The sample application program is intended to illustrate how the processor and I O modules handle the functionality provided on the dsPICDEM 2 Development Board The MPLAB ICD 2 In Circuit Debugger was used to program the sample application into the dsPIC30F device You can also use the MPLAB ICD 2 In Circuit Debugger to examine this baseline code to determine specific applicability to your application The examination process requires that three changes be made to the sample application setup e The dsPIC30F4012 device must be reprogrammed to recognize the MPLAB ICD 2 as a debugger rather than as a programmer e MPLAB IDE must be reconfigured to specify the pins on the dsPIC30F4012 device to be used for debugging e The dsPICDEM 2 board must be physically reconfigured to ensure that it connects the MPLAB ICD 2 debugger to the pins on the dsPIC30F4012 device that were specified in MPLAB IDE The primary programming and debugging functions PGC EMUC PGD EMUD on the dsPIC30F device are multiplexed with other peripheral modules on the device used by the sample application Thus it is necessary to use an alternate pair of debugging pins EMUC1 EMUD1
104. for each type of dsPIC30F device supported by the dsPICDEM 2 Development Board PEN I D uu Getting Started 2 4 2 Connect PC and Start HyperTerminal Session Follow the information in Figure 2 2 to set up your PC to operate with the dsPICDEM 2 Development Board 1 Use an RS 232 cable to connect the serial port on your PC to the UART connec tor J2 on the board 2 On your PC start a HyperTerminal session and set it up with these port settings 9600 baud 8 data bits No parity 1 stop bit No flow control Note For convenience each of the sample program folders contains a utility that automatically launches HyperTerminal set up to run with the demo pro gram Double clicking the file Hyperterminal RS232 dsPICDEM2 ht starts the session FIGURE 2 2 SETUP DIAGRAM PC running HyperTerminal Connect RS 232 cable to PC 9 VDC Power Cable dsPICDEM 2 Development Board running sample application M BN 115VAC Apply power to the board l m w ws E EMEN I dsPICDEM 2 Development Board User s Guide 2 4 3 Observe Sample Application To run and observe the sample application follow these steps 1 2 Plug the 9 VDC cable into the DC IN connector J4 The PWR ON indicator should illuminate Press the RESET ALL pushbutton S1 The LCD displays the current tempera ture and voltage values which represent the A D conversions from the tempera ture sensor and potent
105. he examination process requires that three changes be made to the sample applica tion setup e he dsPIC30F2011 device must be reprogrammed to recognize the MPLAB ICD 2 as a debugger rather than as a programmer e MPLAB IDE must be reconfigured to specify the pins on the dsPIC30F2011 device to be used for debugging e The dsPICDEM 2 board must be physically reconfigured to ensure that it connects the MPLAB ICD 2 debugger to the pins on the dsPIC30F2011 device that were specified in MPLAB IDE The primary programming and debugging functions PGC EMUC PGD EMUD on the dsPIC30F device are multiplexed with other peripheral modules on the device used by the sample application Thus it is necessary to use an alternate pair of debugging pins EMUC1 EMUD1 EMUC2 EMUD2 or EMUC3 EMUD3 to examine the baseline code provided in the sample application 4 6 1 Setting Up MPLAB ICD 2 for Debugging To change MPLAB ICD 2 from a programmer to a debugger 1 From the Debugger menu click Select Tool MPLAB ICD 2 to designate the MPLAB ICD 2 as the debug tool in MPLAB IDE 2 From the Configure menu select Configuration Bits The Configuration Bits window displays the current configuration settings for the device as shown in Figure 4 3 3 Change the Comm Channel Select parameter to Use EMUC2 and EMUD2 On the dsPICDEM 2 board change the setting on switch S4 to turn on EMUC2 and EMUD2 for GP 18 Remove any jumpers on headers H6 and H7 Repr
106. he sample application setup e The dsPIC30F2010 device must be reprogrammed to recognize the MPLAB ICD 2 as a debugger rather than as a programmer e MPLAB IDE must be reconfigured to specify the pins on the dsPIC30F2010 device to be used for debugging e The dsPICDEM 2 board must be physically reconfigured to ensure that it connects the MPLAB ICD 2 debugger to the pins on the dsPIC30F2010 device that were specified in MPLAB IDE The primary programming and debugging functions PGC EMUC PGD EMUD on the dsPIC30F device are multiplexed with other peripheral modules on the device used by the sample application Thus it is necessary to use an alternate pair of debugging pins EMUC1 EMUD1 EMUC2 EMUD2 or EMUC3 EMUD3 to examine the baseline code provided in the sample application 3 6 1 Setting Up MPLAB ICD 2 for Debugging To change MPLAB ICD 2 from a programmer to a debugger 1 From the Debugger menu click Select Tool MPLAB ICD 2 to designate the MPLAB ICD 2 as the debug tool in MPLAB IDE 2 From the Configure menu select Configuration Bits The Configuration Bits window displays the current configuration settings for the device as shown in Figure 3 3 3 Change the Comm Channel Select parameter to Use EMUC2 and EMUD2 On the dsPICDEM 2 board change the setting on switch S3 to turn on EMUC2 and EMUDA Remove any jumpers on headers H6 and H7 Reprogram the dsPIC30F device Debugger Program menu On the dsPICDEM 2 boa
107. ices 88 Debug Selector DIP Switch 88 dsPIC30F Device Headers 88 dsPIC30F4011 Device 88 External Connection Headers 88 External Power Supply Inputs 88 Betreit gell 88 LCD Controller Header 88 LCD Graphic Display 88 LED Selection Header 88 Output LEDS 88 Power On LED 88 Power Supply jumpers 88 Programming Selector DIP Switch 88 Programming Debugging Connector 88 Reset Switch 88 93 RS 232 Serial Port 88 SPI programming header 88 Switch S5 header 88 Switch S6 header 88 Temperature Sensor 88 UART 1 header 88 UART 2 header 88 UART Transceiver 88 voltage regulator ss ssssesssseneerrreerreerrrnsrrerrree 88
108. iew Project Debugger Programmer Build Version Control Find in Files MPLAB ICD 2 Target Device dsPIC30F4011 found revision mm1 al Reading ICD Product ID Running 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 x5FF Verifying Program Memory Address FS0000 Category Clock Switching and Monitor Oscillator Source Primary Oscillator Mode Watchdog Timer WDT Prescaler WDT Prescaler B Master Clear Enable F60002 F50004 Name Jobject o Files output hex map files A to D Converter c eoutines c Type C File Date Modified 3 7 2005 3 19 AM Size 3 66 KB Timers c E UART c System h Le Hyperterminal RS232 dsPICDEM2 ht f Demo mcp l Demo mcs Ki Demo mcw al Delay s README txt Tools Configure Window Help D X mpemo mcw i Demo mcp Source Files 4 to D Converter c Delay s DisplayRoutines c IMTx IO pins c Main c SPI for LCD c Timers c traps c LIART c Header Files p3 f4011 h Object Files A Library Files libpic30 coff a Linker Scripts p30f4011 gld Sw Disabled Mon Disabled Primary Oscillator XT w PLL 8x Disabled l1 512 1 16 Enabled Size Type File Folder File Folder File Folder C File C File C File C File C File C File
109. in this configuration eamus Jl Om umnTe Je Om uxmnme Je Open ummre Je Om Lampe i mao 25 PGDEMUDUTXSDONSCURFS On this device multiplexing of various peripherals on the pins does not allow the simultaneous use of Switch S5 and LCD Primary UART1 pins and LCD Since only one DB 9 connector is provided for RS 232 communication you can select either UART1 primary or alternate pins or UART2 but not both 5 Connect the RS 232 cable from the PC to the UART connector J2 Heapply power to the DC IN connector J4 The PWR ON LED should illuminate 7 Load the sample application program for the dsPIC30F3011 see Section 7 4 Device Programming D PEN D uu Using the dsPIC30F301 1 7 4 DEVICE PROGRAMMING Load the sample application program for the dsPIC30F3011 using this process 1 Plugthe RJ11 telephone cable from the MPLAB ICD 2 into the ICD header J1 Make sure the USB cable from the MPLAB ICD 2 is connected to your PC 2 Start MPLAB IDE 3 Open the dsPIC30F3011 sample project File gt Open Workspace from path dsPICDEM 2 Development Kit Example Soft ware 30F3011 Demo mcw Note Fordetailed information and procedures on using the MPLAB IDE and ICD 2 refer to Chapter 2 Getting Started 4 Build the sample project in MPLAB IDE Project gt Build All 5 Onthe dsPICDEMTM 2 board set
110. ins does not allow the simultaneous use of Switch S5 and LCD Primary UART1 pins and LCD Since only one DB 9 connector is provided for RS 232 communication you can select either UART1 primary or alternate pins or UART2 but not both 5 Connect the RS 232 cable from the PC to the UART connector J2 Heapply power to the DC IN connector J4 The PWR ON LED should illuminate 7 Load the sample application program for the dsPIC30F4012 see Section 12 4 Device Programming D PEN I NH mmm uu Using the dsPIC30F4012 12 4 DEVICE PROGRAMMING Load the sample application program for the dsPIC30F4012 using this process 1 Plugthe RJ11 telephone cable from the MPLAB ICD 2 into the ICD header J1 Make sure the USB cable from the MPLAB ICD 2 is connected to your PC 2 Start MPLAB IDE 3 Open the dsPIC30F4012 sample project File gt Open Workspace from path dsPICDEM 2 Development Kit Example Soft ware 30F4012 Demo mcw Note For detailed information and procedures on using the MPLAB IDE and ICD 2 refer to Chapter 2 Getting Started 4 Build the sample project in MPLAB IDE Project gt Build All 5 Onthe dsPICDEMTM 2 board set all positions on switches S3 and S4 to off Then set switch S2 to M ALL The MPLAB ICD 2 is now connected to the PGC and PGD pins on the dsPIC30F4012 6 Download the sample application Programmer gt Program The Output window Figure 12 2 displays the status a
111. iometer respectively dsPICDEM 2 Board T 18C Potz3 42v The LED indicators D3 and D4 should initially be off and then start to blink 3 Touch the temperature sensor for a moment and observe the temperature read ing It should increase as your finger warms the sensor 4 Adjust the potentiometer clockwise and observe the voltage reading increase Then readjust it counterclockwise and observe the voltage reading decrease 5 Observe the HyperTerminal screen and note that the information is updated to match the LCD see Figure 2 3 FIGURE 2 3 TYPICAL HyperTerminal SESSION 6 EE B D uu Hyperterminal RS232 dsPICDEM2 HyperTerminal File Edit View Cal Transfer Help T 40C Pot 4 92vu dsPICDEM2 Board T 43C Pot 4 92u dsPICDEM2 Board T 34C Pot 4 92v dsPICDEM2 Board T 43C Pot 4 92y dsPICDEM2 Board T 43C Pot 4 92v dsPICDEM2 Board T 40C Pot 4 92v dsPICDEM2 Board T 42C Pot 4 92v dsPICDEM2 Board T amp 0C Pot 4 92v Connected 0 00 17 ANSI 9600 8 N 1 Press pushbutton S5 INTO once and note that the rate at which D3 and D4 blink changes As you press S5 again observe that the blink rate cycles from extremely fast both LEDs appear to be on to fast blinking rapidly to moderate blinking slowly to slow appear to be switching on and off Press pushbutton S6 INT1 once and note that D3 and D4 blink alternately As you press S6 again note the LEDs cycle between blinking together and
112. isabled WDT Prescaler 1 51z WDT Prescaler B 1 16 Fan ua Master Clear Enable Enabled PHM Output Pin Reset Control with PORT TRIS regs High side PWM Output Polarity Active High Low side PUM Output Polarity Active High PBOR Enable Enabled Brown Out Voltage 2 0V POR Timer Value Timer Disabled General Code Segment Code Protect Disabled General Code Segment Write Protect Disabled Comm Channel Select Use 10 6 2 Examining the Code After the application has been reprogrammed to use the MPLAB ICD 2 as a debugger you can use MPLAB IDE to run halt and step the program You can set breakpoints to halt the program and examine the actual code at any point You can also examine the contents of the RAM and registers whenever the processor is halted Refer to Section 2 3 Getting Started for an overview of the sample application Flowcharts illustrate each of these processes e Startup and initialization e Main loop processing e A D conversion processing e External interrupt processing The dsPICDEM 2 Development Kit Example Software 30F3014 folder contains fully annotated code files that you can examine compare and copy l m w ws E MN dsPICDEM 2 Development Board User s Guide 10 7 SUMMARY This chapter has provided specific instructions for using the dsPICDEM 2 Development Board with a dsPIC30F3014 device If you have reviewed this process you should be able to e Configure the dsPICDEM 2 Development Board for the ds
113. l elei ie EE ER 5 3 Board Setup for the dsPIC30F2012 Sample Application 33 5 4 DEVICE ProgiGamifiliigk u uy u u uuu a nn ie nie ententes tetes sat 35 N un uu B w dsPICDEM 2 Development Board User s Guide 5 5 Observing the Sample Application 36 5 6 In Circuit Debugging Le 37 SMART 38 Chapter 6 Using the dsPIC30F3010 6 4 Idee ier EE 39 SZARON S ass CT P E 39 6 3 Board Setup for the dsPIC30F3010 Sample Application 39 6 4 Device Prograrnmillig suceso us subi RON edat ve Ee EE 41 6 5 Observing the Sample Application 42 6 6 In Girc it DE DUGGING ua anciennes ennemie 43 O EE usun usu Eeer 44 Chapter 7 Using the dsPIC30F301 1 Een Wl deele ier e RE D TU UT NM 45 T2 IIGIliO Su z E C C EE din Eten do etre 45 7 3 Board Setup for the dsPIC30F3011 Sample Application 45 4 Device Program u xx u a ren nn ic it 47 7 5 Observing the Sample Application 48 TO MGIC DD COMO GING ee eet 49 PAT NH Iy Su TET TET 50 Chapter 8 Using the dsPIC30F3012 e laude el Eer e uu T mM 51 SA AOI NUS EEN 51 8 3 Board Setup for the dsPIC30F3012 Sample Application 51 8 4 Device E e rel lu le BEE 53 8 5 Observing the Sample Application
114. lays the same information Adjust temperature and note LCD and HyperTerminal readings Adjust potentiometer and note LCD and HyperTerminal readings Observe the rate at which LEDs D3 and D4 blink Press S5 INTO and note the affect on D3 and D4 Press S6 INT1 and note the affect on D3 and D4 Ot PEN I D uu Using the dsPIC30F401 1 11 6 IN CIRCUIT DEBUGGING The sample application program is intended to illustrate how the processor and I O modules handle the functionality provided on the dsPICDEM 2 Development Board The MPLAB ICD 2 In Circuit Debugger was used to program the sample application into the dsPIC30F device You can also use the MPLAB ICD 2 In Circuit Debugger to examine this baseline code to determine specific applicability to your application The examination process requires that three changes be made to the sample applica tion setup e The dsPIC30F4011 device must be reprogrammed to recognize the MPLAB ICD 2 as a debugger rather than as a programmer e MPLAB IDE must be reconfigured to specify the pins on the dsPIC30F4011 device to be used for debugging e The dsPICDEM 2 board must be physically reconfigured to ensure that it connects the MPLAB ICD 2 debugger to the pins on the dsPIC30F4011 device that were specified in MPLAB IDE The primary programming and debugging functions PGC EMUC PGD EMUD on the dsPIC30F device are multiplexed with other peripheral modules on the device used by the sampl
115. led Oscillator Source Primary Oscillator Primary Oscillator Mode XT w PLL 8x FSOOCE Watchdog Timer Disabled WOT Prescaler T e E WDT Prescaler B 1 16 Feooo4 Master Clear Enable Enabled FUM Output Pin Reset Control with PORT TRIS regs High side PUM Output Polarity Active High Low Side PUM Output Polarity Active High PBOR Enable Enabled Brown Out Voltage a Dv POR Timer Value Timer Disabled FSO0nDD0A General Code Segment Code Protect Disabled General Code Segment Write Protect Disabled FSDDDC Comm Channel Select Use EMUCZ and EHUDZ PGC EMUC and PGD EMUD ENUC1 and EMUDI1 Use EMUC2 and EMUDZ EMUCS and ENMUR 6 6 2 Examining the Code After the application has been reprogrammed to use the MPLAB ICD 2 as a debugger you can use MPLAB IDE to run halt and step the program You can set breakpoints to halt the program and examine the actual code at any point You can also examine the contents of the RAM and registers whenever the processor is halted Hefer to Section 2 3 Getting Started for an overview of the sample application Flowcharts illustrate each of these processes e Startup and initialization e Main loop processing e A D conversion processing e External interrupt processing The dsPICDEM 2 Development Kit Example Software 30F3010 folder con tains fully annotated code files that you can examine compare and copy 6 7 SUMMARY This chapter has provided specific instructions for using the dsPICDEM 2 Development Board
116. lopment Board for use with the dsPIC30F3014 Digital Signal Controller It provides suggested procedures for device programming and in circuit debugging of the dsPIC30F3014 using the sample application Chapter 11 Using the dsPIC30F4011 This chapter describes how to configure the dsPICDEM 2 Development Board for use with the dsPIC30F4011 Digital Signal Controller It provides suggested procedures for device programming and in circuit debugging of the dsPIC30F4011 using the sample application Chapter 12 Using the dsPIC30F4012 This chapter describes how to configure the dsPICDEM 2 Development Board for use with the dsPIC30F4012 Digital Signal Controller It provides suggested procedures for device programming and in circuit debugging of the dsPIC30F4012 using the sample application Chapter 13 Using the dsPIC30F4013 This chapter describes how to configure the dsPICDEM 2 Development Board for use with the dsPIC30F4013 Digital Signal Controller It provides suggested procedures for device programming and in circuit debugging of the dsPIC30F4013 using the sample application Chapter 14 Hardware This chapter provides detailed information related to the hardware components used on the dsPICDEM 2 Development Board Appendix A Hardware Drawings and Schematics This appendix illustrates the dsPICDEM 2 Development Board layout and includes complete schematic diagrams Appendix B Writing to LCD This appendix provides detailed instructio
117. ments 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 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 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 l m w ws E w
118. mming Selector DIP Switch see Section 14 1 7 see Section 14 1 4 Output LEDs 33 ICD Connector see Section 14 1 9 see Section 14 1 4 AN 4 E 13 5 1 6 LED Header 34 UART Transceiver see Section 14 1 9 seeSection 14 1 7 7 Pushbutton Switches S5 and S6 35 RS 232 Serial Port see Section 14 1 8 see Section 14 1 7 18 Switch S5 header see Section 14 1 8 14 1 1 Power Supply The dsPICDEM 2 Development Board may be powered by a 9V AC DC wall adapter A DC voltage regulator is provided so as to regulate the 9V input from the wall adaptor and supply 5V to VDD and AVDD pins on the dsPICS3OF device In order to supply power to the board from a wall adaptor the jumpers JP1 and JP2 need to be installed and power should be supplied via the J4 jack The PWR ON LED D1 will illuminate if the power has been applied to the board appropriately The schematics of the power supply circuits are shown in Figure A 8 dsPICDEMTM 2 Development Board Schematic Sheet 7 of 7 wis p I NH mmm uu Hardware 14 1 2 dsPIC30F Device Sockets The left side of the dsPICDEM 2 Development Board includes sockets U2B1 and U2A1 for 28 and 40 pin devices respectively in the Motor Control family The right side of the board includes sockets U1C1 U1B1 and U1A1 for 18 28 and 40 pin devices respectively in the dsPIC30F General Purpose and Sensor family of devices These sockets are concentrically
119. n Bits window displays the current configuration settings for the device as shown in Figure 2 7 3 Change the Comm Channel Select parameter to Use EMUC2 and EMUD2 4 Onthe dsPICDEM 2 board change the setting on switch S3 to turn on EMUC2 and EMUDA 5 Program the dsPIC30F device Debugger gt Program menu On the dsPICDEM 2 board turn off M ALL on switch S2 7 Resetthe program and run it From the Debuggermenu select Heset Processor Reset Then select Debugger gt Run l m w ws ws R o dsPICDEM 2 Development Board User s Guide FIGURE 2 7 CONFIGURATION BITS WINDOW L Configuration Bits Address Category Setting F80000 Clock Switching and Monitor Sw Disabled Mon Disabled Oscillator Source Primary Oscillator Primary Oscillator Mode XT w PLL 8x Watchdog Timer Disabled UDT Prescaler T5512 WDT Prescaler B 1 16 F50004 Master Clear Enable Enabled PUM Output Pin Reset Control with PORT TRIS regs High side PUM Output Polarity Active High Low side PWM Output Polarity Active High PBOR Enable Enabled Brown Out Voltage 2 0V POR Timer Value Timer Disabled General Code Segment Code Protect Disabled General Code Segment Write Protect Disabled Comm Channel Select Use EMUCZ and EMUDZ Use PGC EMUC and PGD EMUD Use EMUCi and EMUD1 Use EMUCZ and EMUD2 Use EMUC3 and EMHS 2 6 2 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 pr
120. ns for writing to the 2 x 16 character LCD Appendix C Board Errata This appendix describes errata associated with certain revisions of the dsPICDEM 2 Development Board Index This section provides cross reference listing of terms features and sections of this document Worldwide Sales and Service A listing of Microchip sales and service locations and telephone numbers worldwide EN I NH mmm uu CONVENTIONS USED IN THIS GUIDE Preface This manual uses the following documentation conventions DOCUMENTATION CONVENTIONS Description Italic characters Initial caps Quotes Underlined italic text with right angle bracket Bold characters bnnnn Text in angle brackets gt Courier font Plain Courier Italic Courier Oxnnnn Square brackets Curly brackets and pipe character Represents Eumpes Referenced books MPLAB IDE User s Guide Emphasized text is the only compiler A window the Output window A dialog the Settings dialog A menu selection select Enable Programmer A field name in a window or Save project before build dialog A menu path File Save A dialog button Click OK A tab Click the Power tab A binary number where nis a b00100 b10 digit A key on the keyboard Press Enter F1 Sample source code define START Filenames autoexec bat File paths CrAM cLe E Keywords _asm endasm static Command line options Bit values 0 1
121. ogram It lets you set breakpoints to examine the code at specific locations or on occurrence of specific events It also lets you examine the contents of the RAM and registers The MPLAB ICD 2 allows you to run the application on the dsPICDEM 2 while monitoring it in MPLAB IDE on your PC The examination process requires that three changes be made to the sample application setup e The dsPIC30F4011 device must be reprogrammed to recognize the MPLAB ICD 2 as a debugger rather than as a programmer e MPLAB IDE must be reconfigured to specify the pins on the dsPIC30F device to be used for debugging e The dsPICDEM 2 board must be physically reconfigured to ensure that it connects the MPLAB ICD 2 debugger to the pins on the dsPIC30F device that were specified in MPLAB IDE Note The primary programming and debugging functions PGC EMUC PGD EMUD on the dsPIC30F device are multiplexed with other peripheral modules on the device used by the sample application Thus it is necessary to use an alternate pair of debugging pins EMUC1 EMUD1 EMUC2 EMUD2 or EMUC3 EMUDS to examine the baseline code provided in the sample application 2 6 1 Select MPLAB ICD 2 as Debugger To change MPLAB ICD 2 from a programmer to a debugger for a dsPIC30F4011 device 1 From the Debugger menu click Select Tool MPLAB ICD 2 to designate the MPLAB ICD 2 as the debug tool in MPLAB IDE 2 From the Configure menu select Configuration Bits The Configuratio
122. ogram after 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 Heset F7 Single Step F9 Run In addition there are more functions available by right clicking on a line of source code These functions include the ability to set simple and advanced breakpoints 2 7 SUMMARY This chapter has provided a suggested process for using the dsPICDEMTM 2 Development Board to jump start your own application If you have reviewed this process you should be able to e Configure the dsPICDEM 2 Development Board for the dsPIC30F device you select for your application Set up MPLAB IDE to use the MPLAB ICD 2 In Circuit Debugger e Locate the sample application for your dsPIC30F device e Program the chip with the MPLAB ICD 2 e View the code execution in program memory and source code e Reset Run Halt and Single Step the code m E D ana dsPICDEM 2 DEVELOPMENT BOARD MICROCHIP USER S GUIDE n up mm 3 1 INTRODUCTION This chapter assumes you have chosen the dsPIC30F2010 for your application The dsPICDEM 2 Development Board supports a dsPIC30F2010 device in a 28 pin SPDIP package as shown in Figure 3 1 This device provides six 10 bit A D 500 ksps channels a UART an SPI module
123. ogram the dsPIC30F device Debugger Program menu On the dsPICDEM 2 board turn off GP 18 on switch S2 Reset the program and run it From the Debugger menu select Reset Processor Reset Then select Debugger gt Run um ONO l m w ws E PEN I dsPICDEM 2 Development Board User s Guide FIGURE 4 3 CONFIGURATION BITS WINDOW L Configuration Bits Address Category Setting Fsoo000 Clock Switching and Monitor Su Disabled Mon Disabled Oscillator Source Primary Oscillator Primary Oscillator Mode ET w PLL 8x FSOOCE Watchdog Timer Disabled WDT Prescaler l sls WDT Prescaler B 1 16 Feooo4 Master Clear Enable Enabled FUM Output Pin Reset Control with PORT TRIS regs High side EUM Output Polarity Active High Low Side PUM Output Polarity Active High PBOR Enable Enabled Brown Out Voltage ZZ UM POR Timer Value Timer Disabled FSO0D0A General Code Segment Code Protect Disabled General Code Segment Write Protect Disabled FSDDDC Comm Channel Select EHUCZ and EMUDZ PGC EMUC and PGD EMUD ENUC1 and EMUD1 Use EMUCZ and EMUDZ EMUC3 and EMTs 4 6 2 Examining the Code After the application has been reprogrammed to use the MPLAB ICD 2 as a debugger you can use MPLAB IDE to run halt and step the program You can set breakpoints to halt the program and examine the actual code at any point You can also examine the contents of the RAM and registers whenever the processor is halted Hefer to Section 2 3 Getting Started for an
124. or RS 232 communication you can select either UART1 primary or alternate pins or UART2 but not both 5 Connect the RS 232 cable from the PC to the UART connector J2 6 Reapply power to the DC IN connector J4 The PWR ON LED should illuminate 7 Load the sample application program for the dsPIC30F3014 see Section 10 4 Device Programming PEN D uu Using the dsPIC30F3014 10 4 DEVICE PROGRAMMING Load the sample application program for the dsPIC30F3014 using this process 1 Plugthe RJ11 telephone cable from the MPLAB ICD 2 into the ICD header J1 Make sure the USB cable from the MPLAB ICD 2 is connected to your PC 2 Start MPLAB IDE 3 Open the dsPIC30F3014 sample project File gt Open Workspace from path dsPICDEM 2 Development Kit Example Soft ware 30F3014 Demo mcw Note For detailed information and procedures on using the MPLAB IDE and ICD 2 refer to Chapter 2 Getting Started 4 Build the sample project in MPLAB IDE Project gt Build All 5 Onthe dsPICDEMTM 2 board set all positions on switches S3 and S4 to off Then set switch S2 to GP 40 The MPLAB ICD 2 is now connected to the PGC and PGD pins on the dsPIC30F3014 6 Download the sample application Programmer gt Program The Output window Figure 10 2 displays the status as the download occurs and indicates when the programming has succeeded FIGURE 10 2 PROGRAMMING THE dsPIC30F3014 DEVICE Build Version Control Find in
125. ould be able to e Configure the dsPICDEM 2 Development Board for the dsPIC30F3012 device Set up MPLAB IDE to use the MPLAB ICD 2 In Circuit Debugger e Locate the sample application for the dsPIC30F3012 device e Program the chip with the MPLAB ICD 2 e Examine the sample application and identify applicable code for your embedded solution mu D ana dsPICDEM 2 DEVELOPMENT BOARD MICROCHIP USER S GUIDE s vx wem up ROUER 9 1 INTRODUCTION This chapter assumes you have chosen the dsPIC30F3013 for your application The dsPICDEM 2 Development Board supports a dsPIC30F3013 device in a 28 pin SPDIP package as shown in Figure 9 1 This device provides ten 12 bit A D 100 ksps channels two UARTs an SPI module an PC module and 20 UO pins A sample application program provides a software baseline for building your own embedded solution FIGURE 9 1 MCLR EMUD3 ANO VREF CN2 RBO EMUC3 AN1 VREF CN3 RB1 AN2 SS1 LVDIN CN4 RB2 ANS CN5 RB3 AN4 CN6 RB4 AN5 CN7 RB5 28 PIN SPDIP dsPIC30F3013 26 J AN6 OCFA RB6 25 EMUD2 AN7 RB7 24 AN8 OC1 RB8 23 1 AN9 OC2 RB9 22 U2RX CN17 RF4 Vss OSC1 CLKI OSC2 CLKO RC15 EMUD1 SOSCI T2CK U1ATX CN1 RC13 EMUC1 SOSCO T1CK U1ARX CNO RC14 21 U2TX CN18 RF5 dsPIC30F3013 SS 18 J PGC EMUC U1RX SDI1 SDA RF2 17 J PGD EMUD U1TX SDO1 SCL RF3 16 SCK1 INTO RF6 15 EMUC2 IC1 INT1 RD8 VDD IC2 INT2 RD9 1 14 9 2 HIGHLIGHTS This chapter dis
126. ource Primary Oscillator Primary Oscillator Mode ET w PLL 8x FSOOCE Watchdog Timer Disabled WDT Prescaler l sls WDT Prescaler B 1 16 Feooo4 Master Clear Enable Enabled FUM Output Pin Reset Control with PORT TRIS regs High side EUM Output Polarity Active High Low Side PUM Output Polarity Active High PBOR Enable Enabled Brown Out Voltage ZZ UM POR Timer Value Timer Disabled FSO0D0A General Code Segment Code Protect Disabled General Code Segment Write Protect Disabled FSDDDC Comm Channel Select EHUCZ and EMUDZ PGC EMUC and PGD EMUD EMUCL and EMUDi1 Use ERC and EMUDZ EMUC3 and EMI 7 6 2 Examining the Code After the application has been reprogrammed to use the MPLAB ICD 2 as a debugger you can use MPLAB IDE to run halt and step the program You can set breakpoints to halt the program and examine the actual code at any point You can also examine the contents of the RAM and registers whenever the processor is halted Hefer to Section 2 3 Getting Started for an overview of the sample application Flowcharts illustrate each of these processes e Startup and initialization e Main loop processing e A D conversion processing e External interrupt processing The dSPICDEM 2 Development Kit Example Software 30F3011 folder contains fully annotated code files that you can examine compare and copy 7 7 SUMMARY This chapter has provided specific instructions for using the dsPICDEM 2 Development Board with a dsPIC30F3011 device
127. rawings and Schematics FIGURE A 7 dsPICDEM 2 DEVELOPMENT BOARD SCHEMATIC SHEET 6 OF 7 Eng H Vasuki Sheet 6 of 7 dsPICDEM 2 Date Thu M 17 2005 Filename 053 090 1814 RevF sch Titl S IL 210 MCLR RESET ALL E a E a S Z x o E o GP INTG 18 PIN DEV GP INT 4d PIN DEV GP INT 28 PIN DEV GP INT 44 28 PIN DEV RA11 1 RF6 1 GP INT 18 PIN DEV RDO 2 MOTOR INT1 48 28 PIN DEV Ban nre 1 ESD Ros 15 Rc 1 4 6 8 6 GP Z SENSOR 5 7 MOTOR R80 2 GP RB1 1 MOTOR Re1 2 gt l m w ws E ww N dsPICDEM 2 Development Board User s Guide FIGURE A 8 dsPICDEM 2 DEVELOPMENT BOARD SCHEMATIC SHEET 7 OF 7 dsPICDEM 2 Date Thu M 17 2005 Filename 053 090 1814 ReyF sch Titl FIDUCIAL FIDUCIAL FIDUCIAL __ MOD Rei o N a 9VDC IN J4 1 2 DJ005B page Icrochip Technology Inc dsPICDEM 2 0 DEVELOPMENT BOARD MICROCHIP USER S GUIDE n to T B 1 OVERVIEW A 2x16 ASCII text LCD is provided on the dsPICDEM2 Development Board dsPIC30F devices installed on the dsPICDEM2 development board may use this LCD to display characters The interface to the LCD is via a 2 wire Serial Peripheral Interface SPI
128. rd turn off M ALL on switch S2 Reset the program and run it From the Debugger menu select Reset Processor Reset Then select Debugger gt Run Nz O NDU l m w ws E usa dsPICDEM 2 Development Board User s Guide FIGURE 3 3 CONFIGURATION BITS WINDOW M Configuration Bits Address Category setting FS50000 Clock Switching and Monitor Sw Disabled Mon Disabled Oscillator Source Primary Oscillator Primary Oscillator Mode XT w PLL 8x Watchdog Timer Disabled WDT Prescaler 1 512 WDT Prescaler B 1 16 Haster Clear Enable Enabled PUM Output Pin Reset Control with PORT TRIS regs High side PWM Output Polarity Active High Low side PUM Output Polarity Active High PBOR Enable Enabled Brown Out Voltage 2 0 POR Timer Value Timer Disabled General Code Segment Code Protect Disabled General Code Segment Write Protect Disabled Comm Channel Select Use EMUCZ and EMUD2 PGC EMUC and PGD EMUD EMUC1 and EMUD1 EMUC2 and EMUD2 EMUC3 and EME 3 6 2 Examining the Code After the application has been reprogrammed to use the MPLAB ICD 2 as a debugger you can use MPLAB IDE to run halt and step the program You can set breakpoints to halt the program and examine the actual code at any point You can also examine the contents of the RAM and registers whenever the processor is halted Hefer to Section 2 3 Getting Started for an overview of the sample application Flowcharts illustrate each of these processes e Startup and initializa
129. rdware components on the board with corresponding pins on the dsPIC30F device Figure 1 2 shows the location of hardware components and configuration headers that need to be set up depending on the dsPICSOF device FIGURE 1 2 dsPICDEM 2 HARDWARE COMPONENTS UART Connection J2 CAN Connection J3 MPLAB Programmer CAN Header H2 Debugger Connection J1 Power Supply Selector S2 for programming d UU Lt gesat and debugging Sow ay te Power Supply jumpers Sio _ 24 Si mm Hc dummy E Ga Al JP1 and JP2 Zeenen Dr Selector S3 for debugging ia FE UM TE NL us UART1 Header H3 motor control devices Selector S4 for debugging general purpose devices o SEL Cu EMUD1 EMUD2 MOTOR o Oscillator for motor control device Y2 Concentric sockets for motor control devices U2A1 amp U2B1 under Reset switch S1 S mes ME Oscillator for General External connection prototyping BE POTAE Purpose device Y5 headers H8 and H9 HANT RS QU eS UART2 Header H5 Temperature Header H10 ta Aoi 8B Output LEDs D3 and D4 Temperature Sensor U5 LED Header H12 LCD SPI Header H1 mn Switches S5 and S6 LCD Controller Programming ma amp d Header H11 JE 20 e Switches Header H6 and H7 Analog Pot R15 SPITM controller for LCD Pot Header H13 Alternate UART1 Header H4 Concentric sockets for General Purpose devices U1A1 U1B1 U1C1 D R21 2 H oeooqooqosoqooosososos q LCD LC
130. s dsPICDEM 2 Development Board User s Guide e 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 MATES II device programmers and the PICSTART9 Plus and PICkit 1 development programmers CUSTOMER SUPPORT Users of Microchip products can receive assistance through several channels e Distributor or Representative Local Sales Office e Field Application Engineer FAE e Technical Support e 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 7
131. s the download occurs and indicates when the programming has succeeded FIGURE 12 2 PROGRAMMING THE dsPIC30F4012 DEVICE Build Version Control Find in Files MPLAB ICD 2 Connecting ta MPLAB ICD 2 HR Connected Setting Vdd source to target Target Device dsPICSOF401 2 found revision Rev Ox1001 Reading ICD Product ID Running ICD Self Test Passed MPLAB ICD 2 Ready Programming Target Validating configuration fields Erasing Fart Programming Frogramming Executive l Verifying Frogramming Executive Programming Program Memory 0x0 Ox5FF Verifying Program Memory ver succeeded Programming Configuration Bits L Contig Memor Verifying configuration memory Programming succeeded I MPLAB ICD 2 Ready 7 Disconnect the MPLAB ICD 2 cable from the ICD header The program is now ready to run see Section 12 5 Observing the Sample Application l m w ws E PEN H dsPICDEM 2 Development Board User s Guide 12 5 OBSERVING THE SAMPLE APPLICATION 1 Press RESET ALL The program begins to run 2 Setup a HyperTerminal session on the PC to run with these parameters Port Setting Value Bits per second 9600 Data bits 8 Parity None Stop bits 1 Flow control None As a shortcut you can launch the Hyperterminal RS232 dsPICDEM2 ht file in the dsPICDEM 2 Development Kit Example Software 30F4012 folder 3 See information on LCD Note that the HyperTerminal displays the same information Adjust temp
132. select Debugger gt Run Nz O NDU l m w ws E BE dsPICDEM 2 Development Board User s Guide FIGURE 5 3 CONFIGURATION BITS WINDOW M Configuration Bits Address Category Setting Fsan0n000 Clock Switching and Monitor Su Disabled Mon Disabled Oscillator Source Primary Oscillator Primary Oscillator Mode XT w PLL 8x FSOOCE Watchdog Timer Disabled WOT Prescaler T e E WDT Prescaler B 1 16 Feooo4 Master Clear Enable Enabled FUM Output Pin Reset Control with PORT TRIS regs High side PUM Output Polarity Active High Low Side PUM Output Polarity Active High PBOR Enable Enabled Brown Out Voltage a Dv POR Timer Value Timer Disabled FSO0nDD0A General Code Segment Code Protect Disabled General Code Segment Write Protect Disabled FSDDDC Comm Channel Select Use EMUCZ and EHUDZ PGC EMUC and PGD EMUD EHUCI and EMUDI EMUC3 and EME 5 6 2 Examining the Code After the application has been reprogrammed to use the MPLAB ICD 2 as a debugger you can use MPLAB IDE to run halt and step the program You can set breakpoints to halt the program and examine the actual code at any point You can also examine the contents of the RAM and registers whenever the processor is halted Hefer to Section 2 3 Getting Started for an overview of the sample application Flowcharts illustrate each of these processes e Startup and initialization e Main loop processing e A D conversion processing e External interrupt processing The dSPIC
133. sion History DOCUMENT LAYOUT This document describes how to use dsPICDEM 2 Development Board as a develop ment tool to emulate and debug firmware on a target board The manual layout is as follows Chapter 1 Introduction This chapter introduces the dsPICDEM 2 Development Board provides a brief description of the hardware components on the board and introduces the demonstration software provided with each of the supported dsPICSOF devices Chapter 2 Getting Started This chapter describes the out of the box operation of the dsPICDEM 2 Development Board It also provides a detailed descripton of how to perform programming and in circuit debugging operations Chapter 3 Using the dsPIC30F2010 This chapter describes how to configure the dsPICDEM 2 Development Board for use with the dsPIC30F2010 Digital Signal Controller It provides suggested procedures for device programming and in circuit debugging of the dsPIC30F2010 using the sample application N un uu B ws dsPICDEM 2 Development Board User s Guide Chapter 4 Using the dsPIC30F2011 This chapter describes how to configure the dsPICDEM 2 Development Board for use with the dsPIC30F2011 Digital Signal Controller It provides suggested procedures for device programming and in circuit debugging of the dsPIC30F2011using the sample application Chapter 5 Using the dsPIC30F2012 This chapter describes how to configure the dsPICDEM 2 Development Board for use with
134. sor in the 40 pin motor control socket a power supply regulator crystal oscillators for each set of sockets an ICD header for the MPLAB ICD 2 In Circuit Debugger and both UART and CAN ports for external communication In addition the board is populated with prototyping hardware including LED indicators push button switches a potentiometer a temperature sensor and an LCD screen All pins on all the device sockets are accessible on prototyping areas Also included is the dsPICDEM 2 Development Kit CD which contains software and this User s Guide Key hardware features include Multiple sockets for 18 28 and 40 pin PDIP and SPDIP devices dsPIC30F4011 40 pin PDIP sample device installed on the board 5V regulator provides VDD and AVDD from a 9V DC power supply An LED indicates when the power is on Connector for MPLAB ICD 2 In Circuit Debugger or MPLAB ICE 4000 In Circuit Emulator HS 232 interface Controller Area Network CAN interface Temperature sensor and analog potentiometer to simulate A D inputs Pushbutton switches and LED indicators to simulate digital input and output 2x16 ASCII Character LCD with SPI interface 2x20 prototyping header area for user hardware expansion header not provided un m dsPICDEM 2 Development Board User s Guide FIGURE 1 1 dsPICDEM 2 DEVELOPMENT BOARD 000000 o 6 o e o00o0090000000090 soo 99000000000000000009 C38 E 4 C4 66000000000
135. ss EMUD1 SOSCI T2CK U1ATX CN1 RC13 PGC EMUC U1RX SDH SDA RF2 EMUC1 SOSCO T1CK U1ARX CNO RC14 PGD EMUD U1TX SDO1 SCL RF3 VDD FLTA INTO SCK1 OCFA RE8 EMUD2 OC2 IC2 INT2 RD1 EMUC2 OC1 IC1 INT1 RDO dsPIC30F3010 6 2 HIGHLIGHTS This chapter discusses e Board Setup for the dsPIC30F3010 Sample Application e Device Programming Observing the Sample Application e In Circuit Debugging e Summary 6 3 BOARD SETUP FOR THE dsPIC30F3010 SAMPLE APPLICATION The dsPICDEM 2 Development Board supports dsPIC30F devices that have multiple peripheral devices multiplexed on some pins Therefore the jumper set up of various headers depends on which of the dsPIC30F peripherals are used by the application This section demonstrates how the board is set up for the dsPIC30F3010 device to support the dsPIC30F3010 example software in the dsPICDEM 2 Development Kit CD Follow these steps to configure the hardware on the dsPICDEM 2 Development Board for the sample application 1 Disconnect the power source 2 Remove any dsPIC30Fxxxx device currently plugged into the dsPICDEM 2 Development Board un m ws I dsPICDEM 2 Development Board User s Guide 3 Plug the dsPIC30F3010 into socket U2B1 4 Configure the hardware components as shown in Table 6 1 TABLE 6 1 dsPIC30F3010 CONFIGURATION SETTINGS Component umperJe1 uei Jumper 5 VOC jumper msee Uumperja L Jumper 5 VDC jumperinstae Selector
136. sume the use of MPLAB IDE version 7 11 or newer and MPLAB C30 version 1 32 or newer A project contains the files needed to build an application source code linker script files etc along with their associations to various build tools and build options A work space contains information on the selected device debug tool and or programmer open windows and their location and other MPLAB IDE configuration settings 1 Start MPLAB IDE 2 From the File menu select Open Workspace path as shown in Figure 2 5 where path is the location of the sample application files l m w ws E MN dsPICDEM 2 Development Board User s Guide FIGURE 2 5 OPEN WORKSPACE DIALOG Bit C dsPICDEM2 Development Kit Example Software 30F4011 Microsoft Internet Explorer File Edit View Favorites Tools Help Q ee ug Y 4 A Search E Folders E Address C dsPICDEM2 Development Kit Example SoftwareY30F401 1 Folders EC dsPICDEM2 Development Kit iL Development Board User Guide with Schematics EC Example Software CI 30F2010 C3 30F2011 i 30F2012 CO 30F3010 CD 30F3011 i 30F3012 i 30F3013 CL 30F3014 30F4011 iL 30F4012 30F4013 t dsPICDEM net Development Board DTMF i evm56kw 3 Select 30F4011 Demo mcw A project and workspace is created in MPLAB IDE As shown in Figure 2 6 Demo mew is the workspace file and Demo mcp is the project file FIGURE 2 6 W MPLAB IDE v7 11 Fie Edit V
137. the dsPIC30F device to the LCD controller A pair of jumpers should be installed on H1 to connect any one of the following to the LCD 28 pin device on U2B1 40 pin device on U2A1 18 pin device on U1C1 28 40 pin device on U1A1 or U1B1 wis B I NH mmm uu Hardware The LCD Controller accesses the LCD via a 4 pin parallel port and a 3 pin control line For a detailed description of the communication protocol see Appendix B Writing to LCD The schematics for the LCD connections on the board are provided in Figure A 4 dsPICDEM 2 Development Board Schematic Sheet 3 of 7 14 1 6 CAN Port An MCP2551 Controller Area Network transceiver is provided on the dsPICDEM 2 Development Board The CAN RXD and TXD lines of the MCP2551 are connected to the C1RX and C1TX pins on the dsPIC30F device by installing a jumper on header H2 CAN bus signals CANH and CANL are available on DB9 connector J3 Three devices supported by the dsPICDEM 2 board feature a CAN module These are dsPIC30F4011 dsPIC30F4012 and dsPIC30F4013 The header H2 should have jumpers installed on the M4O option for using the CAN module on the 30F4011 device jumpers installed on the M28 option for the 30F4012 device and jumpers installed on the GP ALL option for the 30F4013 device The schematic of the CAN port is shown in Figure A 4 dsPICDEM 2 Development Board Schematic Sheet 3 of 7 14 1 7 RS 232 Port A MAX232 transceiver is provided on the
138. the dsPIC30F2010 device that were specified in MPLAB IDE The primary programming and debugging functions PGC EMUC PGD EMUD on the dsPIC30F device are multiplexed with other peripheral modules on the device used by the sample application Thus it is necessary to use an alternate pair of debugging pins EMUC1 EMUD1 EMUC2 EMUD2 or EMUC3 EMUD3 to examine the baseline code provided in the sample application 6 6 1 Setting Up MPLAB ICD 2 for Debugging To change MPLAB ICD 2 from a programmer to a debugger 1 From the Debugger menu click Select Tool MPLAB ICD 2 to designate the MPLAB ICD 2 as the debug tool in MPLAB IDE 2 From the Configure menu select Configuration Bits The Configuration Bits window displays the current configuration settings for the device as shown in Figure 6 3 3 Change the Comm Channel Select parameter to Use EMUC2 and EMUD2 On the dsPICDEM 2 board change the setting on switch S3 to turn on EMUC2 and EMUDA Remove any jumpers on headers H6 and H7 Reprogram the dsPIC30F device Debugger Program menu On the dsPICDEM 2 board turn off M ALL on switch S2 Reset the program and run it From the Debugger menu select Reset Processor Reset Then select Debugger gt Run Nz O NDU l m w ws E a R dsPICDEM 2 Development Board User s Guide FIGURE 6 3 CONFIGURATION BITS WINDOW M Configuration Bits Address Category Setting Fsan0n000 Clock Switching and Monitor Su Disabled Mon Disab
139. tion e Main loop processing e A D conversion processing e External interrupt processing The dsPICDEM 2 Development Kit Example Software 30F2010 folder contains fully annotated code files that you can examine compare and copy 3 7 SUMMARY This chapter has provided specific instructions for using the dsPICDEM 2 Development Board with a dsPIC30F2010 device If you have reviewed this process you should be able to e Configure the dsPICDEM 2 Development Board for the dsPIC30F2010 device Set up MPLAB IDE to use the MPLAB ICD 2 In Circuit Debugger e Locate the sample application for the dsPIC30F2010 device e Program the chip with the MPLAB ICD 2 e Examine the sample application and identify applicable code for your embedded solution w B D ana dsPICDEM 2 DEVELOPMENT BOARD MICROCHIP USER S GUIDE n up S Cet 4 1 INTRODUCTION This chapter assumes you have chosen the dsPIC30F2011 for your application The dsPICDEM 2 Development Board supports a dsPIC30F2011 device in an 18 pin PDIP package as shown in Figure 4 1 This device provides eight 12 bit A D 100 ksps channels a UART an SPI module an IC module and 12 I O pins A sample applica tion program provides a software baseline for building your own embedded solution FIGURE 4 1 18 PIN PDIP dsPIC30F2011 AVDD AVSS ANG SCK1 INTO OCFA RB6 EMUD2 AN7 OC2 IC2 INT2 RB7 VDD Vos PGC EMUC AN5 U1RX SDI1 SDA CN7 RB5 PGD EMUD AN4 U1TX SDO
140. tor pg ss OFF Notuseditisconfguson Selector pu Je OFF Notused in tris configuration emus Jm Open Nojumpercomectons CANT He on CAN x He Om uanrite us ow anime Me Open Atemate VARTI Sun GP ALL 8 EMUDVSOSCIITZCKUTATXCNTIRCIS Atemate VARTI Px Ha GPALL 9 EMUCIJSOSCO TICKUTARXICNUIRCIA ummme Je Om UmmRe Je Open Switch S6 GP 18 EMUC2 OC1 IC1 INT1 RDO pem LCD SPI M Clock GP 18 ANG SCK1 INTO OCFA RB6 LCD SPI Data GP18 PGD EMUD AN4 U1TX SDO1 SCL CN6 RB4 On this device multiplexing of various peripherals on the pins does not allow the simultaneous use of Switch S5 and LCD Primary UART1 pins and LCD Since only one DB 9 connector is provided for RS 232 communication you can select either UART1 primary or alternate pins or UART2 but not both 5 Connect the RS 232 cable from the PC to the UART connector J2 Reapply power to the DC IN connector J4 The PWR ON LED should illuminate 7 Load the sample application program for the dsPIC30F2011 see Section 4 4 Device Programming D wis E I NH mmm uu Using the dsPIC30F201 1 4 4 DEVICE PROGRAMMING Load the sample application program for the dsPIC30F2011 using this process 1 2 3 Plug the RJ11 telephone cable from the MPLAB ICD 2 into the ICD header
141. with a dsPIC30F3010 device If you have reviewed this process you should be able to e Configure the dsPICDEM 2 Development Board for the dsPIC30F3010 device Set up MPLAB IDE to use the MPLAB ICD 2 In Circuit Debugger e Locate the sample application for the dsPIC30F3010 device e Program the chip with the MPLAB ICD 2 e Examine the sample application and identify applicable code for your embedded solution w E I D ana dsPICDEM 2 DEVELOPMENT BOARD MICROCHIP USER S GUIDE P n up ROUER 7 1 INTRODUCTION This chapter assumes you have chosen the dsPIC30F3011 for your application The dsPICDEM 2 Development Board supports a dsPIC30F3011 device in a 40 pin PDIP package as shown in Figure 7 1 This device provides nine 10 bit A D 500 ksps channels two UARTs an SPI module an PC module and 30 I O pins A sample application program provides a software baseline for building your own embedded solution FIGURE 7 1 40 PIN PDIP dsPIC30F3011 MCLR x 2 AVDD EMUD3 ANO VREF CN2 RBO AVss EMUC3 AN1 VREF CN3 RB1 PWM1L REO AN2 SS1 CN4 RB2 PWM1H RE1 AN3 INDX CN5 RB3 PWM2L RE2 AN4 QEA IC7 CN6 RB4 PWM2H RE3 AN5 QEB IC8 CN7 RB5 PWM3L RE4 AN6 OCFA RB6 AN7 RB7 AN8 RB8 VDD Vss PWM3H RE5 VDD OSC1 CLKIN OSC2 CLKO RC15 EMUD1 SOSCI T2CK U1ATX CN1 RC13 U2RX CN17 RF4 U2TX CN18 RF5 PGC EMUC U1RX SDI1 SDA RF2 EMUC1 SOSCO T1CK U1ARX CNO RC14 PGD EMUD U1TX SDO1 SCL RF3 FLTA INTO RE8 SCK1 RF6 EMUD2 OC2 IC2
Download Pdf Manuals
Related Search
Related Contents
Copyright © All rights reserved.
Failed to retrieve file