| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
Digital Signal Processing Solutions Abstract Caller (Identif
Top Searches for this datasheetImplementing Caller Fixed-Point DSPs Digital Signal Processing Solutions Abstract Caller (Identification) method transmitting telephone caller information, such telephone number and/or caller name. Data transmitted subscriber ringing phase telephone hook) using V.23 modem standard, which FSK-type modem 1200 bit/s. interpretation demodulated data specified protocol. This application report describes implementation protocol message handling receiver, which includes demodulator UART. General information about Calling Line Identification Service also provided. Contents Introduction Caller Protocol Specification.3 Signaling Description Caller Routines Processor Resources.18 Hardware Block Diagram Summary.19 References.20 Appendix Source Code.20 Appendix Glossary.52 Figures Figure Figure Figure Figure Figure Figure Figure Figure Figure Figure Figure Data Octet Data Link Message Format.4 Presentation Layer Message Format.5 Example main() Program.6 Flow Chart CallerID Routine High Frequency Filter DT-AS Detection Stages Receiver 1200 Bit/s.10 Bandpass Filter CID_status FSKREG Registers Flow Diagram Protocol Implementation CID_status FSKREG Registers Digital Signal Processing Solutions December 1998 Tables Table Time DT-AS RP-AS Table Carrier Detection Thresholds Table Message Type Coding Table Parameter Types Supported Protocol Implementation.15 Table Date Time Parameter Table Parameter.16 Table Reason Absence Parameter.16 Table Calling Party Name Parameter.16 Table Reason Absence Calling Party Name Parameter Table Call Type Parameter Table FCLI Parameter.17 Table Call Type Parameter Table Processor Resources Required Receiver Transmitter Introduction This application report provides general information about Calling Line Identification Service. Caller software package includes demodulation routine according CCITT recommendation V.23 implementation protocol data interpretation according Draft 659-1. Caller protocol specification discussed section, Caller Protocol Specification. Different ways signaling specified section, Signaling. software, including protocol implementation demodulation routine, that constitutes software core described Description Caller Routines. Required processor resources given section, Processor Resources. Hardware Block Diagram section offers example demonstration board form block diagram. Caller Protocol Specification Basic mode communication covers transmission data between network Terminal Equipment (TE), either before ringing applied without ringing (idle state). interface network consists three layers: Physical layer Data link layer Presentation layer first layer defines data symbol encoding, modulation analog line conditions. second layer defines framing messages transmission simple error checking procedure. third layer defines application-related information assembled into message. Physical Layer Physical layer requirements refer network local loop. asynchronous FSK-type voice-band modem used data transmission. Therefore, frequency modulator required local exchange (LE) demodulator modem meet 1200 baud V.23 standard characteristics. Caller information transmitted means data octets. Each octet preceded start-bit followed stop-bit, shown Figure Figure Data Octet Stop (most significant) (least significant) Start order transmission Start first, Stop last. Octets transmitted according growing order their number (octet octet etc.) Implementing Caller Fixed-Point DSPs Data Link Layer Data Link Layer provides framing data error detection capability form checksum. Data Link message format shown Figure Figure Data Link Message Format Channel Seizure Signal Mark Signal Message Type Message Length Presentation Layer Message Checksum Channel Seizure Signal channel seizure signal consists sequence continuous bits alternating 1's. block bits starts with ends with Mark Signal mark signal consists sequence mark bits mark bits. block mark bits equivalent series stop bits data transmission). Message Type message type consists octet, which used identify message. Message Length message length octet) contains number octets that constitute Data Link layer message except Message Type, Message Length Checksum octets. length Presentation Layer message vary between octets. Presentation Layer Message Presentation Layer Message contains Caller information according message type. details, sections, Presentation Layer Protocol Implementation. Checksum checksum octet) contains twos complement modulo octets message, starting from Message Type message except checksum itself. 8-bit these octets, including checksum ignoring carry bit, must thus equal zero; otherwise, message assumed incorrect. Presentation Layer Presentation Layer contains type information transmitted, number data octets transmitted, data octets themselves. This sequence contained parameter repeated several times. format Presentation Layer illustrated Figure Implementing Caller Fixed-Point DSPs Figure Presentation Layer Message Format Parameter Parameter Parameter Type Length Data Octet(s) Parameter Parameter Type Parameter Length Parameter Data Octet(s) Parameter elements parameter explained following. implementation protocol with list parameter types described more detail section, Protocol Implementation. Parameter Type parameter type octet) specifies type information transmitted. Parameter types are, example, Calling Line Directory Number Caller Name. Parameter Length parameter length octet) contains number data octets transmitted following. Parameter Data Octet(s) parameter contain from data octets. data octets contain information according parameter type. Data octets encoded specified CCITT Recommendation T.50 (see also draft 659-1 Annex Signaling Signaling carried prior data transmission. so-called Alerting Signal (TAS) indicates that data transmitted. Three kinds specified Caller service: Dual-tone alerting signal (DT-AS) Ringing pulse alerting signal (RP-AS) Line reversal followed DT-AS network operator sends these three before data transmission. case data transmission associated with ringing, modulated Caller message followed ring patterns. Otherwise, appropriate idle condition applied local loop after modulation transmission. DT-AS detector implemented well timing verification RP-AS option. different software modules included Caller package described following section. Implementing Caller Fixed-Point DSPs Description Caller Routines Caller software package contains five modules: control routine application level, main assembly routine that calls Caller subroutines, module DT-AS detection receiver. software only handles on-hook reception Caller choice alerting signal recognized user-programmable option, either DTAS RP-AS. C-Control Routines Application Level control routines executed highest level Caller software: Manage_CID transfer_data. routines contained file CID.C. C-Function Manage_CID signature this function void Manage_CID(int AS). function uses input parameter associated with choice alerting signal contained variable This variable program (e.g., main()) before calling Manage_CID(AS). example main() shown Figure Figure Example main() Program #define RP_AS #define DT_AS #define AS_OPTION CID; DT_AS Ring pulse alerting signal Dual tone alerting signal Choice alerting signal external variable indicating that function executed when executed when main() AS=AS_OPTION; CID=1; initialize CID: 0->no Caller 1->Caller function activated while(1) (CID) Manage_CID(AS); main program continues Manage_CID calls main Caller routine CallerID (cf. section, Main Caller Routine), which handles Caller reception. CallerID returns status that copied variable status. value different from zero indicates that Caller information been received. this case function transfer_data called. Each variable status corresponds different Parameter Type Presentation Layer. (Parameter types taken into account software described more detail section, Protocol Implementation.) corresponding number determined (e.g., Bit0: number=0, Bit1: number=1, etc.). This number input parameter function transfer_data, which described following section. Implementing Caller Fixed-Point DSPs C-Function transfer_data This function called when valid data been received. called many times bits variable status. prototype function void transfer_data(int bit_number). Each number corresponds different parameter type. Data corresponding parameter type(s) transmitted displayed screen. telephony applications, this function replaced display function that outputs data telephone display. Main Caller Routine routine CallerID controls whole sequence Caller reception from alerting signal over channel seizure message extraction. CallerID C-callable function written assembly language. corresponding Cprototype CallerID(int AS). same input parameter used function Manage_CID. RP_AS (0), check valid ring pulse alerting signal carried out. Otherwise routine expects valid dual tone alerting signal detection (cf. section, Alerting Signal Detector). flow chart complete routine CallerID shown Figure Implementing Caller Fixed-Point DSPs Figure Flow Chart CallerID Routine ain.asm allerID heck Pulse valid P-AS detected? switch pedance valid detected? Initialization variables arrier detected? eout? _prot.asm aller protocol ScanC eout? received? hecksum correct? eturn status _ret eturn status eturn calling function case alerting signal been detected, CallerID returns zero calling routine (Manage_CID). either RP-AS DT-AS (depending choice made previously) been detected, impedance switched Caller variables initialized. data carrier detected during time specified draft 659-1, routine exits time out. given Table DT-AS RP-AS. time from alerting signal start modulation transmission. Table Time DT-AS RP-AS Alerting Signal DT-AS RP-AS 45-500 500-800 Implementing Caller Fixed-Point DSPs data carrier detected within Caller protocol routine executed (cf. section, Protocol Implementation). Carrier detection indicated BIT1 variable FSKREG (cf. section, Carrier Detection). Data reception must completed within certain time after carrier detection. time specified constant CID_TO exceeded, Caller reception aborted. Once protocol routine finished exit time out) BIT9 BIT10 status variable CID_status indicate whether data reception been completed successfully not. signification bits used CID_status explained section, Protocol Implementation. case valid data, CallerID returns status containing type(s) information received (cf. section, C-Function Manage_CID). Otherwise, zero returned calling function. Alerting Signal Detector Software detect alert signal, which consists dual tone 2130Hz 2750Hz. routine CheckCPE called sample interrupt. This routine controls different states DT-AS detection (start detection, alerting signal detection). calls routine CPE, which contains DT-AS detector filters. filter response curves individual tone detection filters alerting signal shown Figure Each filter order resonator made bi-quads. closeness frequencies bandwidths within which signals must recognized, filters incorporate notch midpoint between frequencies (2440Hz). This prevents single frequency this level from falsely triggering both resonators, which would occur simpler filter designs were used. ensure recognition signal, which 38dB below speech level though present relatively long time filters with stop-band rejection least 40dB, these filters have stop band rejection 50-60dB. Figure High Frequency Filter DT-AS Detection Implementing Caller Fixed-Point DSPs V.23 Receiver demodulator implemented 1200 bit/s. receiver shown Figure V.23 standard uses binary modulation with central frequency 1700 Binary represented frequency 1300 binary 2100 stages receiver found file, RXV23F.ASM. Variable declarations filter coefficients contained file, V23.inc. Figure Stages Receiver 1200 Bit/s Bandpass Filtering Input Sample Dephasor filter Pass Filter Decision Unit Uart Output: Byte Bandpass Filter first stage consists bandpass filtering input sample. bandpass filter found file, V23.inc. filter characteristics shown Figure Implementing Caller Fixed-Point DSPs Figure Bandpass Filter Carrier Detection next stage AGC. gain applied input sample also used carrier detection. gain constants define states "Carrier "Carrier OFF" with hysteresis required V.23 standard. gain threshold insures carrier detection input signals dBm. high gain threshold returns state "Carrier OFF" input signals dBm. These gain thresholds user programmable described more details next section. case "Carrier ON," BIT1 variable FSKREG set. "Carrier OFF" state," BIT1 reset. FSKREG C-callable. Carrier Detection Thresholds high gain threshold specifies input signal level approximately dBm. gain values greater than equal this threshold carrier considered "OFF". gain threshold defines signal level about dBm. gain takes values less than this threshold carrier considered "ON". Between these thresholds hysteresis carried out. constants given Table have file, V23.INC. Table Carrier Detection Thresholds Gain Threshold DCDon High Gain Threshold DCDoff During initialization phase, these constants copied variables, AGCTHRESL AGCTHRESH. Demodulator 1200 Bits/s Data reception carried 1200 bit/s. stages that part corresponding receiver shown Figure After bandpass filtering AGC, input x(n) applied dephasing all-pass filter that carries phase shift central frequency (1700 Hz). dephasor d(n) given Implementing Caller Fixed-Point DSPs output y(n) obtained multiplying x(n) delayed input d(n). Y(n) then lowpass filtered sign lowpass filtered signal indicates whether binary been received. compiler switch allows choice between demodulator versions, MIPS version higher MIPS version. MIPS version constant LOWMIPS file, V.23.INC. LOWMIPS higher MIPS demodulator. higher MIPS version better quality regarding error rate (BER) given signal-to-noise ratio (SNR). This achieved using times oversampling lowpass filter instead simple lowpass filter used MIPS version. UART decision whether binary been transmitted input UART module. Because there 6.666. samples 1200 bit/s, UART function uses oversampling counter. Synchronization carried start bit, then unit counts data bits expects stop end. extracted byte then copied upper bits variable FSKREG. Once byte been extracted, indicated setting BIT0 FSKREG one. After reading byte protocol level BIT0 reset. This done protocol routines that handle message extraction data into buffers according type information received. These routines described following section. Protocol Implementation protocol implemented according specification described section, Caller Protocol Specification. program divided into subroutines, with each them covering part Caller reception, such channel seizure, identification message type etc. routine, called Scan_CID, controls succession subroutines. protocol routines described this section. Protocol Control Routine: Scan_CID This routine called CallerID (cf. section, Main Caller Routine) after carrier detection. Scan_CID uses registers, FSKREG CID_status, bits which explained Figure Implementing Caller Fixed-Point DSPs Figure CID_status FSKREG Registers CID_status register n.u. AS_ON RING 12,11 n.u. 10,9 RET_STAT CID_ON n.u. BUFFER_INIT CID_EVEN 3,2,1,0 CID_function used Alerting signal detected Long ring RP-AS) present used Return status Caller protocol: abort, error during transmission checksum checksum correct Caller receiver enabled 7,6: used Flag initialization pointer current data buffer Flag storage octets 16-bit word 3,2,1,0: Offset function table function executed next 12,11: 10,9: FSKREG register 15,14,13,12,11,10,9,8 Data octet 7,6, used 5,4,3,2 Reserved CARRIERON CHARON 15-8 bits): 7,6: 5,4,3,2: Data octet received used Used receiver visible protocol level Flag carrier detection Flag reception data octet subroutine called whenever octet been received (which indicated BIT1 FSKREG). subroutine called determined BIT0-BIT3 CID_status. These bits correspond number routine function table. conditional call carried each subroutine. Depending parameters Caller protocol (e.g., message length, parameter type), next subroutine called determined. This illustrated flow diagram shown Figure Implementing Caller Fixed-Point DSPs Figure Flow Diagram Protocol Implementation Reset Wait_Seiz: Wait seizure Wait_CID: Wait Call Setup Start_CID: message length data octets received Get_CID_Parm: parameter type parameter type unknown data octets received Get_CID_ParmLen: parameter length Get_CID_Data: parameter data octets Check_CID: Checksum test Get_CID_DummyLen Get_CID_DummyData First channel seizure identification message type have carried out. corresponding routines Wait_Seiz Wait_CID. Channel Seizure: Wait_Seiz This routine waits alternating 1's, which will received 55h. When this value received, next function executed Wait_CID. Identification Message Type: Wait_CID This routine waits seizure, handles transition seizure/mark, waits message type. only message type implemented `Call Setup' (80h). Call Setup first data octet Caller message (see Table Table Message Type Coding Type (Hexadecimal) Message Name Call Setup Message Length: Start_CID data octet that expected follow `Call Setup' contains number octets received following. message length greater than zero Get_CID_Parm will called next. Parameter Type: Get_CID_Parm Parameter Type first octet Presentation Layer Message. specifies type information that will transmitted. Parameter types currently implemented given Table Implementing Caller Fixed-Point DSPs Table Parameter Types Supported Protocol Implementation Type Value (Binary) 0001 0010 0100 0111 1000 1011 1100 1111 Type Value (Hexadecimal) Length max. max. max. Parameter Name Date Time Calling Line Identity (CLI) Reason absence Calling Party Name (CPN) Reason absence Call type First Called Line Identity case forwarded call) Type Forwarded call case forwarded call) buffer specified length reserved each type information. Other parameter types listed above easily added current implementation. Likewise, parameter types needed CLIP service taken out. only parameters that mandatory PSTN CLIP service Calling Line Identity Reason Absence Calling Line Identity (cf. 659-1 Annex parameter type value received does correspond services taken into account current system, dummy read initiated. This means that overall checksum computed without saving parameter data octets. Parameter types supported explained following sections. Date Time Date time provided user, indicating point time when message been generated (see Table used internal equipment clocks calendars. Table Date Time Parameter Octet Number Contents 9,10 01H: Parameter type 08h: Parameter length Month Hours Minutes Calling Line Identity purpose this parameter identify origin call (see Table Thus, this number used call back caller. Implementing Caller Fixed-Point DSPs Table Parameter Octet Number Contents 02H: Parameter type Parameter length Digit Digit Digit Reason Absence Calling Line Identity parameters explaining been transmitted described Table Table Reason Absence Parameter Octet Number Contents 04H: Parameter type 01H: Parameter length "O": Number unavailable "P": Private Calling Party Name Table describes parameters used identify name caller. Table Calling Party Name Parameter Octet Number Contents 07H: Parameter type Parameter length Character1 Character Character Reason Absence Calling Party Name Table summarizes parameters Calling Party Name transmission. Table Reason Absence Calling Party Name Parameter Octet Number Contents 08H: Parameter type 01H: Parameter length "O": Unavailable "P": Private Implementing Caller Fixed-Point DSPs Call Type Different call types given Table Call Type parameter transmitted, call type will "Voice Call". Table Call Type Parameter Octet Number Contents 11H: Parameter type 01H: Parameter length 01H: Voice Call 02H: Ring Back when free call 03H: Calling Name Delivery 81H: Message Waiting Call First Called Line Identity This parameter transmitted forwarded calls identify first called party. Table FCLI Parameter Octet number Contents 12H: Parameter type Parameter length Digit Digit Digit Type Forwarded Call This parameter specifies type forwarded call. Table Call Type Parameter Octet Number Contents 15H: Parameter type 01H: Parameter length 00H: Unavailable unknown call type 01H: Forwarded call busy 02H: Forwarded call reply 03H: Unconditional forwarded call 04H: Deflected call (after alerting) 05H: Deflected call (immediate) 06H: Forwarded call inability reach mobile subscriber Implementing Caller Fixed-Point DSPs Parameter Length: Get_CID_ParmLen This routine reads second element parameter Presentation Layer Message into variable CID_Len. exceeds message length, Caller reception will aborted. Parameter Data Octets: Get_CID_Data data octets parameter transmitted saved corresponding buffer. more than parameter transmitted Presentation Layer, routine Get_CID_Parm will executed once again. Otherwise, checksum test will carried next (Check_CID). Read Dummy Length: Get_CID_DummyLen parameter type does correspond eight parameter values supported (cf. Table dummy read will initiated. purpose this routine receive valid data preceding following dummy read with checksum computed over total number octets received. Read Dummy Data: Get_CID_DummyData Data associated with parameter type unknown system only used updating checksum. there still data octets received, next parameter type will read. Otherwise, checksum test will executed next. Checksum Test: Check_CID last octet Caller message contains checksum that twos complement modulo octets message, starting from message type (Call Setup 80H) excluding checksum itself. checksum test, 8-bit over octets received been computed. Adding checksum octet without taking into account carry must result into zero; otherwise, data received must assumed corrupt. After checksum test, status that indicates whether Caller reception successfully completed contained register CID_status. This processed main Caller routine described section, Main Caller Routine. Processor Resources Table summarizes memory occupation (RAM ROM) well computational load (MIPS) utilized Caller modules. MIPS only given routines executed real time kHz. values parentheses given higher MIPS version (cf. Demodulator 1200 Bits/s). Implementing Caller Fixed-Point DSPs Table Processor Resources Required Receiver Transmitter MIPS C-Application Protocol Demodulator Detector Sample Interrupt 1840 <0.1 <0.1 (3.4) <3.8 (<5.2) Hardware Block Diagram Figure shows example demonstration board Caller reception. general purpose I/Os used ring detection impedance switching. Caller receiver needs only converter that connected synchronous serial port clocked kHz. Displaying received Caller message carried transferring data from on-chip UART (host) RS-232. Figure CID_status FSKREG Registers Ring Detection Impedance Switch TMS320C2xx Line Line Interface Converter Serial Port RS-232 UART Summary Caller software described this report implements receiver on-hook data transmission software package includes: demodulator DT-AS detector Caller protocol Application display Implementing Caller Fixed-Point DSPs References 659-1: Public Switched Telephone Network (PSTN) Subscriber line protocol over local loop display (and related) services; Part hook data transmission, ETSI 1995 CCITT Recommendation V.23 (1988): 600/1200-baud modem standardized general switched public telephone network CCITT Recommendation T.50 (1992): International Standard Alphabet (IRA) Caller TMS320C2xx, Texas Instruments (1997) Appendix Source Code File: Mainc.c File: MAINC.C Author: Katrin Matthes Dec. Description: Application level, Main program Copyright: (c)Texas Instruments France Rights Reserved #define RP_AS Ring pulse alerting signal #define DT_AS Dual tone alerting signal #define AS_OPTION DT_AS Choice alerting signal CID; external variable indicating that function executed when executed when AS=AS_OPTION; detection alerting signal detection alerting signal char transfer_buf[32]; table_read(int *table); external function main() AS_OPT=AS_OPTION; CID=1; initialize CID: 0->no Caller 1->Caller function activated while(1) (CID) Manage_CID(AS_OPT); main program continues ReadTable(int *table) i=0; char temp; temp=table_read(table+(i>>1)); (temp break; Implementing Caller Fixed-Point DSPs transfer_buf[i]=temp>>8; i++; ((temp 0x00ff) break; transfer_buf[i]=temp 0x00ff; i++; }while(i 32); transfer_buf[i]=0; element return character added afterwards, indicates last void Print(char *Pt) Display routine specific connection DSP-host File: Cid.c File: CID.C Author: Katrin Matthes Nov. Description: Application level, Display Revisions: Copyright: (c)Texas Instruments France Rights Reserved #define RING 0x2000 CID_status #define MAX_BUF number buffers external functions CallerID(int as); Print(char *Ptr); void Init_Ptrs(void); ReadTable(int *table); external variables extern CID_status; extern CID_ret; extern *CID_Ptr[MAX_BUF]; extern alerting signal on/off AS=1/0 extern char transfer_buf[32]; extern CLI0[], CLI1[], CLI2[], CLI3[], CLI4[], CLI5[], CLI6[], CLI7[]; void Manage_CID(int AS_OPT) status,i; status=CallerID(AS_OPT); (!status) (CID_status RING) Print("RING"); CID_status ~RING; reset ring else Implementing Caller Fixed-Point DSPs (i=0;i<MAX_BUF;i++) (status (0x0001 transfer_data(i); void transfer_data(int number) *tmp_ptr; BufferLen,i, toggle=0,count=1; switch (number) case 0x0000 count=ReadTable(CLI0); BufferLen=4; break; case 0x0001: count=ReadTable(CLI1); BufferLen=10; break; case 0x0002: count=ReadTable(CLI2); BufferLen=10; break; case 0x0003 count=ReadTable(CLI3); BufferLen=1; break; case 0x0004: count=ReadTable(CLI4); BufferLen=10; break; case 0x0005: count=ReadTable(CLI5); BufferLen=1; break; case 0x0006: count=ReadTable(CLI6); BufferLen=1; break; case 0x0007: count=ReadTable(CLI7); BufferLen=1; break; default: break; tmp_ptr=CID_Ptr[number]; points current buffer (BufferLen (i=0;i<BufferLen<<1;i++) if(!toggle) else transfer_buf[count+i]= (char)(*(tmp_ptr)&0x00ff); tmp_ptr++; toggle^=1; transfer_buf[count+i]=(char) 0x0000; else transfer_buf[count]=(char) *tmp_ptr; transfer_buf[count+1]=(char) 0x0000; Print(transfer_buf); Implementing Caller Fixed-Point DSPs File: PrintTab.asm String tables with routine ReadTable(int *table) Only used .const RAM) .def _CLI0 .string "DATE/TIME:" .word 0000h _CLI1 .string "Tel.:" .word 0000h _CLI2 .string "FCLIP:" .word 0000h _CLI3 .string CLIP:" .word 0000h _CLI4 .string "Name:" .word 0000h _CLI5 .string Name:" .word 0000h _CLI6 .string "Call Type:" .word 0000h _CLI7 .string "FCLIP Type:" .word 0000h File: Main.asm File: MAIN.ASM Description: Main Assembler Routine: init, management Revisions: Copyright: (c)Texas Instruments France Rights Reserved .include "cid.inc" .mmregs .ref _c_int0 .ref _CID_status Implementing Caller Fixed-Point DSPs .ref CheckCPE, RXV23 .def _table_read .def _Tim0, FromAD _Tim0 .usect "SMain",1 ;Timer, incremented FromAD .usect "SMain",1 ;sample from sample ItPage0 .usect "SMain",12 context save .sect "vectors" Reset reset int0 SigmaIt sigma delta real time counter .space 16*16 reserve words timer serial receive serial transmit DTrap trap (for debug) .text Trap debug DTrap dint after reset Reset dint ssxm sovm initialization specific MSP58C8x, changed TMS320C2xx clock lack #0F537h 0101 10111 0101 SDPD 4.096*12/12=Sigma delta 8.0kHz PCPD 4.096*12/4*2 6.14MIPS 10111 PLLFG 4.096*12MHz ldpk sacl FREQ init port lack #04FA1h 0100 1111 1010 0001 ldpk b5,7,8,9,10,11,14 output sacl BDIR lack #04FA0h 0100 1111 1010 0000 sacl init 58C20 lack #003h 0011 ldpk sacl ADAC enable interrupt mask lack #02h ldpk sacl enable SDINT init status register #_CID_status sacl _CID_status eint call _c_int0 start program Sigma Delta ;-SigmaIt .newblock Implementing Caller Fixed-Point DSPs save context ItPage0+0 sst1 ItPage0+1 ldpk sach ItPage0+2 sacl ItPage0+3 ar0,ItPage0+4 ar1,ItPage0+5 ar2,ItPage0+6 ar3,ItPage0+7 ItPage0+8 ItPage0+9 mpyk ItPage0+10 ssxm soft timer #_Tim0 _Tim0 sacl _Tim0 ldpk ldpk sacl status status accuh accul SDAD sample #FromAD FromAD save sample #_CID_status _CID_status #CID_ON no_CID call CheckCPE call RXV23 no_CID no_CID restore context ldpk ItPage0+9 mpyk ItPage0+10 ItPage0+8 ar3,ItPage0+7 ar2,ItPage0+6 ar1,ItPage0+5 ar0,ItPage0+4 zals ItPage0+3 accl addh ItPage0+2 acch lst1 ItPage0+1 status1 ItPage0+0 status eint C-callable routine that allows looking values table _table_read &(&program memory word) &program memory word tblr *,ar1 program memory word Implementing Caller Fixed-Point DSPs File: CID_Main.asm File: CID_MAIN.ASM Author: Katrin Matthes Nov. Description: Main Caller Routine Revisions: Copyright: (c)Texas Instruments France Rights Reserved .include "cid.inc" .def _CallerID .def _reset_imp .ref _CID_status,_CID_ret .ref .ref _Tim0 .ref CID_temp .global _FSKREG .mmregs Main caller routine: CallerID(int Controls sequence Caller reception: Presence alerting signal V.23 Carrier Message Extraction Input: Choice alerting signal: DT-AS RP-AS Output: Status information Caller reception: 0->idle error during transmission !=0->bits give information about type information received used: AR0, AR1, _CallerID POPD save context ar0,ar1 AR0,*+ AR1,* LARK AR0,#0 local variable AR0,*0+ argument lark ar2,-3 *,ar2 short_ring check_ring check ring present insert reading TMS320C2xx #RING_MASK no_ring offset argument Implementing Caller Fixed-Point DSPs #_Tim0 reset timer ring count sacl _Tim0 ;wait ring Ring_on #RING_MASK Ring_on ;check min. ring length #_Tim0 _Tim0 #RING_MIN no_ring ;check max. ring length #RING_MAX ;value blez short_ring #_CID_status _CID_status #RING sacl _CID_status no_ring valid short ring been detected start reception short_ring larp check want receive DT_AS ring_init #_CID_status _CID_status #CID_ON no_as_init ring_init insert writing impedance switch TMS320C2xx dint switch impedance #~SWITCH_IMP ;b11 sacl eint dint call Init_CID init routines: call resV23 receive protocol call _InitRXV23 call _InitDCD init Carrier detection thresholds #_CID_status _CID_status #CID_ON sacl _CID_status eint ;enable interrupts larp check want receive DT_AS no_AS no_as_init _CID_status #AS_ON no_ring no_AS #_Tim0 sacl _Tim0 reset timer timeout no_DCD #_FSKREG _FSKREG Implementing Caller Fixed-Point DSPs #CARRIERON dcd_on #_Tim0 _Tim0 #DCD_TO blez no_DCD timeout1 dint #SWITCH_IMP sacl eint check data carrier detected #_CID_status _CID_status #~CID_ON reset CID_ON sacl _CID_status no_ring dcd_on #_Tim0 reset timer ring count sacl _Tim0 loop_CID call Scan_CID #_Tim0 _Tim0 #CID_TO timeout1 #_CID_status _CID_status #0600h check_ret_stat loop_CID check_ret_stat dint #SWITCH_IMP ;reswitch impedance sacl eint #_CID_status _CID_status #~CID_ON reset sacl _CID_status #0600h #0200h no_ring abort, error during transmission #0200h no_ring #0200h no_ring crc_ok #_CID_ret _CID_ret exit1 no_ring exit1 *,AR1 SBRK AR0,*- restore PSHD _reset_imp Implementing Caller Fixed-Point DSPs dint #SWITCH_IMP ;reswitch impedance sacl eint #_CID_status sacl _CID_status _InitDCD #_AGCTHRESL #DCDon sacl _AGCTHRESL #DCDoff sacl _AGCTHRESH File: CID_Prot.asm File: cid_prot.asm Author: Katrin Matthes April Description: Caller protocol Revisions: Copyright: (c)Texas Instruments France Rights Reserved .include "cid_var.inc" .global _FSKREG .def Init_CID .def _Init_Ptrs .def CID_temp CID_temp .usect .def Scan_CID "CID_Temp",1 Caller Initialization Init_CID call _Init_Ptrs #CID_Byte sacl CID_Byte sacl _CID_status sacl CID_Checksum sacl _CID_ring sacl CID_Len sacl CID_ParmLen sacl MaxParmLen sacl _CID_ret call clear_buffers Clears buffers Implementing Caller Fixed-Point DSPs clear_buffers larp ar3,#_Date_Time_Buf #DATE_TIME_LEN-1 sacl ar3,#_CLIP_Buf #CLIP_LEN-1 sacl ar3,#_FCLIP_Buf #FCLIP_LEN-1 sacl ar3,#_No_CLIP_Buf #NO_CLIP_LEN-1 sacl ar3,#_Call_Name_Buf #CALL_NAME_LEN-1 sacl ar3,#_No_Call_Name_Buf #NO_CALL_NAME_LEN-1 sacl ar3,#_Call_Type_Buf #CALL_TYPE_LEN-1 sacl ar3,#_FCLIP_Type_Buf #FCLIP_TYPE_LEN-1 sacl Caller Control Routine Scan_CID #_FSKREG _FSKREG #CHARON ;check flag no_byte larp ar3,#CID_temp _FSKREG #~CHARON ;reset flag sacl _FSKREG _FSKREG,8 #CID_Byte sach CID_Byte CID_Byte #00ffh sacl CID_Byte #_CID_status _CID_status #000fh ;bit0-3 contain function execute #CID_functions tblr cala branch function no_byte Wait Channel Seizure Implementing Caller Fixed-Point DSPs Wait_Seiz #CID_Byte CID_Byte #55h NoSeiz _CID_status #0fff0h #WAIT_CID sacl _CID_status NoSeiz Wait Call Setup Byte Wait_CID #CID_Byte CID_Byte #55h done still seizure CID_Byte #CALL_SETUP first data byte must equal done transition seizure/mark _CID_status #0fff0h zero function execute next #START_CID that 'or' below will work properly sacl _CID_status CID_Byte sacl CID_Checksum done _CID_status #0fff0h sacl _CID_status done Start Caller Reception Start_CID #CID_Byte global data length CID_Byte sacl CID_Len CID_Checksum sacl CID_Checksum #100h no_wrap sacl CID_Checksum no_wrap larp ar3,CID_Len _CID_status #0fff0h banz next #CHECK_CID sacl _CID_status done1 next #GET_CID_PARM sacl _CID_status done1 Read Caller Parameter Implementing Caller Fixed-Point DSPs Get_CID_Parm call CID_update abort2 contains CID_Len CID_Byte CID_Byte contains service parameter #BufNum date clip no_clip c_name no_name c_type fclip fclip_type dummy date sacl BufNum #DATE_TIME_LEN,1 sacl MaxParmLen done2 clip sacl BufNum #CLIP_LEN,1 sacl MaxParmLen done2 fclip sacl BufNum #FCLIP_LEN,1 sacl MaxParmLen done2 no_clip sacl BufNum #NO_CLIP_LEN sacl MaxParmLen done2 c_name sacl BufNum #CALL_NAME_LEN,1 sacl MaxParmLen done2 no_name sacl BufNum #NO_CALL_NAME_LEN sacl MaxParmLen done2 c_type sacl BufNum #CALL_TYPE_LEN sacl MaxParmLen done2 fclip_type Implementing Caller Fixed-Point DSPs sacl BufNum #FCLIP_TYPE_LEN sacl MaxParmLen done2 dummy #_CID_status service parameter list _CID_status initiate dummy read #0fff0h #GET_CID_DUMMY_LEN sacl _CID_status abort2 #_CID_status _CID_status #CID_ABORT sacl _CID_status done2 #BufNum BufNum #_CID_ret _CID_ret sacl _CID_ret #_CID_status _CID_status #0fff0h #GET_CID_PARM_LEN sacl _CID_status Read Caller parameter length Get_CID_ParmLen call CID_update contains CID_Len CID_Byte abort3 parameter length global length abort CID_Byte sacl CID_ParmLen next2 #MaxParmLen parameter length allocated space then initiate MaxParmLen dummy read dummy_len #_CID_status _CID_status #0fff0h #GET_CID_DATA sacl _CID_status done3 dummy_len #_CID_status #0fff0h #GET_CID_DUMMY_DATA sacl _CID_status done3 next2 #_CID_status Paramter length ;global data length _CID_status next paramter #0fff0h otherwise checksum test Implementing Caller Fixed-Point DSPs ar3,CID_Len banz nxt_parm,*,ar3 #CHECK_CID sacl _CID_status done3 nxt_parm #GET_CID_PARM sacl _CID_status done3 abort3 #_CID_status _CID_status #CID_ABORT sacl _CID_status call clear_buffers done3 Read Caller parameter data Get_CID_Data call CID_update contains CID_Len larp _CID_status #BUFFER_INIT Buffer_ptr buffer start no_init #_CID_Ptr BufNum sacl Buffer_ptr ar3,Buffer_ptr sacl Buffer_ptr _CID_status #BUFFER_INIT bit, that init only carried once sacl _CID_status no_init ar3,Buffer_ptr points current data buffer _CID_status #CID_EVEN get_even CID_Byte,8 sacl past_odd get_even CID_Byte sacl past_odd ar3,Buffer_ptr _CID_status #CID_EVEN toggle sacl _CID_status same function executed next CID_Len Check_It CID_ParmLen sacl CID_ParmLen NxtParm done4 NxtParm #_CID_status _CID_status Implementing Caller Fixed-Point DSPs #0fff0h #GET_CID_PARM #~BUFFER_INIT reset buffer-init next parameter #~CID_EVEN reset toggle next parm sacl _CID_status done4 Check_It #_CID_status _CID_status #0fff0h #CHECK_CID sacl _CID_status done4 Read dummy parameter length Get_CID_DummyLen call CID_update CID_Byte abort4 parameter length global length then abort CID_Byte sacl CID_ParmLen next4 #_CID_status _CID_status #0fff0h #GET_CID_DUMMY_DATA sacl _CID_status done5 next4 #_CID_status _CID_status #0fff0h ar3,CID_Len banz nxt_parm2,*,ar3 #CHECK_CID sacl _CID_status done5 nxt_parm2 #GET_CID_PARM sacl _CID_status done5 abort4 #_CID_status _CID_status #CID_ABORT sacl _CID_status call clear_buffers done5 Read Caller dummy data Get_CID_DummyData call CID_update ;ACC contains CID_Len Chck_Sum CID_ParmLen Implementing Caller Fixed-Point DSPs Nxt_Parm sacl CID_ParmLen done6 Chck_Sum #_CID_status _CID_status #0fff0h #CHECK_CID sacl _CID_status done6 Nxt_Parm #_CID_status _CID_status #0fff0h #GET_CID_PARM sacl _CID_status done6 Caller Checksum Test Check_CID #CID_Byte last byte contains complement bytes CID_Byte CID_Checksum #00ffh check_ok _CID_status #CHECK_BAD sacl _CID_status done7 check_ok _CID_status #CHECK_OK sacl _CID_status done7 _CID_status #~CID_ON sacl _CID_status Update checksum global data length CID_update #CID_Byte CID_Byte CID_Checksum sacl CID_Checksum #100h no_wrap1 sacl CID_Checksum no_wrap1 CID_Len sacl CID_Len Implementing Caller Fixed-Point DSPs Init array pointers buffers _Init_Ptrs #_CID_Ptr #_Date_Time_Buf sacl _CID_Ptr #_CLIP_Buf sacl _CID_Ptr+1 #_FCLIP_Buf sacl _CID_Ptr+2 #_No_CLIP_Buf sacl _CID_Ptr+3 #_Call_Name_Buf sacl _CID_Ptr+4 #_No_Call_Name_Buf sacl _CID_Ptr+5 #_Call_Type_Buf sacl _CID_Ptr+6 #_FCLIP_Type_Buf sacl _CID_Ptr+7 Function Table CID_functions .word Wait_Seiz .word Wait_CID .word Start_CID .word Get_CID_Parm .word Get_CID_ParmLen .word Get_CID_Data .word Get_CID_DummyLen .word Get_CID_DummyData .word Check_CID File: CID_Var.inc Definition caller constants variables .def _Date_Time_Buf, _CLIP_Buf, _FCLIP_Buf, _No_CLIP_Buf .def _Call_Name_Buf, _No_Call_Name_Buf, _Call_Type_Buf, _FCLIP_Type_Buf .def _CID_ring, CID_Checksum .def CID_Len, CID_ParmLen, MaxParmLen, BufNum .def _CID_Ptr .def _CID_status .def Buffer_ptr .def _CID_ret, CID_Byte ***CID-Functions*** WAIT_SEIZ .set WAIT_CID .set function execute START_CID .set contained GET_CID_PARM .set status register GET_CID_PARM_LEN .set GET_CID_DATA .set GET_CID_DUMMY_LEN .set Implementing Caller Fixed-Point DSPs GET_CID_DUMMY_DATA .set CHECK_CID .set ***CID Return Status*** CID_ABORT .set 0200h return status bits 9,10 CHECK_BAD .set 0400h status register CHECK_OK .set 0600h ***CID Service Parameters*** CALL_SETUP .set DATE_TIME .set CLIP .set FCLIP .set NO_CLIP .set CALL_NAME .set NO_CALL_NAME .set CALL_TYPE .set FLIP_TYPE .set ***Buffer Lengths Data Storage*** DATE_TIME_LEN .set CLIP_LEN .set FCLIP_LEN .set NO_CLIP_LEN .set CALL_NAME_LEN .set NO_CALL_NAME_LEN .set CALL_TYPE_LEN .set FCLIP_TYPE_LEN .set ***Misc*** MAX_BUF .set CID_TIMEOUT .set 16000 MAX_CID_LEN .set CID_ON .set 100h status register CID_FLAG .set 800h CID_EVEN .set 010h BUFFER_INIT .set 020h CHARON .set 0001h FSKREG _Date_Time_Buf .usect "CID_Buf",DATE_TIME_LEN _CLIP_Buf .usect "CID_Buf",CLIP_LEN _FCLIP_Buf .usect "CID_Buf",FCLIP_LEN _No_CLIP_Buf .usect "CID_Buf",NO_CLIP_LEN _Call_Name_Buf .usect "CID_Buf",CALL_NAME_LEN _No_Call_Name_Buf .usect "CID_Buf",NO_CALL_NAME_LEN _Call_Type_Buf .usect "CID_Buf",CALL_TYPE_LEN _FCLIP_Type_Buf .usect "CID_Buf",FCLIP_TYPE_LEN _CID_ring .usect "CID_Var",1 _CID_status .usect "CID_Var",1 CID_Checksum .usect "CID_Var",1 CID_Len .usect "CID_Var",1 CID_ParmLen .usect "CID_Var",1 MaxParmLen .usect "CID_Var",1 BufNum .usect "CID_Var",1 _CID_ret .usect "CID_Var",1 _CID_Ptr .usect "CID_Var",MAX_BUF Buffer_ptr .usect "CID_Var",1 CID_Byte .usect "CID_Var",1 received valid data byte Implementing Caller Fixed-Point DSPs File: CID.inc .global _AGCTHRESL, _AGCTHRESH FREQ .equ .equ .equ BDIR .equ ADAC .equ SDAD .equ SDDA .equ SAAD .equ 0007h 000Ch 000Dh 000eh 0010h 0011h 0012h 0013h frequency control register reserved memory port input register port output register port direction register sigma-delta ADC/DAC control sigma-delta input register sigma-delta output register successive-approximation DCDon .set 6100h gain -43dBm DCDoff .set 6500h gain -48dBm CID_ON .set 100h status reg. RING_MASK .set 0040h (input) RING_MIN .set 100ms=>100 RING_MAX .set 5800 (clock kHz) SWITCH_IMP .set 0800h (output) DCD_TO .set 8000 (clock kHz) DCD_ON .set 1000h status reg. RING .set 2000h CID_status AS_ON .set 4000h CID_status CID_TO .set 20000 2.5s (clock kHz) CARRIERON .set 0002h FSKREG File: CPE.asm Dual Tone Alerting Signal Detector .include "cid.inc" .mmregs .global resV23,CheckCPE .ref _CID_status .ref ;=1->DT Alerting Signal, =0->Ring .ref FromAD rptz .macro arg1 mpyk arg1 .endm .text initialize resV23 dint cnfd larp ar3,#iir6_a1 #CPE_delay-iir6_a1+1 sacl #_AS no_CPE0 lacl #200 ;INITIALIZE threshold #CPE_thr Implementing Caller Fixed-Point DSPs sacl CPE_thr #NoCPE end0 no_CPE0 #EndCPE end0 #CPEstat sacl CPEstat eint Alerting signal detector control routine Sequence: NoCPE: wait start DT-AS StCPE: DT-AS started, wait EndCPE: DT-AS, status CID_status CheckCPE #CPEstat CPEstat bacc NoCPE call CPE_tim,7 EndCPE wait start alerting signal #CPEstat #StCPE sacl CPEstat EndCPE StCPE call CPE_tim,7 bbnz EndCPE wait alerting signal #_CID_status _CID_status #AS_ON sacl _CID_status #EndCPE #CPEstat sacl CPEstat EndCPE Sub-routine This subroutine detects alerting signal Entry Acc=Q15 input Exit present Acc=256 Else Acc<0 #FromAD lacc FromAD #iir1_b1 sacl iir1_b1 ;input freq filter sacl iir4_b1 ;input high freq filter bi-quad frequency filter ar3,#iir1_b3 ;point data larp rptz macd #IIR_LF1,*- ;filter with params *;apac sach iir1_a1,1 ;save feedback terms sach iir2_b1,1 ;input next stage bi-quad frequency filter Implementing Caller Fixed-Point DSPs rptz macd #IIR_LF2,*- ;filter with params *;apac sach iir2_a1,1 ;save feedback terms sach iir3_b1,1 ;input next stage bi-quad frequency filter rptz macd #IIR_LF3,*- ;filter with params *;apac sach iir3_a1,1 ;save feedback terms measure signal strength ;convert amplitude Low_En,15 ;add energy filter addh Low_En sach Low_En bi-quad high frequency filter rptz macd #IIR_HF1,*- ;filter with params *;apac apac ;last parameter sach iir4_a1,1 ;save feedback terms sach iir5_b1,1 ;input next stage bi-quad high frequency filter rptz macd #IIR_HF2,*- ;filter with params *;apac apac ;last parameter sach iir5_a1,1 ;save feedback terms sach iir6_b1,1 ;input next stage bi-quad high frequency filter rptz macd #IIR_HF3,*- ;filter with params *;apac apac ;last parameter sach iir6_a1,1 ;save feedback terms measure signal strength ;convert amplitude High_En,15 ;add energy filter addh High_En sach High_En test valid signal levels CPE_thr,15 ;High_En present blez no_CPE lacc Low_En,1 ;Low_En present CPE_thr blez no_CPE lacc Low_En,3 ;check Low_En*9-High_En*4>0 Low_En ;(7.0dB Signal difference) Implementing Caller Fixed-Point DSPs High_En,2 blez no_CPE lacc High_En,3 ;check High_En*9-Low_En*4>0 High_En ;(7.0dB Signal difference) Low_En,2 blez no_CPE adapt threshold detection lacc Low_En CPE_thr,2 Low_OK Low_En,14 sach CPE_thr present Low_OK lacc CPE_tim ;increment frame count #255 ;test valid frames blez CPE_ret CPE_det lacl CPE_ret #256 ;0<acc<256 present invalid sacl CPE_tim ;acc=256 present no_CPE lacl #200 ;CPE default threshold sacl CPE_thr lacl ;acc=0 signal sacl CPE_tim Allocate space detection filters iir's must kept this order data space iir6_a1 .usect "CIDb0",1 iir6_a2 .usect "CIDb0",1 iir6_b1 .usect "CIDb0",1 iir6_b2 .usect "CIDb0",1 iir6_b3 .usect "CIDb0",1 dummy6 .usect "CIDb0",1 ;dummy macd dmov iir5_a1 .usect "CIDb0",1 iir5_a2 .usect "CIDb0",1 iir5_b1 .usect "CIDb0",1 iir5_b2 .usect "CIDb0",1 iir5_b3 .usect "CIDb0",1 dummy5 .usect "CIDb0",1 ;dummy macd dmov iir4_a1 .usect "CIDb0",1 iir4_a2 .usect "CIDb0",1 iir4_b1 .usect "CIDb0",1 iir4_b2 .usect "CIDb0",1 iir4_b3 .usect "CIDb0",1 dummy4 .usect "CIDb0",1 ;dummy macd dmov iir3_a1 .usect "CIDb0",1 iir3_a2 .usect "CIDb0",1 iir3_b1 .usect "CIDb0",1 iir3_b2 .usect "CIDb0",1 iir3_b3 .usect "CIDb0",1 dummy3 .usect "CIDb0",1 ;dummy macd dmov iir2_a1 .usect "CIDb0",1 iir2_a2 .usect "CIDb0",1 iir2_b1 .usect "CIDb0",1 iir2_b2 .usect "CIDb0",1 iir2_b3 .usect "CIDb0",1 dummy2 .usect "CIDb0",1 ;dummy macd dmov iir1_a1 .usect "CIDb0",1 iir1_a2 .usect "CIDb0",1 iir1_b1 .usect "CIDb0",1 iir1_b2 .usect "CIDb0",1 iir1_b3 .usect "CIDb0",1 dummy1 .usect "CIDb0",1 ;dummy macd dmov Low_En .usect "CIDb0",1 ;low frequency energy Implementing Caller Fixed-Point DSPs High_En .usect "CIDb0",1 ;high frequency energy CPE_thr .usect "CIDb0",1 ;CPE detection threshold CPE_tim .usect "CIDb0",1 ;CPE active time CPEstate .usect "CIDb0",1 ;state CPE_delay .usect "CIDb0",1 ;delay time state machine CPEstat .usect "CIDb0",1,1 .sect "RomData" Alerting Signal Tables Follow order filter bi-quads detecting alerting signal signal order b3,b2,b1,a2,a1 frequency filter IIR_LF1 .word 1003,-911,1107,-31343,-4427 ;pass 2.088, stop 1.430 IIR_LF2 .word 2002,0,-2002,-31664,-8530 ;pass 2.169, stop IIR_LF3 .word 7950,5389,7950,-29884,-6092 ;pass 2.124, stop 2.440 High frequency filter IIR_HF1 .word 1094,0,-1094,-31726,-33453/2 ;pass 2.694,stop 0.0&4.0 IIR_HF2 .word 1094,0,-1094,-31536,-37867/2 ;pass 2.802,stop 0.0&4.0 IIR_HF3 .word 7950,5389,7950,-30514,-34855/2 ;pass 2.743,stop 2.440 File: RXV23F.asm File: RX23F.ASM Author: Katrin Matthes Nov. Description: V.23 receiver Revisions: Copyright: (c)Texas Instruments France Rights Reserved .global _InitRXV23,RXV23,_ResetV23 .global _V23REG .def TRIGGER .global V23CCoef .global _FSKREG, FSKCOUNT, FSKCHAR, FSKC, AGCTEMP, AGCGAIN, AGCSamp .global _AGCTHRESL, _AGCTHRESH, AGCGAIN, DecCOUNT .global AgcFSK, FSKDec .ref FromAD .include "V23.inc" .mmregs .text Implementing Caller Fixed-Point DSPs initialization _InitRXV23: dint #AGCGAIN Initialisation page Initialisation variables SACL AGCGAIN gain=0 SACL AGCGAIN+1 SACL FSKCOUNT count=0 SACL FSKC LACC #MEMON SACL _FSKREG mem=1 #CID_PAGE LRLK AR3,V23IN Initialisation upper band LARP RPTK #BPLEN SACL LRLK AR3,ENDXN Initialisation i(n) RPTK #LPLEN SACL #DecCOUNT sacl DecCOUNT count>>1 eint reception Routine versions: MIPS (2), executed parallel with other tasks High MIPS (3.5) LOWMIPS=1->Low MIPS version LOWMIPS=0->High MIPS version Input: sample from sample contained FromAD Output: Demodulated octet _FSKREG Routine modifies AR2,AR3 RXV23: #FromAD FromAD rsxm #CID_PAGE Initialisation page SACL V23IN #CID_PAGE LRLK AR2,ENDIN Compute Pass Band filter LARP MPYK RPTK #BPLEN MACD BandPasCoef,*-; APAC #AGCSamp SACH AGCSamp,1 call AgcFSK #AGCSamp AGCSamp sacl MPYK Compute dephasor filter TN2,12 #2317 A2.tempo(n-1) A1.tempo(n-2) Implementing Caller Fixed-Point DSPs APAC SACH SACH #655 TEMPON2 #-655 TEMPON1 #-2317 TEMPON1,4 TEMPON1 x(n)=tempo(n)*t(n) LOWMIPS #CID_PAGE LRLK AR2,ENDXN MPYK RPTK LPLEN MACD LPCoef,*- APAC CALL TRIGGER SACL OUT2 #_FSKREG _FSKREG #MEMON #_FSKREG _FSKREG #MEMOFF SACL _FSKREG SSXM LRLK AR3,OUT2 .else LRLK AR2,ENDXN Compute pass filter LARP Filter also performs oversampling MPYK sampling frequency times original one. RPTK FirstArray,*- APAC #CID_PAGE CALL TRIGGER SACL OUT1 #_FSKREG _FSKREG #MEMON #_FSKREG _FSKREG #MEMOFF SACL _FSKREG LRLK AR2,ENDXN MPYK RPTK SecondArray,*-; APAC #CID_PAGE CALL TRIGGER SACL OUT2 #_FSKREG _FSKREG Implementing Caller Fixed-Point DSPs #MEMON #_FSKREG _FSKREG #MEMOFF SACL _FSKREG LRLK AR2,ENDXN MPYK RPTK MACD ThirdArray,*APAC #CID_PAGE CALL TRIGGER SACL OUT3 #_FSKREG _FSKREG #MEMON #_FSKREG _FSKREG #MEMOFF SACL _FSKREG LRLK AR2,2 LRLK AR3,OUT1 ;for(i=0;i<3;i++) .endif Decision Unit call FSKDec ssxm TRIGGER:SACH SACL SSXM #-100 RSXM ZALH ADDS #100 #_FSKREG _FSKREG,10 #CID_PAGE #CID_PAGE Test return this value carrier detection AGCSamp contains signal after passband filtering ;-AgcFSK #_FSKREG _FSKREG #~OLDCARON _FSKREG,14 OldCarrier=Carrier CarOn #OLDCARON Implementing Caller Fixed-Point DSPs CarOn SACL Automatic SOVM ssxm SACL NORM NORM NORM NORM NORM SACH ADDH SACH SUBH SACH ZALH ADDS SACH SACL ROVM _FSKREG Gain Control #2000H AGCTEMP AGCSamp AGCGAIN ;load sample band pass filtered mult GAIN ;prevents overflow saturates required AGCSamp AGCSamp AGCSamp ;compute GAIN value AGCTEMP AGCGAIN,14 AGCTEMP AGCGAIN AGCGAIN+1 AGCTEMP,8 AGCGAIN AGCGAIN+1 Carrier detection AGCGAIN _AGCTHRESH BLEZ _FSKREG #~CARRIERON SACL _FSKREG AGCGAIN _AGCTHRESL BGEZ _FSKREG #CARRIERON SACL _FSKREG _FSKREG,13 BBNZ _FSKREG #~CARRIERON SACL _FSKREG EndCid _FSKREG #CARRIERON SACL _FSKREG if(y<=Threshold1) Carrier=0 else if(y>=Threshold2) Carrier=1 else if(OldCarrier==0) Carrier=0 else Carrier=1 Decision Unit 1200 bauds 6.66. samples sample counter incremented Input: Demodulated contained ;-FSKDec LOWMIPS Implementing Caller Fixed-Point DSPs .newblock ssxm #_FSKREG _FSKREG,11 FSKCOUNT SACL FSKCOUNT DecCOUNT,1 SACL FSKCOUNT _FSKREG #~STOPON SACL _FSKREG *,AR3 LACC _FSKREG,12 SACL FSKCHAR FSKCOUNT SACL FSKCOUNT DecCOUNT SACL FSKCOUNT _FSKREG #STARTON SACL _FSKREG _FSKREG,12 FSKCOUNT SACL FSKCOUNT DecCOUNT,1 #01h FSKC FSKCHAR SACL FSKCHAR FSKC SACL FSKC SACL FSKC _FSKREG #~STARTON #STOPON #CHARON #00FFh SACL _FSKREG FSKCHAR,8 _FSKREG SACL _FSKREG #FSKCOUNT SACL FSKCOUNT if(stop_char) count++; if(count>=20) count=0,1,2; stop_char=0; else if(!(out[i] start_char)) char=0; count++; count=0; if(c>=8) c=0; start_char=0; stop_char=1; char_available=1 acc=acc|char; char=char|((out[i]&0x01)<<c); c++; if(count>=20) acc=out[i]; acc=acc&0x01; acc=acc<<(c+1); count=0; start_char=1; if(start_char) count++; if(count>=10) .else Implementing Caller Fixed-Point DSPs LOOP: SACL SACL SACL LACC SACL SACL SACL SACL SACL SACL SACL SACL SACL SACL SACL LARP BANZ ssxm _FSKREG,11 if(stop_char) FSKCOUNT count++; FSKCOUNT if(count==20) ;changed stop detection count=0; FSKCOUNT _FSKREG #STOPOFF stop_char=0; _FSKREG *,AR3 else _FSKREG,12 ;if(!(out[i] start_char)) FSKCHAR char=0; FSKCOUNT count++; FSKCOUNT if(count==10) ;changed ameliorate start detection FSKCOUNT count=0; _FSKREG start_char=1; #STARTON _FSKREG _FSKREG,12 if(start_char) FSKCOUNT count++; FSKCOUNT if(count==20) acc=out[i]; #01h acc=acc&0x01; FSKC acc=acc<<(c+1); FSKCHAR acc=acc|char; FSKCHAR char=char|((out[i]&0x01)<<c); FSKC c++; FSKC if(c>=8) FSKC c=0; _FSKREG #STARTOFF start_char=0; #STOPON stop_char=1; #CHARON char_available=1 #00FFh _FSKREG FSKCHAR,8 _FSKREG _FSKREG count=0; FSKCOUNT *+,AR2 increment ar3,next LOOP EndFor Implementing Caller Fixed-Point DSPs .endif File: V23.inc LOWMIPS .set ;compiler switch:low/high MIPS version V23ZONE .set dead zone slicer LOWMIPS LPLEN .set .else LPLEN .set .endif BPLEN .set length high band length oversampling filter length high band .global _AGCV23L, _AGCV23H .global V23IN, ENDIN .global BandPasCoef .global TXV23 Variables CID_PAGE .usect "V23",0 Start page jlma TEMP2 .usect "V23",1 ;jlma OUTCHAR .usect "V23",1 OUT_SAMPLE .usect "V23",1 TEMP .usect "V23",1 TEMP1 .usect "V23",1 OUT1 .usect "V23",1 OUT2 .usect "V23",1 OUT3 .usect "V23",1 .usect "V23",1 .usect "V23",2 .usect "V23",1 IN_SAMPLE .usect "V23",1 .usect "V23",LPLEN pass filter upper band ENDXN .usect "V23",2 TEMPON1 .usect "V23",1 TEMPON2 .usect "V23",1 .usect "V23",1 .usect "V23",1 .usect "V23",1 V23IN .usect "V23",BPLEN band pass filter upper band ENDIN .usect "V23",2 SAMPLC .usect "V23",1 undersampling counter _FSKREG .usect "FSK",1 _AGCTHRESL .usect "FSK",1 ;AGC threshold hysteresis _AGCTHRESH .usect "FSK",1 FSKCOUNT .usect "FSK",1 FSKCHAR .usect "FSK",1 FSKC .usect "FSK",1 AGCSamp .usect "FSK",1 AGCGAIN .usect "FSK",2 AGCTEMP .usect "FSK",1 DecCOUNT .usect "FSK",1 Constant manipulation V23REG register CHARON .set 0001h CARRIERON .set 0002h OLDCARON .set 0004h STARTON .set 0008h Implementing Caller Fixed-Point DSPs STOPON MEMON .text BandPasCoef: .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .set .set 0010h 0020h -396 -574 -1563 2397 1876 -4287 -8446 2744 12394 2744 -8446 -4287 1876 2397 -1563 -574 -396 Band Pass filter coefficients quantitizied coeff Characteristic this filter file BPV232.FLT LOWMIPS pass filter high band LPCoef .word -250 ;C018 .word -958 ;C017 .word -1899 ;C016 .word -2624 ;C015 .word -2125 ;C014 .word ;C013 .word 4721 ;C012 .word 10015 ;C011 .word 14379 ;C010 .word 16064 ;C009 .word 14379 ;C008 .word 10015 ;C007 .word 4721 ;C006 .word ;C005 .word -2125 ;C004 .word -2624 ;C003 .word -1899 ;C002 .word -958 ;C001 .word -250 ;C000 .else Pass filter coefficients perform oversampling. FirstArray: .word -118 LpFilt[42] .word LpFilt[39] .word LpFilt[36] .word LpFilt[33] .word 1340 LpFilt[30] .word 1898 LpFilt[27] .word 2260 LpFilt[24] .word 2316 LpFilt[21] Implementing Caller Fixed-Point DSPs .word .word .word .word .word .word .word SecondArray: .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word ThirdArray: .word .word .word .word .word .word .word .word .word .word .word .word .word .word .word .endif 2047 1538 -103 -411 -118 1139 1725 2169 2335 2169 1725 1139 -118 -411 -103 1538 2047 2316 2260 1898 1340 -118 LpFilt[18] LpFilt[15] LpFilt[12] LpFilt[9] LpFilt[6] LpFilt[3] LpFilt[0] LpFilt[43] LpFilt[40] LpFilt[37] LpFilt[34] LpFilt[31] LpFilt[28] LpFilt[25] LpFilt[22] LpFilt[19] LpFilt[16] LpFilt[13] LpFilt[10] LpFilt[7] LpFilt[4] LpFilt[1] LpFilt[44] LpFilt[41] LpFilt[38] LpFilt[35] LpFilt[32] LpFilt[29] LpFilt[26] LpFilt[23] LpFilt[20] LpFilt[17] LpFilt[14] LpFilt[11] LpFilt[8] LpFilt[5] LpFilt[2] Appendix Glossary CLIP DT-AS PSTN RP-AS UART Automatic Gain Control Alerting Signal Calling Line Identity Presentation Dual Tone-Alerting Signal Finite Impulse Response Frequency Shift Keying Infinite Impulse Response Local Exchange Pass Filter Public Switched Telephone Network Ring Pulse-Alerting Signal Alerting Signal Terminal Equipment Universal Asynchronous Receiver Transmitter Implementing Caller Fixed-Point DSPs INTERNET www.ti.com Register with TI&ME build custom information pages receive product updates automatically email. Francais Italiano Email +33-(0) 1-30 +33-(0) 1-30 +33-(0) 1-30-70 epic@ti.com Semiconductor Home Page http://www.ti.com/sc Distributors PRODUCT INFORMATION CENTERS Japan Phone International Domestic International Domestic Email Asia Phone International Domestic Australia Asia (continued) Number China +81-3-3457-0972 +0120-81-0026 +81-3-3457-1259 +0120-81-0036 pic-japan@ti.com Americas Phone Email +1(972) 644-5580 +1(972) 480-7800 sc-infomaster@ti.com +886-2-3786800 1-800-881-011 -800-800-1450 10811 Europe, Middle East, Africa Phone Deutsch +49-(0) 8161 3311 English +44-(0) 1604 3399 Number Hong Kong Number India Number Indonesia Number Korea Malaysia Number Zealand Number Philippines Number Singapore Number Taiwan Thailand Number -800-800-1450 800-96-1111 -800-800-1450 000-117 -800-800-1450 001-801-10 -800-800-1450 080-551-2804 1-800-800-011 -800-800-1450 +000-911 -800-800-1450 105-11 -800-800-1450 800-0111-111 -800-800-1450 080-006800 0019-991-1111 -800-800-1450 Implementing Caller Fixed-Point DSPs IMPORTANT NOTICE Texas Instruments subsidiaries (TI) reserve right make changes their products discontinue product service without notice, advise customers obtain latest version relevant information verify, before placing orders, that information being relied current complete. products sold subject terms conditions sale supplied time order acknowledgement, including those pertaining warranty, patent infringement, limitation liability. warrants performance semiconductor products specifications applicable time sale accordance with TI's standard warranty. Testing other quality control techniques utilized extent deems necessary support this warranty. Specific testing parameters each device necessarily performed, except those mandated government requirements. CERTAIN APPLICATIONS USING SEMICONDUCTOR PRODUCTS INVOLVE POTENTIAL RISKS DEATH, PERSONAL INJURY, SEVERE PROPERTY ENVIRONMENTAL DAMAGE ("CRITICAL APPLICATIONS"). SEMICONDUCTOR PRODUCTS DESIGNED, AUTHORIZED, WARRANTED SUITABLE LIFE-SUPPORT DEVICES SYSTEMS OTHER CRITICAL APPLICATIONS. INCLUSION PRODUCTS SUCH APPLICATIONS UNDERSTOOD FULLY CUSTOMER'S RISK. order minimize risks associated with customer's applications, adequate design operating safeguards must provided customer minimize inherent procedural hazards. assumes liability applications assistance customer product design. does warrant represent that license, either express implied, granted under patent right, copyright, mask work right, other intellectual property right covering relating combination, machine, process which such semiconductor products services might used. TI's publication information regarding third party's products services does constitute TI's approval, warranty, endorsement thereof. Copyright 1998, Texas Instruments Incorporated trademark Texas Instruments Incorporated. Other brands names property their respective owners. Implementing Caller Fixed-Point DSPs Other recent searchesUT54LVDM328 - UT54LVDM328 UT54LVDM328 Datasheet TC75S55F - TC75S55F TC75S55F Datasheet TC75S55FU - TC75S55FU TC75S55FU Datasheet TC75S55FE - TC75S55FE TC75S55FE Datasheet SN74LVC1G74 - SN74LVC1G74 SN74LVC1G74 Datasheet S66D8ZOV251RA310 - S66D8ZOV251RA310 S66D8ZOV251RA310 Datasheet NLX2G04 - NLX2G04 NLX2G04 Datasheet LB1816 - LB1816 LB1816 Datasheet EP2AGX190 - EP2AGX190 EP2AGX190 Datasheet ADSP-218x - ADSP-218x ADSP-218x Datasheet
Privacy Policy | Disclaimer |