dsPICDEM™ 80-Pin Starter Development Board User’s Guide © 2006 Microchip Technology Inc.
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.
dsPICDEM™ 80-PIN STARTER DEVELOPMENT BOARD USER’S GUIDE Table of Contents Preface ........................................................................................................................... 1 Introduction............................................................................................................ 1 Document Layout .................................................................................................. 1 Conventions Used in this Guide ................................
dsPICDEM™ 80-Pin Starter Development Board User’s Guide Appendix A. Drawings and Schematics A.1 dsPICDEM 80-Pin Starter Development Board Layout ............................... 37 A.2 dsPICDEM 80-Pin Starter Development Board Schematic ......................... 38 Index .............................................................................................................................43 Worldwide Sales and Service ....................................................................................
dsPICDEM™ 80-PIN STARTER DEVELOPMENT BOARD USER’S GUIDE Preface NOTICE TO CUSTOMERS All documentation becomes dated, and this manual is no exception. Microchip tools and documentation are constantly evolving to meet customer needs, so some actual dialogs and/or tool descriptions may differ from those in this document. Please refer to our web site (www.microchip.com) to obtain the latest documentation available. Documents are identified with a “DS” number.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide CONVENTIONS USED IN THIS GUIDE This manual uses these documentation conventions: DOCUMENTATION CONVENTIONS Description Represents Examples Arial font: Italic characters Initial caps Quotes Underlined, italic text with right angle bracket Bold characters N‘Rnnnn Text in angle brackets < > Courier font: Plain Courier Referenced books Emphasized text A window A dialog A menu selection A field name in a window or dialog A menu path MPLAB® IDE User’s
Preface 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 on the Microchip web site (www.microchip.com). RECOMMENDED READING This user's guide describes how to use the dsPICDEM 80-Pin Starter Development Board.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide PIC24FJ128GA Family Device Data Sheet (DS39474) Consult this document for detailed information on the PIC24FJ128GA 16-bit MCU.
Preface 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.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide CUSTOMER SUPPORT Users of Microchip products can receive assistance through several channels: • • • • Distributor or Representative Local Sales Office Field Application Engineer (FAE) Technical Support Customers should contact their distributor, representative or field application engineer (FAE) for support. Local sales offices are also available to help customers. A listing of sales offices and locations is included in the back of this document.
dsPICDEM™ 80-PIN STARTER DEVELOPMENT BOARD USER’S GUIDE Chapter 1. Introduction 1.1 INTRODUCTION The dsPICDEM 80-Pin Starter Development Board is a development kit and evaluation tool for dsPIC high-performance DSCs and PIC24 MCUs. Note: 1.2 The term dsPIC DSC used throughout this manual refers to both the dsPIC30F and dsPIC33F device families. Unless specified otherwise, these devices can be used interchangeably. Similarly, the term PIC24 MCU refers to both the PIC24F and PIC24H device families.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide FIGURE 1-1: dsPICDEM™ 80-PIN STARTER DEVELOPMENT BOARD FIGURE 1-2: TYPICAL PLUG-IN MODULE (PIM) For information on the components used on the dsPICDEM 80-Pin Starter Development Board see Chapter 4. “dsPICDEM™ Development Board Hardware”. DS51584B-page 8 © 2006 Microchip Technology Inc.
Introduction 1.4 FUNCTIONALITY AND FEATURES The dsPICDEM 80-Pin Starter Development Board provides the following capabilities: Development Board Power • On-board variable voltage regulator for 3.3V and 5.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide 1.
dsPICDEM™ 80-PIN STARTER DEVELOPMENT BOARD USER’S GUIDE Chapter 2. Tutorial 2.1 INTRODUCTION This chapter is a self-paced tutorial to get you started using the dsPICDEM 80-Pin Starter Development Board. 2.2 HIGHLIGHTS Items discussed in this chapter include: • • • • • • 2.3 Tutorial Overview Creating the Project Building the Code Programming the Chip Debugging the Code Summary TUTORIAL OVERVIEW The tutorial program in Eg1_BlinkLed.s is written in assembly code.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide 2.4 CREATING THE PROJECT The first step is to create a project and a workspace in MPLAB IDE. Typically, there is one project in one workspace. Note: These instructions presume the use of MPLAB 7.20 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.
Tutorial FIGURE 2-2: 2.4.2 PROJECT WIZARD, STEP 2, SELECT LANGUAGE TOOLSUITE Select Language Toolsuite 1. From the Active Toolsuite pull-down menu, select Microchip ASM30 Toolsuite. This toolsuite includes the assembler and linker that will be used (the C compiler is not used). 2. In the Toolsuite Contents block, select MPLAB ASM 30 Assembler (pic30-as.exe). 3. In the Location block, click Browse... and navigate to: C:\Program Files\Microchip\MPLAB ASM30 Suite\Bin\pic30-as.exe 4.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide FIGURE 2-3: 2.4.3 PROJECT WIZARD, STEP 3, NAME YOUR PROJECT Name Your Project 1. In the Project Name text box, type MyProject. 2. Click Browse... and navigate to C:\Tutorial to place your project in the Tutorial folder. 3. Click Next > to continue. The Project Wizard Step Four dialog displays (see Figure 2-4). FIGURE 2-4: DS51584B-page 14 PROJECT WIZARD, STEP 4, ADD FILES TO PROJECT © 2006 Microchip Technology Inc.
Tutorial 2.4.4 Add Files to Project 1. From the list of folders on the PC, locate the C:\Tutorial folder and select the Eg1_BlinkLed.s file. 2. Click Add>> to include the file in the project. 3. Expand the C:\Program Files\Microchip\MPLAB ASM30 Suite\Support\gld folder and select the p30f6014a.gld file. 4. Click Add>> to include this file in the project. There should now be two files in the project. 5. Click Next > to continue. 6. When the summary screen displays, click Finish.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide 2.5 BUILDING THE CODE In this project, building the code consists of assembling the Eg1_BlinkLed.s file to create an object file Eg1_BlinkLed.o and then linking the object file to create the Eg1_BlinkLed.hex and Eg1_BlinkLed.cof output files. The HEX file contains the data necessary to program the device, and the .cof file contains additional information that lets you debug the code at the source code level.
Tutorial 2.5.1 Identify Assembler Include Path 1. Select the General tab. 2. At the Assembler Include Path, $(AINDIR):box, click Browse... and navigate to: C:\Program Files\Microchip\MPLAB ASM30 Suite\Support\inc This path tells MPLAB IDE where to find the include files. 3. Select the MPLAB LINK30 tab to view the linker settings (see Figure 2-8). FIGURE 2-8: MPLAB® LINK30 BUILD OPTIONS Check Link for ICD2 2.5.2 Link for MPLAB ICD 2 1. Check Link for ICD 2. 2. Click OK.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide 2.5.3 Build the Project 1. From the Project menu, select Make. The Build Output window displays. 2. Observe the progress of the build. 3. When the BUILD SUCCEEDED message displays (see Figure 2-9), you are ready to program the device. FIGURE 2-9: DS51584B-page 18 BUILD OUTPUT © 2006 Microchip Technology Inc.
Tutorial 2.6 PROGRAMMING THE CHIP The MPLAB ICD 2 In-Circuit Debugger is used to program and debug the dsPIC30F6014A device in-circuit on the dsPICDEM 80-Pin Starter Development Board. Note: Before proceeding, make sure that the USB driver for the MPLAB ICD 2 has been installed on the PC (see the “MPLAB® ICD 2 In-Circuit Debugger User’s Guide” (DS51331) for more details regarding the installation of the MPLAB ICD 2). Use the procedures in the following section to program the dsPIC30F6014A device. 2.6.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide FIGURE 2-11: 2.6.3 TYPICAL dsPIC® DSC DEVELOPMENT BOARD CONNECTED TO MPLAB® ICD 2 Enable MPLAB ICD 2 Connection 1. From the Debugger menu, click Select Tool>MPLAB ICD 2 to set the MPLAB ICD 2 as the debug tool in MPLAB IDE. 2. From the Debugger menu, select Connect to connect the debugger to the device. MPLAB IDE should report that it found the dsPIC30F6014A device, as shown in Figure 2-12.
Tutorial 2.6.4 Program the dsPIC30F6014A Device 1. From the Debugger menu, select Program to program the part. The output window (Figure 2-13) displays the program steps as they occur. 2. Observe the results of the programming. When “MPLAB ICD 2 Ready” displays, the device is programmed and ready to run. FIGURE 2-13: PROGRAMMING THE dsPIC® DSC DEVICE 3. Use the Debugger>Run menu to run the code. LED1 should start blinking when S1 is pressed. © 2006 Microchip Technology Inc.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide 2.7 DEBUGGING THE CODE The MPLAB ICD 2 In-Circuit Debugger is used to run, halt and step the code. A breakpoint can be set so that the program halts once the code has executed the instruction at the breakpoint. The contents of the RAM and registers can be viewed whenever the processor has been halted.
Tutorial 2.7.2 Step the Program 1. Press to single step the code. The green arrow moves to the code at __reset in the Eg1_BlinkLed.s source code, as shown in Figure 2-15. FIGURE 2-15: SOURCE CODE WINDOW 2. Right click the line of code mov W0,W14 and choose Run to Cursor. The green arrow moves to repeat #12 because it has executed the prior lines of code up to and including mov W0,W14. 3. From the View menu, select Watch to open a Watch window, and select RCOUNT in the Add SFR pull-down list. 4.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide 2.7.3 Set Breakpoint 1. To set a breakpoint, right click a code line and select Set Breakpoint from the pop-up menu. Note: An alternate method is to simply double click the line. This feature may need to be enabled in the Edit>Properties menu. As an example, find the following line of code and set a breakpoint on this line: Again: btss PORTA,#S1 A red stop sign should appear in the gutter (gray bar on the left) of the source code window. 2.
dsPICDEM™ 80-PIN STARTER DEVELOPMENT BOARD USER’S GUIDE Chapter 3. Demonstration Program Operation 3.1 INTRODUCTION The dsPICDEM 80-Pin Starter Development Board is shipped with example applications programmed into the dsPIC DSC device. These examples exercise several of the dsPIC DSC peripherals such as the 12-bit Analog-to-Digital Converter (ADC) and UART interfaces. This chapter provides an overview of the demonstration code.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide The dsPIC DSC device functionality used in this demonstration program includes: • Setting up I/O ports • Setting up timer interrupts • Handling interrupts To observe this demonstration, close jumper J4 to enable the LEDs, then operate the switches. 3.3.
Demonstration Program Operation 3.4 DEMONSTRATION CODE OPERATION The following sections describe in more detail how the demonstration programs interact with and take advantage of key dsPIC DSC, DSP and peripheral features. Full details on the peripheral functionality and associated tasks are presented later in this document. 3.4.1 Interrupt Processing The demonstration code samples switches S1 and S2 and uses their status to operate the LEDs associated with processor ports RD4 and RD5, respectively.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide 3.4.2 Analog-to-Digital Conversion This program consists of two subroutines which (1) perform the A/D conversion and (2) transmit the converted value over an RS-232 serial connection (see Figure 3-2). The A/D conversion routine samples the analog output of Potentiometer RB2.
Demonstration Program Operation 3.4.3 Digital-to-Analog Conversion This program uses Digital Potentiometer MCP41010 on the dsPICDEM 80-Pin Starter Development Board as a D/A converter to generate a sine-wave signal (audio tone) to the LINE OUT pin. The digital potentiometer is driven by the output of the serial peripheral interface SPI2 of the dsPIC30F6014A device, which receives its input from the program. The program retrieves HEX values from a table in data memory and delivers it to the SPI.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide 3.5 BOARD SELF-TEST The board self-test is provided for completeness only. Users do not need to run this test. 1. Power the board using a 9V DC supply and the barrel power connector. The LED marked D1 turns ON. If D1 does not light: - the LED is dead, or - the regulator is dead, or - the DC supply is not connected to the AC wall plug 2. Using a DMM set for DCV, check that 3.3V or 5.0V is available at location marked VDD and GND on the 80-pin header.
Demonstration Program Operation If any of these tests fail, then at the end of the Tone test the LED corresponding to the failed test will blink slowly (2 blinks/sec). For example, if RD4 blinks, it means that the UART test failed.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide NOTES: DS51584B-page 32 © 2006 Microchip Technology Inc.
dsPICDEM™ 80-PIN STARTER DEVELOPMENT BOARD USER’S GUIDE Chapter 4. dsPICDEM™ Development Board Hardware 4.1 HARDWARE OVERVIEW This chapter describes the dsPICDEM 80-Pin Starter Development Board hardware.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide 4.1.1 RS-232 Serial Port One RS-232 serial communication channel is provided on the board. This channel is labeled J1. The dsPIC DSC or PIC24 MCU UART channel 1 U1RX and U1TX pins are connected to an RS-232 level shifting MAX3232CD (U3), as shown in Figure A-3. The serial port is configured as DCE and can be connected to a PC using a straight through cable. 4.1.
dsPICDEM™ Development Board Hardware 4.1.10 Power Supply The power supply furnishes +5V or +3.3V for the board (see the schematic in Figure A-4). Source power is provided by a +9V, AC/DC wall adapter through Diode Bridge CR1. An LM317 voltage regulator provides power (VDD and AVDD) to the respective processor pins and prototyping area. A ground trace connects all VSS points. 4.1.11 Power-on Indicator A red LED (D1) indicates the presence of power (see Figure A-4). 4.1.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide FIGURE 4-2: ADAPTER BOARD PLUGS INTO HEADER ON MAIN BOARD Align Corners of PIM and Header P1 DS51584B-page 36 Plug-in Module (PIM) © 2006 Microchip Technology Inc.
dsPICDEM™ 80-PIN STARTER DEVELOPMENT BOARD USER’S GUIDE Appendix A. Drawings and Schematics A.1 dsPICDEM 80-PIN STARTER DEVELOPMENT BOARD LAYOUT Figure A-1 shows the parts layout for the dsPICDEM 80-Pin Starter Development Board. FIGURE A-1: © 2006 Microchip Technology Inc.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide A.2 dsPICDEM 80-PIN STARTER DEVELOPMENT BOARD SCHEMATIC Figure A-2 provides a schematic diagram of the dsPICDEM 80-Pin Starter Development Board.
© 2006 Microchip Technology Inc.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide +5VAN μF VDD μ +5VAN dsPICDEM™ 80-PIN STARTER DEVELOPMENT BOARD SCHEMATIC (SHEET 3 OF 5) μ FIGURE A-4: VDD μ VDD μ VDD VDD μ μ RC13 RC14 VDD OSC1 OSCILLATORS OSC1 OSC2 POWER SUPPLY μ DS51584B-page 40 © 2006 Microchip Technology Inc.
RG13 RG14 RA6 RG1 RF0 GND RD6 RD4 RD12 RD2 RC14 RD0 RD10 RD8 RA14 VDD VDD RG3 RF7 RF2 RF5 RD15 RB15 RB13 VDD RB11 RB9 AGND RA10 RB7 RB0 RB2 RB4 RA13 VDD RG9 RG8 RG6 RC3 RC1 I/O HEADER RG12 RA7 RG0 RF1 VDD RD7 RD5 RD13 RD3 RD1 RC13 RD11 RD9 RA15 GND GND RG2 RF6 RF8 RF3 RF4 RD14 RB14 RB12 GND RB10 RB8 +5VAN RA9 RB6 RB1 RB3 RB5 RA12 GND MCLR RG7 RC4 RC2 RG15 © 2006 Microchip Technology Inc.
dsPICDEM™ 80-Pin Starter Development Board User’s Guide RB3 RG9 RG6 RG8 POT POT LINE_OUT LINE_IN +5VAN LOW-PASS FILTER +5VAN +5VAN LINE_OUT VDD RB2 DD DIGITAL POTENTIOMETER dsPICDEM™ 80-PIN STARTER DEVELOPMENT BOARD SCHEMATIC (SHEET 5 OF 5) +5VAN ANALOG POTENTIOMETER FIGURE A-6: DS51584B-page 42 © 2006 Microchip Technology Inc.
dsPICDEM™ 80-PIN STARTER DEVELOPMENT BOARD USER’S GUIDE Index A F A/D Conversion Demo Program............................... 28 A/D Conversion Flow Diagram................................. 28 Analog Features......................................................... 9 Analog Potentiometer .............................................. 34 Assembler Include Path ........................................... 17 Flow Diagram Analog-to-Digital Conversion ............................ 28 Interrupt Processing......
dsPICDEM™ 80-Pin Starter Development Board User’s Guide R Reading, Recommended............................................ 3 Readme...................................................................... 3 Reference Documents.............................................. 10 Reset Switch ............................................................ 35 RS-232 Serial Port ................................................... 34 S Sample Device .........................................................
Index NOTES: © 2006 Microchip Technology Inc.
WORLDWIDE SALES AND SERVICE AMERICAS ASIA/PACIFIC ASIA/PACIFIC EUROPE 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.