Home
Datasheet - Mouser Electronics
Contents
1. Library Files E Linker Scripts p30f6014 finclude p3OF6014 h Other Files finclude LCD Display h Constants fdefine Fcy 7372800 Define processor speed instructio define LEDZ LATCbits LATC3S const char LCD_Linel dsPICDEM net const char LCD Line2 k Tutorial DE x gt T emo in cots Wa DS51471A page 18 2004 Microchip Technology Inc Tutorial 25 BUILDING THE CODE In this project the code is built in two stages as shown in Figure 2 9 First the source files are compiled into object files then the object files are linked FIGURE 2 9 CODE BUILDING PROCESS dsPICDEM net Tutorial c LCD display c delay c Compile STAGEONE Compile STAGEONE Compile COMPILE COMPILE dsPICDEM net Tutorial o LCD display o delay o STAGE TWO Link LINK MyTutorial cof MyTutorial hex The MyTutorial hex output file contains the data necessary to program the device The MyTutorial cof output file contains additional information that lets you debug the code at the source code level Before building there are compiler and linker settings that must be specified These settings indicate where to find the C library files and where to reserve space for the extra debug code when the MPLAB ICD 2 In Circuit Debugger is used 2 5 1 Set Project Build Option
2. Enter up to 16 characters in the box select update and Press the LEDs button to flash the dsPICDEM net board observe the dsPICDEM net board LCD LEDs mmn LEDs Update JAVA APPLET Turn RP1 and RP2 potentiometers press switches S1 S2 and S3 or touch temperature sensor U2 on the dsPICDEM net board and see the results below RP1 RP2 Temperature 1 2 3 2 14 Y 0 7 V 298 2 C Off Off off Copyright CMX Systems Inc 2003 All rights reserved If you encounter a connection problem refer to Section 4 8 Troubleshooting DS51471A page 54 2004 Microchip Technology Inc HTTP Web Server Demonstration 4 6 3 Monitor the dsPICDEM net Development Board This demonstration shows how you might monitor devices used in your embedded application program over an Ethernet connection or over the internet In this portion of the demonstration you will monitor the voltage on potentiometers RP1 and RP2 the temperature on sensor U12 and the status of switches S1 S2 and S3 see Figure 4 8 1 On the dsPICDEM net board adjust potentiometers RP1 and RP2 Observe the associated voltage value changing on the web page 2 Touchtemperature sensor U2 and monitor the temperature displayed on the web page 3 Press switches S1 S3 and observe the switch indicators on the web page change between Off red and On green FIGURE 4 8 MONITORED DEVICES liz uci wef lr arr res ei TEM
3. 58 Tutorial os saat lost een te theta 13 31 U VART EE 8 Ww Warranty Registration 2 Web Page Web Server Demonstration 54 Web Server Demonstration LCD Display 53 OVGIVIBW sedi tenter EE anie 49 Web Page nee etes 54 Workapnace nae 13 32 WWW Address A A DS51471A page 108 2004 Microchip Technology Inc Index NOTES 2004 Microchip Technology Inc DS51471A page 109 MICROCHIP WORLDWIDE SALES AND SERVICE AMERICAS Corporate Office 2355 West Chandler Blvd Chandler AZ 85224 6199 Tel 480 792 7200 Fax 480 792 7277 Technical Support 480 792 7627 Web Address www microchip com Atlanta 3780 Mansell Road Suite 130 Alpharetta GA 30022 Tel 770 640 0034 Fax 770 640 0307 Boston 2 Lan Drive Suite 120 Westford MA 01886 Tel 978 692 3848 Fax 978 692 3821 Chicago 333 Pierce Road Suite 180 Itasca IL 60143 Tel 630 285 0071 Fax 630 285 0075 Dallas 4570 Westgrove Drive Suite 160 Addison TX 75001 Tel 972 818 7423 Fax 972 818 2924 Detroit Tri Atria Office Building 32255 Northwestern Highway Suite 190 Farmington Hills MI 48334 Tel 248 538 2250 Fax 248 538 2260 Kokomo 2767 S Albright Road Kokomo IN 46902 Tel 765 864 8360 Fax 765 864 8387 Los Angeles 18201 Von Karman Suite 1090 Irvine CA 92612 Tel 949 263 1888 Fax 949 263 1338 San Jose 13
4. E DS51471A page 28 2004 Microchip Technology Inc Tutorial FIGURE 2 23 PROGRAM HALTED AT CURSOR LOCATION Green arrow shows Bil C Tutorial dsPICDEMnet Tutorial c Inl x where program halts TRISC OxFFE3 Set LED pins as outputs T1CON 0 ff Turn off Timerl by clearing co TMRl 0 Start Timerl at zero PRL Fey 512 Load Timerl period register fo T1CON 0x8030 Load Timerl settings for 1 256 Init LCD Initialize LCD home clr Clear screen and home cursor Puts LCD i char 5LCD Linel 0 sizeof LCD_Linel 1 line 21 Go to line Z of the display Puts_LCD char 5LCD Line2 0 sizeof LCD Line2 1 while 1 Loop forever ifi IFSObits TlIF Check for Timerl timeout 1 IFSObits TlIF 0 Clear Timerl interrupt flag LEDZ LEDZ ff Toggle LEDZ X L 4 From the View menu select Watch to open a Watch Window 5 Select PR1 from the SFR pull down list then click Add SFR The PR1 register is added to the Watch Window as shown in Figure 2 24 6 Press lt F7 gt twice Watch the PR1 value change to 0x3840 as the green arrow moves to PR1 Fcy 512 in the code window FIGURE 2 24 WATCH WINDOW DISPLAY FI ACCA DI Add Symbol bss Address Symbol Name value Dx0000000000 0102 Wach Watch 2 Watch 3 Watch 4 2 7 3 Set Breakpoint 1 Toseta breakpoint right click a line and select Set Breakpoint fr
5. wwwwwwmmmmwamwamamaniwiinkanananinaniwinww 8 1 5 dsPICDEM net Board Functionality 8 1 6 dsPICDEM net Demonstration Programs sess 10 1 7 Reference Documents nuna waaina annann nennen nennen nnee eee 11 Chapter 2 Tutorial Ke LA ele Ee Le BEE 13 2 2 ein le LEE 13 23 Tutorial ee 13 2 4 Creating the Project na nuna nina kunani 13 2 5 Building ee EE 19 2 6 Device Configuration and Programming esssssssesseseeceeeeeeeeeeeeeeeeeess 22 2 7 Debugging the Code 27 EE Tunn Tu EE 30 Chapter 3 Quick Start Program 2 T Introduction EE 31 3 2 Highliglits ir uuu paqu e cadcm E nee 31 3 3 Quick Start Program Overview E 31 3 4 Creating the Project u 32 23 5 Building the Code EE 38 3 6 Device Configuration and Programming 40 3 7 Interacting with the Code u 45 3 8 Quick Start Demonstration Features and Peripherals 45 3 9 Data and Control Flow ii aa aa kikahawia 46 3 10 SUMMARY E 48 Chapter 4 HTTP Web Server Demonstration 2 4 Introd ctlon it Hie t Aina 49 ls elle Lu 49 4 3 Demonstration Overview 49 4 4 Demonstration Setup w w emema
6. 49 OVER SW iine diete tae ee e Re dE 61 P G Packet Sniffers AA 57 GNU Language Tools ssssneeeseennneeseeennnneesrrrrneeenee 4 Power Supply tee ke e rex 8 H Project idus ovde oi diee 13 32 Project Wizard 13 32 Hardware Board Components Prototyping Header 10 Analog Potentiometer Input aa 89 PTSN E nn m e Ee 9 2004 Microchip Technology Inc DS51471A page 107 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide Push Button EE EN Pushbutton Gwitches 10 R Recommended Reading 3 Reference Documents 11 Reset SW Su Ru eere ed 10 RJ 45 10 Base T Connector 9 RS 232 Connection 8 RS 422 Connection 8 RS 485 Connection 8 s Serial EE Memory 10 Si3021 Reset Switch 9 Si3034 DAA AFE Chipset 9 Si3035 DAA AFE Chipset 9 T Temperature Sensor ccccccceceeeeeteeeeeeeeeteeeeeeees 88 Thermal Sensor U 12 9 Troubleshooting Web Server Demonstration
7. ON Sa W3d2Igds9 Jua DO I FeU WAdIIdSP I dIH20821U ONT ONIUIOUJONUL 3 9NIJH33NION3 Q3IdJISu3nIGd ISI Slubd NOLLYOI Ide ASSH 1M3N S NOLId1U0830 UO ON 9NIAJIINSOl ON 0 Lydd Wasi angscht NOlldIH2S30 SNOISIn3H nuqisu MOI Sch HdQU3H JdALOLOYd 9d 29d SI B10Z Td OS 4 1094 2H 320 Bas 3G 23H Sat XL GOXL ND GO IQu TIQu 694 AO GO Qu LO NI 13 D 12 EU zaji TIH lNI 2UH eS EU a 1994 33 as ER 00 AIS bay xu QXH NU2 k Iqu 7104 2004 Microchip Technology Inc DS51471A page 96 Hardware Schematics dsPICDEM net DEVELOPMENT BOARD SCHEMATIC SHEET 3 OF 11 FIGURE A 4 I 8 JO ae lt OlIkIl WE 62910 E on ang NOLLYII Ida ON WIS Qut JOH DO Z 39u u3a33IdSP QquuUOg OWJA Feu 3931d gt P d1H20H21U ONT SNIHDI2UJ QNBH S SNIWH3JNISN3 da jISudnid ISI T SIHDd NOLIGDIJIO3dS ICE NOT13143530 40 ON 9N1A3ILN3Q1 318 12NGHON YA lud n 208d42H i osnovao aso SNOISIn3H DS51471A page 97 2004 Microchip Technology Inc PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide dsPICDEM net DEVELOPMENT BOARD SCHEMATIC SHEET 4 OF 11 FIGURE A 5 5 zn
8. Dnnn Dial Dials a telephone number and attempts to connect The dial command must be the last command on the line To cancel the Dial command press any key To dial 5588257 type ATD5588257 Local Loop Back Modem Starts Local loop back On Enter Connect State and Retrain O0 Leave online command mode and return to online data mode O1 Issues the retrain command 2004 Microchip Technology Inc DS51471A page 79 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide TABLE 6 2 AT COMMAND SET FOR dsPIC30F SOFT MODEM CONTINUED Command Description Wn Negotiation Progress Message Control WO CONNECT result code reports DTE speed disable the display of all extended result codes W1 CONNECT result code reports DTE speed enable the display of CARRIER and PROTOCOL extended codes only W2 CONNECT result code reports DCE speed disable the display of all the extended result codes Xn Dial Tone And Busy Tone Detection X0 Busy detect and dial tone detect disabled X1 Busy detect and dial tone detect disabled X2 Busy detect disabled and dial tone detect enabled X3 Busy detect enabled and dial tone detect disabled X4 Busy detect and dial tone detect enabled amp F amp Kn Modem Reset Restore settings to defaults Modem reset Modem Flow Control This command determines how the flow control between the comp
9. FIGURE 2 3 PROJECT WIZARD STEP 2 SELECT LANGUAGE TOOLSUITE Project Wizard 1 x Step Two B Select a language toolsuite Microchip C30 Toolsuite Select Microchip C30 Toolsuite Active Toolsuite Toolsuite Contents MPLAB ASM Saaana pic30 as eke Specify file locations for Assembler Compiler and Object Linker ompiler pic30 qcc exe MPLAB LINK30 Object Linker pic30 Id exe Location C pic30_tools bin pic30 gec ene Help My Suite Isn t Listed Show all installed toolsuites lt Back Next gt Cancel Help 2 4 2 Select Language Toolsuite 1 From the Active Toolsuite pull down menu select Microchip C30 Toolsuite This toolsuite includes the compiler assembler and linker that will be used 2 From Toolsuite Contents select MPLAB ASM 30 Assembler pic30 as exe 3 In the Location group click Browse and navigate to C pic30 tools Bin pic30 as exe Note Cis the drive implemented for this tutorial example The specific location on your system will depend on where you installed the MPLAB C30 compiler If you haven t purchased the MPLAB C30 compiler you can download a full featured 60 day trial version from the Microchip web site www microchip com Follow the download links under Products Development Tools Software 4 From Toolsuite Contents select MPLAB C30 Compiler pic30 gcc exe 5 Inthe Location block click Browse and navigate
10. 2004 Microchip Technology Inc DS51471A page 9 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide Miscellaneous Reset push button switch Three red LEDs LED1 LED3 Three push button switches S1 S3 for external input stimulus 64k x 16 External SRAM Microchip 24LC515 Serial EE memory device 2x 16 character LCD 2x 50 prototyping header for user hardware expansion header not installed Prototype area for user hardware 1 6 dsPICDEM net DEMONSTRATION PROGRAMS The dsPICDEM net Development Board is supplied with several sample application programs for the dsPIC30F6014 to help you jump start your own solutions You will need the MPLAB C30 Compiler to program these applications into the dsPIC30F device You can download a full featured 60 day trial version of MPLAB C30 from the Microchip web site www microchip com Follow the download links under Products Development Tools Software Source code is provided on the Development Kit Software CD for all these demonstration programs D Tutorial The tutorial introduces the new user to the basic skills needed to work with the dsPIC30F It provides step by step instructions for programming the dsPIC30F chip with the MPLAB IDE and MPLAB C30 and debugging the program with the MPLAB ICD 2 See Chapter 2 Tutorial dsPIC30F Quick Start Building on the tutorial the dcPIC30F demonstration uses a sample application to illustrate functiona
11. NOI1dIH2830 SNOISIn3H 1321 18d Ind ER 08d and gud MEIN gan OS S2 VIGO nes AOT Ad z8 ESH 2004 Microchip Technology Inc DS51471A page 102 AO 8 sms Olei em 62910 E0 on od J ON W9S3 3215 00000 OH3d Z 1i9uU qHUO8 OWSd T ieu 3qQ31dSp 3431dSP dIH2O0U2IH ganssr 03x23H2 CO7v v SSOY wua Sonne ONT SONTYNLIYSNNEW 9 SNIS33NION3 93 jISudnId EA Sidi DNIMYHC 3799S LON OQ NOLLUOI Iddi NO Q3sn ASSY LM3N HSINI E S370NY S UWI33Q SNOILOUMJ i SUB S3ONUH3 101 S3HONI Ni 399 SNDISN3HIG 10 S831Nn DS51471A page 103 NOIIdIU2S30 H ON SNIAJIIN3QI ON a3 Hardware Schematics dsPICDEM net DEVELOPMENT BOARD SCHEMATIC SHEET 9 OF 11 FIGURE A 10 NOI1U21412348 K EN 3UNLYTINIHON G3noudau DEIER SNOISIn3u EO led WISi AID be ZI ZaN9 TINO 6t ev SIorI 8TSTUS Wil STETUS SIN 8ZtT1US 21071 TZZTUS UTOZI vc 18S ATOT SCOTUS Bet Sz 6US Bod ZZ 8US ect Z 2US S071 5 S071 ty 90S 071 071 ZO 1 T071 8071 812012243 ZIJN TIIN E T e WE b8 38 b de D9 ag bs as Db db bE D az DI 30 2S19Hr2 In DG as o2 q 069 q9 bs as ob Qr bob o oz a DI dI 20 31 2S19Hr2 zin e x
12. g calvil CH gansst G2910 EO on ang on uos 327s an QHUO8 OH3d Z 1ieu u3q3IdSP EES QH8O8 OWSd 1 3294 W3431d45P Hu dIHJOHOIN S MCHacH ONT TONTENLOUANNUW 9 SNIS33NION3 93131543n149 LST edd SNIMEEQ 31595 LON OQ NOTLYOI Teds NOIIUDIJIO3dS 20143 Lew 3um1u T N3H0N NOTLdTHOS30_ HO ON 9NIA3IIN3OI WO lUud WSs ALD 4901 aduewsosued suotsstwa pazerpes panosdut 404 p p u 41 4 UO 419 II 1SUI a T et 9002084 Naap 7 PI wuogI TSH A Y ER T 13534 IZOEIS lSHTIZOE 4534 1994 1098724 REEI Iqs 1995487933 oas EAR INAS A Od S23 1059 AISI TOW JNASd nS QN9 ON TZ EIS an aanouadu NOLIdIS2S30 pose SNOISIn3H 1no n ZHWEGT 8 8n mM KR 2004 Microchip Technology Inc DS51471A page 98 Hardware Schematics dsPICDEM net DEVELOPMENT BOARD SCHEMATIC SHEET 5 OF 11 FIGURE A 6 JO S as ONIMMHQ 37495 LON OQ NOLLYII Ides a calvil 034 62910 E o REH REH QH808H OWIQ Z 19Uu HdQOIdsP Je OWAd T 39 W3a3IdSP d1H29OU XXX Xx ONT ONIHQIOUJANUL 9 9NIH3J3NION3 QdIJISu3nIQd GIG S3TONY SOBHIO3Q SNDI LI i 389 S32NGH3101 S3HONI NI 349 SN ISN3HI ON 138u1NO2 a3 313349 3simu3nio SS3INN NO11U013193d m NOIIdIH0S30 HO
13. FIGURE 3 6 PROJECT WIZARD SUMMARY SCREEN Project named xi MyQuickStart for dsPIC30F6014 device will be saved to C Quick Start Click Finish to create the project with these parameters Project Parameters Device dsPIC30FB014 Toolsuite Microchip C30 Toolsuite File C Quick Start MyQuickStart mcp new workspace will be created and the new project added to that workspace E Cancel Help 5 Click Finish a aewa gt zzaimus s r DS51471A page 36 2004 Microchip Technology Inc Quick Start Program After the project wizard completes the MPLAB project window shows the project and all the added files see Figure 3 7 FIGURE 3 7 PROJECT WINDOW Dom six MyQuickStart mcp Source Files ikhz s 2khz s bin2dec c Dac Update delay c device config s display s init Adc s init Dci s init INTpin s init Ports s init RealTek NMIC c init Si3021 s init Spil s init Sram c init Timers s E Project window displays the files you added to your MyQuickStart project At this point a project and workspace have been created in MPLAB MyOuickStart mcwis the workspace file and MyQuickStart mcp is the project file Double click the main c file in the project window to open it MPLAB should look similar to Figure 3 8 FIGURE 3 8 MPLAB WORKSPACE LEK alex File Edit View Project Debugger Programmer Tools Configure
14. LED2 Toggle LEDZ 28 SUMMARY This tutorial has demonstrated several features of the MPLAB IDE programmer and the MPLAB C30 compiler It also demonstrated the use of the MPLAB ICD 2 debugger with the dsPICDEM net board After completing this tutorial you should be able to D Create a project using the project Wizard Compile and link the code and set the configuration bits Set up MPLAB to use the MPLAB ICD 2 Program the chip with the MPLAB ICD 2 View the code execution in program memory and source code View registers in a Watch Window Set a breakpoint and make the code halt at a chosen location Use the function keys to Reset Run Halt and Single Step the code D D D D You can now add functionality to this simple project to create your own application To familiarize yourself with several dsPIC peripherals and associated board functions proceed to Chapter 3 Quick Start Program The quick start sample project in Chapter 3 provides several code module building blocks to help you accelerate your proficiency with the dsPICDEM net board DS51471A page 30 2004 Microchip Technology Inc dsPICDEM net 1 AND dsPICDEM net 2 CONNECTIVITY DEVELOPMENT BOARD MICROCHIP USER S GUIDE Chapter 3 Quick Start Program 3 1 INTRODUCTION This chapter describes a demonstration program made up of several Assembly and C module building blocks that exercise dsPIC30F peripherals and associat
15. DS51471A page 44 2004 Microchip Technology Inc Quick Start Program 3 7 INTERACTING WITH THE CODE With the program running you can interact with the peripherals on the dsPICDEM net board and observe the results on the LCD 1 Depress S1 The LCD displays the message Off Hook mode In this mode the dsPIC commands the Si3021 DAA AFE to go off hook and seize the line i e the typical routine for a modem to connect to the PSTN For this demonstration the dsPIC transmits a single tone to the AFE via the Data Converter Interface module on the dsPIC device After the off hook routine is completed the LCD reverts to the routine that displays the values of RP1 and RP2 The tone continues to be generated and can be heard until switch S2 is depressed Depress S2 The LCD displays the message Ready On_Hook For this routine the dsPIC commands the Si3021 DAA AFE to go on hook i e the typical condition when a modem releases the telephone line For this demonstration the dsPIC terminates the data transfer from the Data Converter Interface to the Si3021 AFE After the on hook routine is completed the LCD reverts to the routine that displays the values of RP1 and RP2 Depress S3 The LCD displays the temperature as measure by sensor U2 followed by the Ready On_Hook message and then reverts to the RP1 and RP2 readings Touch U2 located just left of the LCD for a few seconds then depress S3 again Notice the changed v
16. Netherlands P A De Biesbosch 14 NL 5152 SC Drunen Netherlands Tel 31 416 690399 Fax 31 416 690340 United Kingdom 505 Eskdale Road Winnersh Triangle Wokingham Berkshire England RG41 5TU Tel 44 118 921 5869 Fax 44 118 921 5820 02 17 04 DS51471A page 110 2004 Microchip Technology Inc Mouser Electronics Authorized Distributor Click to View Pricing Inventory Delivery amp Lifecycle Information Microchip DM300004 1 DM300004 2
17. with right arrow Bold characters A window or dialog button to click OK Cancel Characters in angle brackets lt gt A key on the keyboard lt Tab gt lt Ctrl C gt Documents Arial font Italic characters Referenced books MPLAB IDE User s Guide Documentation Updates All documentation becomes dated and this user s guide is no exception Since Microchip tools are constantly evolving to meet customer needs some actual dialogs and or tool descriptions may differ from those in this document Please refer to our web site to obtain the latest documentation available Documentation Numbering Conventions Documents are numbered with a DS number The 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 A The document number The revision level of the document WARRANTY REGISTRATION Please complete the enclosed Warranty Registration Card and mail it promptly Sending in your Warranty Registration Card entitles you to receive new product updates Interim software releases are available at the Microchip web site DS51471A page 2 2004 Microchip Technology Inc Preface RECOMMENDED READING This user s guide describes how to use the dsPICDEM net 1 and dsPICDEM net 2 Connectivity Development Board Other useful documents include dsPIC30F Family Reference Manual DS70046 Consult
18. 29 5a d8 e9 05 20 d8 e9 L OU as m 0020 05 1f 10 Oc O00 50 bf 5b 68 79 00 00 00 007002 P hy ape 0030 40 00 4e dc 00 00 02 04 05 b4 01 01 04 02 N Fitter E Reset Apply lt live capture in progress 2004 Microchip Technology Inc DS51471A page 57 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide 48 TROUBLESHOOTING The HTTP Web Server program has been tested on a dsPICDEM net connectivity board like the one you have received No problems have been encountered hence none expected when you run the demonstration The Java applets used in the HTTP Web Server program have been tested with Internet Explorer 5 and 6 and Netscape 4 7 from Windows 98 NT and XP platforms Depending on the Java settings in your browser you may experience the following error message when the browser begins communication with the dsPIC30F based Web Server and attempts to load the Java applet Loading class dsPICDEMO Exception java lang NullPointerException To remedy this error condition use this procedure Note The exact steps may be slightly different depending on the version of Win dows the browser type and browser version you are using 1 Open the Internet Properties XP dialog box From your browser select Too s gt Internet Options From Windows select Start gt Settings gt Control Panel gt Internet Options gt Advanced Ensure that Java console enabled requires
19. 4 10 ETHEREAL FREEWARE PACKET SNIFFER GER File Edit Ca ure Display Tools Help EN NNNM Tse e 917101 588 1004 997169 216 233 589 1004 997617 216 233 5 590 1005 045457 216 233 5 Gi SR POST lcd_msg HTTP 1 1 5 Ge HTTP HTTP 1 0 204 No Content 5 5 31 TCP 4173 gt http FIN ACK Seq 346 5 5 32 TCP http 4173 ACK Seq 175116 A 591 1005 045676 216 233 5 5232 TGR http 4173 FIN ACK Seq 175 592 1005 045710 216 233 5 5 31 TCP 4173 http ACK Seq 34637346 593 1005 632215 216 233 5 32 216 233 5031 TCP 4174 http SYN Seq 34639605 5 5 5 5 5 5 5 5 5 5 5 5 z z kt de dg S d 594 1005 681003 216 233 5 32 TEP http gt 4174 SYN ACK Seq 175 595 1005 681081 216 233 5 231 TER 4174 gt http ACK Seq 34639605 596 1005 682517 216 233 5 31 HTTP POST flash LEDs HTTP 1 1 597 1007 573274 216 233 5 32 HTTP HTTP 1 0 204 No Content 598 1007 574960 216 233 5 asi TCR 4174 gt http FIN ACK Seq 346 599 1007 618605 216 233 5 32 TGP http gt 4174 ACK Seq 175288 A GOO ANA 619070 A164 177 ie ia ton Pee 2 dvd ere Eege EB Frame 1 62 bytes on wire 62 bytes captured Ethernet II Src 00 09 6b 90 4c f9 Dst 00 00 12 34 56 78 Internet Protocol src Addr 216 233 5 32 216 233 5 32 Dst Addr 216 233 5 31 21 E Transmission Control Protocol src Port 4108 4108 Dst Port http 80 Seq 3210 00 00 12 34 56 78 00 09 6b 90 4c f9 08 00 45 00 dX kaL 0010 00 30 55 5b 40 00 80 06
20. Controller DSC devices 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 you in developing software for the dsPIC30F MCU family dsPIC30F Family Overview DS70043 This document provides an overview of the functionality of the dsPIC product family It helps determine how the dsPIC30F 16 bit Digital Signal Controller Family fits a specific product application This document is a supplement to the dsP C30F Family Reference Manual MPLAB ASM30 MPLAB LINK30 and Utilities User s Guide DS51317 This document helps you use Microchip Technology s language tools for dsPIC devices based on GNU technology The language tools discussed are e MPLAB ASM30 Assembler e MPLAB LINK30 Linker e MPLAB LIB30 Archiver Librarian Other Utilities 2004 Microchip Technology Inc DS51471A page 3 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide MPLAB C30 C Compiler User s Guide DS51284 This document details the use of Microchip s MPLAB C30 C Compiler for dsPIC devices to develop an application MPLAB C30 is a GNU based language tool based on source code from the Free Software Foundation FSF For more information about the FSF see www fsf org Other GNU language tools available from Microchip are e MPLAB ASM
21. Controller NIC Every country has telecommunication laws that prohibit the connection of unapproved telecommunication devices including modems to the phone line Approval by a country s telecommunications regulatory agency may entail hardware firmware modifications to your end system modem in order to comply with their telecommunication laws relative to radio frequency interference pulse dial make break ratios redial capabilities etc The words approved or compliant for use in country XYZ mean that the modem has been modified to comply with the telecommunication laws of that country Thus a modem approved by the FCC to work in the USA for example is not automatically approved by the BZT to work in Germany Note Forthe sample applications described in this manual connect to an analog line only You could damage the modem if you use a non analog line e g digital or PBX multiline 2004 Microchip Technology Inc DS51471A page 7 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide The boards come with an ITU T compliant V 22bis V 22 modem module and demonstration code pre programmed on the installed dsPIC30F6014 device This sample application lets you to connect and transfer data between the dsPIC30F Soft Modem and an ITU T compliant reference modem Application source code is included on the supplied development kit software CD The Development Kit Software CD also includes additional sample
22. FTP Server program in the dsPIC30F6014 To examine FTP Server memory 1 In MPLAB IDE select View gt File Registers The File Registers window displays the contents of the FTP Server virtual file The information displayed in red represents new data in FTP Server memory Information related to this demonstration starts around address location 0x850 2 Page down the File Registers window to until you see the values displayed in red Examine the ASCII data to look for the file name testdemo txt in the ASCII area as shown in Figure 5 11 FIGURE 5 11 FTP VIRTUAL FILE DIRECTORY ENTRY E File Registers Registers C ol iol xi Emaus 0000 5551 0000 0000 6574 7473 0000 0000 demo txt 0000 0000 8 0000 0000 D000 0000 D000 0000 0000 0000 Hex Symbolic 3 Next scroll down to the next block of red data approximately at address 0x2000 0x2100 Examine the ASCII area to find the content of the testdemo txt file as shown in Figure 5 12 DS51471A page 69 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide FIGURE 5 12 FILE CONTENT RECEIVED BY FTP SERVER lolx Content of testdemo txt PI file 0000 0000 0000 6854 7369 6069 2065 6574 7420 strate t 3130 30F6014 O1BE A57F F65 Hex Symbolic KY Data 4 In MPLAB close the workspace and exit the program 5 6 SUMMARY This demonstration has illustrated the basic capability of the dsPIC
23. Germany The Silicon Laboratories chipsets used with the dsPICDEM net 1 and dsPICDEM net 2 Connectivity Boards are compliant with FCC Japan Approval Institute for Telecommunications Equipment JATE and Common Technical Regulation CTR_21 country specific Post Telephone amp Telegraph PTT specifications The chipsets can be fully programmed for AC termination DC termination ringer impedance and ringer threshold enabling the devices to meet worldwide telephone line interface requirements The devices interface directly to standard modem DSPs or system interface circuits DS51471A page 84 2004 Microchip Technology Inc V 22bis Soft Modem Demonstration 6 9 1 Federal Communications Commission The Federal Communications Commission FCC rules 47 C F R Part 68 governs the direct connection of Terminal Equipment TE to the Public Switched Telephone Network PSTN and to wireline carrier owned facilities used to provide private line services 6 9 2 Industry Canada DOC CS 03 Approval of equipment for Canada is relatively straight forward Testing and compliance should be in accordance with technical standard CS 03 The requirements are well harmonized with FCC part 68 In many instances it is possible to use FCC reports to obtain Industry Canada DOC CS 03 approval For additional information on FCC part 68 and approved test facilities refer to www fcc gov 6 9 3 Common Technical Regulation CTR 21 CTR 21 is a Common Techni
24. Note The linker script file and header file locations for your environment may be different The location will depend on where you installed the C30 compiler DS51471A page 16 2004 Microchip Technology Inc Tutorial FIGURE 2 5 PROJECT WIZARD STEP 4 ADD FILES TO PROJECT xi Step Four TE B Add the Tutorial files and Add any existing files to your project dsPIC30F6014 support files for the to your newly created project C pic30_tools C pic30_tools support gld p30f6C i Add gt gt oO H bin O C pic30_tools support h p30f601 m 2 docs DIC NutorialNdelay c Ei examples Remove C Tutorial delay h o CH include Bl e DI C Tutorial dsPICDEMnet Tutorial DICATutorial LCD display c DIC Tutorial LCD display h a lib T sic EB support CH gd Oh F J inc gt H E templates Fa Check the box to copy the file to the gt project directory lt Back Cancel Help 4 There should now be seven files in the project Click Next gt to continue The Project Wizard Summary screen Figure 2 6 displays the parameters of your project FIGURE 2 6 PROJECT WIZARD SUMMARY SCREEN x Summary Project named MyTutorial for dsPIC30F6014 device will be saved to C Tutorial Click Finish to create the project with these parameters Project Parameters Device dsPIC30F6014 Toolsuite Microchip C30 Toolsuite File C Tutorial MyT ut
25. RealTek NIC s isr Timers s isr Uartl tx s lcd c main c TestCAN c TestUartl c traps c Close any workspace that might be open File gt Close Workspace From the Project menu select Project Wizard From the Welcome screen click the Next gt to display the Project Wizard Step 2 3 4 One dialog see Figure 3 2 FIGURE 3 2 Select dsPIC30F6014 PROJECT WIZARD STEP 1 SELECT A DEVICE Project Wizard Step ne Select a device Device lt Back Cancel Help xil 5 Select dsPIC30F6014 as the device and click Next gt The Project Wizard Step Two dialog displays see Figure 3 3 DS51471A page 33 2004 Microchip Technology Inc PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide FIGURE 3 3 PROJECT WIZARD STEP 2 SELECT LANGUAGE TOOLSUITE Project Wizard x Step Two B Select a language toolsuite Select Microchip C30 Toolsuite Microchip C30 Toolsuite Active Toolsuite r Toolsuite Contents Specify file location for Assembler ler To 21 el EE C30C Compl pic30 gcc Sc MPLAB LINK30 Object Linker pic30 Id exe r Location C pic30_tools bin pic30 as exe Browse E Reese ee Help My Suite Isn t Listed Show all installed toolsuites lt Back Next gt Cancel Help m m m m m m m m m m m m m m m m m m m m m m m m m m m m g Active Toolsuite Microchip C30 Toolsuite
26. Reference Manual DS70046 dsPIC30F Data Sheet Motor Control and Power Conversion Family DS70082 dsPIC30F Data Sheet General Purpose and Sensor Families DS70083 dsPIC30F5011 dsPIC30F5013 Data Sheet High Performance Digital Signal Controllers DS70116 dsPIC30F6011 dsPIC30F6012 dsPIC30F6013 dsPIC30F6014 Data Sheet High Performance Digital Signal Controllers DS70117 dsPIC30F Programmer s Reference Manual DS70030 dsPIC High Performance 16 bit Digital Signal Controller Family Overview DS70043 MPLAB C30 C Compiler User s Guide DS51284 MPLAB ASM30 MPLAB LINK30 and Utilities User s Guide DS51317 MPLAB ICD 2 In Circuit Debugger Quick Start Guide DS51268 MPLAB ICE Emulator User s Guide DS51159 You can obtain these reference documents from your nearest Microchip sales office listed in the back of this document or by downloading them from the Microchip web site www microchip com SS EE E 2004 Microchip Technology Inc DS51471A page 11 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide NOTES DS51471A page 12 2004 Microchip Technology Inc dsPICDEM net 1 AND dsPICDEM net 2 CONNECTIVITY DEVELOPMENT BOARD MICROCHIP USER S GUIDE Chapter 2 Tutorial 2 1 INTRODUCTION This chapter is a self paced tutorial intended to get you started using the dsPICDEM net Development Board The tutorial demonstrates basic techniques for using the dsPIC30F development tools with
27. and dsPICDEM net 2 Connectivity Dev Board User s Guide 7 1 1 RS 232 Serial Port A single RS 232 serial communication channel is provided on the dsPICDEM net Development Board This serial communication channel labeled J5 can be configured as an RS 232 or RS 485 RS 422 communication channel via jumpers J17 J18 and J19 The following jumper connections are required for RS 232 serial communications J19 shunt pins 1 2 for Tx channel support J19 shunt pins 3 4 for Rx channel support J17 shunt pins 1 2 for Request to Send RTS support J17 shunt pins 3 4 for Clear to Send CTS support Note The shunts for J17 and J19 must be connected vertically J18 shunt pins 2 3 for Rx connection to the dsPIC device Jumper 19 connects the dsPIC UART channel 1 U1RX and U1TX pins to an RS 232 level shifting IC U7 The serial port is configured as DCE and can be connected to a PC using a straight through cable If hardware handshaking is required inserting shunts on jumper J17 will connect CTS and RTS to port pins RA9 and RA10 on the dsPIC device These pins can support CTS RTS through a bit bang control approach Both pins are connected to IC U7 7 1 2 CAN Port The CAN RXD and TXD lines ofthe MCP2551 are connected to the dsPIC CANRX and CANTX pins CAN bus signals CANH and CANL are available on the DB9 connector J4 The CANH and CANL bus can be locally terminated with a 120 ohm by inserting jumper J3 7 1 3 RS 485 RS 422 P
28. applications a tutorial module and complete product documentation The additional sample applications will familiarize you with the CMX MicroNet HTTP Web and FTP Servers which demonstrate two TCP IP protocol based applications over the 10 Base T Ethernet Datalink layer Product tutorials provide hands on experience in debugging with the MPLAB ICD 2 1 4 dsPICDEM net PACKAGE CONTENTS The following items comprise the dsPICDEM net Connectivity Development Board package The dsPICDEM net 1 or dsPICDEM net 2 Printed Circuit Board supports both embedded internet and ethernet connections A pre programmed dsPIC30F6014 device on an adapter board that plugs into the main development board A CAT5 crossover network cable RJ45 connectors for networking the board 9 VDC Power Supply RS 232 Interface Cable dsPICDEM net Development Kit Software CD containing demonstration connectivity solutions from Microchip and it s partners along with a product tutorial and complete documentation D D D 1 5 dsPICDEM net BOARD FUNCTIONALITY The dsPICDEM net Development Board Figure 1 1 provides a basic platform for developing and evaluating solutions that use dsPIC30F6014 16 bit Digital Signal Controllers The dsPICDEM net Development Board includes the following capabilities Power Supply Single on board 5V regulator for VDD and AVDD with direct input from 9V AC DC wall adapter 9 VDC power source input jack for developme
29. net DEVELOPMENT BOARD SCHEMATIC SHEET 1 OF 11 NOLIUD13IO3dS KEIER DOG WER N NOT 1e183S3g uo u3Qg3H 001 143 Sd Iz kA N ON 9NIAJIIN3QI ON es dod 39d N c ALD No aasn AISI N FH N ssn d 3 Q3 STG EH 104 D SJ BIA ojo bari Fasi Aeen 1X3N Cu 24 IS IE Ii CO zaa 1037 134 INAS4 ERES 82 AA 1gs3 S4 1994 ISHT ZOE JHJ40 1994 33 08 62 el 8 2 dil3l zu UOS o o o gas iU 198 Su q21 81 21 nuglsu Tdi M TIS DU dM 3 30 MOI o dt SISI 2 g Lo Ox 1 NB2 a401 ER Lo ZS IS H IIN pea axed NU2 Du c ns e ns me ns qNS ES OH N 3m us AN9 dS 471094 S qt S oj Sau 30 uS HIH 329 uS LSHIZBE Sd kO 1de DO OHOO AH340 1994 34 e1Qu gane EAR EQ3 q31 co t o o ede ZO 104 EH 28H SEI 1931 TOY o leien nani 3 looro INAS 4 DEEN NOLLdT OS3a SNOISIA3H Zwei 3a EI AZZ EI 99d sou Sas 23H ERR S44 EE XL xu QXL NU2 QXH NU2 1NI 2UH ES cS IS AE 644 3 331 Su OO L 9 Sb Ak SSN SS
30. open tpdemo hex 5 From the MPLAB IDE Configure menu select Configuration Bits and verify the device configuration settings shown in Figure 5 5 FIGURE 5 5 FTP SERVER CONFIGURATION BITS SETTINGS BER address vai category Setting 0 0 0 0 8 Clock Switching and Monitor Sw Disabled Mon Disabled Oscillator Source Primary usciiiacor Primary Oscillator Mode XT w PLL 8x Watchdog Timer Disabled WDT Prescaler A 1 512 WDT Prescaler B 1 16 Master Clear Enable Enabled PBOR Enable Enabled Brown Out Voltage 4 5V POR Timer Value 6410s General Code Segment Code Protect Disabled General Code Segment Write Protect Disabled Comm Channel Select Use PGC EMUC and PGD EMUD 6 From the MPLAB IDE Debugger menu select Program The ftpdemo hex file downloads to the dsPIC30F6014 The Output Window records the process as it occurs and indicates completion by displaying MPLAB ICD 2 Ready 7 Press F6 to reset the program then press F9 to run the program The LCD on the dsPICDEM net board indicates that the program is running as shown in Figure 5 6 FIGURE 5 6 LCD DISPLAY FOR FTP DEMONSTRATION CMX MicroNet FTP Server Demo 2004 Microchip Technology Inc DS51471A page 65 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide 5 5 2 Start FTP Server Session After programming the demonstration into the dsPIC30F6014 follow these steps 1 If CMX MicroNet FTP Server is
31. operates with a 75 bps backwards channel e V 22bis includes fallback to V 22 V 23 and V 21 standards V 32bis optionally falls back to V 22bis V 22 V 23 and V 21 standards These key parameters are further detailed in Table 6 1 TABLE 6 1 SOFT MODEM FEATURES AND PERFORMANCE Performance Memory Kbytes MIPS Half Full Data Program Data Algorithm Data Rate bps Duplex Modulation V 21 Bell 103 4 300 Full FSK 13 1 0 4 5 1200 V 22N 22bis Full PSK QAM 22 1 7 7 v 23 Half FSK 15 1 0 4 5 V 32 Full QAM TCM 31 3 2 v 32BIS QAM TCM v 42 n a 14 2 0 1 5 DP V 42 API n a 7 1 2 AT Command Set n a 7 0 15 Note 1 Data pump modules V 21 V 22 V 22bis V 23 V 32 V 32bis and Bell 103 are implemented in Assembly language V 42 Data Pump and AT Command APIs are implemented in C language 2 The program data memory usage for the V series data pumps is NOT cumulative due to the sharing of components internally 3 Memory size does not account for application which combines data pump V 42 and AT commands if required 4 V 21 Bell 103 and V 23 data pumps do not require V 42 DS51471A page 78 2004 Microchip Technology Inc V 22bis Soft Modem Demonstration 67 dsPIC30F SOFT MODEM AT COMMAND SET The AT commands listed in Table have been selected to serve embedded soft modem applications on the dsPIC30F product family These commands are a subse
32. phone cable connect the MPLAB ICD 2 to RJ 11 modular connector ICD on the board 3 Connect one end of the supplied CAT 5 crossover cable to RJ 45 modular connector J15 on the board and the other end to the Ethernet network card on the PC or Laptop 4 Connect the dsPICDEM net power cable to the power input connector J14 E DS51471A page 62 2004 Microchip Technology Inc FTP Server Demonstration 5 3 3 FTP Server Program Setup Copy the FTP Server folder from the dsPICDEM net Development Kit Software CD to the CA drive on your PC or laptop see Figure 5 2 FIGURE 5 2 FTP SERVER DEMONSTRATION CODE Copy FTP Server folder from CD to your C N drive E 19 dsPICDEM net Board Sample Apal e FTP Server Quick Start O Tutorial 22bis Soft Modem Ceo WEB Server dsPICDEM net Development P kit Software 5 4 CONFIGURING YOUR LAPTOP OR DESKTOP PC The FTP server demonstration is configured to operate with a Static IP address To run the sample program you must configure the local network connections on your laptop or desktop computer to use a compatible Static IP address Note Before you reconfigure your network connection settings for this sample program make a note of your current PC settings You will want to restore your original PC settings after you complete the demonstration 5 4 1 Network Connections To reconfigure your network connections follow these steps 1 From the W
33. release the RESET switch located to the right of the LCD The LCD acknowledges that the soft modem is initialized as shown in Figure 6 3 FIGURE 6 3 LCD DISPLAY dsPIC30F V 22bis Soft Modem Demo 6 4 2 Configure the Terminal for dsPIC30F Soft Modem These procedures assume but do not require that you are using the Windows HyperTerminal 1 Start HyperTerminal on both PCs If you are set up for interoperability and are using a standard reference modem on one terminal consult the modem user manual for specifics on configuring the modem 2 Configure HyperTerminal with these settings Bits per second 19200 Data bits 8 Parity None Stop bits 1 Flow Control Hardware Set the Comm Channel appropriately for each PC DS51471A page 74 2004 Microchip Technology Inc V 22bis Soft Modem Demonstration 3 Execute these AT commands on each HyperTerminal and note the response Command Response AT lt ENTER gt OK AT amp F lt ENTER gt OK ATX0 OK ATS0 1 OK Refer to Section 6 7 dsPIC30F Soft Modem AT Command Set for descriptions of AT commands supported 6 4 3 Initiate Communication At this point the dsPIC30F Soft Modem is ready to establish a dial connection with another modem 1 Initiate dialing with the following AT command ATD lt dial string gt where lt dial string gt indicates the telephone number of the remote soft modem By default auto an
34. restart is selected see Figure 4 11 Click OK and allow the browser to restart FIGURE 4 11 BROWSER JAVA SETTINGS Internet Properties 31 xl General Security Privacy Content Connections Programs Advanced Settings HTTP 1 1 settings Use HTTP 1 1 Use HTTP 1 1 through proxy connections 3 Microsoft VM Java console enabled requires restart L Java logging enabled JIT compiler for virtual machine enabled requires restart 99 Multimedia LJ Don t display online media content in the media bar Enable Automatic Image Resizing Enable Image Toolbar requires restart Play animations in web pages Play sounds in web pages Play videos in web pages L Show image download placeholders Show pictures 4 b Restore Defaults Cancel Apply DS51471A page 58 2004 Microchip Technology Inc HTTP Web Server Demonstration Next go to Control Panel and select the Java Plug in application Open this application and select the Cache tab Ensure the Enable Caching box is deselected Once complete click on the Apply and close this control panel Retry the browser refresh function and see if the entire HTML page is now displayed correctly FIGURE 4 12 JAVA PLUG IN BROWSER SETTINGS Basic Advanced Browser Proxies Cache Certificates About Enable Caching Cache Settings Location Size Jar compression J None 4 9 USING HTTP WEB SERVER IN Y
35. this document for detailed information on dsPIC30F device operation This reference 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 for device specific information dsPIC30F Data Sheet Motor Control and Power Conversion Family DS70082 Consult this document for detailed information on the dsPIC30F Motor Control and Power Conversion devices Reference information found in this data sheet includes Device memory map Device pinout and packaging details Device electrical specifications List of peripherals included on the device dsPIC30F Data Sheet General Purpose and Sensor Families DS70083 Consult this document for detailed information on the dsPIC30F Sensor and General Purpose devices Reference information found in this data sheet includes Device memory map Device pinout and packaging details Device electrical specifications List of peripherals included on the device dsPIC30F5011 dsPIC30F5013 Data Sheet High Performance Digital Signal Controllers DS70116 This data sheet contains specific information for the dsPIC30F5011 5013 Digital Signal Controller DSC devices dsPIC30F6011 dsPIC30F6012 dsPIC30F6013 dsPIC30F6014 Data Sheet High Performance Digital Signal Controllers DS70117 This data sheet contains specific information for the dsPIC30F6011 6012 6013 6014 Digital Signal
36. to C pic30_ tools Bin pic30 gcc exe 6 From Toolsuite Contents select MPLAB LINK30 Object Linker pic30 Id exe 7 Inthe Location block click Browse and navigate to C pic30 tools Bin pic30 ld exe 8 Click Next gt to continue The Project Wizard Step Three dialog displays see Figure 2 4 2004 Microchip Technology Inc DS51471A page 15 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide FIGURE 2 4 PROJECT WIZARD STEP 3 NAME YOUR PROJECT x Step Three Name your project ke Type a name for your project Project Name R WyQuickStan r Project Directory 1 Esauick Start and save it in the Project Directory C Tutorial lt Back Next gt Cancel Help 2 4 3 Name Your Project 1 Inthe Project Name text box type MyTutorial 2 Click Browse and navigate to C Tutorial to place your project in the Tutorial folder 3 Click Next gt to continue 2 4 4 Add Files to Project 1 On the Project Wizard Step Four dialog see Figure 2 5 locate the C Tutorial folder and add these files to the right side dsPICDEMnet Tutorial c LCD Display c LCD Display h delay c delay h 2 Navigate to the C Npic30 tools support gld folder and add file p30f6014 gl1d to include the linker script file in the project 3 Navigate to the C pic30 toolsNsupportNh folder and add file p30f 6014 h to include the header file in the project
37. 0 PROTOCOL LAPM CONNECT 19200 CONNECT 2400 ARQ LAPM V 22 1200 bps CARRIER 1200 PROTOCOL LAPM CONNECT 19200 CONNECT 1200 ARQ LAPM V 23 1200 bps CARRIER 1200 75 PROTOCOL NONE CONNECT 19200 dsPIC30F Soft Modem is the answer modem CONNECT 75 1200 NONE USRobotics is the originate modem CARRIER 75 1200 PROTOCOL NONE CONNECT 19200 CONNECT 1200 75 NONE USRobotics is the answer modem dsPIC30F Soft Modem is the originate modem CARRIER 300 PROTOCOL NONE CONNECT 19200 Bell 103 TBP TBP V 21 300 bps CONNECT 69 REGULATORY COMPLIANCE REFERENCE INFORMATION Every country has telecommunication laws that prohibit the connection of unapproved telecommunication devices including modems to the phone line Approval by a country s telecommunications regulatory agency may entail hardware firmware modifications to your end system modem in order to comply with telecommunication laws Approval could require modifications for radio frequency interference pulse dial make break ratios redial capabilities and so forth The words approved or compliant for use in country XYZ mean that the modem has been modified to comply with the telecommunication laws of that country An American modem approved by the Federal Communications Commission FCC in the United States and imported to Germany would not be a legal telecommunications device in Germany FCC approval in the USA does not imply BZT approved in
38. 00 Terra Bella Avenue Mountain View CA 94043 Tel 650 215 1444 Fax 650 961 0286 Toronto 6285 Northam Drive Suite 108 Mississauga Ontario L4V 1X5 Canada Tel 905 673 0699 Fax 905 673 6509 ASIA PACIFIC Australia Suite 22 41 Rawson Street Epping 2121 NSW Australia Tel 61 2 9868 6733 Fax 61 2 9868 6755 China Beijing Unit 706B Wan Tai Bei Hai Bldg No 6 Chaoyangmen Bei Str Beijing 100027 China Tel 86 10 85282100 Fax 86 10 85282104 China Chengdu Rm 2401 2402 24th Floor Ming Xing Financial Tower No 88 TIDU Street Chengdu 610016 China Tel 86 28 86766200 Fax 86 28 86766599 China Fuzhou Unit 28F World Trade Plaza No 71 Wusi Road Fuzhou 350001 China Tel 86 591 7503506 Fax 86 591 7503521 China Hong Kong SAR Unit 901 6 Tower 2 Metroplaza 223 Hing Fong Road Kwai Fong N T Hong Kong Tel 852 2401 1200 Fax 852 2401 3431 China Shanghai Room 701 Bldg B Far East International Plaza No 317 Xian Xia Road Shanghai 200051 Tel 86 21 6275 5700 Fax 86 21 6275 5060 China Shenzhen Rm 1812 18 F Building A United Plaza No 5022 Binhe Road Futian District Shenzhen 518033 China Tel 86 755 82901380 Fax 86 755 8295 1393 China Shunde Room 401 Hongjian Building No 2 Fengxiangnan Road Ronggui Town Shunde District Foshan City Guangdong 528303 China Tel 86 757 28395507 Fax 86 757 28395571 China Qingdao Rm B505A Fullhope Plaza No 12 Ho
39. 1 Open another FTP session see Section 5 5 2 Start FTP Server Session 2 Atthe ftp prompt type put testdemo txt As the transfer progresses milestones are displayed sequentially When the file transfer is complete the status displays the number of bytes transferred how long it took and the transfer rate achieved 3 Atthe next ftp prompt type dir to verify that the file is now in the FTP server virtual data memory The listing shows that the file is included as shown in Figure 5 10 DS51471A page 68 2004 Microchip Technology Inc 2004 Microchip Technology Inc FTP Server Demonstration FIGURE 5 10 FTP SEND DEMONSTRATION SESSION c Command Prompt ftp 216 233 5 31 252 Jan 1 2663 contact gif 218 Jan 1 20803 home gif 286 Jan 1 2808803 press gif ftp 526 bytes received in 16Seconds 3 3 Kbytes sec ftp gt put testdemo txt 88Seconds 63000 66Kbytes sec root s 1148 Jan root 724 Jan root 2488 Jan root 266 Jan root 258 Jan root s 252 Jan root s 218 Jan 2003 index htm 2003 page2 htm 2003 cmxlogo gif 2003 about gif 2003 benchmrk gif 2003 contact gif 2003 home gif 2003 press gif 2003 testdemo txt root 288 Jan root sy 64 Jan peh peh peh pb puh P d received in 34Seconds 1 73Kbytes sec 4 Atthe ftp gt prompt type quit to end the FTP session Then type exit to close the DOS command prompt 5 Goto MPLAB IDE and press lt F5 gt to halt the
40. 30 Assembler MPLAB LINK30 Linker MPLAB LIB30 Librarian Archiver dsPIC Language Tools Libraries DS51456 DSP dsPIC peripheral and standard including math libraries for use with dsPIC language tools GNU HTML Documentation This documentation is provided on the language tool CD ROM It describes the standard GNU development tools upon which these tools are based MPLAB IDE Simulator Editor User s Guide DS51025 Consult this document for more information pertaining to the installation and implementation of the MPLAB Integrated Development Environment IDE Software To obtain any of these documents visit the Microchip web site at www microchip com THE MICROCHIP WEB SITE Microchip provides online support on the Microchip World Wide Web WWW site The web site is used by Microchip as a means to make files and information easily available to customers To view the site you must have access to the Internet and a web browser such as Netscape Navigator or Microsoft Internet Explorer The Microchip web site is available at www microchip com The web site provides a variety of services Users may download files for the latest development tools data sheets application notes user s guides articles and sample programs A variety of information specific to the business of Microchip is also available including listings of Microchip sales offices distributors and factory representatives Technical Support Frequently As
41. 300 1200 V 23 bps AT MS 3 0 300 1200 V 21 bps AT MS 0 0 300 300 Bell 103 300 bps AT MS 1 0 300 300 2004 Microchip Technology Inc DS51471A page 75 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide 5 You may need to reset and reconfigure the standard reference modem for enabling these specific data modulations Consult the standard reference modem user s manual for this information An example of configuring a USR modem for V 21 and V 23 is presented in Section 6 8 4 V 23 Connection Between dsPIC30F Soft Modem and US Robotics Modem and Section 6 8 5 V 21 connection Between dsPIC30F Soft Modem and US Robotics Modem 65 REPROGRAMMING THE dsPIC30F6014 Should you need to reprogram the dsPIC30F6014 device begin by copying the PC Based Soft Modem folder from the dsPICDEM net Development Kit Software CD to the C Wrive on your PC or laptop see Figure 6 4 FIGURE 6 4 PC BASED SOFT MODEM DEMONSTRATION CODE Copy V 22bis Soft Modem folder from CD to your C N E C3 dsPICDEM net Board Sample Applications dsPICDEM net Development Kit Software O FTP Server i E Size Type E O Quick Start 1 HEX File Tutorial x ao lt WEB Server The easiest way to get the soft modem demonstration up and running is to program the provided hex file into the dsPIC device using this procedure 1 Apply power to the board The green POWER LED illuminates 2
42. 30F6014 functioning as an embedded FTP Server As stated in Section 5 2 Application Overview an embedded FTP server may be suitable in such applications such as data logging inventory control remote system performance analysis and remote reprogramming of the dsPIC Program Memory Flash just to mention a few The FTP Server uses the TCP IP protocol layer which ensures an ordered reliable delivery of the data The Program Memory Flash and Data RAM resources requirements for the CMX MicroNet Stack is presented in Table 5 1 TABLE 5 1 RESOURCES FOR THE CMX MICRONET STACK Flash UDP IP Core 4470 bytes TCP IP Core 7827 bytes UDP TCP IP Core 8685 bytes PPP 6681 bytes Modem 447 bytes HTTP Server 3888 bytes Virtual File 885 bytes Ethernet 2652 bytes DHCP Client 2202 bytes FTP Server 3657 bytes TFTP Client 723 bytes BOOTP 684 bytes SMTP 1918 bytes Utility 1314 bytes RAM not including buffer sizes UDP SLIP 56 bytes TCP HTTP PPP 304 bytes Ethernet 38 bytes DS51471A page 70 2004 Microchip Technology Inc dsPICDEM net 1 AND dsPICDEM net 2 CONNECTIVITY DEVELOPMENT BOARD MICROCHIP USER S GUIDE Chapter 6 V 22bis Soft Modem Demonstration 6 1 INTRODUCTION This chapter describes the dsPIC30F Soft Modem demonstration running on the dsPICDEM net Development Board The demonstration software is a subset of the dsPIC30F data modem library of
43. 471A page 80 2004 Microchip Technology Inc V 22bis Soft Modem Demonstration TABLE 6 2 AT COMMAND SET FOR dsPIC30F SOFT MODEM CONTINUED Command Description S Registers These registers are used set some of the simple modem configurations ATSn x Command writes the value x to the specified S register n ATSn Command displays the value of S register n S0 Ring to Auto answer On Sets the number of rings required before the modem answers Auto answer ring count Default Value SO 1 si Ring Counter Counts and stores the number of rings from an incoming call S6 Wait Before Dialing Sets the number of seconds the modem waits for dial tone before dialing Default Value S6 1 S7 Wait for Carrier After Dial Answer Sets the number of seconds the modem waits for a carrier or answers before returning on hook and sending a NO CARRIER result code Default Value S7 60 91 Transmit Signal Level This register is used to specify the transmit signal level in dBm value Default Value S91 12 12 dBm Escape Sequence This is a three character escape code used to enter into the command mode from the data mode 68 TROUBLESHOOTING THE CONNECTION The dsPIC30F Soft Modem has undergone multiple levels of testing ranging from extensive bench testing using standard off the shelf reference modems to full ITU T compliance testing The reference modems used in the testing are listed i
44. 471A page 92 2004 Microchip Technology Inc AN dsPICDEM net 1 AND dsPICDEM net 2 CONNECTIVITY DEVELOPMENT BOARD MICROCHIP USER S GUIDE Appendix A Hardware Schematics A 1 BOARD LAYOUT AND SCHEMATICS A 1 1 dsPICDEM net 1 and dsPICDEM net 2 Development Board The following figures show the parts layout silk screen and schematics for the dsPICDEM net 1 and dsPICDEM net 2 Development Board 2004 Microchip Technology Inc DS51471A page 93 dsPICDEM net DEVELOPMENT BOARD LAYOUT gs zs IS dod Eder CH CO zag qaq eu esos 1 es zur U l S2 eieze Nou S83 B 8 dua QN9U Ed eu Dm EE eat een angu 20 ER Su ES ER C3 J ep c QN9U 022 EI ato duu 2 y nudisu o 9 F L sz oE em HMOI 3534 aane Emm CL zm qanu 1 T9021 95 Zdu arn e
45. 51471A page 99 2004 Microchip Technology Inc dsPICDEM net DEVELOPMENT BOARD SCHEMATIC SHEET 6 OF 11 I g t I 9 Las 9NIMEHQ 31895 LON 04 399921 822 222 g cOlelI S ASSU 1X3N N340 62910 E 90 on ang oN_ugsa 3zIs ase qHUO8 OWAd Z 19uU H3031d SP HnBEE Jua OWSd I 39u H3GO23IdSP N3dO vd Zou d1H20H21H Se 19S Stubby ONT SNIWNLOUSNNEW ZSS1 STONY S ULIJAQ SNOIIQUMA EIER azo 122 0 S3ONUBJ OL ONIYSSNIONS Q3IJISH3hIQ EE DEE EE SE N3dD Szo zI LSI S1HBd N SZ 3dess Z9 929 NGIIG3I3133d DEER v masc Les ee bEBETS 141431 BYNLUTSNIWON YO Lud Wass A10 nas 1HUH2 IZI qN9I nes 1HUHJ LYBHO T84 eza LYBHO 200 La EEN HOI Late sNOISIn3H CN 05 N PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide FIGURE A 7 2004 Microchip Technology Inc DS51471A page 100 Hardware Schematics dsPICDEM net DEVELOPMENT BOARD SCHEMATIC SHEET 7 OF 11 FIGURE A 8 JO 2 Lane SNIMBYO 34363S LON 00 NOL LYIT Ides g 4225 29 Eet 62910 E0 on angl Qqueoag OW3d Z 38U WAdDIdSP quB808 OWSd I 394 W39JIdSP dT HOO No geen ASSU Un Sun udde ONT ONTYNIOUINNEW 9 9NIWH33NION3 d3IdISdd3 IQ ISLI Geld ZSS L SBH S32NBHS 0L 3 S3HINI NI 38 SNOISNSH
46. 8401 61485 819S TUS STUS STUS bIUS 1US THS TITUS TYS 68S 88S 20S SUS ZHWEE BE 2 v 2u 6 a2 2g 2 EM nudisg WAA WA t v2H 2004 Microchip Technology Inc DS51471A page 104 Hardware Schematics TT 30 IL NOTLUOT Tad CBILITI ASSY 1X3N g8 nay 62S1B E on ong ou ve gt Qqduo8 ONAA Z 19u H3O02IdSP SS0u d lt a OWJA T 384 WAddTdSP pue JIHIJOBIJIW XX INI SNIYNLOBANNUW 8 ZSSI S379NU STHLIOSQ SNOTLOUYS Sne i 200 S32NdH3 DI SNIYASNISNA Q3IJISH3nIGd EENS NOIIUOIJIO3dS NOIIJIUDS3d UO ON 9NIAJIIN3QI ON dba ECKER WO luud Viel Aib qasn qasn 10N 1581 HOLBNOSIS3Q dsPICDEM net DEVELOPMENT BOARD SCHEMATIC SHEET 11 OF 11 Qan ze BEER aang SNOLS103H DS51471A page 105 FIGURE A 12 2004 Microchip Technology Inc PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide NOTES DS51471A page 106 2004 Microchip Technology Inc dsPICDEM net 1 AND dsPICDEM net 2 MICROCHIP CONNECTIVITY DEVELOPMENT BOARD USER S GUIDE Index A CAN Bob Wa 88 Analog Devices ccccccccsecesesssseseses
47. AB IDE v6 50 QO eet 9 16am 2004 Microchip Technology Inc DS51471A page 37 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide 3 5 BUILDING THE CODE In this project the code is built in two stages First the source files are compiled into object files then the object files are linked The MyQuickStart hex output file contains the data necessary to program the device The MyQuickStart cof output file contains additional information that lets you debug the code at the source code level Before building the program compiler and linker settings must be specified These settings indicate where to find the C library files and where to reserve space for the extra debug code when the MPLAB ICD 2 In Circuit debugger is used 3 5 1 Set Project Build Options The Quick Start project does not explicitly use any libraries but the C compiler startup library code is always automatically linked into the project Use the Project Build Options gt Project menu to display the Build Options dialog 1 Select the General tab 2 Type or browse to the file locations shown in Figure 3 9 FIGURE 3 9 BUILD OPTIONS Build Options For Project MyQuickStart mcp E 2 xl General MPLAB ASM30 MPLAB C30 MPLAB LINK30 Let the project know where the output files will be located Output Directory BINDIR Browse Intermediates Directory TMPDIR i Browse Assembler Include Path AIN
48. CD 2 Connected Setting Vdd source to target Target Device dsPIC30F6014 found revision 0x40 Reading ICD Product ID Running ICD Self Test Passed MPLAB ICD 2 Ready DS51471A page 52 2004 Microchip Technology Inc HTTP Web Server Demonstration 4 From the MPLAB IDE File menu select Import Browse to the C WEB Server directory where you saved the webdemo hex file select it and click Open 5 From the MPLAB IDE Configure menu select Configuration Bits and verify the device configuration settings shown in Figure 4 5 FIGURE 4 5 SETTING CONFIGURATION BITS IN MPLAB IDE SES EE Clock Switching and Monitor Sw Disabled Mon Disabled Oscillator Source Perina rs Oscillator Primary Oscillator Mode XT w PLL 8x Watchdog Timer Disabled WDT Prescaler A WDT Prescaler B Master Clear Enable PBOR Enable Brown Out Voltage POR Timer Value General Code Segment Code Protect General Code Segment Write Protect Comm Channel Select Use PGC EMUC and PGD EMUD 6 From the MPLAB IDE Programmer menu select Program The webdemo hex file downloads to the dsPIC30F6014 The Output Window records the process as it occurs and indicates completion by displaying MPLAB ICD 2 Ready 7 Remove the MPLAB ICD 2 cable from the board then press RESET on the demonstration board to run the program The LCD on the dsPICDEM net board indicates that the program is running as shown in Figure 4 6 F
49. DIR EApic3 toolNsuppornciCAQuck Stan Browse Include Path INCDIR DNadckStaNh Be Library Path LIBDIR E 5pic30_toolsib Browse Linker Script Path LKRDIR Help Suite Defaults Cancel Apply Note The library path for your environment may be different The location will depend on where you installed the C30 compiler 3 Select the MPLAB LINK30 tab to display the linker settings 4 Check Link for ICD2 to tell the linker to reserve space for the debug code used by the MPLAB ICD 2 In Circuit Debugger see Figure 3 10 5 Click OK DS51471A page 38 2004 Microchip Technology Inc Quick Start Program FIGURE 3 10 MPLAB LINK30 BUILD OPTIONS General MPLAB ASM30 MPLAB C30 MPLAB LINK30 Categories General zl Generate Command Line Heap size bytes Allow overlapped sections Min Stack Size bytes v Link for ICD2 Symbol Definitions Add Remove Remove All Inherit global settings Restore Defaults defsym _ICD2RAM 1 o TARGETBASE cof Use Alternate Settings Check Link for ICD2 o TARGETBASE cof Cancel Apply 3 5 2 Build the Project At this point the project is ready to build 1 From the Project menu select Build All The Build Output window displays see Figure 3 11 2 Observe the progress of the build 3 When the BUILD SUCC
50. Development Board running USB Port connection web server demonstration EL m j e E Power Cable 115 VAC Connect MPLAB ICD 2 Apply power to board to PC with USB cable Connect MPLAB ICD 2 to board with RJ 11 phone cable 1 Connect the MPLAB ICD 2 to your PC with the USB cable 2 Using the short RJ 11 phone cable connect the MPLAB ICD 2 to RJ 11 modular connector ICD on the board 3 Connect one end of the supplied CAT 5 crossover cable to RJ 45 modular connector J15 on the board and the other end to the Ethernet network card on the PC or Laptop 4 Connect the dsPICDEM net power cable to the power input connector J14 DS51471A page 50 2004 Microchip Technology Inc HTTP Web Server Demonstration 4 4 3 WEB Server Program Setup Copy the WEB Server folder from the dsPICDEM net Development Kit Software CD to the C N drive on your PC or laptop see Figure 4 2 FIGURE 4 2 WEB SERVER DEMONSTRATION CODE Copy WEB Server folder from CD to your C N drive E 9 dsPICDEM net Board Sample Applications 5 FTP Server Fl 5 Quick Start FA O Tutorial E 3 v22bis Soft Modem mb dsPICDEM net Development Kit Software WEB Server p 4 5 CONFIGURING YOUR LAPTOP OR DESKTOP PC This HTTP Web Server demonstration is configured to operate with a Static IP address To run the demonstration program you must configure the local Network Connections on your lapt
51. Display LOOPBACK FAIL LOOPBACK PASS Pass init uart s Nu Initialize amp Test UART1 testuartl c Y UART1 TEST RESULT DISPLAYS Display No UART1 Display LOOPBACK FAIL Loopback LOOPBACK PASS Pass Initialize DCI init DCI s Y Initialize Si3021 DAA AFE init Si3021 s Display FAIL Message Initialize INTx init INTpin s Pins for Interrupt Y Initialize SPI1 Module Y Initialize ADC Module FRAME LOCK STATUS DISPLAYS Display LOCK Message init Spil s init Adc s RUNNING RP1 and RP2 VALUES DISPLAY 2004 Microchip Technology Inc DS51471A page 43 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide At this point the program is running in the main loop see Figure 3 18 The LCD displays the current values of potentiometers RP1 and RP2 QUICK START PROGRAM MAIN LOOP S1 DEPRESSED Yes Execute OFF HOOK and Display Message S2 DEPRESSED Yes Execute ON HOOK and Display Message S3 DEPRESSED Yes Display TEMPERATURE RP1 3 44v RP2 2 14v FIGURE 3 18 isr_INTpin s No isr_INTpin s No lt isr_INTpin s No Delay delay c 200 ms display s Call Display bin2dec c Conversion t Display RP1 amp RP2 Values Y Update Digital Pot Dac Update c
52. EEDED message displays you are ready to program the device FIGURE 3 11 BUILD OUTPUT Build Version Control Find in Files MPLAB ICD 2 0x100 0x157c x2af8 xf80000 0x1 00000 0xf 80002 0x1 00004 0xf80004 Ox1f 00008 Oxf 8000a Ox1 00014 021808 0x3010 iE 0x4 0x8 aivt 0x84 0x108 sinewave_lkhz 0x1976 0x32ec sinewave 2khz 0x19c6 0x338c isr Ozla66 Ox34cc 0x4 Total program memory used bytes 0x27a2 10146 Executing C Program Files MPLAB IDE dsPIC_Fools Bin Loott_iCott exe CAQuick Stari hex MyQuickStart cof Loaded CAQuick Start hex MyQuickStart cof BUILD SUCCEEDED Tue May 18 03 14 10 2004 afi If you experience any problems with the build double click the error messages in the Output window and MPLAB will point to the offending line in the source code This should not happen if the files were copied from the dsPICDEM net Development Kit CD Double check all the steps in this section and ensure that you are using the latest versions of the development tools The latest upgrades are available on the Microchip web site www microchip com 2004 Microchip Technology Inc DS51471A page 39 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide 3 6 DEVICE CONFIGURATION AND PROGRAMMING After you have built the code you must set up the configuration bits and then connect the tool you plan to use for programming running and debugging the code Note Before proce
53. IG On 13881NO2 Jasi3133es 3s1rux 10 Ge H NOL18913133dS NOI 19149539 YO K IER 380 18 12N3HON ON 9N1AJIIN3dI Ten 0038 HO led was A18 1004 NUO NS I 1TSSZd3W SY axl HNUJ qN9 WR qan a339 axy ON NUJ OXY NBI xee i noo e bo WEIEN i 213 AST INT M S123 19 39 lY0d t 3d ZZb SU xl Y ob ZS8y Su JH ccv 404 ANOWSY S8 404 u3dlfin TIGLSNI Q3n Bdad NOl1dIH283d SNOISIn3H wudoozT ECH 0H 368v KUW sn DS51471A page 101 2004 Microchip Technology Inc PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide dsPICDEM net DEVELOPMENT BOARD SCHEMATIC SHEET 8 OF 11 FIGURE A 9 I 31808 ONIMBEd 31825 LON 00 NOTLYOT Idd 8 aal 62910 0 ON ama ON W984 ayo OWSd ddog OH3G I 394 W3931d45P FSU WACIIdSP dIH20u2IH ONT ONTYMLOYINNGW 9 SNIUJJNISN3 GQ3IdISud3 nIC 1SIT Slubd ganssi S319N8 S14WI JO SOL 1344 S3ONGU3 OL NOLIUOIJIO3dS S IER NOLIdIU2S3d 40 3un 10 19N3HON ON 9NIAJIINSOI Y0 luu 1899 1279199 G3nouddu
54. IGURE 4 6 LCD DISPLAY CMX MicroNet WEB Server Demo 2004 Microchip Technology Inc DS51471A page 53 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide 4 6 2 Start HTTP Web Server Session This demonstration is intended to run with Windows 98 NT and XP using Internet Explorer 5 or 6 or Netscape 4 7 1 Launch your browser 2 Type the following URL address http 216 233 5 31 The dsPIC30F6014 Web Server returns the HTML page shown in Figure 4 7 FIGURE 4 7 WEB PAGE FROM dsPIC30F6014 za CMX MicroNet Demo Microsoft Internet Explorer fie Edit View Favorites Tools Help 2 590 48 8mug sns Forward Stop Refresh Home leas Favorites History Print Edi Address w s e 233531 d oo N CMX Zuse sp This WEB Page is Served by the dsPIC30F running the CMX MicroNet CMX MicroNet is an embeddable TCP IP stack that is specifically designed for optimized use of FLASH and RAM resources on Microchip s 16 bit Digital Signal Controller The software runs directly on the processor with no gateways or PCs required The stack can be run in stand alone mode or work in conjunction with an RTOS Using only industry standard protocols CMX MicroNet offers true TCP IP networking via Direct Dial Up or Ethernet connectivity This demo is using approximately 4 2K instructions in Flash for code and 300 bytes RAM not including the HTML java applets and and the jpg and gif images
55. IYN LU TON3HON ON SNIA3IIN3QI WO Dud ASSY 1X3N JOi3i2ede2 zg z z u2x ngi Ju2 z uirn payetndod eq PINOYS Ezy pue zgz z pe uytn p yeIndod Inous 119 30ddns aur NEE 404 1930N Neb n8T cz bIBETS cIOEIS bn N3dD NOW nOvc INOW 328 328 L N3d0 N3dO EEH ZEH IEN Siu z148 SIN RER N3dD Scd N3dO DREI vc wyogst N3d0 GC Es WYO TBE Szu wyosiz wyo 82 N3d0 N3dO led DCH bM N3d0 EZH ABET SE bed N3dO WHO TBE Zy WYHOZOb SEA uuqosT N3dO MZ 1 uuoIs 95938 N3d0 eed 614 18 nes 3daogT N3d0 913 AST ania N3d0 219 NST 378g N3dD 92 nosz 1HUH2 123 L I NBS LYYHS 219 lug LECH Tog D N ZEY luBH3 BALIAN Zi LH EZH ASE INZZ GEIER N3d0 nBSZ dus ki ETI NASZ J3nze N3d0 S3 OST Ant ngi _ 30109 1 63 bEBETS BEGETS DCH YUH ZH Canet NaL1d18083d SNOISIN3H 4l LH Al Lon 814 2TH l LO 314 9 s ZONY TONY ER ER ER qN9I NEE 1x38 c93un 93un LH DS
56. LAB ICE4000 Connections Be E EE 10 MPLAB ICE 4000 Connection 8 LCD Display Power Supply Circuit 8 FTP Server Demonstration 65 Serial Communication Channels 8 Web Server Demonstration 53 Voice band Codec 9 LED Development Board Layout 94 POoWer On dede ne ene dee este e terres 8 Development Board Schematic 95 LED Indicators 10 Devlopment Board Features Link Statys LEDS nannan u uuu a sayashan 9 PATS sz as tte rS 9 Low Pass Eiter 9 Digital Potentiometers 9 Documentation M TEE 2 Microchip Web Site sseessseseeeeeeeeee 4 MPLAB ICD 2 eese reete rti reste reads 11 E MPLAB ICE 4000 azima 8 Emulation Header 8 MPLAB ICE User s Guide nnoesennneeesneen neeese 11 External SRAM eee di aeo 10 MPLAB IDE User s Guide 4 F O Free Software Foundation 4 WEE 13 FTP Server Demonstration FTP Server Demonstration 61 LCD Display 2n ires 65 Web Server Demonstration
57. Launch MPLAB IDE on your PC From the menu bar select Configure Select Device gt dsPIC30F6014 3 Select Programmer gt Select Tool gt MPLAB ICD 2 You should see a connection message in the MPLAB IDE output window as shown in Figure 6 5 If the MPLAB ICD 2 does not initially connect and recognize the dsPIC30F6014 device click the MPLAB ICD 2 puck icon on the MPLAB IDE toolbar The output window should then indicate a successful connection FIGURE 6 5 MPLAB ICD 2 CONNECTION MESSAGE WITH dsPIC30F6014 Build Version Control Find in Files MPLAB ICD 2 Connecting to MPLAB ICD 2 Connected Setting Vdd source to target Target Device dsPIC30F6014 found revision 0x40 Reading ICD Product ID Running ICD Self Test Passed MPLAB ICD 2 Ready m DS51471A page 76 2004 Microchip Technology Inc V 22bis Soft Modem Demonstration 4 From the MPLAB IDE File menu select Import Select V22bisdemo hex and click Open 5 From the MPLAB IDE Configure menu select Configuration Bits and verify the device configuration settings shown in Figure 6 6 FIGURE 6 6 CONFIGURATION BITS WINDOW E Configuration Bits BEP Bl x F80000 C306 Clock Switching and Monitor Sw Disabled Mon Disabled Oscillator Source Primary usciiiaror Primary Oscillator Mode XT w PLL 8x Watchdog Timer Disabled NDT Prescaler A 1 512 WDT Prescaler B 1t16 Master Clear Enable Enabled PBOR Enable Disabled Brown Out Voltage 4 5V POR Tim
58. MICROCHIP dsPICDEM net 1 and dsPICDEM net 2 Connectivity Development Board User s Guide 2004 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 All of these methods to our knowledge reguire 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 ma
59. Modifications on dsPICDEM Crystal R61 R62 R67 C42 C41 and XTAL2 open U16 empty Crystal in XTAL3 caps in C40 and C39 Mini Crystal R67 R61 R62 C40 C39 and XTAL3 open U16 empty Crystal in XTAL2 caps in C42 and C41 Canned Oscillator R67 R61 R62 C42 C41 C40 C39 XTAL2 and XTAL3 open U16 installed RC R61 R62 C42 C41 C40 XTAL2 and XTAL3 open U16 empty Cap in C39 and resistor in R67 External Clock R67 C42 C41 C40 C39 U16 XTAL2 and XTAL3 open 0 ohm installed for R61 and R62 7 1 19 Reset Switch This switch is tied to the MCLR pin on the dsPIC controller and is used to reset the device 7 1 20 Prototyping Area A prototyping area and associated header are provided which enables additional ICs and attachment boards to be added 7 1 21 Sample Devices A sample dsPIC device programmed with the demonstration code is included in the dsPICDEM net Development Board Kit The 80 pin TQFP is soldered to a 1 5 x 1 5 adaptor PCB which is inserted onto the emulation header J11 and J13 J15 Careful device handling should be used for inserting and extracting the adaptor board The orientation of the adaptor board is important The Microchip logo and device part numbering should be aligned to read from left to right before the insertion of the adapter board 2004 Microchip Technology Inc DS51471A page 91 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide NOTES DS51
60. N SSN SSN NI319212S0D0 S134 03213 2980 12H 0N2 211 7 12S0S 12U IN2 22S0S v2d 2SL 2H 2v1 SERA I2H 2 1 Si9u S5302 KSE RER I9u 00S3 2194 1459 6997 1 INI ZSS 894 81NI Z0AS 294 6N3 21985 S9H 8N2 2 2S 9H 80S e9u 12S I9H 7X122 09u xuc3 84397100S 2344 1198 S93dZ 01NI2Z153S SJH 81N2 x1en vdd 2T1N2 Xucn 3A3d2x11In Z 3d XHdIn Isi 039 X913 SSAB aana STUY b LNT v IBH ELINI IUH ZINI CIBH TINI QrgH 43un 6897 439 2UH ZNJ v 1693O 2IdSP 8 19H SIQH TZN27821 v 1QU 02N2 722I IQH G6IN2 921 Z1QH S23I TIQUZ V2I DOC OO 8094 1931 2QH 8T1N2 820 SQH SIN27220 SQH v TN2 920 tH ETN2 S20 Qu v20 cQH 230 1094 2930 a47 130 S184 21N9 8330 51N4 1847 INH 18B8 ETNU Z18H ZINU ETA 2184 81N4 B58H 6NH 88H 8NU 28H 2N 8 98U 8320 9NU S8H 2N2J SNB8 P S8H 9SNO vNU 8H SN2J ENB8 Z8H vNJ ZNU QN9 ino nuqisu YMOI QuO1 ay ERR 3074S 39 HS 88H 28H 98u ein 13534 4 Td JW3 SJ O18Z gt 23d SJ Le 194 DS51471A page 95 88d 28H gay arud Sus SIN NO SNId QO3ShND JN n SUH ZNJ I8B EN2 29d7 ND 75d O8H ZN2 09d 0NJ8 ddd gan gan can gan I2 8 Ze ZI Y N FIGURE A 2 2004 Microchip Technology Inc PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide dsPICDEM net DEVELOPMENT BOARD SCHEMATIC SHEET 2 OF 11 FIGURE A 3
61. OUR APPLICATION Operating the dsPIC30F with the CMX MicroNet TCP IP stack gives you the ability to send data across the Internet However you must decide how to use it in your design If you are simply looking for an interactive method of monitoring real time values as they are changing within your target device you may want to utilize the HTTP protocol and server already developed By setting up a series of URLs or links you can have the HTTP module format the information in the form of HTML files If you require a more efficient or a secure form of interaction you could set up a proprietary method of communication and deliver it within the payload of the TCP packet itself A Windows application could be created in order to communicate interact and manage a group of your devices on the Net One step further may be to give the ability of the devices themselves to interact with each other 2004 Microchip Technology Inc DS51471A page 59 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide NOTES DS51471A page 60 2004 Microchip Technology Inc dsPICDEM net 1 AND dsPICDEM net 2 CONNECTIVITY DEVELOPMENT BOARD MICROCHIP USER S GUIDE Chapter 5 FTP Server Demonstration 5 1 INTRODUCTION This chapter describes a sample program that demonstrates remote monitoring and control of an embedded application using File Transfer Protocol FTP communication 5 4 HIGHLIGHTS Information in this c
62. PED BER 000394 nop 000394 nop 000394 nop 20850F mov w 0x850 w15 227960 mov w 0x2796 w0 880100 mov w wO SPLIM 000000 nop 070005 reall psv init o7000c reall data init 02020C call main 000000 nop DA4000 ReservedBR pcodeHex Machine Symbolic PSV Mixed PSV Data 2 Openthe dsPICDEMnet Tutorial c source file Double click on the file name in the Project Window if the file is not already open 3 Select and right click line TMR1 0 then choose Run to Cursor as shown in Figure 2 22 FIGURE 2 22 RUN TO CURSOR COMMAND Mi C Tutorial dsPICDEMnet Tutorial c nl x LATCbits LATC3 Close Set Breakpoint const char LCD Breakpoints const char LCD define LED2 Run to Cursor Set PC at Cursor Right click TMR1 0 and select Run to Cursor Cut Main routir int main void Paste LATC Get Delete TRISC Ox Turn LED1 LEDZ and LEDS off Set LED pins as outputs Add To Project TICON 0 Advanced TMR1 0 Bookmarks PRL Fey Text Mode D TICON 0 properties Turn off Timerl by clearing co Start Timerl at zero Load Timerl period register fo Load Timerl settings for 1 256 Init LCD Initialize LCD home clr Clear screen and home cursor sl gt The code runs briefly until it reaches the specified line It then halts with the green arrow pointing to the next line as shown in Figure 2 23
63. PERATURE SENSOR U2 2004 Microchip Technology Inc DS51471A page 55 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide 4 6 4 Control the dsPICDEM net Development Board This portion of the demonstration illustrates how you can remotely control functions in an embedded application from your browser Information you enter on the web page affects the LEDs and LCD display on the dsPICDEM net board 1 Repeatedly click the LEDs button on the web page LED1 LED2 and LED3 on the dsPICDEM net development board toggle up and down in sequence for each mouse click 2 Enter up to 16 characters in the text box on the web page then click the LCD button The information you typed displays as line 2 of the LCD on the dsPICDEM net board 3 Repeat step 2 The last typed entry replaces line 2 of the LCD FIGURE 4 9 CONTROLLED DEVICES INFORMATION TYPED ON WEB PAGE DISPLAYS ON LCD 4 6 5 Hyper Text Transfer Protocol HTTP is the defacto standard for transferring World Wide Web documents although it is designed to be extensible to almost any document format HTTP Version 1 1 is documented in RFC 2068 HTTP Version 1 0 deprecated is documented in RFC 1945 See also the W3C s work on the standard at www w3 org Protocols HTTP operates over TCP connections usually to port 80 though this can be overridden and another port used After a successful connection the client transmits a request message to the serve
64. TS The 12 bit module is configured to continually sample and convert channels AN3 temperature sensor U2 AN4 RP1 and AN5 RP2 When all three signals have been converted an ADC module based interrupt occurs and the ISR code simply saves off the converted values to variables defined in data memory Outside the interrupt this raw data is converted to ASCII by a simple conversion routine and then used by the UART and LCD display code modules 3 9 8 8 UART TRANSMIT INTERRUPTS Approximately every 200 mS data is transmitted via the UART to the HyperTerminal session window The term data refers to the following Analog data such as RP1 and RP2 voltages Temperature sensor data U2 3 9 8 4 TIMERI Timer1 is a 16 bit timer that uses the instruction cycle as its time base It is configured to time out and generate an interrupt every 2 2 milliseconds The Timer1 Interrupt Service Routine ISR simply toggles LED1 and clears the associated interrupt flag 3 9 85 TIMER2 Timer2 is a 16 bit timer that uses the instruction cycle as its time base It is configured to time out and generate an interrupt every 3 95 milliseconds The Timer2 Interrupt Service Routine ISR increments a variable tests bit 9 of this variable and if set toggles LED2 If LED2 is toggled the ISR resets this same variable to zero Finally the associated interrupt flag is cleared 3 9 8 6 TIMER3 Timer3 is a 16 bit timer that uses the instruction cycle as i
65. Technology Inc Quick Start Program FIGURE 3 4 PROJECT WIZARD STEP 3 NAME YOUR PROJECT Project Wizard E XI Step Three E Name your project r Project Name MyQuickStart Type a name for your project Project Directory C Quick Start Browse and save it in the Project Directory C Quick Start lt Back Next gt Cancel Help 3 4 3 Name Your Project 1 2 3 In the Project Name text box type MyQuickStart Click Browse and navigate to C NQuick Start to place your project in the Quick Start folder Click Next gt to continue 3 4 4 Add Files to Project 1 On the Project Wizard Step Four dialog see Figure 3 5 locate the C NQuick Start folder and add all the hex source and include files to the right side Select and add all the files in the Quick Start h folder e defines h enic init param h e delay h enic strings h e 1cd h e strings h Select and add all the files in the Quick Start inc folder e device Fcy inc e 513021 mode inc e 513021 outputs inc Select and add all the files in the Quick Start source folder e bin2dec c e init Adc s e Dac Update c e init Dci s e delay c e init INTpin s e init RealTek NIC c e init Ports s e init Sram c e init _Si3021 s e 1cd c e init Spil s e main c e init Timers s e TestCAN c e init Uart s e TestUartl c e isr Adc s e traps c e isr Dci s e lkhz s sier INTpin s
66. Telephone Network PSTN Interface The dsPICDEM net Development board is available in 2 configurations one using the Si3035 chipset for the FCC and JATE compliant designs and the other using Si3034 chipset for worldwide applications The dsPIC communicates with this port with its Data Converter Interface DCI The Si3035 chipset is composed of the Si3012 DAA and a Si3021 AFE ICs The dsPIC communicates to the Si3021 AFE via its DCI peripheral module The Si3034 chipset is composed of a Si3014 DAA and the same Si3021 AFE A speaker is provided on the development board and provides for call progress monitoring For detailed operation please refer to the Si3034 and Si3035 data sheets available on www silabs com 2004 Microchip Technology Inc DS51471A page 89 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide 7 1 12 10 Base T Ethernet An Ethernet interface is provided using the Realtek RTL8019 ethernet controller This is accessed via the bidirectional bus on PORTD For detailed operation of this device please see the RTL8019 data sheet from Realtek STATUS LEDs Four LEDs are provided LINK STATUS This LED can be used for link status XMIT and RX When the board is connected correctly these are normally lit and flash OFF inverted logic when the board is transmitting or receiving a packet respectively BNC This LED is enabled as default and indicates medium type Connection to the Et
67. Window Help D y mal e E MyQuickStart mcp Will C Quick Start source main c E Source Files Filename 1khz s Date 05 17 2004 2khz s bin2dec c Dac_Update c delay c device_config s Details Initial Demo Code Release display s Other Files Required p30F6014 gld p30f6014 inc init Adc s Tools Used MPLAB IDE 6 50 00 init Die ASM30 Assembler 1 20 01 init_INTpin s Linker 1 20 01 init Ports s init RealTek NIC c s Devices Supported by this file init Si3021 s dsPIC 30F6014 init Spil s init_Sram c init_Timers s init_Uart s isr_Adc s Ir Dci s ist INTpin s isr_RealTek_NIC s isr_Timers s isr Uartl tx s El Q er 3S si J I EI E Additional Notes Basic demo code for initializing and control several dsPIC peripherals and board functions Complete demo functionality tested to 29 5 MIPs No C module optimizations enabled 3 dsPIC device configuration set in device config s file kcd c dsPIC PLL mode set in device Fcy inc file main c Adjustment of delay routines supported in delay h file TestCAN c TestUart1 c traps c der Files finclude p3DF6014 h defines h finclude defines h delay h include lcd h device Fcy inc finclude strings h kd h include delay h ric init param h ni strings h p30f6014 h MPLABICD2 dsPIC3OF6O14 pc loab sab IPO dene ze ln 1 Col 1 INS wR start BG Dean Lovejoy Inbox L EE Microsof TER MPL
68. alue of the temperature sensor Adjust RP1 and or RP2 Notice the changed value s 3 8 QUICK START DEMONSTRATION FEATURES AND PERIPHERALS The intent of the Quick Start demonstration is to give you hands on experience with the dsPIC30F processor and peripheral features At this point you can examine the program main c and or individual code modules in MPLAB IDE You can set breakpoints to examine specific activities Or you can step through the code modules one instruction at a time 3 8 1 dsPIC30F Peripheral Features The Quick Start demonstration program initializes and controls these dsPIC30F peripherals and associated board functions Timer1 Configured as a 16 bit timer with 1 1 prescaler used as toggle rate for LED1 Timer2 Configured as 16 bit timer with a 1 1 prescaler used as toggle rate for LED2 Timer3 Configured as 16 bit timer with a 1 1 prescaler used as toggle rate for LED3 UART1 TX Used to transmit demonstration data to the PC for display SPI 1 Used to communicate to the MCP42050 Dual Channel Digital potentiometer 12 bit ADC Used to convert multiple analog signals such as potentiometer and temperature values TC1047A temperature sensor 2004 Microchip Technology Inc DS51471A page 45 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide Data Converter Interface Interfaced to an external Si303x DAA AFE chipset for PSTN interface control and
69. ama 81 6 9 Regulatory Compliance Reference Information 84 6 10 ITU T Specifications oo cece e eaaa aaa an aa E E EO EEA Ena iaa 86 Chapter 7 dsPICDEM net Development Hardware 7 1 dsPICDEM net Hardware Components 87 Appendix A Hardware Schematics A 1 Board Layout and Schematics 93 Index AA AA 107 Worldwide Sales and Service U uuu 109 DS51471A page iv 2004 Microchip Technology Inc dsPICDEM net 1 AND dsPICDEM net 2 CONNECTIVITY DEVELOPMENT BOARD MICROCHIP USER S GUIDE Preface INTRODUCTION This user s guide supports the dsPICDEM net 1 and dsPICDEM net 2 connectivity development boards These boards provide basic platforms that enable the application developer to create and evaluate both connectivity and non connectivity based solutions This chapter previews the contents of the manual tells you how to obtain valuable customer support and recommends useful reference information HIGHLIGHTS Items discussed in this chapter are About This Guide Warranty Registration Recommended Reading The Microchip Web Site Development Systems Customer Notification Service Customer Support ABOUT THIS GUIDE This user s guide describes how to use the dsPICDEM net 1 and dsPICDEM
70. are AT commands for enabling V 21 between the dsPIC30F Soft Modem and US Robotics Model 5686E Reference Modem If the AT command is valid HyperTerminal displays OK as the response message If the AT command is invalid or unsupported HyperTerminal displays ERROR as the response message Supported AT commands for V 21 connection on US Robotics Modem AT Command Function AT amp F1 Factory Default settings ATS0 1 Enable auto answer after one ring ATS27 1 Enable the V 21 fallback Supported AT commands for V 21 connection on dsPIC30F Soft Modem AT Command Function AT amp F Enable dsPIC30F Soft Modem default settings AT MS 0 0 300 300 Force V 21 connection Note In almost all the modems a V 42 LAPM connection is not supported for V 21 and V 23 data pump modulation modes Hence a connection will be established in Non V 42 mode PROTOCOL NONE KENE EN 2004 Microchip Technology Inc DS51471A page 83 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide 6 8 6 Response Messages for Successful Modem Connections Table 6 3 lists connection messages displayed on the HyperTerminal when a successful modem connection has been established between the dsPIC30F Soft Modem and the US Robotics Model 5686E modem using the V22bis demonstration TABLE 6 4 SUCCESSFUL CONNECTION RESPONSE MESSAGES Data Pump Modulation dsPIC30F Soft Modem US Robotics Model 5686E V 22bis 2400 bps CARRIER 240
71. assigned auomatic ally if pour nelwork supp Check this option the capability Dihamvies younesd lo eek pour natwork administrator the appropiate P settings Type IP address C Oblan en IP address automaticaly Use the folowang IP addeesz IP address 216 233 5 Subnet mask 255 255 255 0 Defaut gatewaj C Dbian DNES seve adess actam cceli Use the folowing DNS server edereases Proteried DNS sarver gt kemas ONS terves 4 6 HTTP WEB SERVER DEMONSTRATION 4 6 1 Programming the dsPIC30F6014 Device The dsPIC30F6014 device must be programmed with the HTTP Web demonstration program webdemo hex If you have previously loaded this program on a dsPIC30F6014 device you can proceed directly to Section 4 6 2 Start HTTP Web Server Session 1 Apply power to the board The green POWER LED illuminates 2 Launch MPLAB IDE on your PC From the Configure menu choose Select Device then select dsPIC30F6014 3 Select Programmer gt Select Programmer gt MPLAB ICD 2 You should see a connection message in the output window as shown in Figure 4 4 Ifthe MPLAB ICD 2 does not initially connect and recognize the dsPIC30F6014 device click the MPLAB ICD 2 puck icon on the MPLAB IDE toolbar The output window should then indicate a successful connection FIGURE 4 4 MPLAB ICD 2 CONNECTION MESSAGE WITH dsPIC30F6014 Build Version Control Find in Files MPLAB ICD 2 Connecting to MPLAB I
72. ay trial available from the Microchip web site The quick start program basically displays information on the LCD screen and toggles LEDs in response to specific actions Source files are provided on the dsPICDEM net Development Kit Software CD in the dsPICDEM net Board Sample Applications Quick Start folder Full source code is provided to assist in debugging The source files are used with a linker script file p30 6014 gld and a header file p30 6014 h from the MPLAB C30 compiler to form a simple quick start project As you work with the step by step instructions you will become increasingly familiar with key features of the dsPIC30F 2004 Microchip Technology Inc DS51471A page 31 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide There are three or four steps to this quick start depending on the debug tool being used 1 Create a project in MPLAB 2 Assemble and link the code 3 Program the chip if the MPLAB ICD 2 is being used 4 Debug the code with the MPLAB ICD 2 The MPLAB ICD 2 is used in the quick start procedures to illustrate debugging 3 4 CREATING THE PROJECT The first step is to create a project and a workspace in MPLAB Usually you will have one project in one workspace 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 workspace contains one or more projects a
73. c dsPICDEM net 1 AND dsPICDEM net 2 CONNECTIVITY DEVELOPMENT BOARD MICROCHIP USER S GUIDE Chapter 7 dsPICDEM net Development Hardware 7 1 dsPICDEM net Hardware Components Figure 7 1 illustrates the major components that comprise the dsPICDEM net Development Board Table 7 1 identifies these hardware elements and points to the specific instructions for using each item FIGURE 7 1 dsPIC30F6014 16 BIT SIGNAL CONTROLLER HARDWARE COMPONENTS TABLE 7 1 dsPICDEM net DEVELOPMENT BOARD HARDWARE No Hardware Element No Hardware Element 1 CANPort Secion 7 12 12 LCD Graphic Display Section7 1 9 2 10 Base T Ethernet Section 7 1 12 13 Temperature Sensor Section 7 1 4 3 Oscillator Section 7 1 18 14 PSTN Telephone Interface Section 7 1 11 4 Emulation Header Section 7 1 15 15 Power On Indicator Section 7 1 17 5 Sample Devices Section 7 1 21 16 Power Supply Section 7 1 16 6 Prototyping Area Section 7 1 20 17 RS 232 Serial Port Section 7 1 1 7 64kx16 External SRAM Section 7 1 14 18 SerialEE Memory Section 7 1 13 8 Push Button Switches Section 7 1 6 19 RS 485 RS 422 Port Section 7 1 3 9 Reset Switch Section 7 1 19 20 Digital Potentiometer Section 7 1 8 10 LEDs Section 7 1 7 21 ICD 2 Connector Section 7 1 10 11 Analog Potentiometers Section 7 1 5 2004 Microchip Technology Inc DS51471A page 87 PICDEM net 1
74. cal Regulation that defines a harmonized standard for analog access to the PSTN throughout the European Economic Area EEA and Switzerland In the past analog standards were not harmonized Manufacturers were required to go to each country and test analog equipment to that country s unique specifications CTR 21 simplifies this process by enabling manufacturers to go to one test lab and take one compliance test for all EEA member countries The result is faster product delivery throughout the EEA market 6 9 4 Japan Approval Institute for Telecommunications Equipment JATE is the institute that approves telecommunications equipment for use with Japan s public telephone network Approved equipment bears a JATE approval mark or number For more information on JATE refer to www jate or jp index_e html or Nippon Telegraph and Telephone NTT Corporation www ntt co jp index_e html 2004 Microchip Technology Inc DS51471A page 85 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide 6 10 ITU T SPECIFICATIONS Table 6 5 lists the ITU T specifications used for development of the soft modem and DTMF implementation on the dsPIC30F product family TABLE 6 5 ITU T SPECIFICATIONS ITU T Specification Name Of The Document ITU T V 32bis A duplex modem operating at data signalling rates of up to 14400 bit s for use on the general switched telephone network and on leased point to po
75. cstseetescssscineeeateces 9 Digital Potentiometer see 89 Emulation Header 90 B ICD GConnectot iier enu 89 Board Hardware niet e eter 9 LCD Graphic Display osnneeeeeeeeeeeeeneenn eenen 89 c LEDS iei a AAA 89 Oscillator Options 91 CAN Channel 5 iet eire rede dee 8 Power Supply 91 Crossover Cable 8 Power on Indieator ooc ooocoococcoccececcececeececeececeeccccee 91 Customer Notification Service 5 Prototyping Area 91 Customer SUPPO t sii 6 Push Button Switches 89 D Reset Switch tued NEEN rn EN RS 232 Serial Ports 88 GE Control Flow eene nennen 46 RS A85 RS 422 Port 88 ower up Peripheral Initialization 46 Demonstration Setup Sample Devices Ge geg EN Te EI 23 ee 99 90 Web Server 50 UE ES Development Board Features l 10 Base T Ethernet 9 Interface Cable s ssssseissseiesieiieisresrerisrerrsrereerereereres 8 Analog Devices 9 Internet Address aaa aaa aaa 4 Device Clocking 9 MPLAB ICD 2 Connection L MPLAB ICD 2 Connection 8 Language Toolsuite 15 34 MP
76. e 2khz s e isr RealTek NIC s e device config s eisr Timers s e display s e isr Uartl tx s 2004 Microchip Technology Inc DS51471A page 35 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide 2 Navigate to the C pic30 tools support gld folder and add file p30f 6014 gl1d to include the linker script file in the project 3 Navigate to the C pic30 tools support h folder and add file p30 6014 h to include the header file in the project Note The linker script file and header file locations for your environment may be different The location will depend on where the C30 compiler is installed FIGURE 3 5 PROJECT WIZARD STEP 4 ADD FILES TO PROJECT x existing files to your project Add the Quick Start files S and dsPIC30F6014 support files to your newly EC ine created project E device Fcy inc DICA Quick Start source isr_Real DIC Quick Start source isr_Time DIC Quick Start source isr_Uart DICA Quick Start source led c O C GQuick Start source main c Di C GQuick Start source Si3021_ O C GQuick Start source TestCat DIC Quick SS gt Add gt gt E 5i3021 mode i B 5i3021 output BS EI CH source D MER O C Guick Start source traps c e Check the box to copy the file to the project directory feu ew 4 Click Next gt to continue The Project Wizard Summary screen Figure 3 6 displays the parameters of your project
77. e hardware included on the of the dsPICDEM net 1 and dsPICDEM net 2 boards Appendix A Hardware Schematics This Appendix contains hardware layout and schematic diagrams of the dsPICDEM net 1 and dsPICDEM net 2 2004 Microchip Technology Inc DS51471A page 1 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide Conventions Used in This Guide This User s Guide uses the following documentation conventions DOCUMENTATION CONVENTION Description Represents Examples Code Courier font Plain characters Sample code Filenames and paths define START c Nautoexec bat Angle brackets lt gt Square brackets Variables Optional arguments lt label gt pic30 as lt exp gt main s Curly brackets and pipe character Choice of mutually exclusive arguments an OR selection errorlevel 0 1 Lower case characters hexadecimal digit Type of data filename in quotes Ellipses Used to imply but not show list additional text that is not relevant to list option the example list option Oxnnn A hexadecimal number where n is a OxFFFF 0x007A Italic characters A variable argument it can be eithera char isascii char type of data in lower case characters ch or a specific example in upper case characters Interface Arial font Underlined italic text A menu selection from the menu bar File Save
78. e latest versions of all of Microchip s development systems software products Plus this line provides information on how customers can receive any currently available upgrade kits The Hotline Numbers are 1 800 755 2345 for U S and most of Canada 1 480 792 7302 for the rest of the world DS51471A page 6 2004 Microchip Technology Inc dsPICDEM net 1 AND dsPICDEM net 2 CONNECTIVITY DEVELOPMENT BOARD MICROCHIP USER S GUIDE Chapter 1 Introduction 1 1 INTRODUCTION This chapter introduces several connectivity capabilities that can easily be implemented with the use of the dsPICDEM net Connectivity Development Board 1 2 HIGHLIGHTS This chapter discusses Overview e dsPICDEM net Package Contents dsPICDEM net Board Functionality e dsPICDEM net Demonstration Programs Reference Documents 1 3 OVERVIEW The dsPICDEM net 1 and dsPICDEM net 2 connectivity development boards are tools designed to help the application developer create and evaluate both connectivity and non connectivity based solutions using dsPIC30F High Performance Digital Signal Controllers The dsPICDEM net 1 board supports the Federal Communications Commission FCC and Japan Approval Institute for Telecommunications Equipment JATE country specific Public Switched Telephone Network PSTN The dsPICDEM net 2 board supports the Common Technical Regulation 21 CTR 21 PSTN Both boards support the Realtek 10 base T Ethernet Network Interface
79. ed hardware on the dsPICDEM net Development Board These code modules are intended to increase your comfort level with the dsPIC by getting you started initializing and controlling peripherals Additional code modules are provided to initialize and perform loopback tests on board hardware such as the 64Kx16 SRAM RealTek 10 Base T NIC and Si303x Data Access Arrangement DAA and Analog Front End AFE circuits 3 2 HIGHLIGHTS This chapter discusses Quick Start Program Overview Creating the Project Building the Code Device Configuration and Programming Interacting with the Code Quick Start Demonstration Features and Peripherals Data and Control Flow Summary 3 3 QUICK START PROGRAM OVERVIEW The quick start program is provided to accelerate your proficiency in working with the dsPIC30F device and dsPICDEM net Development Board to create your own embedded solutions The building block code modules can be used to initialize and control several dsPIC peripherals and associated board functions The quick start program will also increase your familiarity with the dsPIC software development tools You will use the MPLAB IDE to create a quick start project You will use the MPLAB C30 compiler to build the quick start program And you will use the MPLAB ICD 2 debugger to program the dsPIC30F chip and debug the program on the board If you have not yet purchased the MPLAB C30 compiler you will need to download and install the full feature 60 d
80. eding 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 the USB driver 3 6 1 From the Configure menu select Configuration Bits to view the configuration bits and set up the bits as shown in Figure 3 12 The settings that will most likely need to change are Set Up Device Configuration Oscillator Source Primary Oscillator Mode Watchdog Timer Comm Channel Select Primary Oscillator XT w PLL 8x Disabled Use PGC EMUC and PGD EMUD FIGURE 3 12 CONFIGURATION SETTINGS W Configuration Bits nl x Address Value cCetegorv sd Setting Clock Switching and Monitor Sw Disabled Mon Disabled Oscillator Source Primary pr Primary Oscillator Mode XT w PLL 8x Watchdog Timer Disabled WDT Prescaler A 1 512 WDT Prescaler B Master Clear Enable PBOR Enable Broun Out Voltage POR Timer Value General Code Segment Code Protect General Code Segment Write Protect Comm Channel Select 1 16 Enabled Enabled 4 5V 64ms Disabled Disabled Use PGC EMUC and PGD EMUD lt After building the code and setting the configuration bits the MPLAB ICD 2 debugger can be used to run and debug the code on the dsPICDEM net Demonstration Board Follow the instructions in one of the next two sections depending on which tool you are using 3 6 2 E
81. er Value 64ms General Code Segment Code Protect Disabled General Code Segment Write Protect Disabled Comm Channel Select Use PGC EMUC and PGD EMUD 6 From the MPLAB IDE Programmer menu select Program The V22bisdemo hex file downloads to the dsPIC30F6014 The Output Window records the process as it occurs and indicates completion by displaying MPLAB ICD 2 Ready 7 Remove the MPLAB ICD 2 cable from the board then press RESET on the demonstration board to run the program The LCD on the dsPICDEM net board indicates that the program is running as shown in Figure 6 7 FIGURE 6 7 LCD DISPLAY dsPIC30F V 22bis Soft Modem Demo At this point you are ready to run the soft modem demonstration as described in Section 6 4 Demonstration Procedures 2004 Microchip Technology Inc DS51471A page 77 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide 66 DESCRIPTION OF dsPIC30F SOFT MODEM The Microchip data modem library includes ITU T compliant algorithms for V 21 V 22 V 22bis V 23 V 32 and V 32bis modem recommendations as well as Bell standard 103 These are the important parameters V 21 V 23 and Bell 103 are Frequency Shift Keying FSK modems V 32 V 32bis and V 22bis are Quadrature Amplitude Modulated QAM modems V 22 is a Phase Shift Keyed PSK modem V 21 V 22 V 22bis V 32 and V 32bis are two wire full duplex modems V 23 is full duplex when it
82. ere Category Setting Oscillator Source Primary Oscillator Primary Oscillator Mode XT w PLL 4x Watchdog Timer Disabled Comm Channel Select Use PGC EMUC and PGD EMUD DS51471A page 22 2004 Microchip Technology Inc Tutorial FIGURE 2 13 CONFIGURATION SETTINGS BER Address Value category Setting LI Clock Switching and Monitor Sw Disabled Mon Disabled Oscillator Source Primary Oscillator Primary Oscillator Mode Watchdog Timer Disabled WDT Prescaler A 1 512 WDT Prescaler B 1 16 Master Clear Enable Enabled PBOR Enable Enabled Brown Out Voltage 4 5V POR Timer Value 6410s General Code Segment Code Protect Disabled General Code Segment Write Protect Disabled Comm Channel Select Use PGC EMUC and PGD EMUD After building the code and setting the configuration bits use the MPLAB ICD 2 debugger to program the device and run and debug the code on the dsPICDEM net Demonstration Board 2 6 2 Enabling the MPLAB ICD 2 Connection The MPLAB ICD 2 can be used to program and debug the dsPIC30F6014 device in circuit on the dsPICDEM net board Note Before proceeding 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 details regarding the installation of the USB driver 1 Connect the MPLAB ICD 2 to the PC with the USB cable see Figure 2 14 2 Connect the MPLAB ICD 2 to modular connecto
83. ers J17 and J19 Also it is necessary to enable the hardware flow control in HyperTerminal or other terminal emulation program running on the PC It is possible to change the flow control mode of the dsPIC30F Soft Modem to Xon Xoff by using a specific AT command AT amp Kn and selecting a corresponding flow control mode in the HyperTerminal J n H r n M nn DS51471A page 82 2004 Microchip Technology Inc V 22bis Soft Modem Demonstration 6 8 4 V 23 Connection Between dsPIC30F Soft Modem and US Robotics Modem Following are AT commands for enabling V 23 between the dsPIC03F Soft Modem and US Robotics Model 5686E Reference Modem If the AT command is valid HyperTerminal displays OK as the response message If the AT command is invalid or unsupported HyperTerminal displays ERROR as the response message Supported AT commands for V 23 connection on US Robotics Modem AT Command Function AT amp F1 Enable factory default settings ATS0 1 Enable auto answer after one ring ATS27 16 Enable the V 23 fallback AT commands for V 23 connection on dsPIC30F Soft Modem AT Command Function AT amp F dsPIC30 Soft Modem default settings AT MS 3 0 300 1200 Force V 23 connection 6 8 5 V 21 connection Between dsPIC30F Soft Modem and US Robotics Modem Following
84. et more information FIGURE 3 14 ENABLING MPLAB ICD 2 Build Version Control Find in Files MPLAB ICD 2 Connecting to MPLAB ICD 2 Connected Setting Vdd source to target Target Device dsPIC30F6014 found revision 0x40 Reading ICD Product ID Running ICD Self Test Passed MPLAB ICD 2 Ready 6 From the Debugger menu select Settings to display the ICD Debugger settings see Figure 3 15 7 Onthe Program tab ensure that Allow ICD 2 to select memories and ranges is selected This setting will speed up programming by addressing only a small part of the total program memory 2004 Microchip Technology Inc DS51471A page 41 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide FIGURE 3 15 MPLAB ICD 2 DEBUGGER SETTINGS ais Status Communication Limitations Power Program Versions Warnings Allow ICD 2 to select memories and ranges rC Manually select memories and ranges External Memos Hey Start ba End ba 8 Program the part Debugger gt Program The Output window shows the results of the programming cycle as shown in Figure 3 16 The part is now programmed and is ready to run FIGURE 3 16 OUTPUT WINDOW Build Version Control Find in Files MPLAB ICD 2 F TODTOITITITIO Arget Erasing Part Programming Program Memory 0x0 0x1A F Loading DebugExecutive Programming DebugExec
85. fered by Microchip The dsPIC30F data modem library is composed of ITU T compliant algorithms for V 21 V 22 V 22bis V 23 V 32 and V 32bis modem recommendations and Bell standard 103 The dsPIC30F data modem included as part of the dsPICDEM net Connectivity Development Board and demonstrated in this section supports V 22bis and all lower data pump modulations Full source code for V 22bis and lower data pump modulations is provided on the dsPICDEM net Development Kit Software CD V 32bis is not part of this demonstration package but is available for purchase For detailed information on the soft modem refer to the dsPIC30F Soft Modem User s Guide provided on the dsPICDEM net Development Kit Software CD 61 HIGHLIGHTS Information covered in this chapter includes Demonstration Overview Demonstration Configurations Demonstration Procedures Reprogramming the dsPIC30F6014 Description of dsPIC30F Soft Modem dsPIC30F Soft Modem AT Command Set Troubleshooting the Connection Regulatory Compliance Reference Information ITU T Specifications 62 DEMONSTRATION OVERVIEW This demonstration illustrates the ability of the dsPIC30F Soft Modem to connect to another modem for transmitting and receiving data over the PSTN The demonstration program implements real time ITU T V 22bis Transmit and Receive Data Pump Modulations For specific information related to key features and performance metrics for the dsPIC30F Soft Modem see Section 6 6 Descript
86. formation on Microchip in circuit emulators This includes the MPLAB ICE 2000 and MPLAB ICE 4000 In Circuit Debuggers The latest information on Microchip in circuit debuggers These include the MPLAB ICD and MPLAB ICD 2 MPLAB 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 and MPLAB SIM30 simulators MPLAB IDE Project Manager and general editing and debugging features Programmers The latest information on Microchip device programmers These include the PRO MATE II device programmer and PICSTART Plus development programmer 2004 Microchip Technology Inc DS51471A page 5 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev 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 Corporate Applications Engineer CAE Hotline Customers should call their distributor representative or field application engineer FAE for support Local sales offices are also available to help customers See the sales offices and locations listed on the back of this publication Corporate Applications Engineers CAEs may be contacted at 480 792 7627 In addition there is a Systems Information and Upgrade Line This line provides system users a listing of th
87. gh a low pass filter VR1 is the main voltage regulator for all components on the development board 7 1 6 Push Button Switches Three switches S1 S3 are connected to port pins RA12 RA14 respectively on the dsPIC device The signal lines are normally pulled up to 5 VDC through 10 kQ resistors Pressing the switch will short the line to ground Port pins RA12 RA14 are configured as the INT1 INT3 external interrupt pins 7 1 7 LEDs Three red LEDs LED1 LED3 are connected to port pins RC2 to RC4 respectively on the dsPIC device The LED anodes are tied to VDD through a 1 2K resistor 7 1 8 Digital Potentiometer A dual channel digital potentiometer MCP42050 is provided on the development board Control of the digital potentiometer is via the dsPIC SPI 1 communication channel The outputs of the digital potentiometer are applied to test points PWO and PW1 7 1 9 LCD Graphic Display A 2 x 16 character dot matrix LCD display is provided on the development board The dsPIC device accesses the LCD via PORTD pins RDO RD7 The three LCD control signals RS RW and E are connected to dsPIC port pins RA6 RB11 and RA7 respectively 7 1 10 ICD Connector By way of the modular connector ICD the MPLAB ICD 2 can be connected for low cost programming and debugging of the dsPIC device Programming and debugging the dsPIC device is through dedicated use of the PGC EMUC RB1 and PGD EMUD RBO pins on the development board 7 1 41 Public Switch
88. h w pad actual length 0x376 x6ec 0x378 Ox6 0 Ox4 0x8 0x84 0x108 0x39a 0x734 Total program memory used bytes Executing C Program Files MPLAB IDE dsPIC_Tools Bin Lcoff_iCoff exe MyTutorial cof Loaded CATutorial MyTutorial cof BUILD SUCCEEDED Mon May 10 15 49 01 2004 If you experience problems with the build double check all the steps in this tutorial and ensure that you are using the latest versions of the development tools The latest upgrades are available on the Microchip web site www microchip com If there are errors in the source code you can double click the error messages in the Output window and MPLAB will point to the offending line in the source code This should not happen if the files were copied from the dsPICDEM net Development Kit CD 2 6 DEVICE CONFIGURATION AND PROGRAMMING After you have built the code you must set up the configuration bits and then connect the tool you plan to use for programming running and debugging the code Note Before proceeding 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 the USB driver 2 6 1 Set Up Device Configuration From the Configure menu select Configuration Bits to view the configuration bits see Figure 2 13 Accept the settings resulting from your build However make sure these device categories are set up as shown h
89. hapter includes Application Overview Demonstration Setup Configuring your Laptop or Desktop PC FTP Server Demonstration e Summary 5 2 APPLICATION OVERVIEW This demonstration program illustrates file transfers between an embedded application on the dsPIC30F6014 and a remote computer The embedded application uses the CMX MicroNet TCP IP Stack configured as an FTP Server The FTP server associates system application data with a virtual file system implemented in the dsPIC Flash memory A typical dsPIC30F FTP application allows data files produced by the dsPIC device and stored in the virtual file system to be retrieved remotely for such tasks as data logging inventory control performance analysis and more on the remote computer system Some applications may update Program Flash on a remote dsPIC device from a central server location In other applications FTP activity may execute on a scheduled basis using automatic error detection correction to ensure that data is properly transmitted and received CMX MicroNet FTP Server is fully compliant with Internet Engineering Task Force IETF and Request for Comments RFC standards and supports Windows DOS UNIX and Linux based FTP clients For detailed information on these standards refer to www ietf org and www faqs org rfcs respectively This sample application demonstrates two main activities supported by the dsPIC30F6014 FTP Server Retrieving a file on the FTP
90. hernet is supported via the RJ 45 modular connector 7 1 13 Serial EE Memory Device A Microchip 24LC515 serial EEPROM provides 512 Kbit 64 Kbyte of storage for constants such as Web pages linearization tables for sensors and custom data tables The 24LC515 is programmable via a two wire serial I2C interface 7 1 14 64k x 16 External SRAM A Cypress 1 Mbit 64k words CY7C1021B CMOS Static RAM is provided and can be used to store temporary data for product development or diagnostic purposes The CY7C1021B is accessible via a multiplexed bus on PORTD pins RDO RD15 The SRAM control signals CE OE and WE are provided by the dsPIC PORTB pins RB9 RB10 and RB11 respectively Two 74HCT573 Octal D latches are implemented for latching the SRAM address The high and low byte control signals BHE and BLE of the SRAM are tied to ground through zero ohm resistors Reads and writes to the SRAM are performed in the x16 data mode The following is a typical sequence of steps for accessing the external SRAM device Place 16 bit address on PORTD and set pin direction TRISD as outputs Assert ALE RB12 to a logic 1 from a logic o to latch address Assert control signal OE RB10 to a logic o for a read or logic 1 for a write For a write place data on PORTD Assert CE RB9 to a logic o to select SRAM chip If performing a read read data on PORTD If performing a write assert control signal WE RB11 to a logic 1 fro
91. icrosoft Internet Explorer iaj xj File Edit View Favorites Tools Help 35 A x 2 TN JO Search Sie Favortes S Media O Ee Address c index htm z o uns gt Gna EI re EI This page is coming from CMX MicroNet CMX MicroNet can do more than just display HTML pages Forms can be used to send data to the web server where the data can then be acted upon by user defined functions lt exec cgi gt Submit The buttons below don t do anything They are here to show that multiple graphics files can be included in web pages EISES Go to Page 2 Copyright CMX Systems Inc 2003 All rights reserved El a T My Computer 5 5 4 Send a File to FTP Server This portion of the demonstration shows how you might transfer a file to the embedded application The demonstration process is conducted in three parts First you create a file on your PC to transfer to the dsPIC30F6014 FTP Server Next you open an FTP session and transfer the file And finally you use MPLAB IDE to examine the actual contents of the FTP virtual file memory on the dsPIC30F6014 device To create the demonstration file to be transferred 1 At the DOS command line prompt type notepad 2 When Notepad displays type the following message This is a test file to demonstrate the dsPIC30F6014 FTP Server 3 Save the message as c testdemo txt To transfer the demonstration file
92. indows desktop click Start gt Settings gt Network Connections Local Area Connection 2 Right click Local Area Connection and select Properties The Local Area Connection Properties dialog displays your current connections 3 Onthe General tab scroll down the list of connections to Internet Protocol TCPIIP then click Properties The Internet Protocol TCP IP Properties dialog displays as shown in Figure 5 3 Make a note of your current settings so you can restore them later 4 Onthe General tab check Use the following IP address and type in these settings IP Address 216 233 5 32 Subnet mask 255 255 255 0 5 Check OK in each dialog box until you close all the windows Depending on the version of Windows you are running you may be required to reboot your PC for the changes to take effect 6 Proceed with the FTP Server demonstration 2004 Microchip Technology Inc DS51471A page 63 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide FIGURE 5 3 IP SETTINGS DIALOG six General You can get IP sellings assigned automaticaly if pour network supports the capability Othansies you nesd to ack your network administrator for the appropiate P settings Check button C Oblan en IP address automaticaly TAAS Ee Type IP address IP address FIG 230 aA Subnet mask 255 255 255 0 Defaut gewa I 2 xj C bano2NSseve addess atoma ead Use the folowi
93. int 2 wire telephone type circuits ITU T V 32 A family of 2 wire duplex modems operating at data signalling rates of up to 9600 bit s for use on the general switched telephone network and on leased telephone type circuits ITU T V 22bis 2400 bits per second duplex modem using the frequency division technique standardized for use on the general switched telephone network and on point to point 2 wire leased telephone type circuits ITU T V 21 300 bits per second duplex modem standardized for use in the general switched telephone network ITU T V 23 600 1200 baud modem standardized for use in the general switched telephone network ITU T V 8 Procedures for starting sessions of data transmission over the public switched telephone network ITU T V 25 Automatic answering equipment and general procedures for automatic calling equipmenton the general switched telephone network including procedures for disabling of echo control devices for both manually and automatically established calls ITU T V 42 Error correcting procedures for DCEs using asynchronous to synchronous conversion ITU T V 56bis Network transmission model for evaluating modem performance over 2 wire voice grade connections ITU T V 56ter Test procedure for evaluation of 2 wire 4 kHz voice band duplex modems ITU T Q 23 Technical features of push button telephone sets ITU T Q 24 Multi frequency push button signal reception DS51471A page 86 2004 Microchip Technology In
94. ints to the next instruction as shown in Figure 2 19 FIGURE 2 19 PROGRAM HALTED iB FB8000 ze b wO wO 600061 and w wO 1 w0 E00000 cp w wo 32FFF9 brace be 496084 belr b IFSO 3 BFc2D0 mov b LATC wO FRANNN ze h mN wN pcodeHex Machine Symbolic PSV Mixed PSV Data 4 Press lt F6 gt to reset the program The green arrow moves to address 00000 the goto _reset instruction as shown in Figure 2 20 The linker inserted this instruction to make the program branch to the start of the code FIGURE 2 20 PROGRAM RESET ER gt 040100 goto reset 000000 nop 000394 nop 000394 nop 000394 nop 000394 nop nnnasa nnn Opcode Hex Machine Symbolic PSV Mixed PSV Data uwa slsahnsnsn u Oj ess 2004 Microchip Technology Inc DS51471A page 27 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide 2 7 2 Step the Program 1 Press lt F7 gt to single step the code The green arrow moves to line 129 reset mov w 0x850 w15 as shown in Figure 2 21 This code comes from a library archive file 1ibpic30 a which is automatically linked into C30 compiler projects This code line initializes the stack pointer and is part of the initialization code that the C30 compiler uses to set up the stack and initialize data Notice line 135 ca11 main This instruction calls the main routine from the dsPICDEMnet Tutorial c source file FIGURE 2 21 PROGRAM SINGLE STEP
95. ion of dsPIC30F Soft Modem 2004 Microchip Technology Inc DS51471A page 71 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide Some possible applications implied by this demonstration include POS Terminals Set Top Boxes Drop Boxes Fire Panels Internet enabled home security systems Internet connected power gas and water meters Internet connected vending machines Smart Appliances Industrial Monitoring D D 63 DEMONSTRATION CONFIGURATIONS The soft modem demonstration is set up to run either as a pair of dsPIC30F devices running the soft modem and connected end to end or as a dsPIC30F device communicating with a remote terminal equipped with a standard reference modem The LEDs and switches on the dsPICDEM net board are not used for the soft modem demonstration 6 3 1 Equipment Requirements The soft modem demonstration requires the following equipment e dsPICDEM net Development Board for originate answer modem dsPICDEM net Development Board or standard reference modem for answer originate modem PC or laptop for configuring and controlling dsPIC30F soft modem s via AT commands PC or laptop for configuring and controlling standard reference modem via AT commands Analog phone line for each originate and answer modem RJ 11 phone cable for each dsPICDEM net board and standard reference modem not provided D D D D D Note Connect dsPICDEM ne
96. ked Questions FAQ Online Discussion Groups conferences for products development systems technical information and more Microchip Consultant Program Member Listing Links to other useful web sites related to Microchip products Engineer s Toolbox Design Tips Device Errata Other Available Information Latest Microchip Press Releases Listing of Seminars and Events Job Postings DS51471A page 4 2004 Microchip Technology Inc Preface DEVELOPMENT SYSTEMS CUSTOMER NOTIFICATION SERVICE Microchip started the customer notification service to help our customers stay current on Microchip products with the least amount of effort Once you subscribe you will receive E mail notification whenever we change update revise or have errata related to your specified product family or development tool of interest Go to the Microchip web site at www microchip com and click on Customer Change Notification Follow the instructions to register The Development Systems product group categories are e Compilers Emulators e In Circuit Debuggers MPLAB Programmers Here is a description of these categories Compilers The latest information on Microchip C compilers and other language tools These include the MPLAB C17 MPLAB C18 and MPLAB C30 C compilers MPASM and MPLAB ASM30 assemblers MPLINK and MPLAB LINK30 object linkers MPLIB and MPLAB LIB30 object librarians Emulators The latest in
97. l Programming ICSP ICEPIC Migratable Memory MPASM MPLIB MPLINK MPSIM PICkit PICDEM PICDEM net PICLAB PICtail PowerCal Powerlnfo PowerMate PowerTool rfLAB rfPICDEM Select Mode Smart Serial SmartTel and Total Endurance are trademarks of Microchip Technology Incorporated in the U S A and other countries SQTP is a service mark of Microchip Technology Incorporated in the U S A All other trademarks mentioned herein are property of their respective companies 2004 Microchip Technology Incorporated Printed in the U S A All Rights Reserved e Printed on recycled paper Microchip received ISO TS 16949 2002 quality system certification for its worldwide headquarters design and wafer fabrication facilities in Chandler and Tempe Arizona and Mountain View California in October 2003 The Company s quality system processes and procedures are for its PICmicro 8 bit MCUs KEELOQ code hopping devices Serial EEPROMs microperipherals nonvolatile memory and analog products In addition Microchip s quality system for the design and manufacture of development systems is ISO 9001 2000 certified DS51471A page ii 2004 Microchip Technology Inc dsPICDEM net 1 AND dsPICDEM net 2 CONNECTIVITY DEVELOPMENT BOARD MICROCHIP USER S GUIDE Table of Contents Pr face AA WA AE KI KAA KA Ee 1 Chapter 1 Introduction WANO HUU EE E 7 CH AIG UGS EE 7 Oe ENEE 7 1 4 dsPICDEM net Package Contents
98. lity of the dsPIC30F and its peripherals interacting with components on the dsPICDEM net board This application is described fully in Chapter 3 Quick Start Program HTTP Web Server Demonstration This sample application illustrates an embedded web server that supports remote monitoring and control over a 10 Base T Ethernet connection This demonstration program uses the CMX MicroNet TCP IP Stack configured for HTTP Web Server protocol This sample application is described fully in Chapter 4 HTTP Web Server Demonstration FTP Server Demonstration This demonstration illustrates an embedded FTP server application that provides remote monitoring and control over a 10 Base T Ethernet connection This sample application uses the CMX MicroNet TCP IP Stack configured for FTP Server protocol This demonstration is described fully in Chapter 5 FTP Server Demonstration V 22bis Soft Modem Demonstration The dsPIC30F6014 plug in device is pre programmed with an ITU T compliant V 22bis V 22 modem demonstration that lets you to connect and transfer data between the dsPIC30F Soft Modem and an ITU T compliant reference modem This demonstration is described fully in Chapter 6 V 22bis Soft Modem Demonstration D D D D DS51471A page 10 2004 Microchip Technology Inc Introduction 1 7 REFERENCE DOCUMENTS The following documentation is available to support your use of the dsPICDEM net Development Board dsPIC30F Family
99. m a logic 0 8 Assert control signal CE RB9 to a logic 1 to deselect the SRAM NDOANA 7 1 15 Emulation Header Headers J10 J13 provide for a connection to the MPLAB ICE 4K In Circuit Emulator The emulation headers also support the processor adaptor boards see Section 7 1 21 Sample Devices The processor adaptor boards enable quick change out of the 80 pin TQFP device DS51471A page 90 2004 Microchip Technology Inc dsPICDEM net Development Hardware 7 1 16 Power Supply The dsPICDEM net Development Board is powered by a 9V AC DC wall adapter A single 5 VDC regulator provides all board components with 5 VDC Analog components are sourced from this same regulator through a low pass filter circuit Separate analog and digital ground planes are connected through a single point Jumper J6 allows the supplied power source to be bypassed and an alternate supply to be provided 7 1 17 Power on Indicator A green LED is connected to the input of the regulators to indicate the presence of power 7 1 18 Oscillator Crystal oscillator 7 3728 MHz supplied Thru holes and pads provided for user furnished watch type crystal and two capacitors for SOSC1 and SOSC2 Socket and pads for an output pull up resistor for user furnished crystal oscillator to processor External clock connections from J8 TABLE 7 2 OSCILLATOR SELECTIONS Oscillator Selection on TG sU dsPICDEM
100. ment Kit Software CD to your c X drive see Figure 2 1 2004 Microchip Technology Inc DS51471A page 13 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide FIGURE 2 1 TUTORIAL CODE FILES E 9 dsPICDEM net Board Sample Applications B FTP Server 3 Quick Start dsPICDEM Development Kit Software ge 3 v22bis Soft Modem dsPICDEMnet Tutoria c 4KB NM WEB Server EJ LCD display c E LCD display h 1KB Copy Tutorial folder from CD to your C drive Your c NTutorial folder should now contain these files delay c delay h dsPICDEM net Tutorial c LCD Display c LCD Display h Note Files copied from the CD are read only you will need to change the attributes of files that need to be edited 2 4 1 Select a Device 1 Start MPLAB IDE Close any workspace that might be open File Close Workspace From the Project menu select Project Wizard From the Welcome screen click the Next gt to display the Project Wizard Step One dialog see Figure 2 2 P oh FIGURE 2 2 PROJECT WIZARD STEP 1 SELECT A DEVICE Project wizard r x Step ne B Select a device Select dsPIC30F6014 Device lt Back Cancel Help 5 Select dsPIC30F6014 as the device and click Next gt The Project Wizard Step Two dialog displays see Figure 2 3 DS51471A page 14 2004 Microchip Technology Inc Tutorial
101. mewamanananamanunumwnnanwaninunwnanananaawnwza 50 4 5 Configuring your Laptop or Desktop PC 51 4 6 HTTP Web Server Demonstration aaa 52 2004 Microchip Technology Inc DS51471A page iii dsPICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide Af Debugging TIPS 5 AAA AA AAA s ete eet WA 57 4 8 Troubleshootlrig EE 58 4 9 Using HTTP Web Server in Your Application 59 Chapter 5 FTP Server S T Introduction e s ete ete the te E deu odds 61 fa Aa Ya La NA EE 61 5 2 Application Overview zwa usa nuusan a as aaa 61 5 3 Demonstration Setup u A FN Ua us 62 5 4 Configuring your Laptop or Desktop PC 63 5 5 FTP Server Demonstration sssssssssssssss eene 64 enee Put M 70 Chapter 6 V 22bis Soft Modem Demonstration 6 1 Introduction o Pd e EE ed 71 O lighlighiS isse issus ono uh chou ads ua RR cdam Uu Dis paa Saut bUqs E 71 6 2 Demonstration Overview eene 71 6 3 Demonstration Configurations ssssssssss ww www wawi ww awana rannen 72 6 4 Demonstration Procedures I 74 6 5 Reprogramming the dsPIC30F6014 ssssssssssn 76 6 6 Description of dsPIC30F Soft Modem 78 6 7 dsPIC30F Soft Modem AT Command Set sss 79 6 8 Troubleshooting the Connection sssssssss mwaa wamama wa wam
102. monitor INTx pins Used for detecting switch S1 S3 inputs PORTD pins RDO RD15 Used to interface to 64Kx16 SRAM 10 base T NIC and 2x16 LCD 3 9 DATA AND CONTROL FLOW 3 9 1 Power up Sequence Table 3 1 provides more details on the power up peripheral initialization sequence illustrated in Figure 3 17 TABLE 3 1 POWER UP PERIPHERAL INITIALIZATION SEQUENCE Module or Board Seq Function Initialization Process 1 Timer1 Configured to count to 2 2 mS and reset 2 Timer2 Configured to count to 3 95 mS and reset 3 Timer3 Configured to count to 2 2 mS and reset 4 2x16 LCD Initialization of 2x16 character LCD via PORTD pins RDO RD15 5 64Kx16 SRAM Initialization and test of 64Kx16 SRAM via PORTD pins RDO RD15 Testing is performed by writing and reading back a specific incrementing pattern 6 10 base T NIC Initialization and test of 10 base T NIC via PORTD pins RDO RD15 Testing is performed by performing internal loop back tests as supported by the NIC 7 UART1 The transmitter is configured for interrupt driven operation at 38400 baud 8 Data Converter Configured for Slave mode Configured to communicate to the Interface DCI Si303x DAA AFE chipset operating in Master mode Some DAA AFE self test routines are executed 9 External interrupt Configured to interrupt on the falling edge and used for pins INT1 INT3 switches S1 S3 respectively 10 SPI 1 Configured for communicatio
103. n Table 6 3 Reference modems are not all equal in terms of data pump DP modulations they support as power on default For example the US Robotics External 56K modem model 5686E supports V 21 and V 23 but only if it is enabled via suitable AT commands Attempts to connect with V 21 and V 23 will fail until these DP modulations have been enabled Also the US Robotics External 56K modem model 5686E does not support V 32 9600 bps NTCM The modem will disconnect after the rate exchange sequence during the V 32 hand shake since this is an invalid speed setting in V 32 mode It connects at 9600 bps TCM in V 32bis mode This troubleshooting section does not address every specification or operational feature of the reference modems It is intended to be a starting point should you experience some basic connection issues 2004 Microchip Technology Inc DS51471A page 81 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide 6 8 1 Standard Reference Modems The dsPIC30F Soft Modem has undergone extensive testing to ensure ITU T compliance and robust system operation During performance and interoperability testing the reference modems listed in Table 6 3 were used in both the originate and answer modes while communicating with the dsPIC30F Soft Modem on the dsPICDEM net Connectivity Board TABLE 6 3 REFERENCE MODEMS Reference Modem Model Description U S Robotics 5686E Exte
104. n with MCP42050 Dual Channel Digital potentiometer 11 12 bit ADC Configured to continuously sample channels AN3 temperature sensor U2 AN4 RP1 and AN5 RP2 3 9 2 Main Loop Code Execution Table 3 2 explains the step by step execution sequence of the Main Loop shown in Figure 3 18 TABLE 3 2 MAIN LOOP CODE EXECUTION SEQUENCE Program Task 1 Check state of variable hook_status which is modified in either INT1 INT2 and INT3 Interrupt Service Routines 2 12 bit ADC collects a sample each from the digital potentiometer RP1 and RP2 and temperature sensor U2 3 Data obtained from ADC is converted to ASCII for display by UART and LCD 4 LCD is updated with Potentiometer RP1 and RP2 values 5 SPI 1 transmit RP1 and RP2 values to dual channel digital potentiometer Monitor of potentiometer output is via PW0 and PW1 test points on board DS51471A page 46 2004 Microchip Technology Inc Quick Start Program 3 9 3 Interrupts Used in the Demonstration Program 3 9 3 1 EXTERNAL INTERRUPTS TO MAIN ROUTINE External interrupts INT1 INT3 are controlled by switches S1 S3 respectively Each switch is monitored by the respective Interrupt pin INT1 INT3 For each switch detected the variable book status is modified in the ISR The variable book status is then monitored in the main loop and based upon the variable state one of three actions are taken 3 9 8 2 12 BIT ADC INTERRUP
105. nabling the MPLAB ICD 2 Connection The MPLAB ICD 2 can be used to program and debug the dsPIC30F6014 device in circuit on the dsPICDEM net board Note Before proceeding 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 details regarding the installation of the USB driver 1 Connect the MPLAB ICD 2 to the PC with the USB cable see Figure 3 13 2 Connect the MPLAB ICD 2 to modular connector labeled ICD on the dsPICDEM net board with the provided short RJ 11 cable 3 Apply power to the board DS51471A page 40 2004 Microchip Technology Inc Quick Start Program FIGURE 3 13 dsPICDEM net DEVELOPMENT BOARD CONNECTED TO MPLAB ICD 2 PC running MPLAB IDE dsPICDEM net Connectivity Connect USB cable to PC Development Board ds running Quick Start program Power Cable 115 VAC USB Cable MPLAB ICD 2 RJ 11 Cable Connect RJ 11 cable to Apply power to the board MPLAB ICD 2 4 From the Debugger gt Select Tool menu select MPLAB ICD 2 as the debug tool 5 From the Debugger menu select Connect MPLAB should report that it found the dsPIC30F6014 as shown in Figure 3 14 Note MPLAB may need to download new firmware if this is the first time the MPLAB ICD 2 is being used with a dsPIC30F device Allow it to do so If any errors are shown double click the error message to g
106. nd information on the selected device debug tool and or programmer open windows and their location and other IDE configuration settings MPLAB IDE contains a Project Wizard to help create new projects Before starting copy the Quick Start folder on the dsPICDEM net Development Kit Software CD to your c drive see Figure 3 1 Note Files copied from the CD are read only you will need to change the attributes of files that need to be edited FIGURE 3 1 DEMONSTRATION CODE FILES Copy Quick Start folder from CD to your C drive dsPICDEM L1 Dorem E i dsPICDEM net Board Sample Applications amp FTP Server Name se type I C ik Start Dh File Folder IO O Tutorial Dinc File Folder lt E D v22bis Soft Modem source File Folder ie EH CH WEB Server The folder should contain these files h files e defines h enic init param h e delay h enic strings h elcd h e strings h inc files device Fcy inc e 3513021 mode inc e 3513021 outputs inc DS51471A page 32 2004 Microchip Technology Inc Quick Start Program source files e ikhz s e 2khz s e bin2dec c e Dac_Update c e delay c e device config s e display s init Adc s init Dci s init INTpin s init Ports s init RealTek NIC c init Si3021 s init Spil s 3 4 1 1 Start MPLAB IDE Select a Device init Sram c init Timers s init Uart s isr Adc s isr Dci s isr INTpin s isr
107. net 2 connectivity development boards The document is organized as follows Chapter 1 Introduction This chapter introduces the dsPICDEM net 1 and dsPICDEM net 2 connectivity development board and provides a brief description of the hardware Chapter 2 Tutorial This chapter presents a step by step process for getting your dsPICDEM net 1 and dsPICDEM net 2 connectivity development board up and running with the MPLAB In Circuit Debugger 2 MPLAB ICD 2 Chapter 3 Quick Start Program This chapter describes the operational func tionality of a demonstration program included on the dsPICDEM net Development Kit Software CD The demonstration program exercises several capabilities of the dsPIC30F by interacting with peripheral devices on the development board Chapter 4 HTTP Web Server Demonstration This chapter describes the operational functionality of a sample HTTP Web Server based embedded application that is included on the dsPICDEM net Development Kit Software CD Chapter 5 FTP Server Demonstration This chapter describes the operational functionality of a sample FTP Server based embedded application that is included on the dsPICDEM net Development Kit Software CD Chapter 6 V 22bis Soft Modem Demonstration This chapter describes the operational functionality of a sample PSTN based application that is preprogrammed into the dsPIC30F6014 device Chapter 7 dsPICDEM net Development Hardware This chapter describes th
108. ng DNS server addresses Proteried DNS carver gt gt Shemate ONS zero 5 5 FTP SERVER DEMONSTRATION 5 5 1 Programming the dsPIC30F6014 Device This exercise requires that the dsPIC30F6014 device be programmed with the FTP demonstration program ftpdemo hex If you have previously loaded this program on a dsPIC30F6014 device you can proceed directly to Section 5 5 2 Start FTP Server Session 1 Apply power to the board The green POWER LED illuminates 2 Launch MPLAB IDE on your PC From the Configure menu choose Select Device then select dsPIC30F6014 3 From the MPLAB IDE Debugger menu choose Select Tool then select MPLAB ICD 2 You should see a connection message in the output window as shown in Figure 5 4 ww Fr DS51471A page 64 2004 Microchip Technology Inc FTP Server Demonstration Ifthe MPLAB ICD 2 does not initially connect and recognize the dsPIC30F6014 device click the MPLAB ICD 2 puck icon on the MPLAB IDE toolbar The output window should then indicate a successful connection FIGURE 5 4 MPLAB ICD 2 CONNECTION MESSAGE WITH dsPIC30F6014 Build Version Control Find in Files MPLAB ICD 2 Connecting to MPLAB ICD 2 Connected Setting Vdd source to target Target Device dsPIC30F6014 found revision 0x40 Reading ICD Product ID Running ICD Self Test Passed MPLAB ICD 2 Ready 4 From the MPLAB IDE File menu select Import Browse to c NFTP Server and
109. ng ICD Self Test Passed MPLAB ICD 2 Read Running Target Output window shows program running On the board LED2 should start blinking and the LCD display should display the following text dsPICDEM net Tutorial Note When debugging with MPLAB ICD 2 it is always necessary to reprogram the part with the new code after each build MPLAB will remind you with a message that states Program memory has changed since last operation DS51471A page 26 2004 Microchip Technology Inc Tutorial 27 DEBUGGING THE CODE The MPLAB ICD 2 debugger programmer can be used to run halt and step the code You can set a breakpoint so that program execution halts after the code has executed the instruction at the breakpoint A green arrow points to the next line to be executed The contents of the RAM and registers can be viewed when the processor has been halted MPLAB ICD 2 uses the following function keys to access the main debugging functions lt F5 gt Halt lt F6 gt Reset lt F7 gt Single Step lt F9 gt Run There are more functions available by right clicking on a line of source code The most important of these are Set Breakpoint and Run to Cursor 2 7 1 Display the Code 1 From the View menu select Program Memory The Program Memory window displays 2 Select the Symbolic tab at the bottom of the window 3 Press lt F5 gt to halt the processor The program stops and the green arrow po
110. ng Kong Central Rd Qingdao 266071 China Tel 86 532 5027355 Fax 86 532 5027205 India Divyasree Chambers 1 Floor Wing A A3 A4 No 11 O Shaugnessey Road Bangalore 560 025 India Tel 91 80 22290061 Fax 91 80 22290062 Japan Benex S 1 6F 3 18 20 Shinyokohama Kohoku Ku Yokohama shi Kanagawa 222 0033 Japan Tel 81 45 471 6166 Fax 81 45 471 6122 Korea 168 1 Youngbo Bldg 3 Floor Samsung Dong Kangnam Ku Seoul Korea 135 882 Tel 82 2 554 7200 Fax 82 2 558 5932 or 82 2 558 5934 Singapore 200 Middle Road 07 02 Prime Centre Singapore 188980 Tel 65 6334 8870 Fax 65 6334 8850 Taiwan Kaohsiung Branch 30F 1 No 8 Min Chuan 2nd Road Kaohsiung 806 Taiwan Tel 886 7 536 4818 Fax 886 7 536 4803 Taiwan Taiwan Branch 11F 3 No 207 Tung Hua North Road Taipei 105 Taiwan Tel 886 2 2717 7175 Fax 886 2 2545 0139 EUROPE Austria Durisolstrasse 2 A 4600 Wels Austria Tel 43 7242 2244 399 Fax 43 7242 2244 393 Denmark Regus Business Centre Lautrup hoj 1 3 Ballerup DK 2750 Denmark Tel 45 4420 9895 Fax 45 4420 9910 France Parc d Activite du Moulin de Massy 43 Rue du Saule Trapu Batiment A ler Etage 91300 Massy France Tel 33 1 69 53 63 20 Fax 33 1 69 30 90 79 Germany Steinheilstrasse 10 D 85737 Ismaning Germany Tel 49 89 627 144 0 Fax 49 89 627 144 44 Italy Via Quasimodo 12 20025 Legnano MI Milan Italy Tel 39 0331 742611 Fax 39 0331 466781
111. not running press lt F6 gt Reset followed by lt F9 gt Run 2 From Windows open a DOS command session 3 From the command line prompt type ftp 216 233 5 31 to connect to the dsPIC30F6014 FTP Server When the connection is made you will be prompted for your user name and password 4 For the user name type cmx 5 When prompted for the password type password Note Both the user and password are case sensitive Be sure both entries are lower case Upon successful sign on you will have connected to the FTP Server running on the dsPIC30F6014 device You will see a transaction sequence similar to that shown in Figure 5 7 FIGURE 5 7 LOG ON FTP SERVER SESSION Microsoft Windows XP Version 5 1 26001 lt C Copyright 1985 2001 Microsoft Corp C gt ftp 216 233 5 31 Connected to 216 233 5 31 228 User 216 233 5 31 none gt gt 331 Successful connection Successful sign on This screen shows when the connection is made and when the user is success fully logged on This program only uses commands necessary to receive files from and send files to the dsPIC30F device For information on the command set supported by CMX MicroNet FTP Server refer to the FTP FUNCTIONS section of the CMX MicroNet TCP IP STACK Manual ws tuuuwmaa ae _ DS51471A page 66 2004 Microchip Technology Inc FTP Server Demonstration 5 5 3 Receive File From FTP Server This portion of the demo
112. nstrates Web based monitoring and control of an embedded application operating with the CMX MicroNet TCP IP Stack configured for Hyper Text Transfer Protocol HTTP Web Server protocol 42 HIGHLIGHTS Information in this chapter includes Demonstration Overview Demonstration Setup Configuring your Laptop or Desktop PC HTTP Web Server Demonstration Debugging TIPS Troubleshooting Using HTTP Web Server in Your Application 43 DEMONSTRATION OVERVIEW This demonstration program runs on the dsPIC30F6014 using the CMX MicroNet TCP IP Stack configured for HTTP Web Server protocol to support remote monitoring and control of the application over an Ethernet connection The CMX MicroNet TCP IP Stack is designed for optimized use of Flash and RAM Memory on dsPIC30F devices This software runs directly on the processor with no gateways or PCs required The stack can be run in stand alone mode or work in conjunction with an RTOS This demonstration uses approximately 4 2K instructions in Flash and 300 bytes in RAM not including the HTML java applets and jpg and gif images In this demonstration the dsPIC serves up HTML pages to a browser and implements two basic HTML form methods GET and POST The GET and POST methods are demonstrated in the form of requests from and updates to the HTML page displayed on a browser These functions enable you to monitor and change functions on the dsPICDEM net board The GET method retrieves information f
113. nstration shows how you might retrieve a file from the FTP Server virtual file system in dsPIC30F6014 memory 1 Atthe ftp prompt type dir 2 The FTP Server returns a listing of the files in its virtual file system as shown in Figure 5 8 FIGURE 5 8 RECEIVING A FILE FROM THE FTP SERVER 331 Password 236 Jan index htm Jan page2 od Jan cmxlogo gif Jan about gif Jan benchnrk gif Jan contact gif Jan home gif Jan 3 press gif root root root root root root root root 1 1 1 1 1 T 1 6000000060 we uu 606 0 0 00 0 0090 received in 0 31Seconds 1 htm 3 Atthe next ftp gt prompt type get index htm As the file downloads the DOS screen displays status milestones command received 200 file ready to send 150 and file transferring 226 4 When the file transfer is complete the status displays the number of bytes transferred how long it took and the transfer rate achieved At the next ftp gt prompt type quit to close the FTP session but leave the DOS session running 5 In Windows locate and view the transferred file using a graphics program see Figure 5 9 This file is located in the directory from which you ran the DOS command FTP session c N 2004 Microchip Technology Inc DS51471A page 67 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide FIGURE 5 9 IMAGE OF TRANSFERRED FILE CMx MicroNet Demo M
114. nt board Power on indicator LED MPLAB ICD 2 and ICE 4000 Connections MPLAB ICD 2 programming connector Emulation header connection to MPLAB ICE 4000 Pad location for 80 pin TQFP dsPIC device Serial Communication Channels Single RS 232 communication channel 6 pin terminal block and configuration jumper for RS 485 and RS 422 communication on UART1 from the dsPIC device Single CAN communication channel DS51471A page 8 2004 Microchip Technology Inc Introduction Public Switched Telephone Network PSTN Silicon Laboratories Si3035 DAA AFE chipset dsPICDEM net 1 board Silicon Laboratories Si3034 DAA AFE chipset dsPICDEM net 2 board Speaker for monitoring call progress Si3021 reset push button switch FIGURE 1 1 dsPICDEM net DEVELOPMENT BOARD 10 BaseT Ethernet Realtek RTL8019AS 10 Base T single chip Network Interface Controller and transceiver Four link status LEDs RJ 45 10 Base T modular connector Analog Two 5 kQ Potentiometers RP1 and RP2 e Microchip MCP42050 Digital Potentiometer dual channel output Microchip TC1047A Thermal Sensor U2 Microchip MCP602 op amp configured as low pass filter for thermal sensor U12 Device Clocking 7 3728 MHz crystal X3 for dsPIC device Socket U16 clock oscillator for dsPIC device alternate clock source X3 removed Pad for 32 768 kHz crystal XTAL2 and load caps P r
115. ntrolled by the terminal emulator on the opposite PC or laptop This demonstration requires two analog phone lines one each for the originate and answer modems FIGURE 6 2 INTEROPERABILITY DEMONSTRATION SET UP PC running Windows I HyperTerminal PC running Windows Analog HyperTerminal Telephone Exchange or TAS T T Vesti E U C z E Standard RJ 11 Reference Modem dsPICDEM net Connectivity x Board with Soft Modem KEREN 2004 Microchip Technology Inc DS51471A page 73 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide 6 4 DEMONSTRATION PROCEDURES Follow these steps to exercise the soft modem functionality in real time The dsPIC30F6014 device plugged into the dsPICDEM net board has been pre programmed with the V 22bis data modem for this demonstration If the demonstration program has been replaced by another application you will need to reprogram the dsPIC30F6014 see Section 6 5 Reprogramming the dsPIC30F6014 for instructions on programming the soft modem into the dsPIC 6 4 1 Initialize the Hardware 1 Configure the demonstration for end to end operation as shown in Figure 6 1 or interoperability as shown in Figure 6 2 2 Make sure the 2x2 shunts on J17 and J19 are inserted in vertical alignment perpendicular to the LCD display 3 Apply power to the dsPICDEM net Board s and or the standard reference modem 4 Press and
116. om the pop up menu Note An alternate method is to simply double click the line This feature may need to be enabled by using the Edit gt Properties menu For this example find the following line of code and set a breakpoint IFSObits T1IF 0 uwa r aes 2004 Microchip Technology Inc DS51471A page 29 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide A red stop sign should appear in the gutter grey bar on the left of the source code window as shown in Figure 2 25 2 Press lt F9 gt to run the code The program will halt on the instruction following the breakpoint In this example every time lt F9 gt is pressed to run the code the program runs through the timing delay loop once before reaching the breakpoint It toggles LED2 each time FIGURE 2 25 SETTING BREAKPOINT WC Tutorial dsPICDEMnet Tutorial c TRISC OxFFE3 Set LED pins as outputs T1CON 0 Turn off Timerl by clearing co TMRl j PRl Fcy 512 Load Timerl period register fo T1CON 0x8030 ZZ Load Timerl settings for 1 256 Start Timerl at zero Init LCD ZZ Initialize LCD home clr Clear screen and home cursor Puts_LCD char 5LCD Linel 0 sizeof LCD Linel 1 line 21 Go to line 2 of the display Puts LCD char 5LCD Line2 0 sizeof LCD_LineZ 1 E Loop forever ifi IFSObits TlIF Check for Timerl timeout IFSO bits TlIF 0 f f Clear Timerl interrupt flag LED2
117. op or Desktop to use a compatible Static IP address Note Before reconfiguring your network connection settings for this demonstration make a note of your current PC settings You will want to restore your original PC settings after you complete this demonstration To reconfigure your network connections follow these steps 1 From the Windows desktop click Start Settings Network Connections Local Area Connection 2 Right click Local Area Connection and select Properties The Local Area Connection Properties dialog displays your current connections 3 Onthe General tab scroll down the list of connections to nternet Protocol TCP IP then click Properties The Internet Protocol TCP IP Properties dialog displays as shown in Figure 4 3 Note Record your current settings so you can restore them later 4 Onthe General tab check Use the following IP address and type in these settings IP Address 216 233 5 32 Subnet mask 255 255 255 0 5 Check OK in each dialog box until you close all the windows Depending on the version of Windows you are running you may be required to reboot your PC for the changes to take effect 6 Proceed with the HTTP Web Server demonstration 2004 Microchip Technology Inc DS51471A page 51 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide FIGURE 4 3 IP SETTINGS DIALOG Ais General rou can get IP sellirq
118. orial mep A new workspace will be created and the new project added to that workspace Cancel Help lt Back 5 Click Finish After the project wizard completes the MPLAB project window shows the project and all the added files see Figure 2 7 yawa a s n 2004 Microchip Technology Inc DS51471A page 17 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide FIGURE 2 7 PROJECT WINDOW Project window displays the source files header files and linker script file you added to your project MyTutorial mew MyTutorial mcp Source Files delay c dsPICDEMnet Tutorial c LCD display c Header Files delay h LCD display h p30f6014 h Object Files Library Files Linker Scripts p30f6014 gld Other Files At this point a project and workspace have been created in MPLAB MyTutorial mcw is the workspace file and MyTutorial mcp is the project file Double click the dsPICDEMnet Tutorial cfile in the project window to open it MPLAB should look similar to Figure 2 8 FIGURE 2 8 MPLAB WORKSPACE File Edit View Project Debugger Programmer Tools Configure Window Help peu x mm x att em CEZEEXTES 7 MyProject mcp E Source Files delay c dsPICDEMnet Tutorial c LCD display c El Header Files delay h BBB C Tutorial dsPICDEMnet Tutorial c LCD displ p30f6014 Object Fes 1
119. ort Signals for the RS 485 RS 422 port are available on the 6 pin terminal block labeled TB1 The terminal block is configurable from RS 485 to RS 422 by removing the jumper on J2 Inserting jumper J1 will terminate the bus with a 120 ohm resistor The RX485 and TX485 lines of the MAX489E can be tied to the dsPIC UART channel 1 U1RX and U1TX pins by the following jumper settings J19 shunt pins 1 2 for Tx channel support J19 shunt pins 3 4 for Rx channel support Note The shunts for J19 must be connected vertically J18 shunt pins 1 2 for Rx connection to the dsPIC device MAX489E receiver and driver output enables are controlled by port pins RGO and RG1 respectively 7 1 4 Temperature Sensor This is a 40 C to 125 C linear output temperature sensor TC1047A connected to analog channel AN3 of the dsPIC device The output of the temperature sensor U2 is fed through a second order low pass filter before connection to the dsPIC device The LP filter cutoff frequency is set at 10 Hz The output voltage range for the TC1047A is typically 750 mV at 25 C The TC1047A exhibits a typical 10 mV C voltage slope DS51471A page 88 2004 Microchip Technology Inc dsPICDEM net Development Hardware 7 1 5 Analog Potentiometers Two 5 kOhm potentiometers are connected to analog channels AN4 and AN5 The voltage output range for each potentiometer isbetween 0 VDC and 5 VDC The voltage source is provided by VR1 throu
120. p size bytes Allow overlapped sections Min Stack Size bytes V Link for ICD2 Symbol Definitio Add Remove Restore Defaults Check Link for ICD2 J Use Altemate Settings o TARGETBASE cof Cancel Apply 4 Check Link for ICD2 to tell the linker to reserve space for the debug code used by the MPLAB ICD 2 In Circuit Debugger 5 Click OK 2 5 2 Build the Project At this point the project is ready to build 1 From the Project menu select Make The Build Output window displays see Figure 2 12 2 Observe the progress of the build 3 When the BUILD SUCCEEDED message displays you are ready to program the device aww ama a IIlTrq p 2004 Microchip Technology Inc DS51471A page 21 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide FIGURE 2 12 BUILD OUTPUT E output Anl x Build Version Control Findin Files Make The target CA TutonaAL CD display o is out of date Executing C pic30_tools bin pic30 gec exe D__dsPIC30F6014__ c x c LCD display c o LCD display o g Make The target C Tutorial MyTutorial cof is out of date Executing C pic30_tools bin pic30 gcc exe Wi C Tutorial delay o C Tutorial dsPICDEMnet Tutorial o C NTutori Executing C Program Files MPLAB IDE dsPIC_Tools Bin pic30 bin2hex exe My Tutorial cof writing MyTutorial bes PC address byte address lengt
121. r Toolsuite Contents MPLAB ASM30 Assembler pic30 as exe Specify file location for Compiler MPLAB C30 C Compiler pic30 acc exe MPLAB LINK30 Object Linker pic30 Id exe 7 Location m m m m m m h pic30_tools bin pic30 gec exe BEBE BBR RB RP RP RP RR RRR RRP eee ee eee 1 Active Toolsuite Microchip C30 Toolsuite kr Toolsuite Contents MPLAB ASM30 Assembler pic30 as exe Ge ca c Compiler pic 30 Specify file location for Object Linker ic 30 Id exe Location pie30_tools bin pic30 ld exe 3 4 2 Select Language Toolsuite 1 Fromthe Active Toolsuite pull down menu select Microchip C30 Toolsuite This toolsuite includes the compiler assembler and linker that will be used 2 Set Toolsuite Contents to MPLAB ASM 30 Assembler pic30 as exe 3 Set Location to C Npic30 tools Bin pic30 as exe Note Cis the drive implemented for this example The specific location of the MPLAB C30 compiler may be different on your system Reset Toolsuite Contents to MPLAB C30 Compiler pic30 gcc exe Set Location to C pic30_ toolsMBinMpic30 gcc exe Reset Toolsuite Contents to MPLAB LINK30 Object Linker pic30 Id exe Set Location to C pic30_tools Bin pic30 1d exe Click Next to continue The Project Wizard Step Three dialog displays see Figure 3 4 DS51471A page 34 2004 Microchip
122. r which sends a reply message back HTTP messages are human readable An HTTP server can be manually operated witha command such as Telnet Server 80 The simplest HTTP message is GET url to which the server replies by sending the named document In HTML you can specify two different submission methods for a form The method is specified inside a form element using the METHOD attribute The difference between METHOD GET the default and METHOD POST is primarily defined in terms of form data encoding DS51471A page 56 2004 Microchip Technology Inc HTTP Web Server Demonstration 47 DEBUGGING TIPS Use a packet sniffer to monitor all the transmitted frames and observe exactly what is going on in real time see Figure 4 10 A packet sniffer can be used with the PC side TCP UDP client server test programs that are included with the MicroNet software A number of good packet sniffers are available as freeware Freeware Packet Sniffers for Windows include e AnalogX PacketMon www analogx com Anasil www sniff tech com CommView www tamosoft com Ethereal www ethereal com e Sniffem www sniff em com Commercially available packet sniffers include Klos Technologies SerialView PacketView www klos com Windows Packet sniffing library for C C VB www packet sniffing com For additional information on packet sniffers refer to www robertgraham com pubs sniffing faq html FIGURE
123. r labeled ICD on the dsPICDEM net board with the provided short RJ 11cable 3 Apply power to the board FIGURE 2 14 TUTORIAL DEMONSTRATION SETUP PC running MPLAB IDE dsPICDEM net Connectivity Development Board running Tutorial program Connect MPLAB ICD 2 to PC with USB cable Power Cable 115 VAC MPLAB ICD 2 Ps Apply power to the board Connect MPLAB ICD 2 to board with provided RJ 11 cable 2004 Microchip Technology Inc DS51471A page 23 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide 4 From the Debugger gt Select Tool menu select MPLAB ICD 2 as the debug tool 5 Fromthe Debugger menu select Connect dsPIC30F6014 as shown in Figure 2 15 MPLAB should report that it found the Note FIGURE 2 15 MPLAB may need to download new firmware if this is the first time the MPLAB ICD 2 is being used with a any errors are shown double click information dsPIC30F device Allow it to do so If the error message to get more ENABLING MPLAB ICD 2 Build Version Control Find in Files MPLAB ICD 2 Connecting to MPLAB ICD 2 Connected ICDWAarn0030 MPLAB ICD2 is about Downloading Operating System Connecting to MPLAB ICD 2 Connected Setting Vdd source to target Target Device dsPIC30F601 4 found revision 0x40 Reading ICD Product ID Running ICD Self Test Passed Download Operating System Succeeded Setting Vdd sou
124. rce to target Target Device dsPIC30F601 4 found revision 0x40 Reading ICD Product ID Running ICD Self Test Passed MPLAB ICD 2 Ready itto download a new operatin EE g system If M tarting it will appear to I 6 From the Debugger menu select Settings to display the ICD Debugger settings see Figure 2 16 FIGURE 2 16 MPLAB ICD 2 DEBUGGER SETTINGS Status Communication Limitations Power Program Versions Warnings Ze E Make sure this option is selected Allow MPLAB ICD 2 to select memories and ranges Allow ICD 2 to select memories and ranges Manually select memories and ranges Memorie DS51471A page 24 2004 Microchip Technology Inc Tutorial On the Program tab ensure that Allow ICD 2 to select memories and ranges is selected This setting will speed up programming by addressing only a small part of the total program memory Program the part Debugger gt Program The Output window shows the results of the programming cycle as shown in Figure 2 17 The part is now programmed and is ready to run FIGURE 2 17 MPLAB ICD 2 PROGRAM READY Build Version Control Find in Files MPLAB ICD 2 Lusseu MPLAB ICD 2 Ready Programming Target Erasing Part Programming Program Memory 0x0 0x3BF Loading DebugExecutive Pragramming DebugExecutive Programming Debug Vector Programming Configuration Bits ve
125. rifying Program Memory Debug Executive Debug Vector Verify Succeeded Pragramming Configuration Bits Config Memory Merifying configuration memory Connecting to debug executive Programming succeeded MPLAB ICD 2 Ready Run the code Debugger gt Run The MPLAB Output window should indicate that the target is running see Figure 2 18 2004 Microchip Technology Inc DS51471A page 25 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide FIGURE 2 18 TUTORIAL PROGRAM RUNNING a MPLAB IDE v6 50 File Edit View Project Debugger Programmer Tools Configure Window Help Dae 2 m m 2 cia a b gt m t O Be Eno e El MyTutorial mcp E Source Files delay c dsPICDEMnet LCD displav c Build Version Control Find in Files MPLAB ICD 2 E Header Files delay h Connecting to MPLAB ICD 2 LCD display h Connected p30f6014 h Setting Vdd source to target Object Files Target Device dsPIC30F6014 found revision 0x40 Library Files Reading ICD Product ID E Linker Scripts Running ICD Self Test p30f6014 gld Passed Other Files MPLAB ICD 2 Ready ICDWarn0015 Program memory has changed since last program operation Continue with Debug operation Stepping Target MPLAB ICD Ready Project status bar Connecting to MPLAB ICD 2 Connected shows program running Setting Vdd source to target Target Device dsPIC30F6014 found Reading ICD Product ID Runni
126. rnal V 90 V 92 56k Fax Modem U S Robotics 0839 External Sportster 33 6 Fax Modem U S Robotics 98117203 External Sportster Voice 33 6 Fax Modem Zoom 2949 External V 90 Fax Modem Zoom 3049 External V 92 Fax Modem D Link DMF 336 E External 33 6 Fax Modem D Link DMF 560 ES External 56k Data Fax Voice Modem 3Com 455630 01 External 56k Fax Modem 6 8 2 ITU T V 8 Support Currently the dsPIC30F Soft Modem falls back to other modulations only through V 8 handshake Therefore the dsPIC30F Soft Modem will not be able to establish a connection in any DP modulation mode with reference modems that do not support the V 8 handshake For example D Link and Zoom reference modems do not support the V 23 modulation selection through V 8 handshake when they are in originating mode Therefore the dsPIC30F Soft Modem in answer mode will not be able to establish a V 23 connection with these reference modems However in answer mode these reference modems do support the falling back to V 23 modulations through V 8 handshake Therefore the dsPIC30F Soft Modem in originate mode is able to establish a V 23 connection with these reference modems 6 8 3 Data Flow Control By default the dsPIC30F Soft Modem uses hardware flow control for data transfer The dsPIC30F Soft Modem uses the UART flow control pins RTS amp CTS on the dsPICDEM net connectivity board This configuration requires that a two position shunt be installed in the vertical position on jump
127. rom the potentiometers temperature sensor and switches to illustrate monitoring functionality The POST method uploads information to the LCD and LEDs on the board to illustrate control and updating functionality For this demonstration the HTML page served up by the dsPIC device is stored in the Flash Program Memory Alternatively the dsPICDEM net board provides a 24LC515 Serial I C EE 64 Kbyte Memory device that can be used to store the HTML pages 2004 Microchip Technology Inc DS51471A page 49 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide 44 DEMONSTRATION SETUP 4 4 1 Equipment Requirements The HTTP Web Server demonstration requires the following equipment dsPICDEM net Development Board Kit with dsPIC30F6014 Plug in Module PIM CAT 5 crossover cable or standard Ethernet cable and access to a network or hub MPLAB IDE Integrated Development Environment MPLAB ICD 2 In Circuit Debugger Laptop or Desktop PC with RS 232 serial port or USB port for connecting to the MPLAB ICD 2 In Circuit Debugger RJ 11 phone cable for connecting the MPLAB ICD 2 to the dsPICDEM net board 4 4 2 Equipment Setup Connect the dsPICDEM net board to your PC or laptop as shown in Figure 4 1 FIGURE 4 1 WEB SERVER DEMONSTRATION SETUP PC running MPLAB IDE and Internet Connect board to PC with CAT 5 crossover cable Explorer ES dsPICDEM net Connectivity Ethernet
128. s The tutorial project does not explicitly use any libraries but the C compiler startup library code is always automatically linked into the project Use the Project gt Build Options gt Project menu to specify the location of the library files as shown in Figure 2 10 2004 Microchip Technology Inc DS51471A page 19 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide FIGURE 2 10 BUILD OPTIONS General MPLAB ASM30 MPLAB C30 MPLAB LINK30 Output Directory BINDIR J Browse Intermediates Directory TMPDIR Letthe project know where the Browse library files are located Assembler Include Path AINDIR ME S o Browse Include Path INCDIR Jia cC 7 C nl Browse Library Path LIBDIR C pic30_tools lib Browse Linker Script Path LKRDIR Help Suite Defaults Cancel Apply 1 Selectthe Build Options General tab 2 Add a Library Path by browsing to C pic30 tools lib Note The library path for your environment may be different The location will depend on where you installed the C30 compiler 3 Select the MPLAB LINK30 tab to display the linker settings see Figure 2 11 aa aar uamuaw n DS51471A page 20 2004 Microchip Technology Inc Tutorial FIGURE 2 11 MPLAB LINK30 BUILD OPTIONS General MPLAB ASM30 MPLAB C30 MPLAB LINK30 Categories Gee Tj m Generate Command Line Hea
129. server from an FTP client Transmitting data to the FTP server from an FTP client This demonstration is set up to run with a Microsoft Windows FTP client or at the command prompt 2004 Microchip Technology Inc DS51471A page 61 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide 5 3 DEMONSTRATION SETUP 5 3 1 Equipment Requirements This demonstration requires the following equipment dsPICDEM net Development Board Kit with dsPIC30F6014 Plug in Module PIM Crossover Cable or standard Ethernet cable and access to a network or hub MPLAB IDE Integrated Development Environment MPLAB ICD 2 In Circuit Debugger Laptop or Desktop PC with RS 232 serial port or USB port for connecting to the MPLAB ICE 2 In Circuit Emulator RJ 11 phone cable for connecting the MPLAB ICD 2 to the dsPICDEM net board 5 3 2 Equipment Setup Connect the dsPICDEM net board to your PC or laptop as shown in Figure 5 1 FIGURE 5 1 FTP SERVER DEMONSTRATION SETUP PC running MPLAB IDE Connect board to PC with and DOS Command CAT 5 crossover cable Prompt dsPICDEM net Connectivity Ethernet Development Board running connection FTP Ssrver demonstration USB Port wA Power Cable 115 VAC Apply power to board Connect MPLABO ICD 2 to PC with USB cable Connect MPLAB ICD 2 to board with RJ 11 phone cable 1 Connect the MPLAB ICD 2 to your PC with the USB cable 2 Using the short RJ 11
130. swer after one ring is enabled The remote soft modem answers the call after one ring and connects in V 22bis and V 42 LAPM Mode ITU T Recommendation V 42 contains a High Level Data Link Control HDLC protocol referred to as Link Access Procedure for Modems LAPM and defines error correcting protocols for modems The following result codes are displayed on both the Hyper Terminals upon a successful connection CARRIER 2400 PROTOCOL LAPM CONNECT 19200 You should hear the call negotiation and training sequence on the call progress speaker If you are using a standard reference modem on one terminal the con nection message transmitted and displayed on the PC may be slightly different but should present this same basic information See Section 6 8 6 Response Messages for Successful Modem Connections for an example of a connection message provided by a USR 5686E type modem 2 With the two modems connected test data transfer by typing information on one terminal and verifying that the same data is displayed on the other terminal 3 Test file transfer by creating a brief text file and using following file transfer options on the HyperTerminal HyperTerminal Transfer Send Text File HyperTerminal Transfer Capture File 4 Repeat the test procedure for the other modulation protocols by executing the following AT commands Protocol Command V 22bis 2400 bps AT MS 2 0 300 2400 V 22bis 1200 bps AT MS 2 0
131. sy aanu 299 St aang eH SES B 692 ads Loy LT d T c T S IE 523 ZC Zou m ER 824 m 1053 oas3 G pisa EH FEJ 1SY1Z0E ds4 1494 2H ees AH440 198 ES in n o 4 a RI gueo8 OH3d QNO z aye 30 2 23d S o 83 SIHI S Si ar CT o wW xL Ou Hu OX17N82 2 z QNO QNO x S Jeo bla S1Qu 3 WA 8 D ziau 1d4 Q E otay 110H N ESO edd GOU a Pat QN9 ano Lie X 9au ay Zey L bso Eeer OH say T bur Ge bd zay qu 694 i U Ke ide L_ xu CICI aa IPO JNO QN9 LJ c9u Te DEER DER eeu 3 prs sss J x ex Gi D kton oao LL o ss C k 3s3u rzecIS sga ETIR T28 ezn wam ida egan 29 t 93 oi eeu 2i qN9 TOY i SE QNO QN9 Su SC mmm s Mis d EE gs NICOUH ein LJ LJ ES Seu sss Qa RE QTY 68H 4 vS3 E Su q31 37201 f CE cee QN9 QNO z E nsi ns 893 L L 11255 S s 893 Tin r ER nsi n sir J Gr er To Zz 903 300 C S8v 404 z r wWd3ddnt 71381 m e aby 65 J T gt PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide FIGURE A 1 2004 Microchip Technology Inc DS51471A page 94 JO T ae SNIMBHO 371028 LON D I NOL1U2I1ddU 8 P 62910 OItIl D EO on ond Os W983 32TS CH ONAC Qu8O8 ON3Q c 4S WAdITdSP I 3eu u3d3IdSPD dI aanss INT ONIYNLOYSNNGWN 9 SNIH3J3NISN43 dalsalSeanid ISI S1u8d xx xx S316NH SI6W1 930 SNOI a S32NgH3 101 SNOISN3HId Hardware Schematics dsPICDEM
132. t of the overall AT command set Although the command setincludes support for up to V 32bis only V 22bis is supported in this demonstration TABLE 6 2 AT COMMAND SET FOR dsPIC30F SOFT MODEM Command Description En Command Echo EO Inhibits the echoing of commands to the computer E1 Echoes commands to the computer Hn Hang Up And Hook Control H Modem hangs up and go on hook H0 Causes the modem to go on hook H1 Causes the modem to go off hook Ln Control Speaker Volume L0 Speaker Turn off L1 Low L2 Medium Default L3 High Qn Information and Identification This command has various options which are used to instruct the modem to provide specific information about itself I0 Displays the modem controller firmware revision I3 Same as IO 14 Current modem settings 16 Link diagnostics Quiet Mode Determines whether the modem sends result codes and status codes OK BUSY RING etc to the terminal QO Display result codes user sees command responses e g OK Q1 Result codes are suppressed user does not see responses Vn Result Code Form Selects whether the modem sends long form in words or short form numeric result codes the terminal VO Numeric result codes V1 English result codes e g CONNECT BUSY etc Answer Modem goes off hook transmits answer tone and waits for a carrier response from the remote modem
133. t to an analog line only Using a non analog line e g digital PBX Multi line may damage the modem 6 3 2 Selecting the Demonstration Configuration Figure 6 1 illustrates the set up configuration for operating the end to end soft modem demonstration This configuration requires the modem software on both dsPICDEM net boards The soft modem is controlled by AT commands entered on the Windows HyperTerminal or suitable alternative terminal emulator running on the PC or Laptop This demonstration requires two analog phone lines one each for the originate and answer modems DS51471A page 72 2004 Microchip Technology Inc V 22bis Soft Modem Demonstration FIGURE 6 1 END TO END DEMONSTRATION SET UP PC running Windows HyperTerminal PC running Windows Analog HyperTerminal Telephone Exchange or TAS d d dsPICDEM net Connectivity Board running Soft Modem Figure 6 2 illustrates the set up configuration for the interoperability soft modem demonstration With this configuration one terminal is the dsPIC30F running the soft modem The other terminal is a PC or laptop with a standard reference modem See Section 6 8 1 Standard Reference Modems for a list of tested reference modems The soft modem is controlled by AT commands entered on the HyperTerminal or suitable terminal emulator program running on a PC or laptop The other terminal is co
134. the connectivity board 22 HIGHLIGHTS This chapter discusses Tutorial Overview Creating the Project Building the Code Programming the Chip Debugging the Code Summary 2 3 TUTORIAL OVERVIEW This tutorial combines step by step instructions for using the dsPIC development tools with files provided on the Development Kit Software CD to exercise key features of the MPLAB IDE MPLAB ICD 2 and MPLAB C30 for programming and debugging the dsPIC30F chip There are three or four steps to this tutorial depending on the debug tool being used 1 Create a project in MPLAB 2 Assemble and link the code 3 Program the chip if the MPLAB ICD 2 is being used 4 Debug the code with the MPLAB ICD 2 The MPLAB ICD 2 is used in the tutorial to illustrate debugging 2 4 CREATING THE PROJECT The first step is to create a project and a workspace in MPLAB Usually you will have one project in one workspace 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 workspace contains one or more projects and information on the selected device debug tool and or programmer open windows and their location and other IDE configuration settings MPLAB IDE contains a Project Wizard to help create new projects Before starting copy the Tutorial files from the dsPICDEM net Sample Applications folder on the dsPICDEM net Develop
135. to co ojo o s uc o0 2004 Microchip Technology Inc PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide dsPICDEM net DEVELOPMENT BOARD SCHEMATIC SHEET 10 OF 11 FIGURE A 11 II dO 0T isses awos SNIMEHQ 31828 LON DQ NOILUJI een CBILI 8 ei S2910 E on sma ON W984 3215 Qugo8 OH3Q Qquuo8 OH3Q lt 19u 43323IdSP t 7 8U WaAdIT dP dIH20H21IU ONI SNIYNLOIBANNYW 8 9NIgH3JNISN3 d3IdISd3 Iq ISTI SiuBd DENTEN S3H3NI NI 344 SNOISN3HI ON LOVHINOD Jasr31234s 3SIMb3HIO 5S3INN NOLIUDIJIO3dS RUTUY NOIIdIU283d YO Ssn18 3N3LI0N ON 9NIAdIINSQI YO Liya A Toocw 01 CI Z usw SI D I TL ya gt 3031234 lt nes nT 99 98 eS tH 8 v wuoggz Sed JdIBISNI LON OG 310N gandueds NOI1dIu2e3d SNOISINAY 3 NIdl NIdl GND QNO GNI ANI GND N9 LNOdL 1NOdL Ma xu 09 q3 HIKI LXL ON803 THA 1031 0437 SIQS 1IdS elas Zich TIOS oras 6ds DOG 20S gaS sas vas gas ds Ids eas 208 948 sag vaa 08 eda LO oag 5333 Zug zya 6148 8148 2188 9148 siya vibe 1 SUGI881U gan gan dan aan aan aan 8528 df Ing 8918301 QUH201I Nay nuaisd aMWINS Suis 8MOI
136. ts time base It is configured to time out and generate an interrupt every 2 2 milliseconds The Timer3 Interrupt Service Routine ISR increments a variable tests bit 9 ofthis variable and if set toggles LED3 If LED3 is toggled the ISR resets this same variable to zero Finally the associated interrupt flag is cleared 2004 Microchip Technology Inc DS51471A page 47 PICDEM net 1 and dsPICDEM net 2 Connectivity Dev Board User s Guide 3 10 SUMMARY This quick start demonstration program is aimed at getting users more familiar with the dsPIC peripherals and dsPICDEM net Development Board functions In working through this demonstration you should also become more comfortable with features of MPLAB IDE and the MPLAB C30 compiler and the use of the MPLAB ICD 2 debugger with the dsPICDEM net board After working with the Quick Start program you will have Increased your understanding of how the dsPIC30F works with its peripherals Gained a further understanding of how to initialize and control dsPIC30F peripherals and associated board functions Reduced the learning cycle for getting started with your development using the dsPIC30F product family SSS SSS SE Se DS51471A page 48 2004 Microchip Technology Inc dsPICDEM net 1 AND dsPICDEM net 2 CONNECTIVITY DEVELOPMENT BOARD MICROCHIP USER S GUIDE Chapter 4 HTTP Web Server Demonstration 4 1 INTRODUCTION This chapter describes a sample program that demo
137. uter and the local modem is handled amp K0 Disable local flow control amp K3 Enable RTS CTS Hardware flow control default amp K4 Enable XON XOFF Software flow control amp Qn Communication Mode Q5 Modem negotiates an Error corrected link default Q6 Selects asynchronous operation MS 1 2 3 4 Select Modulation MS lt mod gt lt automod gt lt minrate gt lt maxrate gt Where lt mod gt Is specified modulation lt automod gt Enables the auto mode operation This mode is always enabled lt minrate gt Sets the lowest modem speed lt maxrate gt Sets the highest modem speed lt Mod gt Modulation Possible Rates bps 0 V 21 300 2 V 22bis 2400 or 1200 3 V 23 1200 9 V 32 9600 or 4800 By default V 32 9600 mode is selected and V 22bis V 23 V 21 modes can be selected by the following commands respectively V 32bis 14400 bps V 32bis 12000 bps V 32bis 9600 bps V 32bis 7200 bps V 32 9600 bps V 32 4800 bps V 22bis 2400 bps V 22bis 1200 bps AT MS 9 0 300 14400 AT MS 9 0 300 12000 AT MS 9 0 300 9600 AT MS 9 0 300 7200 AT MS 8 0 300 9600 AT MS 8 0 300 4800 AT MS 2 0 300 2400 AT MS 2 0 300 1200 V 23 bps AT MS 3 0 300 1200 V 21 bps AT MS 0 0 300 300 Bell 103 300 bps AT MS 1 0 300 300 Note 1 For V 23 originating mode transmits at 75 bps and receives at 1200 bps Answering mode transmits at 1200 bps and receives at 75 bps DS51
138. utive Programming Debug Vector Programming Configuration Bits verifying Program Memory Debug Executive Debug Vector Verify Succeeded Programming Configuration Bits Config Memory verifying configuration memory Connecting to debug executive Programming succeeded MPLAB ICD 2 Ready 9 Runthe code Debugger gt Run The program initializes and tests the peripherals as depicted in Figure 3 17 Note the responses on the dsPICDEM net board as the program executes These responses are indicated along the right side of the flow chart The code modules are identified along the left side of the flow chart DS51471A page 42 2004 Microchip Technology Inc Quick Start Program FIGURE 3 17 PERIPHERAL INITIALIZATION AND TEST PROGRAM FLOW main c START Initialize Ports amp W Registers Y Initialize Timers 1 2 amp 3 LEDS ILLUMINATE k2 LED2 and LED3 BLINK led c Initialize LCD Y Test SRAM init ports s init timers s init Sram s x SRAM TEST RESULT DISPLAYS Display Display SRAM FAIL SRAM PASS Initialize amp Test i NIC init RealTek NIC c Y NIC NIC TEST RESULT DISPLAYS Display Display l LOOPBACK FAIL Loopback LOOPBACK PASS Pass Initialize amp Test y AN TestCAN c CAN CAN TEST RESULT DISPLAYS Loopback Display No
139. y have a right to sue for relief under that Act Information contained in this publication regarding device applications and the like is intended through suggestion only and may be superseded by updates It is your responsibility to ensure that your application meets with your specifications No representation or warranty is given and no liability is assumed by Microchip Technology Incorporated with respect to the accuracy or use of such information or infringement of patents or other intellectual property rights arising from such use or otherwise 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 intellectual property rights QUALITY MANAGEMENT SYSTEM CERTIFIED BY DNV ISO TS 16949 2002 Trademarks The Microchip name and logo the Microchip logo Accuron dsPIC KEELOQ microID MPLAB PIC PICmicro PICSTART PRO MATE PowerSmart rfPIC and SmartShunt are registered trademarks of Microchip Technology Incorporated in the U S A and other countries AmpLab FilterLab MXDEV MXLAB PICMASTER SEEVAL SmartSensor and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U S A Analog for the Digital Age Application Maestro dsPICDEM dsPICDEM net dsPICworks ECAN ECONOMONITOR FanSense FlexROM fuzzyLAB In Circuit Seria
Download Pdf Manuals
Related Search
Related Contents
Zotac ZT-50102-10P NVIDIA GeForce GTX 580 1.5GB graphics card Camcorder HD di design digitale MD 85806 Italiano LAITERIE - CRDP de Montpellier Energy Sistem EasyMatch User Manual Utilisation de Flash MX EINBAUANLEITUNG MULTIVERSO Warranty Experimental Life Energy Meter Copyright © All rights reserved.
Failed to retrieve file