| Datasheets.org.uk - 100 Million Datasheets from 7500 Manufacturers. |
www.spiritDSP.com/CST Literature Number: SPRU029A March 2003
Top Searches for this datasheetsensor s42 - sensor s42 sdk cid audio amplify - sdk cid audio amplify PIC PROJECT CCS C flex driver - PIC PROJECT CCS C flex driver echo cancellation noise speech recognition - echo cancellation noise speech recognition cstm* - cstm* C54CST - C54CST afsk - afsk "Silicon Laboratories" -si3014 si3021 - "Silicon Laboratories" -si3014 si3021 "line-side daa" - "line-side daa" Client Side Telephony (CST) Chip Software User's Guide www.spiritDSP.com/CST Literature Number: SPRU029A March 2003 Mailing Address: Texas Instruments Post Office 655303 Dallas, Texas 75265 Copyright 2003, Texas Instruments Incorporated Preface Read This First About This Manual This user's guide assists user with programming various components from SPIRITt Corp TMS320C54x platform. provides instructions integrating these software components implementating various telephony devices based TMS320C54x platform. algorithims conform TMS320 Algorithm Standard, also known XDAIS. This Manual contents Client Side Telephony (CST) Chip Software User's Guide follows: Chapter Introduction Client Side Telephony (CST), brief over- view Client Side Telephony (CST) Chip Software User's Guide (CST), abbreviations terms used throughout this document, important copyright information. Chapter Getting Started, provides quick steps allow user imme- diately begin using chip modes. Important notes concerning installation procedures also provided. Chapter Hardware Overview, provides overview chip C54CST board, settings. description UART interface with C54CST provided, well instructions adapting C54CST chip user specific hardware. Chapter Software Overview, overview Framework Com- ponents Software parts. This chapter also describes benefits using Flex mode control chips. Chapter Flex Application Development Guidelines, brief overview develop user-specific applications. benefits Flex mode over Chipset discussed. Chapter Framework Overview, provides user with overviews descriptions different Layers, services, their API. Read This First Notational Conventions Chapter Framework Components, provides detailed descriptions framework components, their interface, architecture. Chapter C54CST Resources: Registers Conventions, Memory, MIPS, summary important information about C54CST chip resources their framework algorithms. Chapter Command Descriptions, provides user with scription commands, syntax, shielded codes, result tokens. Chapter Host Utility, provides user with requirements set- tings running host utility. Chapter Product Installation Procedure, provides brief instructions installation SDK, setup host communicate with C54CST EVM, setup Windowst communicate with C54CST generic modem. Chapter Chipset Mode Testing Troubleshooting, provides scriptions several test procedures available troubleshooting testing functionality. Notational Conventions This document uses following conventions. Program listings, program examples, interactive displays shown special typeface similar typewriter's. Examples bold version special typeface emphasis; interactive displays bold version special typeface distinguish commands that enter from items that system displays (such prompts, command output, error messages, etc.). Here sample program listing: 0011 0012 0013 0014 0005 0005 0005 0006 0001 0003 0006 .field .field .field .even Here example system prompt command that might enter: /user/ti/simuboard/utilities Information About Cautions Warnings Information About Cautions Warnings This book contain cautions warnings. This example caution statement. caution statement describes situation that could potentially damage your software equipment. This example warning statement. warning statement describes situation that could potentially cause harm you. information caution warning provided your protection. Please read each caution warning carefully. Related Documentation From Texas Instruments Using TMS320 Algorithm Standard Static System (SPRA577) TMS320 Algorithm Standard Rules Guidelines (SPRU352) TMS320 Algorithm Standard Reference (SPRU360) Technical Overview eXpressDSP-Compliant Algorithms Software Producers (SPRA579) TMS320 Algorithm Standard (SPRA581) Achieving Zero Overhead with TMS320 Algorithm Standard IALG Interface (SPRA716) Reference Framework Flexible, Multi-Channel/Algorithm, Static System (SPRA793) Reference Frameworks eXpressDSP Software: Reference (SPRA147) TMS320 DSP/BIOS User's Guide, (SPRU423) Read This First Related Documentation TMS320C5000 DSP/BIOS Application Programming Interface (API) Reference Guide (SPRU404) Writing DSP/BIOS Device Drivers Block (SPRA802) TMS320C54x Chip Support Library Reference Guide, (SPRU420) TMS320C54CST Client Side Telephony (SPRS187) TMS320VC5407 Bootloader Technical Reference (SPRA827) Client Side Telephony (CST) Chipset Mode (SPRA859) Client Side Telephony (CST) Chip Flex Mode Flex Examples Description (SPRA862) Related Documentation Si3044 User Guide. ENHANCED GLOBAL DIRECT ACCESS ARRANGEMENT. Silicon Laboratories, 2000. http://www.silabs.com/products ITU-T Recommendation V.250. Serial asynchronous automatic dialing control, 07/97 ITU-T Recommendation V.253. Control voice-related functions asynchronous DTE, 02/98 TMS320C54CST Evaluation Module. Technical Reference. Spectrum Digital, Inc. Using Zero-Overhead model Static memory example Documentation XDAIS Algorithms Automatic Gain Control (AGC) Algorithm User's Guide (SPRU631) Caller (CID) Algorithm User's Guide (SPRU632) Comfort Noise Generator (CNG) Algorithm User's Guide (SPRU633) Echo Canceller (EC) Algorithm User's Guide (SPRU634) Voice Activity Detector (VAD) Algorithm User's Guide (SPRU635) ModemIntegrator Algorithm User's Guide (SPRU636) G726 Algorithm User's Guide (SPRU637) Universal Multifrequency Tone Detector (UMTD) Algorithm User's Guide (SPRU638) Universal Multifrequency Tone Generator (UMTG) Algorithm User's Guide (SPRU639) viii Trademarks Trademarks TMS320t trademark Texas Instruments. "eXpressDSP Compliant" trademark Texas Instruments. SPIRIT CORPt tradmark Spirit Corp. HyperTerminalt trademark Hilgraeve, Inc. Windows, Windows 95/98/2000/NT/XPt registered trademarks Microsoft Corporation. Procomm Plust trademark Datastorm Technologies, Inc. Software Copyright Software Copyright 2003, SPIRIT Technologies, Inc. Read This First Need Assistance Need Assistance World-Wide Sites Online Semiconductor Product Information Center (PIC) Solutions Hotline On-linet Microcontroller Home Page Networking Home Page Military Memory Products Home Page http://www.ti.com http://www.ti.com/dsp http://www.ti.com/sc/micro North America, South America, Central America Product Information Center (PIC) (972) 644-5580 Literature Response Center U.S.A. (800) 477-8924 Software Registration/Upgrades (972) 293-5050 Fax: (972) 293-5967 U.S.A. Factory Repair/Hardware Upgrades (281) 274-2285 U.S. Technical Training Organization (972) 644-5580 Microcontroller Hotline (281) 274-2370 Fax: (281) 274-4203 Email: micro@ti.com Microcontroller Modem (281) 274-3700 8-N-1 Hotline Email: dsph@ti.com Internet anonymous ftp://ftp.ti.com/pub/tms320bbs Networking Hotline Fax: (281) 274-4027 Email: TLANHOT@micro.ti.com Europe, Middle East, Africa European Product Information Center (EPIC) Hotlines: Multi-Language Support Email: epic@ti.com Deutsch 8161 English Francais Italiano EPIC Modem European Factory Repair Europe Customer Training Helpline Fax: Fax: Asia-Pacific Literature Response Center Hong Kong Hotline Korea Hotline Korea Modem Singapore Hotline Taiwan Hotline Taiwan Modem Taiwan Internet anonymous +852 7288 +852 7268 2804 2914 Fax: +852 2200 Fax: +852 1002 Fax: 2828 Fax: 7179 +886 1450 Fax: +886 2718 +886 2592 ftp://dsp.ee.tit.edu.tw/pub/TI/ Japan Product Information Center +0120-81-0026 Japan) +03-3457-0972 (INTL) 813-3457-0972 Hotline +03-3769-8735 (INTL) 813-3769-8735 Nifty-Serve Type TIASP" Fax: +0120-81-0036 Japan) Fax: +03-3457-1259 (INTL) 813-3457-1259 Fax: +03-3457-7071 (INTL) 813-3457-7071 Need Assistance Documentation When making suggestions reporting errors documentation, please include following information that title page: full title book, publication date, literature number. Mail: Texas Instruments Incorporated Email: dsph@ti.com Email: micro@ti.com Technical Documentation Services, P.O. 1443 Houston, Texas 77251-1443 Note: When calling Literature Response Center order documentation, please specify literature number book. product price availability questions, please contact your local Product Information Center, www.ti.com/sc/support http://www.ti.com/sc/support details. additional technical support, Home Page Semiconductor KnowledgeBase Home Page (www.ti.com/sc/knowledgebase). have problems with Client Side Telephony software, please, read first list Frequently Asked Questions http://www.spiritDSP.com/CST. also visit this site obtain latest updates software documentation. Read This First Contents Contents Introduction Client Side Telephony (CST) brief overview Client Side Telephony (CST) Chip Software User's Guide (CST), abbreviations terms used throughout this document, important copyright information. Overview Abbreviations Acronyms Legal Disclaimer Getting Started This chapter provides quick steps allow user immediately begin using chip modes. Important notes concerning installation procedures also provided. Overview Running Solution: Standalone Chipset Mode Running Solution: Flex Mode Hardware Overview This chapter provides overview chip C54CST board, settings. description UART interface with C54CST provided, well instructions adapting C54CSt chips user specific hardware. Introduction Chip Main Modes Chip TMS320C54CST Configuration UART Hardware Flow Control Indication Adapting C54CST Chip User-Specific Hardware Software Overview This chapter overview Framework Components Software parts. This chapter also describes benefits using Flex mode control chips. Flex Mode Applications Framework Components Telephony Components 4.3.1 Data Modem 4.3.2 Voice Processing 4.3.3 Telephony Signals Processing xiii Contents Flex Application Development Guidelines This chapter brief overview develop user-specific applications. benefits Flex mode over Chipset discussed. Chipset Flex Mode Commands Alternative Interfaces Designing Implementing Standard Applications 5.3.1 Preliminary Application Design 5.3.2 Detailed Application Design 5.3.3 Implementation 5-10 5.3.4 Chapter Summary 5-15 Building Loading Flex Applications 5-16 5.4.1 Projects Building Flex Applications 5-16 5.4.2 Bootloader 5-18 Framework Overview This chapter provides user with overviews descriptions different Layers, services, their API. Overview Framework Layers 6.2.1 Action-Based Interface 6.2.2 Commander Layer 6.2.3 Service Layer 6.2.4 Other Parts Services 6-11 6.2.5 Layers Summary 6-12 Framework 6-15 6.3.1 Main Types 6-15 6.3.2 S-Registers 6-16 6.3.3 Call Tree 6-17 6.3.4 Controlling Through Action Layer Interface 6-19 6.3.5 Standard Custom Atomic Commands 6-21 6.3.6 Command Execution Different Layers 6-22 6.3.7 Action Interface Usage 6-24 6.3.8 Dynamic Functions 6-26 Framework Components This chapter provides detailed descriptions framework components, their interface, architecture. Service Layer 7.1.1 Files CSTService.c, CSTService.h Commander 7-16 7.2.1 Files CSTSReg.c, CSTSReg.h 7-16 7.2.2 Files CSTCommander.c, CSTCommander.h 7-26 7.2.3 Files CSTAtomic.c, CSTAtomic.h 7-41 Contents Action 7-47 7.3.1 Unified Action Message 7-47 7.3.2 Action Message Type 7-46 7.3.3 Action Message Contents 7-47 7.3.4 Brief Description Action Function Interface 7-50 7.3.5 Using Action Interface, Practical Aspects 7-52 Parser 7-63 7.4.1 Command Line Parser 7-63 7.4.2 Command Execution 7-64 7.4.3 Brief Description Command Line Parser Interface 7-65 Memory Management 7-66 7.5.1 Overview 7-66 7.5.2 Memory Manager Function Interface 7-67 7.5.3 Possible Memory Configurations 7-68 7.5.4 More About Algorithm Creation Deletion 7-74 Telephony Components Brief Specification 7-75 7.6.1 Data Modem 7-76 7.6.2 Voice Processing 7-88 7.6.3 Telephony Signals Processing 7-100 7.6.4 Telephony Components Summary 7-105 Drivers 7-107 7.7.1 Overview, Interface Functions Function Call Diagram 7-107 7.7.2 Peripheral Driver. Files CSTPeriph.h, EVM54CSTDrv.c, EVM54CSTDrv.h 7-117 7.7.3 High-Level Driver. Files DAADrv.c, DAADrv.h 7-122 7.7.4 Brief Description Low-level (LIO) Interface 7-126 7.7.5 Low-level (LIO) Driver. Files DAADrv54CST.c, Si3044Stages.c 7-130 7.7.6 Low-Level (LIO) UART Driver. Files Uart550Drv.c, UartAutoBaud.c 7-140 7.7.7 Reloading Drivers 7-146 C54CST Resources: Registers Conventions, Memory, MIPS summary important information about C54CST chip resources their framework algorithms. Overview General Register Conventions Program Data Address Space Memory Resource Usage Each Algorithm Framework 8-10 Command Descriptions This chapter provides user with description commands, syntax, shielded codes, results tokens. Command Description Command Modes Contents Contents Command Syntax 9.3.1 General Commands Conventions 9.3.2 Types Commands 9.3.3 Basic Syntax Command Format 9.3.4 S-Parameters Syntax 9.3.5 Extended Syntax Commands 9.3.6 Command Execution 9-12 Commands 9-13 9.4.1 General Commands 9-13 9.4.2 Caller Related Commands 9-23 9.4.3 Modem Related Commands 9-26 9.4.4 Voice Mode Commands 9-34 9.4.5 S-Registers 9-37 9.4.6 S-Registers Controlling 9-40 Shielded Codes Voice Mode 9-42 Result Tokens 9-44 Commands Summary 9-45 Host Utility 10-1 This chapter provides user with requirements settings running host utility. 10.1 10.2 Minimum System Requirements Host Settings 10.2.1 Port Settings 10.2.2 International Settings 10.2.3 Miscellaneous Settings Voice Playback Record 10.3.1 Host Audio File Format 10.3.2 Application Sequence "Playback Greeting Record" 10-2 10-3 10-4 10-5 10-6 10-7 10-8 10-9 10.3 Product Installation Procedure 11-1 This chapter provides brief instructions installation SDK, setup host communicate with C54CST EVM, setup windows communicate with C54CST generic modem. 11.1 11.2 11.3 11.4 Installing Description Product Document Directory Tree Setting Host Installing Modem Drivers Chips Windowst 11-2 11-3 11-4 11-5 Chipset Mode Testing Troubleshooting 12-1 This chapter provides descriptions several test procedures available troubleshooting functionality. 12.1 12.2 12.3 Testing UART 12-2 Testing 12-4 Troubleshooting Procedures 12-7 Figures Figures 10-1 10-2 10-3 10-4 10-5 11-1 Chip Overview General Hardware Setup Chip Framework Diagram Data Modem Objects Generic Flex Application 5-14 Framework Controlled Command Parser Framework Controlled Action Layer Control Layers Interaction Service Periodic Thread 6-10 Schematic Diagram Periodic Thread Call Tree 6-18 Example Command Execution Different Layers 6-24 Fragments Modem Call Code 6-25 Solution Data Path 7-76 Modem Data Flow 7-79 Modem Data Pump Operating Environment 7-81 V.42 Operating Environment 7-86 G726 G711 Bitstream Format 7-91 Drivers Function Call Diagram 7-107 Solution Memory Parser State Diagram Host Settings Dialog 10-3 Port Settings Dialog 10-4 Settings Dialog 10-5 Voice Play/Record Buttons 10-7 Host Processing Flow 10-7 Documentation Software Directory Tree 11-3 Contents xvii Tables Tables 7-10 7-12 7-13 7-14 7-15 7-16 7-17 7-18 7-19 7-20 7-21 7-22 7-23 7-24 7-25 7-26 7-27 7-28 7-29 xviii Abbreviations Acronyms UART Lines Indication LEDs Meaning Action Associations Standard Callback Function Messages Top-Level Interface Functions 5-10 Actions Service message Service Tasks Service Message Types Service Message Summary Service Status Service Message Result Codes List xDAIS Algorithms 7-10 Service Interface Functions 7-11 S-Register Descriptor 7-16 Defined S-Registers 7-17 Settings 7-21 Brief Description S-Registers Function Interface 7-24 Simple Structure 7-24 S-Register Request Descriptor 7-25 Dynamic Functions 7-27 Commander General Control Interface 7-37 Commander Modes 7-37 Commander External Message Events 7-38 Brief Description Commander Function 7-40 Commander Atomic Commands 7-41 Commander Special Pauses 7-44 Basic Predefined Commander Atomic Command Scripts 7-45 Unified Action Message 7-47 Action Message Type 7-47 tCSTConfigCommand Structure 7-48 tCSTStandardOperation Structure 7-48 Action Standard Operations 7-49 Action Function Interface 7-50 Command Descriptor 7-63 Tables 7-30 7-31 7-32 7-33 7-34 7-35 7-36 7-37 7-38 7-39 7-40 7-41 7-42 7-43 7-44 7-45 7-46 7-47 7-48 7-49 7-50 7-51 7-52 7-53 7-54 7-55 7-56 7-57 7-58 7-59 7-60 7-61 7-62 7-63 7-64 7-65 7-66 Some Parser Interface Functions 7-65 Memory Manager Function Interface Types 7-67 Basic Memory Configurations 7-68 Memory Space Segment Structure 7-70 BIOS Memory Space Segment Structure 7-73 Data Flow Parameters 7-79 Brief Description S-Registers Function Interface 7-81 Voice Controller Main Structure Definition 7-89 Brief Description Voice Controller Function Interface 7-90 Structure Definition 7-97 Detected Signals 7-101 CPTD Configurations 7-102 Generated Signals Parameters 7-103 Relationship Between Algorithms, Service Tasks, Atomic Commands Actions 7-105 Interface Functions 7-108 High-Level Driver Functions 7-108 UART Interface Functions 7-112 Peripheral Driver Commands 7-117 Events From Peripheral Driver 7-119 Peripheral Driver Function Interface 7-120 Standard Operations High-Level Driver 7-122 High-level Driver Commands Compose Scripts 7-123 Commands High-Level Driver 7-123 High-Level Driver Function Interface 7-125 Function Table 7-127 Open Function Modes 7-128 Multiple Device Setup Structure 7-131 Device Setup Structure 7-132 Initial Device Registers Values 7-133 Fields Task Parameter 7-134 Driver Commands 7-138 Driver Parameter Result 7-139 Driver Register Write Structure 7-139 UART Setup Function Track Modem Escape Sequence Characters 7-140 Default Setup Settings UART Driver 7-141 UART Driver Commands 7-144 UART Driver Parameter Result 7-145 Registers Used Solution Areas Description Algorithms ROM/RAM Characteristics 8-10 Algorithims MIPS Characteristics 8-11 Definition Parser Modes Commands Syntax Specifics Contents Tables 9-10 9-12 9-13 9-14 9-15 9-16 9-17 10-1 12-1 TE-ACK Signal Settings DT-AS Detector Parameters Demodulator Settings Data Compression Subparameters V.42 Window Size Subparameters V.42 Frame Length Subparameters S-Registers Defined CST-Solution Registers Summary Country Specific Register Settings Parser Voice Mode Shielded Codes Sent From Parser Voice Mode Shielded Codes Sent Parser Result Tokens Summary Standard V.250 Commands Supported Summary CST-Solution Proprietary Commands Summary Commands Categories Host Parameter Requirements Troubleshooting Procedures 9-24 9-24 9-25 9-27 9-30 9-31 9-37 9-40 9-41 9-42 9-42 9-44 9-45 9-47 9-48 10-2 12-7 Notes, Cautions, Warnings Notes, Cautions, Warnings Legal Disclaimer Compiling Flex examples Code Composer Studio Word "Action" Commands Running applications demo examples boards 10-3 Important notes Code Composer Studio version users 11-2 Notice: TMS320C54CST chip UART capabilities 11-5 Troubleshooting Testing 12-7 Contents Chapter Introduction Client Side Telephony (CST) This chapter provides brief overview Client Side Telephony (CST) Chip Software User's Guide. lists explains abbreviations terms used throughout this document, contains copyright information. Topic Page Overview Abbreviations Acronyms Legal Disclaimer Overview Overview Software consists several eXpressDSP compliant telephony components special Framework, which ties them together provides unified access each them. Software ROM'ed into TMS320C54CST chip from Texas Instruments. There main modes Chip operation Chipset mode Flex mode: Chipset mode, only software running inside Chip, controlled from outside serial link commands. Flex mode, user code running inside Chip, controlling Software using several different control layers Framework. following components included Software standalone XDAIS algorithms): Data Modem (V.32bis/V.32, V.22bis/V.22, V.14, V.42, V.42bis) Voice processing (ADPCM G.726, G.711, G.168 Echo Canceller, VAD, AGC) Telephony Signals Processing (DTMF, CPTD, CID) Besides, algorithms portofolio extented very memoryefficient Add-ons, supplied separately from chip: functionality (fax modem supporting V.17/V.29/V.27ter/V.21) V.29 Fast Connect (for terminals) Standard vocoders (G.729AB kbps, G.723.1 kbps) SPIRIT-proprietary 1200 vocoder There also integration shell (CST Framework), which consists several layers forms very flexible configurable framework. Each framework layer intermediate interface, with level abstraction. Framework consists following parts (supplied open source code): Command Parser (Data Voice commands, used mostly Chipset mode) Overview Several control layers (used Flex mode only): Action layer give user control over Solution whole through mapping commands messages different sublayers; eliminates need Parser) Commander layer give user control over Solution through special command sequences) Service layer provide data flow between different XDAIS components device drivers, give user unified access XDAIS components through special messages) LIO- CSL-compliant drivers data flow controllers UART codecs Memory management other system services Framework organized give user maximal flexibility. achieve this, many Framework functions call another function pointers. This allows user override these functions well driver routines. also possible create several instances framework. user still directly standalone eXpressDSP compliant algorithms regardless Framework Framework partially. Besides Software, there also start Bootloader core code DSP/BIOS ROM'ed into Chip. Introduction Client Side Telephony (CST) Abbreviations Acronyms Abbreviations Acronyms following abbreviations used this document: Table 1-1. Abbreviations Acronyms Name Description Analog-digital converter Adaptive differential pulse code modulation. type waveform coding implemented G.726 codec. Analog front end. Hardware and/or software parts that convert signal waveform stream samples. Delay introduces buffering hardware part affect modem operation. Automatic Gain Control XDAIS algorithm creation/deletion functions (ALGorithm instantiation Reference Frameworks). also XDAIS, IALG RF3. Used interchangeably with DSP/BIOS, DSP/BIOS Caller Mode Chip operation when controlled only externally, commands sent over serial link. Comfort noise generator Call progress tone detector Chip support library- TI's standard library support on-chip hardware Client side telephony, also means Chip solution Clear-to-send. UART interface signal that indicates readiness receive data direction (see also RTS). Data access arrangement, hardware interface with telephone line Digital-analog converter Dual access Data communications equipment. Within scope this document implies EITHER chip when used chipset mode receiving commands from external host, software solution controlled user-specific software inside chip. TI's Real Time DSPs ADPCM ALGRF BIOS Chipset Mode CPTD DARAM DSP/BIOS Abbreviations Acronyms Table 1-1. Abbreviations Acronyms (Continued) Name Description Data terminal equipment. Within scope this document implies EITHER another host) sending commands Chip serial link, user-specific software inside chip (flex application), sending commands parser virtual UART, software unit providing functionality. Dual-tone modulated frequency signal TMS320C54CST evaluation module supplied spectrum digital. Frame check sequence Mode chip operation when controlled internally user program loaded into internal external memory Chip. General switched telephone network Interface define XDAIS algorithms' memory requirements (see also XDAIS ALGRF) Internet service provider Interrupt service routine "Low-level I/O" TI's standard drivers interface Minimum addressable unit, whose size usually equal sizeof(char) Micro-controller unit Pulse code modulation. This term means representation waveform quantized digital signal using linear logarithmic laws, rather than modulation technique Public switched telephone network Reference framework level Includes into itself: XDAIS, ALGRF, DSP/BIOS Request-to-send. UART interface signal that indicates readiness receive data another direction (see CTS). Software development DSP/BIOS software interrupt Telephone answering machine Universal asynchronous receiver/transmitter, chip which allows data exchange over serial link Universal multi-tone detector DTMF Flex Mode GSTN IALG PSTN UART UMTD Introduction Client Side Telephony (CST) Abbreviations Acronyms Table 1-1. Abbreviations Acronyms (Continued) Name Description Voice activity detector eXpressDSPAlgorithm standard (also known TMS320 Algorithm Standard). XDAIS NOTICE part number: Throughout document, Silicon Lab's referred Si3016 Si3021 chip. Here explanation part names: Si3016 Si3021 Si3044 Line-side DAA, directly connected telephone line. External chip. DSP-side DAA, connected line-side only capacitors. This part on-chip C54CST chip. Compound part name, denoting Si3016 Si3021 together. NOTICE C54CST part number: TMS320C54CST chip current version chip, having bundle V2.0 ROM, also referred CST2. TMX320VC54CST chip previous version chip, having bundle V1.0 ROM, also referred CST1. Throughout document, C54CST name refers bundle V2.0, unless noted otherwise. Legal Disclaimer Legal Disclaimer Legal Disclaimer views, opinions references expressed herein necessarily state reflect those companies cited section 1.3. aforementioned companies this User's Guide affiliated with SPIRIT CORP, SPIRIT TECHNOLOGIES, INC. Introduction Client Side Telephony (CST) Chapter Getting Started This chapter provides quick steps allow user immediately begin using chip modes. Important notes concerning installation procedures also provided. Topic Page Overview Running Solution: Standalone Chipset Mode Running Solution: Flex Mode Overview Overview There main modes Chip operation: Flex mode Chipset mode Please refer section more information concerning these modes. learn control Chip Flex mode write your program TMS320C54CST using solution, read following chapters: Chapter Hardware Overview Chapter Flex Application Development Guidelines Chapter C54CST Resources: Register Conventions, Memory, MIPS Algorithm user guides found Related Documentation from Texas Instruments section Preface Client Side Telephony (CST) Chip Flex Mode Flex Examples Description (SPRA862) instructions learning control Chip Chipset mode, please consult following chapters: Chapter Command Descriptions Chapter Host Utility Chapter Chipset Mode Testing Troubleshooting Client Side Telephony (CST) Chipset Mode (SPRA859) yourself quickly acquainted with Software, strongly recommend trying several examples described Client Side Telephony (CST) Chip Flex Mode Flex Examples Description (SPRA682). fast these applications using TMS320C54CST chip TMS320C54CST EVM. also code these examples, located Src\FlexExamples\, quickly create your application Flex mode. It's also recommended that look through supplied Framework source code when learning Framework components other internals. installation procedure, please refer chapter Product Installation Procedure. Running Solution: Standalone Chipset Mode Running Solution: Standalone Chipset Mode solution standalone Chipset mode, following steps should taken: Step Connect TMS320C54CST EVM, connect port PC's ports (COM1 COM2, example), connect telephone line also power supply, power yet. jumpers described section 3.3. Step Start host terminal specialized CSTHost\CSTHost.exe, general-purpose HYPERTERMINAL PROCOMM communication programs open port which connected. this port 115200 bps, bits data, stop bit, parity, Hardware flow-control. running CSTHost, open terminal window File->CST Terminal, press Settings button. Choose port which connected, press Configure Port button. port according settings mentioned above, press Step Turn power EVM. Step Type "AT" terminal window, tell bootloader switch into Chipset mode, load patch necessary) Settings->Load Patch CSTHost. Step LEDs should blink several times (which indicates that successfully started Chipset Mode) following greeting should output terminal window port configured correctly): Bundle SPIRIT CORP Type AT$, AT$H AT&V help Step Type AT$<Enter> terminal should help available registers their settings. Getting Started Running Solution: Standalone Chipset Mode Step Type AT&V<Enter> terminal should current settings CST. Step test modem, type ATDTxxxx, where xxxx number wish dial connect. Once modem connects, reports rate which connected. Step test voice capabilities, press Play Greeting Record button Host, call number which connected from another phone. Step something does work properly, need tune properly standards your country pressing Settings, International settings (read more about this chapter also read Client Side Telephony (CST) Chipset Mode (SPRA859). Running Solution: Flex Mode Running Solution: Flex Mode Note: Compiling Flex examples Code Composer Studio Before taking these steps, please, read carefully installation procedure chapter correctly compile Flex example, include path project file require tuning, your Code Composer Studio require small update. solution user programmable Flex mode, following steps should taken: Step Connect TMS320C54CST EVM, connect port PC's ports port needed your Flex mode application), connect telephone line also power supply, power yet. jumpers described section 3.3. Step Turn power EVM. Step Start Code Composer Studio. Step Load file EVM54CST.gel from Src\GEL Step Open appropriate project file folders: Src\FlexApp (for non-DSP/BIOS based applications) Src\FlexAppBIOS (for DSP/BIOS based apps). project files are: CSTFlexApp.pjt CSTFlexAppBIOS.pjt, respectively. Copy Flex Src\FlexExamples into either: Src\FlexApp examples from folder Src\FlexAppBIOS renaming main.c, order substitute existing main.c file. Getting Started Running Solution: Flex Mode Step Compile application load EVM. compilation fails, please, refer chapter update files Code Composer, tune project file include path. Step Program LEDs should blink several times, which indicates that program loaded initialized Flex mode correctly. Step Call number which connected from another phone, test application running Chip (read Flex Mode Application Note learn more about Flex mode examples). Step something does work properly, need tune properly standards your country pressing Settings, International settings (read more about this chapter also read Client Side Telephony (CST) Chip Flex Mode Flex Examples Description (SPRA682). Chapter Hardware Overview This chapter gives hardware overview chip C54CST board settings. also describes UART interface C54CST. Section provides overview instructions adapting C54CST Chip User-Specific Hardware. Topic Page Introduction Chip Main Modes Chip TMS320C54CST Configuration UART Hardware Flow Control Indication Adapting C54CST Chip User-Specific Hardware Introduction Chip Introduction Chip Texas Instrument's TMS320C54CST generic C54x with UART Digital integrated into ROM. Client Side Telephony software developed SPIRIT ROM'ed into this thus making TMS320C54CST device (see Figure 3-1). Figure 3-1. Chip Overview TMS320C54CST chip Host (optional) UART Analog C54x core User's code (optional) Internal Internal most generic hardware setup Chip shown Figure 3-2. telephone line side, Chip connected Analog chip from Silicon Laboratories, Si3016 (NOTE: chip other Codec; driver reloaded easily, section 7.7.7.2). This provides galvanic de-coupling with telephone line, connected Analog chip capacitors only. host interface side, chip connected controller serial asynchronous port (RS232C). Host controls chip command both data modem mode voice mode (most functions Chip controllable commands). Chip does require external other hardware tasks. same time, possible load additional code control chip into internal TMS320C54CST, software library XDAIS objects, thus eliminating need host controller. Introduction Chip Figure 3-2. General Hardware Setup Chip Serial link Telephone modem PSTN Analog Si3016 C54CST chip This document concentrates mostly software aspects 54CST chip. more information hardware aspects read TMS320C54CST Client Side Telephony Data Manual, SPRS187. Hardware Overview Main Modes Chip Main Modes Chip There main modes Chip operation Chipset mode Flex mode. Chipset mode, only software running inside Chip, controlled from outside serial link commands. this mode, chip used standard data modem with voice features, including duplex voice transfer (all standard functionality Software accessible commands). Flex mode, user code loaded into running inside chip, using Software library. This mode gives user more flexible access different levels software, allows user build applications using only Chip, without need host controller. There several ways switch into Chipset mode from Bootloader: High transition INT1 within cycles after reset; Sending symbols ("AT") UART, 115200 bps, shortly after reset. Writing "magic" number 0x45 memory location 0x7E interface. Even while Chipset mode, User still possibility load Flex application (user code) into using special command (AT#DATA, section 9.4.1.29). starts Chipset mode, immediately runs solution from internal ROM. Otherwise, starts Flex mode, tries load user's program through external interfaces. More information Bootloader given section 5.4.2 this document TMS320C54CST Bootloader Technical Reference Guide (SPRA827). TMS320C54CST Configuration TMS320C54CST Configuration Spectrum Digital's with TMS320C54CST processor, jumpers should following pins connected, pins connected): Initially will start TMS320C54CST Flex mode. Bootloader will first, will waiting Flex application from several external sources (see section 5.4.2 details). start TMS320C54CST Chipset mode, just type "AT" symbols terminal, connected EVM's UART. Hardware Overview UART Hardware Flow Control UART Hardware Flow Control TMS320C54CST chip only dedicated pins UART rest UART lines have general purpose lines chip, which combined with pins. UART driver implies that these additional UART lines connected same they connected board (see TMS320C54CST Evaluation Module Technical Reference, Spectrum Digital, Inc.). Table 3-1. UART Lines UART Line External Direction (for DSP) Input Input Output Output Output Output Comments Controls behavior Used flow control, tells that host ready receive data Used flow control, tells host that ready receive data used Reports modem online status Reports RING event user wants connect UART lines other pins these pins all, necessary modify UART driver reloading some virtual methods Flex mode (see section 7.7.7.2). Indication Indication C54CST chip uses Port output indication information about some internal events. Spectrum Digital's this port connected LEDs, through DS6. meaning this indication described Table 3-2: Table 3-2. Indication LEDs Meaning Data Port CST's LED0 Meaning enough MIPS real-time operation This toggled every time buffer driver UART driver overflows. Buffer overflow usually happens when some parts code consume many MIPS, that Framework consumes less data from these buffers than supposed according real-time requirements (for example, 8000 samples second from DAA). LED1 Voice buffer underrun Voice controller buffer, storing bitstream decoded played voice mode. This toggled every time this buffer underruns. This happens when Host does send bitstream played fast enough, this leads interruptions output voice signal sometimes even incorrect decoding further bitstream. LED2 (clear-to-send) circuit state When CST's UART driver receive buffer gets filled size (capacity), driver turns circuit telling Host wait send data. When buffer frees size, driver turns circuit back LED3 IDLE mode (power saving) When Power saving mode enabled (via command), this turned when enters IDLE mode, turned when leaves IDLE mode. This allows user estimate roughly loaded MIPS-wise: darker this more time spends processing CST's routines less time spends IDLE mode. When Power saving mode disabled, this should off. user needs Port some other purposes, possible reload peripheral driver Flex mode (see section 7.7.7.4), remove indication code, which writes Port Hardware Overview Adapting C54CST Chip User-Specific Hardware Adapting C54CST Chip User-Specific Hardware When going User-specific hardware, software needs reconfigured order hardware environment, areas where different from C54CST EVM. This chapter gives only brief overview this topic, more information found other chapters this document, appropriate application notes. following areas need taken into consideration: connection Using external SiLab's Si3021+Si3016 driver already includes support external Si3021 DAA, also multiple DAAs this type. User connect multiple DAAs (either each each McBSP (which what driver supports), several DAAs McBSP connected daisy chain (for what driver required)), same driver control them all. Read sections 7.7.5, 7.7.7.3 7.7.7.5 details. Using another external driver reloaded reconfigured support other external DAA. Again, multiple DAAs connected CST. Read sections 7.7.7.3 7.7.7.5 details. UART connection Reconfiguring UART control lines User want redefine pins, which used UART control lines (CTS/RTS, DSR/DTR, DCD, RI). default, GPIO pins HD0-HD5 used this purpose. this, some UART driver virtual functions need reloaded. Read section 7.7.7.2 details. Using GPIO pins HD0-HD5 other purposes configure UART driver GPIO pins, section 7.7.7.2. However, framework writes couple more times into GPIO register during initialization. This happens functions CST_DSPInit() TargetBoardInit() (they both GPIOCR want touch GPIO registers even during initialization, have reload functions CST_DSPInit() TargetBoardInit(). Adapting C54CST Chip User-Specific Hardware Connecting with Host UART connect host computer Host C54CST UART, required, although recommended, UART hardware flow control lines. flow control lines connected, User needs make sure that line tied (always high), that would allowed send data Host; Host never sends much data chip, prevent overflows internal UART buffer. Also, C54CST's UART capable operating higher rates than 115200 least times faster). This useful some applications. connection Connecting with Host Host control port only. Bootloader supports booting from HPI. UART traffic commands data) redirected from UART HPI. make this redirection, UART driver needs reloaded (see 7.7.7.1). SPIRIT Corp. also planning provide flex example switch into "HPI-controlled Chipset Mode". Please, refer support site. McBSP connection Connecting channels (T1/E1) C54CST process data coming from channel just processes data coming from DAA. order framework this case, driver needs reloaded, described section 7.7.7.3. process several slots (PCM channels), multiple instances driver Framework should created. Connecting with Host McBSP Host control McBSP port only. Bootloader supports booting from McBSP. UART traffic commands data) redirected from UART McBSP. make this redirection, UART driver needs reloaded (see 7.7.7.1). LEDs control Peripheral driver uses Port output indication information about some internal events using C54CST LEDs. configure this indication differently, disable peripheral driver needs reloaded, described section 7.7.7.4. Hardware Overview Adapting C54CST Chip User-Specific Hardware Adding driver device When adding driver device, User still benefit from reach functionality framework, that driver added inline with framework driver concept. Read sections 7.3.5.1 7.3.5.2 details. Using another clock Clock Frequency on-chip used, C54CST frequency, MHz. Internal clock multiplier calling function TargetBoardInit(.,int Multiplier,.) with appropriate parameter. default, C54CST EVM, this parameter equal which sets clock with 14.7456 input clock. C54CST MHz, change this parameter Clock jitter clock used clock (for on-chip DAA, this case), clock jitter needs very small, order enable robust modem operation. this reason, recommended crystals without internal PLL, because otherwise crystal's internal combination with DSP's leads high jitter. Memory wait states considerations When clock higher than access time external RAM/ROM, accesses external memory done with several wait states. This done programming wait state register, SWWSR. peripheral driver does this initialization function, that contains parameter which specifies amount wait states external memory TargetBoardInit(.,.,int ExtWaitStates). default, this parameter equal wait states, which applicable C54CST with SRAM when running MHz. running MHz, this parameter should equal port accesses (I/O), wait states TargetBoardInit(), this needs changed, this function reloaded/overridden (see section 7.7.7.4). 3-10 Adapting C54CST Chip User-Specific Hardware UART divisor considerations On-chip UART clocked from clock. clock changes, UART divisor needs changed enable operation standard baud rate. this purpose, UART driver global parameters, UartParams.baud UartParams.clkInput. UART divisor multiple these values, DLAB=baud*clkInput. example, 115200 baud rate clock, these parameters baud=32 clkInput=2. Connecting external SRAM Since C54CST device internal ROM, both need visible program data space software function normally, external memory visible/accessible only certain address areas, described section 8.3. order external SRAM these areas visibility, some external address decoding page access logic required. Look hardware application note this support site. Connecting external ROM/Flash booting from Connection external parallel Flash done similar done Spectrum Digital's C54CST (see schematics TMS320C54CST Evaluation Module Technical Reference, Spectrum Digital, Inc.). Programming utility C54CST EVM's Flash provided example SDK, Utilities\Flex2Flash. Refer readme file Connection other types Flash chips also possible. Look hardware application note this support site. Adding algorithm Read section 7.3.5.2 details. Remember, that algorithms portfolio extended very memory-efficient Add-ons, supplied separately from chip: V.29FC, G.729AB, G.723.1, 1200 vocoder. Some these topics will also covered upcoming application notes. Hardware Overview 3-11 Chapter Software Overview This chapter explains benefits using Flex mode control chip, gives overview main software parts Framework Telephony Components. Topic Page Flex Mode Applications Framework Components Telephony Components Flex Mode Applications Flex Mode Applications There main modes chip operation: Chipset mode Flex mode Flex mode, user code loaded into running inside Chip, using Software library. alternative commands, offers unified top-level software interface main interface flex mode applications. unified high-level interface also called Action interface fully covers extends functionality command approach used during serial connection DTE. Action interface only used flex mode. easy-to-use offers number additional features dramatically reduces program size development time. design most Flex applications, only basic knowledge architecture required. This document mostly attends Action interface main types. When using high-level interface, whole development process considered couple standard stages. Typically, first stage includes preliminary design application logical structure. second stage basically implementing algorithm combination main callback functions. standard flex application roughly corresponds AT-command based standard applications. Multichannel multi-codec applications, well those with non-standard data flow, considered non-standard flex applications. Such non-standard applications auxiliary options Framework, some cases reasonable Framework down XDAIS libraries instead. Note that contains broad range examples implementing different applications, which makes even easier create User-specific Flex applications. Main guidelines Flex application development given chapter Flex Application Development Guidelines. Brief specifications main types given section 6.3, Framework Overview. Framework Components Framework Components components solution tied together Framework, which consists several layers forms very flexible configurable framework. Each framework layer intermediate interface which allows developers work with solution whole down level abstraction most suitable their purposes. Framework includes: command parser (data voice commands) Action control layer give user control over solution whole through mapping commands messages different sublayers) Commander control layer give user control over solution through special command sequences) Service control layer provide data flow between different XDAIS components device drivers, give user unified access XDAIS components through special messages) compliant drivers UART codec. Memory management DSP/BIOS core Figure 4-1. Framework Diagram command parser layer Commander layer Service layer Action layer xDAIS ALGRF Software Overview Framework Components Framework alternative layers therefore, alternative top-level interfaces. Chipset mode, Framework interacts with host commands. This mode used Chipset mode configured default. However, default status does mean preference this interface user integration flex mode because enforces user imitate host terminal, generate commands decode responses, substitute virtual UART driver instead existing rule, standard Flex applications oriented additional host terminals. firmware under development does require modem-oriented commands, recommended parser top-level interface. alternative command interface action-based interface. basic concept this method eliminate parser unify access control layers. Framework multichannel framework. sub-service structures grouped into global structure. defines global instance this structure used single channel applications. Framework OS-agnostic, other words under DSP/BIOS other RTOS, without non-RTOS environment, Framework running single thread application. However, fully supports multi-threaded mode, multithreading capability provided user using some kind RTOS), Framework benefit from calling most algorithms highpriority periodic process posting priority standard threads background tasks (such V.42bis compression). there multithreading User's environment, Framework will still operate User will have more careful about evenness MIPS load distribution. more flexibility, some important functions called pointers. learn more about Framework, please refer chapter Flex Application Development Guidelines. Telephony Components Telephony Components solution integrates libraries data communication, telephony signaling, voice processing algorithms. components solution eXpressDSP compliant share standardized interface. these objects device drivers linked together framework that provides unified access algorithms eliminates compatibility access issues. following algorithms included solution: Modem algorithms V.32bis/V.22bis(up 14.4 kbps) V.42 error correction Embedded V.42bis compression Modem integrator Embedded V.14 async-to-sync conversion supporting V.17/V.29/V.27ter/V.21 14.4 kbps) addon only1 V.29 fast connect (for terminals) add-on only1 Telephony algorithms UMTG/UMTD (Universal multifrequency tone generator/detector) DTMF generation/detection Call progress tone generation/detection Caller types Voice algorithms G.168 line echo cancellation G.726 ADPCM compression (16-40 kbps) Embedded G.711 G.729AB vocoder kbps) add-on only1 G.723.1 vocoder (5.3 kbps) add-on only1 SPIRIT-proprietary 1200 vocoder add-on only1 Automatic Gain Control (AGC) Voice Activity Detection (VAD) Comfort Noise Generator (CNG) This functionality added very memory-efficient Add-on, supplied separately from chip Software Overview Telephony Components 4.3.1 Data Modem Data modem consists several components, each implemented separate XDAIS object. These objects modem data pump (unifies ITU-T V.22/V.22bis/V.32/V.32bis automode modem procedure), V.42 error correction protocol with embedded V.42bis data compression protocol, Modem Integrator object, which unifies access other modem algorithms (unified parameters, sample data flows, extended status, etc), interconnects them inside itself. Data Modem Controller (hereafter referred DMController) upper layer that integrates Modem Integrator object into Framework. Figure 4-2. Data Modem Objects DMController Modem Integrator Data Pump V.42 V.42bis 4.3.2 Voice Processing Voice processing includes several components waveform codec (PCM ADPCM), line echo canceller, Automatic Gain Control (AGC) controlled Voice Activity Detector (VAD), Comfort Noise Generator (CNG). components have simple interface operate with 14-bit samples. CST's G726G711 component implements ITU-T G.726 adaptive differential pulse code modulation (ADPCM) encoder decoder voice frequencies, well G.711 logarithmic conversion. supports A-law µ-law conversion to/from uniform (linear) according G.711; compresses/decompresses linear samples to/from bitstream, based selected compression rate kbps, according G.726 CST's Line Echo Canceller (LEC) used cancellation electric echo introduced telephone hybrid, conforms G.165 G.168 recommendations. includes double talk detector nonlinear processor. User value maximum echo path equal msec. CST's Voice Activity Detector (VAD) detects presence speech signal. special adaptive algorithm automatically adjust level Telephony Components noise signal, order provide robust operation even noisy speech. many user configurable parameters, allowing algorithm optimally tune itself specific application. also outputs several coefficients that characterize spectral envelope noise (when speech detected), that regenerated noise would similar original noise. CST's Comfort Noise Generator (CNG) generates noise, distributed either uniformly shaped according spectral envelope coefficients, which passed parameters. CST's Automatic Gain Control (AGC) designed specifically amplify voice signal, which very non-stationary amplitude envelope. operates much better conjunction with VAD, which tell when there speech signal, that would adapt these periods. 4.3.3 Telephony Signals Processing Telephony signals processing includes several components UMTD (detects DTMF signals), UMTG (generates DTMF signals) Client side Caller components have simple interface operate with 16-bit samples (they have wider input dynamic range than voice processing components, which operate with 14-bit samples only). includes Universal Multifrequency Tone Detector (UMTD) detecting DTMF, Call Progress Tones (CPT) many other telephony signals. brief, UMTD detector filters input samples, estimates spectrum input signal, checks cadences pauses makes decision about presence signaling tone. UMTD easily configured specific standard country. CST's DTMF Detector operates compliance ITU-T Q.24 Recommendation. CST's detector supports wide range call progress tones fitting standards most countries according Q.35 recommendation some signals that into Q.35 recommendation. also possible describe custom call progress tones. includes Universal Multifrequency Tone Generator (UMTG) DTMF, many other telephony signals generation. generate tones according standards different countries (tones' frequencies cadences adjustable). UMTG-based DTMF Generator operates compliance ITU-T Q.23 Recommendation. Software Overview Telephony Components UMTG-based generator produces output signals with cadences frequencies specified UMTG settings. CST's Client Side Caller Includes Type Type Caller signal detection, compliant with standards several providers countries: Bellcore GR-30-CORE, SR-TSV-002476; British Telecom SIN227 SIN242; ETSI 659, 778; Mercury Communications Client side caller supports call waiting operation parsing/converting message into presentable format. more information section 7.6, Telephony Components Brief Specification. Chapter Flex Application Development Guidelines This chapter design specifically give quick overview quick start developing user-specific flex application, without overloading User with lots specific information about framework components. strongly recommend read this whole chapter before plunging into reading framework into building your flex application based flex examples. Section explains benefits Flex mode over Chipset mode controlling chip. Section elaborates little more this topic, explaining commands convenient control modem- voice-based applications when user code inside chip. Section describes three steps build user-specific flex application. finally, section gives some specific details actually compile load flex application. Topic Page Chipset Flex Mode Commands Alternative Interfaces Designing Implementing Standard Applications Building Loading Flex Applications 5-16 Chipset Flex Mode Chipset Flex Mode multifunctional solution that used external modem chip, embedded modem chip, library standalone XDAIS algorithms. chip full-scale modem single crystal. chip connected serial port personal computer running terminal program. Using default commands user test standard modes, including voice mode. user required have prior knowledge `C54x architecture development tools order start using external modem chip. However, this kind firmware presumes separate host processor connected serial port. Software host processor should incorporate interface serial asynchronous automatic dialing control that includes data exchange serial port flow control, algorithm synchronization commands, data shield codes required), commands coding recognition. Using embedded modem (i.e. flex mode) somewhat similar previous technique. Nearly each command corresponds command (CST Action). this case host processor absent perform entirely different functions. Program interface simpler more reliable than data transfer serial port using commands. user required have knowledge architecture, XDAIS algorithms, etc. order start using API, basic knowledge `C54x architecture related development tools needed. also necessary note that framework real time system, therefore, user need obtain some knowledge real-time example TI's DSP/BIOS. Flex mode, user able utilize auxiliary features CST, modify parameters/functionality various services create non-standard applications. (Software Development Kit) contains large number examples usage Flex mode. Flex mode also used create patch-applications reconfigure commands wouldn't allow. following chapters, will review Flex mode exclusively. Commands Alternative Interfaces Commands Alternative Interfaces DTE-DCE interface logically implemented commands sent (all commands parameters coded lines ASCII characters) responses (the responses either verbal numeric). Using command interface (from hereafter, interface) allows design equipment compatible with modems different manufacturers, this only true basic command set. should keep mind that supports incomplete commands registers defined V.250 standard, also providing additional features defined scope that standard. main problem classic DTE-DCE interface implementation using same information channel (UART) both data transfers control signals exchanging. supposed that interpretation data being exchanged strictly related state (off-line/on-line). This reduces flexibility interface significantly. This disadvantage minimalist implementation RS-232 interface that accepted standard. However, certain modems (Comsphere from AT&T, DataLink from Penril) separate physical port control/diagnostic purposes. problem becomes more aggravated when amount control data increases. Sharing UART channel results drastic complication exchange protocol between DCE. general, simultaneous transfer data commands impossible. attempt this lead number consequences, such Lack flexibility, especially obvious voice Caller applications Inability control things continuously, inability control arbitrary stants Inability distinguish between data commands certain situations, example, connection with remote modem broken prematurely Necessity parsing incoming data stream separate additional status/control information voice applications) Implementation protocol intense data command transmission complicated issue itself. Flex Application Development Guidelines Commands Alternative Interfaces alternative commands, offers unified top-level software interface, referred Action interface, which fully covers even extends functionality command approach used serial connection between DTE. Action interface only used flex mode. easy-to-use offers number additional features dramatically reduces program size development time. Advantages Action interface arise from separation data control channels, easy implementation complicated operations (such nonstandard connection establishment scripts), automatic control synchronization processes being executed, etc. Flex mode allows exploit additional features CST, including multi-channeling, considerably simplifies debugging. Applications oriented interface easily transferable Action interface, most basic commands reflected standard Actions. contains broad range examples implementing different algorithms, which makes even easier create Flex applications. Designing Implementing Standard Applications Designing Implementing Standard Applications With easy create applications broad range tasks, such Embedded data transfer modems. used various remote sensors security systems that require transfer compressed digital data over phone lines Voice menu systems with remote control option Call centers answering machines Internet appliances Designing vast majority Flex applications requires only basic knowledge architecture. whole development process divided into important distinct stages. first stage includes preliminary design application logical structure. second stage basically implementing application's algorithm combination main callback functions. This chapter gives some recommendations what consider optimal techniques designing standard Flex applications. standard flex application roughly corresponds AT-command based standard applications. Multichannel multi-codec applications, well those with non-standard data flow, considered non-standard flex applications. Such non-standard applications auxiliary options Framework, some cases reasonable framework down XDAIS libraries instead. Definition non-standard application based fact that non-standard application requires functionality beyond unified high-level interface described below. Flex Application Development Guidelines Designing Implementing Standard Applications 5.3.1 Preliminary Application Design Flex application algorithm should represented elementary states, such waiting ring, initializing modem, waiting connection established, sending data, closing connection, etc. Each algorithmic state usually associated with single command (CST Action) sent unified high-level interface. state User's algorithm requires performing multiple Actions, that state should broken into several elementary states, that each state only associated with single Action. Normally, each Action associated with single command. most common Actions listed below: Table 5-1. Action Associations Action hook Caller after ring Caller after line reversal Call remote modem Similar AT-command ATH1 Note hook, CPTD DTMF detectors. Usually runs automatically Usually runs automatically hook, wait dial tone, dial number modem originate (calling) mode (unless dial modifier included number). hook modem answer (response) mode. hook, wait dial tone, dial number, wait ring back signal appearance then disappearance (only dial modifier included number) enable voice mode hook enable voice mode (run Caller Type G.726/G.711 encoder signal detectors (CPTD, DTMF). Answer call from remote modem Dial switch voice mode voice mode Answer switch voice mode While voice mode, enable voice receiving procedures voice mode AT#VRX Designing Implementing Standard Applications Table 5-1. Action Associations(Continued) Action While voice mode, enable voice sending procedures While voice mode, enable both voice receiving sending procedures While voice RXTX modes, disable voice receiving sending procedures Just make call Shut down current process correctly Shut down current process immediately Send data Similar AT-command AT#VTX AT#VRXTX Note G.726/G.711 decoder signal detectors (CPTD, DTMF). G.726/G.711 encoder, decoder signal detectors (CPTD, DTMF). Turn G.726/G.711 encoder, decoder, keep signal detectors (CPTD, DTMF Caller ID). hook, wait dial tone disabled), dial number Correctly stop current task, then turn other algorithms hook. Turn algorithms, hook. Also used abort operation. Feed data transmitting algorithms (DTMF generator, modem, G.726/G.711 decoder) <DLE><CAN> ATDxx; necessary note that developer limited standard commands actions described above. possible create Actions specific needs. such Action implies performing sequence elementary operations that interrupted, user automatically, given time, cannot modified once initiated. Normally, takes some time perform Action; therefore, will ignore Action command current still being performed. Thus, developers should always prepared system reject sent command data. this case, rejected command/data should re-sent after some pause2. necessary emphasize that provides full control over execution telephony tasks automatically synchronizes commands/data being sent from user with current states processes, allowing user concentrate higher-level design application. Modification process settings occurs instantaneously. However, most cases, process settings modification does influence process that running already, considered standalone Action. Flex Application Development Guidelines Designing Implementing Standard Applications currently executed atomic command canceled special user's command automatically (when cannot executed successfully). latter case, unprocessed data lost. 5.3.2 Detailed Application Design Most data, coming from inside application, transmitted special egress messages. function that receives these messages provided developer. calls function from services whenever necessary. Therefore, order implement proprietary application, developer needs create only functions: Main function. This function contains main logic application. Normally, main function implemented finite state machine. each states function possibly send data/commands transit state. Besides state machine, main function should also call standard process routine, which carries internal processes. Callback function. This function receives processes messages coming from process routine addressed application3. callback function receives messages from various services. list standard messages follows: Table 5-2. Standard Callback Function Messages Message Type Event detected peripheral Caller Description Attached data contains peripheral driver message, such ring message, ring message, line reversal message. Attached data contains Caller result code (success error code, such time-out, invalid state, wrong check sum, illegal length, unknown type) Attached data contains DTMF symbol Attached data contains CPTD tone, such dial tone, (fast) busy tone, ring back tone detected tone Detected DTMF symbol Detected call progress tone Informs that modem just connected Informs that modem just disconnected Informs that voice just disconnected Voice data receiving transmitting stopped system still off-hook Note that sending commands/data Framework unified high-level interface does perform immediate actions never leads immediate calling user's callback function. Designing Implementing Standard Applications Table 5-2. Standard Callback Function Messages(Continued) Message Type Voice data Modem data Auto turnoff request Description Attached data array voice data bytes Attached data array modem data bytes Attached data characterizes reason turnoff request (which following: Call Progress Tone Detection time-out, busy detection, modem disconnection, failure create XDAIS algorithm) Attached data number codec samples elapsed since last tick message Tick message callback function suitable place make transitions between states main program's state machine. This some state transitions being caused messages that sends application. recommended place some state transition code callback function. developer should first outline application's logical structure find elementary states actions application. This includes finding correct sequence state-to-state transitions transition conditions. This preliminary development stage. Once preliminary design stage been completed, developer turn attention start developing actual application. implementation application mainly consists creating application's main function callback function. Both functions will work according previously designed application state machine. main function will send commands/actions appropriate states transit between some application states. callback function will receive handle messages coming from perform rest transitions between application states. Implementing application, however, limited only creation code that sends commands CST, receives messages from handles application state machine. necessary custom signal-processing algorithm algorithms directly, bypassing framework. necessary modify behavior CST, work with additional different hardware, etc. This still about developing application, although involve considerably more effort than just creating functions described above application longer considered standard Flex application. Flex Application Development Guidelines Designing Implementing Standard Applications What offers user convenient global state machine that used unify number telephony algorithms routines. Anything beyond standard functionality will require appropriate changes made application. 5.3.3 Implementation second stage flex application design process implementation application's algorithm combination main callback functions. Most standard applications require re-configuring services. this case, feasible implement above functions means unified top-level interface provided Action Layer. unified toplevel interface allows access lower layers and, necessary, controllable. unified top-level interface provided Action layer represented three functions: Table 5-3. Top-Level Interface Functions Name CSTAction_Init CSTAction_Process CSTAction Functionality initialization (does include hardware init) Function called periodically action execution. Sends command portion data, reads/ writes configuration registers (S-registers) unified action-based interface both BIOS- single-thread ready. also supports multiple channels. However, support multichannel some virtual functions Framework have reloaded. generic single-threaded flex application, well BIOS application, will similar this code example: #include #include //Select single-thread DSP/BIOS-based application #define BIOS_APPLICATION typedef enum as_STATE_1, as_STATE_2, 5-10 Designing Implementing Standard Applications tApplicationState; tApplicationState ApplicationState; //Prevent improper compilation !BIOS_APPLICATION asm("_sys_memory .usect #endif //!BIOS_APPLICATION asm("_STACK_BEGINNING .usect \".stack\",0"); \".sysmem\",0"); bool MyCallback (tCSTChannel* pChannel, tCSTExternalMsgEvent CSTExternalMsgEvent,int Data,int16 *pData) switch CSTExternalMsgEvent ApplicationState=as_STATE_4; return void MyPeriodicThread CSTAction_Process (&Ch0); ////////////////// //USER'S CODE.// ////////////////// switch (ApplicationState) void MyInitialization ////////////////// //USER'S CODE.// ////////////////// #define EVM54CST_118MHZ_MULT void main Flex Application Development Guidelines 5-11 Designing Implementing Standard Applications ////STANDARD INITIALIZATION://// !BIOS_APPLICATION //Processor boot init. CST_DSPInit #else initBiosConst(); #endif //BIOS_APPLICATION //CST internal data sections init. CST_bssInit //Particular board init. //You need change this according your board specification //if different from standard C54CST board TargetBoardInit BIOS_APPLICATION, EVM54CST_118MHZ_MULT, //CST Framework init. CSTAction_Init //Initialize CSL_init(); //Particular peripheral init. //You need change this according your UART codecs //if they different from 'C54CST on-chip UART TargetPeriphInit (BIOS_APPLICATION,1); !BIOS_APPLICATION //Now safe enable interrupts rsbx INTM"); #endif //BIOS_APPLICATION //Perform user's specific initialization MyInitialization ////////////////////////// ////MAIN LOCAL LOOP.//// ////////////////////////// 5-12 BIOS flag internal multiplier external clock Wait states external memory Designing Implementing Standard Applications !BIOS_APPLICATION while MyPeriodicThread #endif //BIOS_APPLICATION user's code downloaded chip must contain function main(). This function should perform required hardware software initializations periodically call periodic function CSTAction_Process(). chipset mode, framework does DSP/BIOS functionality, however, DSP/BIOS core available used DSP/BIOS based applications. DSP/BIOS based applications, user should periodically post that runs CSTAction_Process() function. example doing this contained file BIOS\CSTBIOS.c (this supplementary file making single-channel applications DSP/BIOS). function BIOSDAADataCallBack() posts periodically (once certain amount input samples). Thus, only MyInitialization(), MyCallback() MyPeriodicThread() functions extended user (only these three routines overridden Flex application examples package). Figure represents generic flex application. Flex Application Development Guidelines 5-13 Designing Implementing Standard Applications Figure 5-1. Generic Flex Application Standard initialization CSTAction_Init() Unified high-level interface periodic thread CSTAction_Process() User's callback procedure periodic process calls back user pass local state machines xDAIS algos message drivers (DAA, UART) Call directly priority tasks (modem voice only) services Process passed info switch (message) Change application state needed Main state machine switch (application state) Send command data actions CSTAction(.) needed needed Access standard peripheral controls script inject data change config. regs periph. drivers UART DAA/Codec Access non-standard peripheral Once initialization complete, interrupts should enabled. This moment marks beginning main loop application. main loop must periodically call function CSTAction_Process(). called rarely every highly recommended call least several times more frequently. 5-14 Designing Implementing Standard Applications function CSTAction_Process() runs internal processes inside calls back user's message processing function. CSTAction_Process() high priority thread function. Usage DSP/BIOS allows adding several auxiliary low-priority threads utilize processor resources more efficiently. also possible allocate separate auxiliary threads lowpriority modem voice tasks (for example, vocoders with large processing frame size, such G.723.1, G.729, etc.), user's control functions. Three SWI's defined file FlexAppBIOS\CSTFlexAppBIOS.cdb. periodic thread corresponding MyPeriodicThread() invoked high priority SWI. other modem voice priority SWI's. Many flex applications based standard easy-to-read examples included demonstrate certain capabilities algorithms. flex application either under BIOS single-threaded process. 5.3.4 Chapter Summary features unified top-level interface that provides unified bi-direc- tional stream commands data. features predefined top-level actions solve standard lephony tasks. features global state machine solving standard telephony tasks, number independent system services. provides reliable control over process being executed. This eliminates need user code additional logic that synchronizes execution standard telephony operations. Development standard application treated develop- ment main callback functions. main function usually serves primary state machine application's logic transfers user's data algorithms. callback function serves process messages sent algorithms contain data control information state process being executed. allows developing both single-threaded multi-threaded applica- tions using DSP/BIOS. Some multichannel, multicodec, other non-standard applications quire reconfiguration some services. provides support that, however some cases reasonable Action Layer down lower layers, even XDAIS layer. Flex Application Development Guidelines 5-15 Building Loading Flex Applications Building Loading Flex Applications This chapter gives some specific information build flex application, load chip. compilation fails, please, refer chapter Production Installation Procedure, instructions updating files Code Composer, tune project file include path. 5.4.1 Projects Building Flex Applications available flex examples made same manner. mentioned section 5.3, there suggested scheme building standard flex application, single- multithreaded. There functions prepared developer completed according task hand. There standard project files building offered flex application examples. single-threaded applications that will without DSP/BIOS other multi-threaded applications that will under DSP/BIOS. Each projects already setup tuned. developer only needs create main application file (the project expects main.c) take existing flex application example, into directory with project file build project. course, there extra files need included into project, project file altered. main files flex application examples contained directory FlexExamples. 5.4.1.1 Project Single-Threaded Applications standard project single-threaded flex applications consists five files: CSTFlexApp.pjt CSTFlexApp.cmd Main.c ROM\CSTRom.s54 ROM\rts_ext.lib project file Code Composer Studio version higher linker command file main source code file flex application reference file TI's Runtime Library (the version which used build CST) linker command file (CSTFlexApp.cmd) specifies locations sizes application's code data sections. This file also contains sizes heap stack. accommodate developer needs, linker command file modified. 5-16 Building Loading Flex Applications After project been built, produced out-file converted binary image loaded into chip serial port JTAG available). this, file hexCST.bat, which will first obtain file running utility hex500.exe, then binary image running utility hextobin.exe. hexCST.bat hex.cmd hextobin.exe batch file, which runs hex500.exe, then hextobin.exe command file hex500.exe ASCII BINARY file conversion utility project file, linker command file, batch file conversion utility reside directory FlexApp. 5.4.1.2 Project Multi-Threaded Applications standard project multi-threaded flex applications consists following files: CSTFlexAppBIOS.pjt CSTFlexAppBIOS.cmd CSTFlexAppBIOS.cdb Main.c BIOS\CSTBIOS.c BIOS\BIOSmemman.c ROM\CSTRom.s54 ROM\rts_ext.lib project file Code Composer Studio version higher linker command file DSP/BIOS configuration file, preset main source code file flex application DSP/BIOS support file wrapper DSP/BIOS memory manager reference file, includes references DSP/BIOS components TI's Runtime Library (the version which used build CST) DSP/BIOS configuration file (CSTFlexAppBIOS.cdb) specifies locations sizes application's code data sections. This file also contains sizes heap stack. accommodate developer needs, DSP/BIOS configuration file modified (see TMS320 DSP/BIOS User's Guide (SPRU423B)). After project been built, produced out-file converted binary image loaded into chip serial port JTAG available). this, file hexCST_BIOS.bat, which will first obtain file running utility hex500.exe, then binary image running utility hextobin.exe. Flex Application Development Guidelines 5-17 Building Loading Flex Applications hexCST_BIOS.bat hex_BIOS.cmd hextobin.exe batch file, which runs hex500.exe, then hextobin.exe command file hex500.exe ASCII BINARY file conversion utility project file, linker command file, DSP/BIOS configuration file, batch file conversion utility reside directory FlexAppBIOS. 5.4.2 Bootloader bootloader used transfer code from external source into internal external memory following power-up. bootloader provides variety ways download code accommodate different system requirements. This includes multiple types both parallel serial port boot modes, UART boot mode, bootloading through HPI, special 54CST chipset boot mode. Bootloading both 8-bit byte 16-bit word modes supported. determine which boot mode use, bootloader uses various control signals including interrupts, BIO, following list different boot modes implemented bootloader, well summary their functional operation: 54CST Chipset Boot Mode This mode used start 54CST device chipset mode. Upon detection this mode, bootloader automatically passes control 54CST chipset application. code copied this mode. There several ways switch into Chipset mode from Bootloader: High transition INT1 within cycles after reset; Sending symbols ("AT") UART, 115200 bps, shortly after reset. Writing "magic" number 0x45 memory location 0x7E interface. Even while Chipset mode, user still possibility load Flex application (user code) into using special command (AT#DATA, section 9.4.1.29). Host Port Interface (HPI) Boot Mode code executed loaded into on-chip memory external host processor Host Port Interface. Code execution begins once execution address loading completed. 5-18 Building Loading Flex Applications Parallel Boot Modes (8-bit 16-bit supported) bootloader reads boot table from data space external parallel interface bus. boot table contains code sections loaded, destination locations each code sections, execution address once loading completed, other configuration information. Standard Serial Port Boot Modes (8-bit 16-bit supported) bootloader receives boot table from multi-channel buffered serial ports (McBSP) operating standard mode, loads code according information specified boot table. McBSP0 supports 16-bit serial receive mode. McBSP1 supports 8-bit serial receive mode. UART Boot Mode (8-bit supported) bootloader receives boot table from on-chip UART loads code according information specified boot table. Below UART settings used: data bits Parity bit, Stop Bit, flow control 8-Bit Serial EEPROM Boot Mode bootloader receives boot table from serial EEPROM connected McBSP1 operating clockstop mode, loads code according information specified boot table. Boot Mode (8-bit 16-bit supported) bootloader reads boot table from port external parallel interface employing asynchronous handshake protocol using pins. This allows data transfers performed rate dictated external device. bootloader also offers following additional features: Reprogrammable Software Wait State Register parallel boot modes, bootloader reconfigures software wait state register based value read from boot table during bootload. Reprogrammable Bank Switching Control Register parallel boot modes, bootloader reconfigures bank switching control register based value read from boot table during bootload. Flex Application Development Guidelines 5-19 Building Loading Flex Applications Multiple-Section Boot 54CST bootloader capable loading multiple separate code sections. These sections required occupy continuous memory space some previous C54x bootloaders. more information bootloader, please, refer TMS320C54CST Bootloader Technical Reference document (SPRA827). 5-20 Chapter Framework Overview This chapter provides user with overviews descriptions different layers, services, their API. Topic Page Overview Framework Layers Framework 6-15 Overview Overview Besides standalone XDAIS algorithms, offers hierarchy services user. Generally, services divided into groups: Basic, low-level, services: Service layer S-registers high-level driver, peripheral driver, low-level UART drivers, interrupt memory management subsystems Advanced, high-level, services: Parser Action Commander layers. Parser used standard flex applications. purpose Commander layer executing complex process represented script, containing sequence commands, where each command corresponds elementary operation carry out. Commander interacts with Service layer. Action layer supplements Commander provides virtually additional functionality. Service layer foundation CST. interface similar Action layer more XDAIS oriented. user skip advanced, high-level, services instead work with basic, low-level, services directly. Framework Layers Framework Layers Framework alternative layers therefore, alternative top-level interfaces. Chipset mode, Framework interacts with host commands. This mode used chipset mode configured default. General view Framework structure initial configuration shown Figure 6-1. Figure 6-1. Framework Controlled Command Parser USER result tokens, data UART driver Parser UART based high-level control Bootloader Other services (unused chipset mode) commands, data S-registers commnander Service DTMF Det/Gen CPTD Det/Gen CallerID Modem V.32bis/V.22bis Error correction V.42 Compression V.42bis Modem intergator Echo canceller G.168 ADPCM G.726/G.711 VAD/AGC/CNG driver solution However, default status does mean preference this interface user integration Flex mode because enforces user imitate host terminal, generate commands decode responses, substitute virtual UART driver instead existing Usually, standard Flex applications oriented additional host terminals. developed firmware does require modem-oriented commands, recommended parser top-level interface. alternative command interface Action-based interface. basic concept this method eliminate parser unify access sublayers. Framework Overview Framework Layers Figure 6-2. Framework Controlled Action Layer User's on-chip code Action UART driver S-registers Commander Service DTMF Det/Gen CPTD Det/Gen CallerID DSP/BIOS core Modem V.32bis/V.22bis Error correction V.42 Compression V.42bis Modem intergator Echo canceller G.165 ADPCM G.726/G.711 VAD/AGC/CNG driver solutions action interface based interfaces sublayers without essential modifications. action interface allows user begin integration into Framework. Framework Layers Figure 6-3. Control Layers Interaction USER UART driver parser incorporates wide range services. Framework provides: Interrupt management BIOS memory management compliant UART codec drivers, high-level driver peripheral driver (CST Service Layer) service that manages XDAIS object instances (XDAIS layer, Service layer) service that ties XDAIS layer with drivers (CST Service layer) service control reconfigure processes XDAIS layer (CST Service layer) service unified digital data control data flows organization (CST Service layer) service automatic consecutive execution standard operations needed telephony routines (CST Commander layer) service handle Service messages (CST Commander layer) redirect message information upward parser Action layer then user) Framework Overview Action script SRegs data script messages data Commander messages Service Voice components Telephony components Modem components driver Framework Layers service external user's control (CST Commander layer, parser, optional Flex mode) implementation Commander UART interconnection parser, optional Flex mode) command parser (optional Flex mode) high-level service providing unified interface user access data transfer commands (CST Action layer) When controlling solution from external controller serial port, Parser considered most convenient, though simplified, control tool. Standard commands provide control over solution components. 6.2.1 Action-Based Interface Action-based interface alternative parser control solution. unified interface between whole user application. Action layer unifies services being split several sublayers order offer user most powerful easy fast integration into Framework. Action layer interface more convenient than commands and, unlike command interface, does restrain user from direct access other modules. been mentioned above, Action layer represented three functions: CSTAction_Init(), CSTAction_Process(), CSTAction(). function CSTAction_Init() used initialization interface. function CSTAction_Process() runs internal processes, called periodically. function CSTAction() used unified command/data delivery services. CSTAction performs actions three types: Framework Layers Table 6-1. Actions Action Configure settings Description This action results reading writing given system parameter mapped registers (note that registers, which also mapped registers, can't CSTAction() function). action this type will executed immediately. standard (typical) telephony operation This action results preparing execute script consisting sequence elementary operations called atomic commands. immediate action performed. Commander later executes atomic commands. Transfer Service message Generally used data transfer. Therefore, Action layer integrates elements three modules: registers (configuring options), Commander layer (running algorithms successively), Service layer (transferring data). 6.2.2 Commander Layer middle layer Commander layer intended perform sequences elementary operations handling internal state machine. general, Commander provides interaction between user Service control layer decoding user's instructions into separate atomic commands transferring sequences corresponding messages Service layer. This allows controlling solution single object through standard custom command scripts. Commander contains predefined standard command scripts, which cover most standard operations needed telephony applications. Commander layer extendible layer that allows adding functionality time, without having change internal code. given moment, Commander focuses execution single atomic command, which active moment. command executed successfully, next command script becomes active. Framework Overview Framework Layers main atomic commands follows: Send message Service that will immediately turn active algorithms Send command peripheral driver Sustain pause Wait appearance call progress tone Wait disappearance absence call progress tone Dial telephone number stored string Send message Service that will turn modem Send message Service that will turn stand alone voice loop (run echo canceller activate voice path) Send message Service that will turn voice pumping direction Send message Service that will turn voice pumping direction Wait modem establish connection Send message Service that will turn Caller Send message Service that will turn algorithm. algo- rithm specific parameters included message. Used DTMF CPTD detector. Correctly terminate current task (usually it's used disconnect modem). Write S-register Several system commands Several special parser oriented commands Commander layer knows perform each command, what abnormal situations, including task cancellation. ultimate purpose Commander layer interaction with Service layer. When developing non-standard flex application, developer create custom atomic commands scripts. Framework Layers general, Commander layer performs following operations: processes current atomic command current script current command requires sending message Service layer, attempts deliver that message Service layer, until Service layer will able accept until task aborted processes messages from Service layer, which contain data control information also provides service handle Service messages redirect message information upward Parser Action layer then user). There important things point about Commander: Commander does support data transfers from user Service layer. user skip both Parser Action layer start working with Commander directly, since Commander does depend these layers. 6.2.3 Service Layer Service layer lowest control layer solution. performs foreground processing running XDAIS algorithms. Internally, Service layer ties separate XDAIS objects, analog digital data flows control commands together. Service Commander layers interact with each other dedicated messages. This allows controlling specific objects within solution unified interface, which also some error protection capabilities. Almost control data information between Service user (the Commander) carried dedicated Service messages. Service message multifunctional information packet. contain broadcast dedicated control command, data bytes. case when message sent Service layer, actually request, which service either accept reject. time Service layer executing only request. message being sent from service inform higher layer submit portion data. These messages into small queue that allows keeping several messages issued from different tasks. Framework Overview Framework Layers Figure 6-4. Service Periodic Thread (CST Action, User) Service periodic thread CSTServiceProcess() Higher layer accumulated samples codec voice tasks Post call priority voice task CSTServiceProcessIOandVoice() Egress messages Other active algorithms Post call priority modem task CSTServiceProcessCommonAlgos() Egress messages Small message queue Callback higher level CSTFxns.pCSTUserOperation() Egress messages Call periodic functions peripheral drivers CSTFxns.pPeriphProcess() (CST Commander) Higher layer send message Service CSTSendServiceMessage() Ingress message User's storage message Process pending message CSTFxns.pProcessMessage() Ingress message Service storage There pending message 6-10 Framework Layers Service layer foundation CST. main periodic function CSTServiceProcess(), which called directly from CSTAction_Process(). This function must called from high-priority periodical thread. maximum allowed interval between calls (e.g. call once samples 8KHz sampling rate), recommended call several times more often. Service control layer synchronized with codec operating KHz, and, normally, CSTServiceProcess() periodic function runs internal processes there least samples (which corresponds 1.25 ms), there fewer samples function will processing. multithreaded applications, CSTAction_Process() called from user's periodic thread. file BIOS\CSTBIOS.c high-priority periodically posted special procedure called from interrupt callback. This calls function CSTAction_Process(). Similarly Commander, user work with Service layer directly, skipping Parser, Action Commander layers. This possible because Service layer does strongly depend these layers. above control layers lack needed functionality specific task direct control over objects required, XDAIS layer used directly. This layer includes eXpressDSP compliant objects standard XDAIS oriented framework (ALGRF) correct operations with objects. Framework multichannel framework; therefore, services multichannel well. 6.2.4 Other Parts Services Besides AT-command parser, Action, Commander, Service XDAIS layers, there other parts CST, namely: S-registers service, high-level driver, peripheral driver, low-level codec UART drivers. Framework supports well-known modem S-registers interface. S-registers thought object properties. S-register service maps major configuration variables index-addressable parameter list. That means that each S-register assigned existing 16-bit variable. Writing reading S-register will result writing reading variable associated with S-register. Each S-register referenced number. When developing non-standard Flex application, developer define his/her S-registers. Additionally, convenience, hardware registers mapped registers starting from register #100, user configure international other settings registers. Framework Overview 6-11 Framework Layers more detailed specification S-registers found sections 7.2.1.1, 9.4.5 9.4.6. high-level driver dedicated perform hardware-independent portion operations such going off- on-hook, dialing digit pulse mode), detecting rings line reversals more. hardware independence achieved indirectly calling low-level driver functions through well-defined interface fact that hardware register numbers values aren't hard-coded. This been possible make large portion entire driver hardware-independent. When using different device codec, high-level driver subject change. detailed information about high-level driver section 7.7.3. peripheral driver used perform hardware-specific initialization handling hardware specific EVM54CST (LED signaling). driver also overrides methods high-level driver extend them with hardware specific functionality. detailed information about peripheral driver section 7.7.2. low-level UART drivers give user access appropriate devices. drivers export their functions through unified interface. interface makes possible integrate drivers devices, override driver methods alter their functionality, even time. detailed information about low-level UART drivers sections 7.7.5 7.7.6. interface described 7.7.4. 6.2.5 Layers Summary Framework consists following parts: command parser (data voice commands, used chipset mode) Several control layers (used Flex mode): Action layer give user control over solution whole through mapping commands messages different sublayers; eliminates need parser) Commander layer give user control over solution through special command scripts) Service layer provide data flow between different XDAIS components device drivers, give user unified access XDAIS components through special messages) 6-12 Framework Layers High-level driver perform hardware-independent portion operations) Memory management subsystem Interrupt management subsystem Peripheral driver (responsible low-level, hardware-specific initializa- tion CST) Low-level (LIO) UART device drivers will DSP/BIOS functions handling interrupts, memory allocation scheduling threads different priorities Flex application compiled DSP/BIOS. Service Layer layer (CST Service layer) performs foreground processing running XDAIS algorithms. Service layer higher layer (the Commander layers) interact with each other dedicated messages. Commander Layer middle layer intended perform sequences elementary operations handling internal state machine. time Commander layer executing single command script. Commander knows perform each command, what abnormal situations, including task cancellation. purpose Commander layer interact with Service layer. Parser additional part Framework UART interconnection. includes command parser related tasks such modem escape sequence tracking (<pause> <pause>), voice shielded (DLE) code processing, data flow organization, etc. parser simplified service with reduced functionality. parser high-level control functions represent example user integration. parser well Action layer) does have especially useful logic. Only parser aware UART, only layer using Framework Overview 6-13 Framework Layers Action Layer high-level Action layer represents unified interface between whole user application. main interface function Action layer CSTAction(). This layer does functionality only unifies Service Commander layer interfaces. layer alternative command parser UART interface. data commands sent through Action unified message. data control information from transferred through only callback function (except modem caller tasks). Action layer very small service, good example working directly with Commander Service layers. 6-14 Framework Framework 6.3.1 Main Types Main types: Type Name tCSTAction Description Unified Action message (the main structure Action interface). message variant record, whose actual content depends message type. 7.3.1. Action message type (the type key). Selects actual type Action message content. 7.3.2. Action standard operations. Most operations correspond standard commands, such ATA, etc. 7.3.3.2. defined S-registers. S-registers configure settings serve tCSTActionType tCSTStandardOperationType tSRegDefinition XDAIS parameters setting (e.g. voice modem speed) services parameters setting (e.g. voice gain, pause duration's) Various system parameters controls 7.2.1.1. tCSTExternalMsgEvent Action (CST Commander) external event messages sent user's callback function. Either parser user's flex application should receive process such event messages. 7.2.2.4. Commander atomic commands. These commands, when together sequence, compose script. Standard scripts correspond Action standard operations. 7.2.3.1. Service message structure (the main structure Service interface). used both messages addressed Service messages originating from CST. 7.1.1.2 Service (and Action) message result codes. Contains results processing message Service Action). 7.1.1.7. dynamic functions. They allow user extend functionality services non-standard Flex applications. global dynamic functions grouped structure CSTFxns. 7.2.2.1. structure that keeps individual channel data. such structure defined CST: tCSTChannel Ch0. multichannel applications there will number such structures. tCSTAtomicCommand tCSTServiceMessage tCSTMessageResult tCSTFxns tCSTChannel Framework Overview 6-15 Framework Most services keep their variables (data) separate structures. These structures grouped together into global structure tCSTChannel (defined CSTChannel.h). Therefore, data services individual each channel instance. defines global variable used single channel applications (file CSTChannel.c). same time, S-registers, UART drivers also have channel dependent data structures each channel instance. Nevertheless, there also some global data common channels. includes dynamic function structure, S-register descriptors, algorithm initial parameters (except those mapped S-registers), UART drivers' global data. This means that Framework can't used several different applications running simultaneously same CPU, however, perfectly fine have single multi-channel flex application. 6.3.2 S-Registers defines several dozens S-registers (enum tSRegDefinition defined CSTSReg.h). Most them split into following semantic groups: Registers specifying dial operation (srd_LONG_DIAL_DELAY, srd_DTMF_TONE_DURATION, srd_DEFAULT_DIAL_MODE several temporary registers dial modifiers) srd_V42BIS, srd_MODEM_GAIN, srd_FAST_CONNECT, srd_DESIRED_MODEM_SPEED, srd_TIME_BEFORE_FORCED_HANGUP parser oriented register srd_ESCAPE_PROMPT_DELAY) voice settings (srd_VOICE_GAIN, srd_ECAN, srd_VOICE_BPS, srd_VAD, srd_AGC, srd_DLECHAR) Registers modem settings (srd_V42, Registers Registers other settings (srd_INPUT_GAIN, srd_CID_MODE) Registers controlling parser behavior System indication registers (srd_STATISTICS_FLAGS, srd_AVAIL- ABLE_ALGOS, srd_AVAILABLE_MEMORY, srd_STACK_FREE_SIZE, srd_PEAK_MIPS, srd_INPUT_POWER) When developing non-standard application, developer Sregisters. been mentioned earlier, channel instances have common list S-registers, values individual. Most S-registers assigned variables tCSTChannel structure. S-registers linked memory that reserved user array tCSTChannel.aUserReservedWords. 6-16 Framework S-registers with numbers exceeding treated physical peripheral registers (CST maps Si3021 registers S-registers 100.119). User should access these registers Action interface. more information about S-registers, read section 7.1.1. 6.3.3 Call Tree algorithms high-priority periodic process. entry point periodic thread defined CSTAction_Process(). multi-threaded mode, Service control layer posts couple priority threads. user should manually post them. During periodic thread execution, number internal routines called between them user's callback function invoked. more flexibility, some important functions called pointers. Once initialized, pointers never change. This allows user redefine virtual functions and, thus, alter functionality various services. Most pointers virtual/dynamic functions defined global structure CSTFxns tCSTFxns type, declared defined CSTCommander.h, CSTCommander.c). sections 6.3.8 7.2.2.1. schematic diagram periodic thread call tree shown Figure 6-5. Framework Overview 6-17 Framework Figure 6-5. Schematic Diagram Periodic Thread Call Tree User User periodically calls CSTAction_Process() which alias CSTServiceProcess() there least available samples buffer? CSTServiceProcessBuffer() call active xDAIS algorithms EVMPeriphProcess() CSTAction_UserOperation() DAAProcess() CSTCommander() srcipt processor needed EVMPeriphDriver() needed DAAPeriphDrive() CSTServiceSendMessage() CSTServiceProcessMessage() xDAIS object creation, data transfer CSTAction_ServiceFeedBack() CSTServiceGetMessage() CSTFeedBackMsgFunc() User's callback function 6-18 Framework functions painted gray. Dotted arrows represent dynamic function calls, e.g. functions called through CSTFxns pointers. Action, Commander, Service control layers, high-level driver peripheral driver presented following functions: CSTAction_Process(), CSTAction_UserOperation() CSTAction_Ser- viceFeedBack() belong Action control layer. CSTCommander() CSTFeedBackMsgFunc() belong Commander layer. CSTServiceProcess(), CSTServiceProcessBuffer(), CSTServiceSend- Message(), belong Service control layer EVMPeriphProcess(), DAAProcess(), EVMPeriphDriver(), DAAPeriph- Drive() belong peripheral high-level drivers. functions CSTServiceSendMessage(), EVMPeriphDriver() CSTAction() (the last never called periodic thread) implement main control respective layers. call these functions initiate process, which will take some time complete. Therefore, subsequent call function always accepted, there still ongoing process that hasn't finished yet. service cannot accept user request, user should repeat request during after) next periodic thread iteration. more information concerning this topic, please read about Main Periodic High-Priority Thread Function 7.1.1.9. 6.3.4 Controlling Through Action Layer Interface Action control layer unifies access three services: S-registers, Commander Service control layers. access these services, Action message should sent Action layer with function CSTAction(). There four message type keys defined (enum tCSTActionType defined CSTAction.h): cat_SET_REGISTER, cat_GET_REGISTER, cat_STANDARD_OPERATION cat_CSTSERVICE_MESSAGE. Therefore, depending type message, function CSTAction() will following: read/write S-register, script sequence atomic commands) send message directly Service layer (usually used transfer data). Action both standard custom user-defined scripts. standard scripts defined enum tCSTStandardOperationType (file CSTAction.h). Each elements corresponds standard script. standard scripts split into following semantic groups (the parenthesis contain applicable elements): Framework Overview 6-19 Framework Scripts standard modem operations (sot_TURNON_MODEM_CALL_X, sot_TURNON_MODEM_ANS) Scripts standard voice operations (sot_TURNON_VOICE_CALL_X, sot_TURNON_VOICE_ANS, sot_TURNON_VOICE_TXDATA, sot_TURNOFF_VOICE_DATA) sot_TURNON_VOICE_RXDATA, sot_TURNON_VOICE_RXTXDATA, Scripts standard caller operations (sot_CID_AFTER_RINGEND, sot_CID_AFTER_LINE_REVERSAL) Scripts standard simple telephone operations (sot_OFF_HOOK, sot_JUST_CALL_X) Scripts task termination (sot_SOFT_TURNOFF_ALL, sot_TURN- OFF_ALL) Other standard scripts sot_CSTSERVICE_TURNOFF_ALL, sot_CUSTOM_ATOMIC_CHAIN_X sot_SET_DIAL_STRING_X. identifiers with postfix `_X' need additional parameter dial number string user-defined sequence atomic commands, e.g. userdefined script). additional parameter also stored Action message. internal processes, some which have been initiated Action messages, will eventually send event data messages into user's callback function. Action based layer takes part transferring these messages. Action layer redirects Commander's feedback messages user's callback function. layer also sends periodic timer messages user's callback. Additionally, Action layer defines dedicated modem callback function able received data from modem pass data message user's callback function. This default configuration. However, recommended another modem callback function intensive modem data transmission, because Action interface does allow user reject received data. user can't take data, data will lost. these messages, which will sent user's callback, defined enum tCSTExternalMsgEvent (file CSTCommander.h). feedback messages user's callback split into following semantic groups: 6-20 Framework Messages with received information eme_DTMF_DATA, eme_CPTD_DATA, eme_MODEM_DATA, eme_CID_DATA) (eme_PERIPH_DATA, eme_VOICE_DATA, Event messages (eme_TICK, System data messages eme_MODEM_CONNECT, DEM_DISCONNECT, eme_VOICE_DISCONNECT) eme_MO- Strictly speaking, above lists exact. Even though message eme_CID_DATA should carry data, does not. reason this amount data (which exceed size feedback message) their formatting. Therefore, data attached message other functions should used read data. message eme_TICK does carry data except time (measured 8KHz samples) since last eme_TICK message. Because that fact that this message periodic (the period related time between subsequent calls CSTAction_Process() what same, CSTServiceProcess()), treated event message. 6.3.5 Standard Custom Atomic Commands Commander control layer designed process complex scripts. Each script sequence atomic commands (see standard scripts CSTAtomic.c). predefines approximately thirty atomic commands (enum tCSTAtomicCommand defined CSTAtomic.h), which split into following semantic groups: Commands turn algorithm activate Service task (cac_TURNON_VOICE_LOOP, cac_TURNON_VOICE_DATA_X, cac_TURNON_MODEM, cac_TURNON_CID_X, cac_TURNON_SIMPLE_X) Commands turn several algorithms deactivate several Service tasks (cac_TURNOFF_ALL, OFF_VOICE_DATA_X, cac_SOFT_STOP_TASK) Conditional/unconditional pauses (cac_PAUSE_X, cac_TURN- cac_WAIT_CPTD_APPEARANCE_XX, cac_WAIT_CPTD_DISAPPEARANCE_X, cac_MODEM_CONNECT_WAIT) Commands standard telephone operations (cac_PERIPH_SIM- PLE_X, cac_DIALING) number system commands number parser oriented commands Framework Overview 6-21 Framework Every script must with cac_NONE command. identifiers with postfix `_X' expect additional parameter placed next word. identifiers with postfix `_XX' expect additional parameters placed next words (again, standard scripts CSTAtomic.c). developer alter behavior standard commands ones extending CSTCommander() function (see section 7.4.2). 6.3.6 Command Execution Different Layers consider processing basic command which dials phone number "532" establishes modem connection. Chipset mode, this initiated ATDT532 command; Flex mode initiated Action message, passed CSTAction(&Ch0, &Action) function, with Action message equal Action.ActionType cat_STANDARD_OPERATION; sot_TURNON_MODEM_CALL_X; "532"; pseudo-code This message results processing script Commander. script contained array aTur Other recent searchesZL30109 - ZL30109 ZL30109 Datasheet ZL30109QDG - ZL30109QDG ZL30109QDG Datasheet ZL30109QDG1 - ZL30109QDG1 ZL30109QDG1 Datasheet NJM2823 - NJM2823 NJM2823 Datasheet NJM2823F - NJM2823F NJM2823F Datasheet MRF321 - MRF321 MRF321 Datasheet MA26P02 - MA26P02 MA26P02 Datasheet LM317L - LM317L LM317L Datasheet ICS9212-03 - ICS9212-03 ICS9212-03 Datasheet BAX18 - BAX18 BAX18 Datasheet AN55037 - AN55037 AN55037 Datasheet
Privacy Policy | Disclaimer |