Advertisement

Quick Links

®
dsPIC
DSC DTMF
DETECTION LIBRARY
USER'S GUIDE
© 2008 Microchip Technology Inc.
DS70332A

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the dsPIC DSC DTMF and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Microchip Technology dsPIC DSC DTMF

  • Page 1 ® dsPIC DSC DTMF DETECTION LIBRARY USER’S GUIDE © 2008 Microchip Technology Inc. DS70332A...
  • Page 2 MPLAB, PIC, PICmicro, ensure that your application meets with your specifications. PICSTART, rfPIC and SmartShunt are registered trademarks MICROCHIP MAKES REPRESENTATIONS of Microchip Technology Incorporated in the U.S.A. and other WARRANTIES OF ANY KIND WHETHER EXPRESS OR countries. IMPLIED, WRITTEN ORAL,...
  • Page 3: Table Of Contents

    2.3 Si3035 – FCC Options ................. 15 2.4 Si3034 – Global-Based Chipset Options ............15 Chapter 3. Application Programming Interface (API) 3.1 dsPIC DSC DTMF Generation Library API Functions ........19 Chapter 4. DTMF Detection Demonstration 4.1 Setting Up the dsPICDEM.net Board ............23 4.2 DTMF PSTN Phone Line Demonstration .............
  • Page 4 ® dsPIC DSC DTMF Detection Library User’s Guide NOTES: © 2008 Microchip Technology Inc. DS70332A-page iv...
  • Page 5: Preface

    • Document Layout • Conventions Used in this Guide • Warranty Registration • Recommended Reading • The Microchip Web Site • Development Systems Customer Change Notification Service • Customer Support • Document Revision History © 2008 Microchip Technology Inc. DS70332A-page 1...
  • Page 6 • Chapter 1. “Introduction” – This chapter explains the basic concepts to help you implement the dsPIC DSC DTMF Detection Library in your application and discusses the principle of DTMF tone detection. • Chapter 2. “Configuring the Analog Front End (AFE)” – This chapter describes the Analog Front End (AFE) on the dsPICDEM.net™...
  • Page 7 Please complete the enclosed Warranty Registration Card and mail it promptly. Sending in the Warranty Registration Card entitles users to receive new product updates. Interim software releases are available at the Microchip web site. © 2008 Microchip Technology Inc. DS70332A-page 3...
  • Page 8 DSC DTMF Detection Library User’s Guide RECOMMENDED READING This user’s guide describes how to use the dsPIC DSC DTMF Detection Library. Other useful documents include: dsPIC33F Family Reference Manual Sections Refer to these documents for detailed information on dsPIC33F device operation.
  • Page 9 IDE Project Manager and general editing and debugging features. • Programmers – The latest information on Microchip programmers. These include ® ® the MPLAB PM3 and PRO MATE II device programmers and the PICSTART Plus development programmer. © 2008 Microchip Technology Inc. DS70332A-page 5...
  • Page 10 Technical support is available through the web site at: http://support.microchip.com DOCUMENT REVISION HISTORY Revision A (August 2008) Initial release of this document. © 2008 Microchip Technology Inc. DS70332A-page 6...
  • Page 11: Chapter 1. Introduction

    LIBRARY USER’S GUIDE Chapter 1. Introduction The dsPIC DSC DTMF Detection Library provides an algorithm that detects the Dual Tone Multi-Frequency (DTMF) signals. This chapter explains the basic concepts to help you implement the dsPIC DSC DTMF Detection Library in your application. This chap- ter also discusses the principle of DTMF tone detection.
  • Page 12: Principle Of Detection

    DTMF tone. Thus, it avoids false tone detections. However, the most important part of the detection process is the Tone Detection phase, which involves the analysis of the spectral properties of a signal. © 2008 Microchip Technology Inc. DS70332A-page 8...
  • Page 13: Dtmf Tone Detector

    IIR structure for the Goertzel DFT filter is shown in Figure 1-3. It contains two complex-conjugate poles. Using only one real coefficient, it facilitates the computa- tion of the difference equation. The squared magnitude information of the DFT is sufficient for the tone detection. © 2008 Microchip Technology Inc. DS70332A-page 9...
  • Page 14 Table 1-1 and for their corresponding eight second harmonics. The second harmonics are used to differentiate DTMF tones from speech or music signals. FIGURE 1-3: GOERTZEL DFT SIGNAL FLOW GRAPH X(n) π π 2cos(2 k/N) 2cos(2 k/N) © 2008 Microchip Technology Inc. DS70332A-page 10...
  • Page 15 Non-operation Max. -55 dBm Power level difference — +4 dB to -8 dB between frequencies Signal reception timing Signal duration Operation Min. 40 ms Non-operation Max. 23 ms Pause duration Min. 40 ms © 2008 Microchip Technology Inc. DS70332A-page 11...
  • Page 16: Applications And Performance

    Table 1-4 provides the size of the Data Memory, Program Memory, and MIPS required to support the dsPIC DSC DTMF Detection Library. TABLE 1-4: DTMF KEY PAD AND ASSOCIATED FREQUENCIES...
  • Page 17: Chapter 2. Configuring The Analog Front End (Afe)

    CSDI Data Output from Si3021 CSDO Data Input to Si3021 FSYNC COFS Frame Sync to dsPIC33FJ256GP710 OFHK Hardware off-hook (not used) RESET AFE Device Reset RGDT/FSD SS2/CN11 Not used FC/RGDT SCK2/CN8 Not used © 2008 Microchip Technology Inc. DS70332A-page 13...
  • Page 18: Gain Control Register Settings

    Si3034/Si3035 AFE chip. The Si3021Drv.h file includes various options that are necessary to set up the AFE for the dsPIC DSC DTMF Detection Library. Review these options carefully to ensure proper modem operation.
  • Page 19: Si3035 - Fcc Options

    = 0, 11 to 22 Arms n = 1, 17 to 33 Arms © 2008 Microchip Technology Inc. DS70332A-page 15...
  • Page 20 Rising this voltage may improve distortion performance. n = 0, Normal n = 1, -0.125V n = 2, 0.25V n = 3, 0.125V Table 2-5 lists the country specific register settings. © 2008 Microchip Technology Inc. DS70332A-page 16...
  • Page 21 CTR_21 includes the following countries: Austria, Belgium, Denmark, Finland, France, Germany, Greece, Iceland, Ireland, Italy, Luxembourg, Netherlands, Norway, Portugal, Spain, Sweden, Switzerland and the United Kingdom. Supported for loop current > 20 mA. © 2008 Microchip Technology Inc. DS70332A-page 17...
  • Page 22 CTR_21 includes the following countries: Austria, Belgium, Denmark, Finland, France, Germany, Greece, Iceland, Ireland, Italy, Luxembourg, Netherlands, Norway, Portugal, Spain, Sweden, Switzerland and the United Kingdom. Supported for loop current > 20 mA. © 2008 Microchip Technology Inc. DS70332A-page 18...
  • Page 23: Chapter 3. Application Programming Interface (Api)

    LIBRARY USER’S GUIDE Chapter 3. Application Programming Interface (API) This chapter lists and describes the Application Programming Interface (API) that are available in the stand-alone dsPIC DSC DTMF Detection Library. Topics covered include: • dsPIC DSC DTMF Generation Library API Functions...
  • Page 24 CF1.DTMFframeType = NOT_A_DIGIT_FRAME; //Init frametype CF1.DTMFshapeTest = YES; //Disable the Shape Test CF1.DTMFcurrentDigit = CURRENT_DIGIT; //Init 20 as the Current //Digit CF1.DTMFdeclaredDigit = DECLARED_DIGIT; //Init 30 as the prev //detected digit CF1.DTMFinputType = LEFT_JUSTIFIED; DTMFDetInit(&CH1,&CF1); © 2008 Microchip Technology Inc. DS70332A-page 20...
  • Page 25 Handle to an instance of DTMF Detection. pDTMFDet Pointer to input buffer. pSamplesBuffer Pointer to store the detected digit. Digit Return Value Process State/Type Remarks None. Code Example dtmfdet_sHandle CH1; int inSignal[80]; int Digit,State; State = DTMFDetection(&CH1,&inSignal[0],&Digit); © 2008 Microchip Technology Inc. DS70332A-page 21...
  • Page 26 ® dsPIC DSC DTMF Detection Library User’s Guide NOTES: © 2008 Microchip Technology Inc. DS70332A-page 22...
  • Page 27: Chapter 4. Dtmf Detection Demonstration

    • Flow Control: Hardware Flow Control DTMF PSTN PHONE LINE DEMONSTRATION In this demonstration setup, the dsPIC DSC DTMF Detection Library interacts with a remote telephone over the PSTN, as illustrated in Figure 4-1. The telephone handset is used to dial the dsPICDEM.net board over an analog phone line. The Si3034/Si3035 DAA/AFE interface on the board detects the ring and alerts the dsPIC33FJ256GP710 device, which then executes the DTMF detection algorithm.
  • Page 28 It is always necessary to reprogram the device with the new code after each build. MPLAB will remind you with a message that states “Program memory has changed since last operation”. Figure 4-2 shows a flow chart that summarizes the remote DTMF detection demonstration. © 2008 Microchip Technology Inc. DS70332A-page 24...
  • Page 29 Dial dsPICDEM.net™ Board Connectivity Board Ringing? Press S1 to go off-hook Press key on handset ® Feed Digit to dsPIC DTMF Detection Library Send Detected Digit to UART Display Digit String on HyperTerminal © 2008 Microchip Technology Inc. DS70332A-page 25...
  • Page 30 ® dsPIC DSC DTMF Detection Library User’s Guide NOTES: © 2008 Microchip Technology Inc. DS70332A-page 26...
  • Page 31: Appendix A. Drivers

    DSC DTMF DETECTION LIBRARY USER’S GUIDE Appendix A. Drivers This section provides information about the drivers used with the dsPIC DSC DTMF Detection Library. DAA/AFE DRIVER FUNCTIONS The dsPIC33F device implements both 8.0 kHz and 7.2 kHz sampling rates when communicating with the DAA/AFE.
  • Page 32 Used to change the AFE sampling rate to 8 kHz. This function must be called by the user application to change the AFE sampling rate from 7.2 kHz to 8 kHz. Prototype void SetFs8000(void) Arguments None. Return Value None. Code Example SetFs8000(); © 2008 Microchip Technology Inc. DS70332A-page 28...
  • Page 33 Used to set the AFE to the Off-Hook state. Prototype void go_off_hook(INT SpeakerVolume) Arguments None. Return Value None. Code Example SpeakerVolume = 0x03 -> Low SpeakerVolume = 0x63 -> Medium SpeakerVolume = 0x00 -> High go_off_hook(SpeakerVolume); © 2008 Microchip Technology Inc. DS70332A-page 29...
  • Page 34 This function is used to turn off the transmit and receive signal to the speaker connected to the AOUT pin of the chipset. Prototype void speaker_off(void) Arguments None. Return Value None. Code Example speaker_off(); © 2008 Microchip Technology Inc. DS70332A-page 30...
  • Page 35: Index

    ............ 29 Reading, Recommended ........... 4 Init_Si3021 ..........27 SetFs7200 ............28 SetFs8000 ............28 SetFs8000..............28 speaker_off ..........30 Documentation Conventions ............3 Warranty Registration ..........3 Layout ..............2 WWW Address............5 © 2008 Microchip Technology Inc. DS70332A-page 31...
  • Page 36: Worldwide Sales And Service

    Fax: 86-592-2388130 Fax: 886-2-2508-0102 Toronto China - Xian Thailand - Bangkok Mississauga, Ontario, Tel: 86-29-8833-7252 Tel: 66-2-694-1351 Canada Fax: 86-29-8833-7256 Fax: 66-2-694-1350 Tel: 905-673-0699 China - Zhuhai Fax: 905-673-6509 Tel: 86-756-3210040 Fax: 86-756-3210049 01/02/08 © 2008 Microchip Technology Inc. DS70332A-page 32...

Table of Contents