MCF5407 Low Data Rate Soft Modem Software Developer s Reference Manual
|
|
|
- Katrina Olivia Barnett
- 10 years ago
- Views:
Transcription
1 nc. MCF5407SWRM/D 1/2003 REV 0 nc MCF5407 Low Daa Rae Sof Modem Sofware Developer s Reference Manual
2 nc. HOW TO REACH US: USA/EUROPE/LOCATIONS NOT LISTED: Moorola Leraure Dsruon P.O. Box 5405, Denver, Colorado or JAPAN: nc Moorola Japan Ld. SPS, Techncal Informaon Cener , Mnam-Azau Mnao-ku Tokyo Japan ASIA/PACIFIC: Moorola Semconducors H.K. Ld. Slcon Harour Cenre, 2 Da Kng Sree Ta Po Indusral Esae, Ta Po, N.T., Hong Kong TECHNICAL INFORMATION CENTER: HOME PAGE: hp://moorola.com/semconducors Informaon n hs documen s provded solely o enale sysem and sofware mplemeners o use Moorola producs. There are no express or mpled copyrgh lcenses graned hereunder o desgn or farcae any negraed crcus or negraed crcus ased on he nformaon n hs documen. Moorola reserves he rgh o make changes whou furher noce o any producs heren. Moorola makes no warrany, represenaon or guaranee regardng he sualy of s producs for any parcular purpose, nor does Moorola assume any laly arsng ou of he applcaon or use of any produc or crcu, and specfcally dsclams any and all laly, ncludng whou lmaon consequenal or ncdenal damages. Typcal parameers whch may e provded n Moorola daa shees and/or specfcaons can and do vary n dfferen applcaons and acual performance may vary over me. All operang parameers, ncludng Typcals mus e valdaed for each cusomer applcaon y cusomer s echncal expers. Moorola does no convey any lcense under s paen rghs nor he rghs of ohers. Moorola producs are no desgned, nended, or auhorzed for use as componens n sysems nended for surgcal mplan no he ody, or oher applcaons nended o suppor or susan lfe, or for any oher applcaon n whch he falure of he Moorola produc could creae a suaon where personal njury or deah may occur. Should Buyer purchase or use Moorola producs for any such unnended or unauhorzed applcaon, Buyer shall ndemnfy and hold Moorola and s offcers, employees, susdares, afflaes, and dsruors harmless agans all clams, coss, damages, and expenses, and reasonale aorney fees arsng ou of, drecly or ndrecly, any clam of personal njury or deah assocaed wh such unnended or unauhorzed use, even f such clam alleges ha Moorola was neglgen regardng he desgn or manufacure of he par. Moorola and he Sylzed M Logo are regsered n he U.S. Paen and Trademark Offce. dgal dna s a rademark of Moorola, Inc. All oher produc or servce names are he propery of her respecve owners. Moorola, Inc. s an Equal Opporuny/Affrmave Acon Employer. Moorola, Inc. 2003
3 nc. Secon Paragraph Numer Conens Tle Aou Ths Book Page Numer nc Audence. xv Suggesed Readng. xv General Informaon xv ColdFre Documenaon. xv Acronyms and Arevaons. xv Chaper 1 Inroducon 1.1 Key Feaures Relaed Fles Quck Sar Chaper 2 General Archecure 2.1 The Basc Blocks of he Sof Modem Samplng Frequency Numerc Formas Channel Transmer Recever Gloal Sae Machne Inerface Gloal Daa Srucures Crcular Buffer Inlne Funcons Chaper 3 Module Descrpons 3.1 Daa Pump V Esalshmen of connecon V MOTOROLA Conens
4 nc. Paragraph Numer Conens Tle Page Numer nc Esalshmen of connecon V Scramler Descramler Handshake Implemenaon RX V.22 Handshake daa handler srucure V.22s Scramler Descramler Handshake Reran sequence (2400 /s operaon) Implemenaon RX V.22s handshake daa handler srucure TX V.22s handshake daa handler srucure FSK FSK Transmer FSK Recever DPSK DPSK ransmer Scramler Encoder Modulaor Bandpass fler Guard one generaor DPSK recever Bandpass flers Auomac Gan Conrol (AGC) Demodulaor Decson lock and Decoder Descramler Clock Recovery Carrer Recovery DPSK modulaor conrol srucure DPSK demodulaor conrol srucure QAM QAM ransmer Scramler Encoder Modulaor Transm fler v MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
5 nc. Paragraph Numer Conens Tle Page Numer nc Guard one generaor QAM recever Bandpass flers Auomac Gan Conrol (AGC) Demodulaor Decson lock and Decoder Descramler Adapve Equalzer Clock Recovery Carrer Recovery QAM modulaor conrol srucure QAM demodulaor conrol srucure V.42 Error Correcon General srucure of he V.42 module Accessng he daa uffers Tmng conrol Deecon phase V.42 Recever B-level npu FCS check Frame handler Informaon frame handlng Supervsor frame handlng The V.42 Transmer Frame capsulaon and sendng daa Sendng Informaon frames Sendng Supervsor frames Suppor of he V.14 proocol The V.42 module funcon descrpon V.42s Daa Compresson Proocol Proocol Background Informaon Implemenaon Overvew Communcaon wh V Programmng Inerface Compresson rao The V.14 Sofware Module V.14 Daa Handler Rx V.14 Daa Handler V.8 Sofware Module V8 Daa Handler Rx V8 Daa Handler MOTOROLA Conens v
6 nc. Paragraph Numer Conens Tle Page Numer nc The V.8 sar-up procedure n callng mode The V.8 sar-up procedure n answerng mode Suppor Modules UART module DAA Inerface Tone Generaor and Deecor Tone Generaor Tone Deecor Rng Deecor DTMF Daler Pulse Daler Tex Response Mscellaneous Funcons AT command se suppor Command Parser Command Handler v MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
7 nc. Fgures nc Fgure Numer Tle Page Numer 1-1 Modem Daugher Card Insallaon. Jumper Sengs Basc Archecure of he Sandalone Verson of he LDR Sof Modem The Daa Flow Dagram Gloal Sae Machne Tmng dagram of he V.21 Handshake sequence Tmng dagram of he V.23 Handshake sequence Sgnal Consellaon for V V.22 scramler V.22 descramler Handshake sequence Handshake sae dagram V.22s 16-pon consellaon dagram V.22s scramler V.22s descramler V.22s handshake sequence V.22s reran sequence Handshake Sae Dagram FSK Tx Daa Pump FSK Transmer srucure FSK Rx Daa Pump FSK Demodulaor srucure Smplfed demodulaon specrum of a nary FSK sgnal DPSK ransmer lock dagram DPSK modem recever lock dagram Sgnal energes over a aud Clock Recovery lock dagram Carrer Recovery lock dagram DPSK recever decson pons QAM ransmer lock dagram QAM modem recever lock dagram Sgnal energes over a aud QAM Clock Recovery lock dagram QAM Carrer Recovery lock dagram QAM recever decson pons Exernal relaonshps of he V.42 module MOTOROLA Fgures v
8 nc. Fgures nc Fgure Numer Tle Page Numer 3-32 General srucure of he V.42 module Sae machne of he V.42 recever Sae machne of he V.42 ransmer Srucure of he V.42 recever Srucure of he V.42 ransmer V.42s connecon Compresson flow Decompresson flow Tx V.14 Daa Handler n he Tx channel Tx V.14 Daa Handler General daa flow accordng he V.14 Recommendaon The Rx V.14 Daa handler Tone generaor Tone deecor Sages of he Tone Deecon Rng Deecor DTMF daler Pulse daler Command Handler v MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
9 nc. Tales nc Tale Numer Tle Page Numer Acronyms and Arevaed Terms. xv 1-1 Daa Pump Proocols Suppored y Sof Modem The Gloal Sae Machne Saes sae_machne_n argumens sae_machne argumens Gloal Daa Srucures Tx_sample_wre argumens Tx_sample_read argumens Rx_sample_wre argumens Rx_sample_read argumens Tx_daa_wre argumens Tx_daa_read argumens Rx_daa_wre argumens Rx_daa_read argumens Tx_uar_daa_wre argumens Tx_uar_daa_read argumens Rx_uar_daa_read argumens command_wre argumens command_read argumens gloal_srucure_n argumens Tx_channel_n argumens Rx_channel_n argumens Tx_rese argumens Rx_rese argumens Tx_daa_pump argumens Rx_daa_pump argumens Tx_daa_handler argumens Rx_daa_handler argumens command_parser argumens command_handler argumens Tx_slence_gen argumens Rx_dle argumens save_daa_handler_parameers argumens load_daa_handler_parameers argumens Tx_V21_n argumens. 3-5 MOTOROLA Tales x
10 nc. Tales nc Tale Numer Tle Page Numer 3-2 Rx_V21_n argumens Tx_V21_handshake_n argumens Tx_V21_handshake_roune argumens Rx_V21_handshake_n argumens Rx_V21_handshake_roune argumens Tx_V23_n argumens Rx_V23_n argumens Tx_V23_handshake_n argumens Tx_V23_handshake_roune argumens Rx_V23_handshake_n argumens Rx_V23_handshake_roune argumens Bs encodng n V.22 modem V22_scramle_ argumens V22_descramle_ argumens Tx_V22_n argumens Rx_V22_n argumens Rx_V22_handshake_n argumens Rx_V22_handshake_roune argumens Tx_V22_handshake_n argumens Tx_V22_handshake_roune argumens Bs encodng n V.22s modem V22s_scramle_ argumens V22s_descramle_ argumens Tx_V22s_n argumens Rx_V22s_n argumens Rx_V22s_handshake_n argumens Rx_V22s_handshake_roune argumens Tx_V22s_handshake_n argumens Tx_V22s_handshake_roune argumens Tx_V22s_change_mode argumens Rx_V22s_change_mode argumens FSK_modulaor_n argumens FSK_modulaor argumens FSK_demodulaor_n argumens FSK_demodulaor argumens DPSK_modulaor_n argumens DPSK_modulaor argumens DPSK_demodulaor_n argumens DPSK_demodulaor argumens QAM_modulaor_n argumens QAM_modulaor argumens x MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
11 nc. Tales nc Tale Numer Tle Page Numer 3-43 QAM_demodulaor_n argumens QAM_demodulaor argumens re_connecon_code argumens v42_ges argumens v42_n argumens v42_pus argumens v42_rx_daa argumens v42_x_daa argumens v42_vews argumens V42s Funcons v42s_in argumens v42s_encode argumens v42s_encode argumens v42s_flush argumens Compresson rao comparson Tx_V14_DH_n argumens Tx_V14_DH_roune argumens v14_pus argumens Rx_V14_DH_n argumens Rx_V14_DH_roune argumens v14_ges argumens Tx_V8_DH_n argumens Tx_V8_DH_roune argumens v8_pu_s argumens Rx_V8_DH_n argumens Rx_V8_DH_roune argumens v8_ge_s argumens mcf5407_uar_n argumens mcf5407_uar_parameers_se argumens mcf5407_uar_nerrup_mask_se argumens Rx_uar argumens Tx_uar argumens Tx_uar_all argumens ou_char_uar argumens ou_sample_codec argumens flow_conrol argumens daa_n argumens daa_counry_se argumens daa_rx_level_se argumens daa_x_level_se argumens daa_aou_level_se argumens MOTOROLA Tales x
12 nc. Tales nc Tale Numer Tle Page Numer 3-84 daa_aou_mue argumens daa_rng_deec argumens daa_go_off_hook argumens daa_go_on_hook argumens daa_read_reg argumens daa_wre_reg argumens Tx_daa argumens Rx_daa argumens Tones ha are suppored y he Tone Generaor Tx_one_n argumens Tx_one argumens Tones ha are suppored y Tone Deecor Rx_one_n argumens Rx_one argumens Rx_rng_de_n argumens Rx_rng_deec argumens Frequences used y he DTMF generaor Tx_DTMF_n argumens Tx_DTMF argumens Tx_pulse_n argumens Tx_pulse argumens Correspondence of dal dgs o he numer of Make/Break pulses prn_resul_code argumens Effec of he AT V command on he Resul code forma prn_ex_response argumens Effec of AT Vn command on Tex response forma prn_connec argumens Effec of he AT Xn command on he CONNECT resul code ex_o_de argumens ex_o_de_fxed argumens char_o_de argumens un8_o_sr_decmal argumens un8_o_sr_hexadecmal argumens dsp_cos argumens dsp_convoluon_frac argumens memcpy_mcf argumens AT_parser_n argumens AT_parser_n argumens AT_parser_n argumens AT_parser_n argumens AT_handler_n argumens x MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
13 nc. Tale Numer Tales Tle Page Numer AT_handler_roune argumens nc MOTOROLA Tales x
14 nc. Tale Numer Tales Tle Page Numer nc xv MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
15 nc. Aou Ths Book The prmary ojecve of hs user s manual s o defne he funconaly of he MCF5407 processors for use y sofware developers. nc The nformaon n hs ook s sujec o change whou noce, as descred n he dsclamers on he le page of hs ook. As wh any echncal documenaon, s he readers responsly o e sure he s usng he mos recen verson of he documenaon. To locae any pulshed erraa or updaes for hs documen, refer o he world-wde we a hp:// Audence Ths manual s nended for sysem sofware developers who wan o develop producs wh he MCF5407. I s assumed ha he reader undersands operang sysems, mcroprocessor sysem desgn, asc prncples of sofware and hardware, and asc deals of he ColdFre archecure. Suggesed Readng Ths secon lss addonal readng ha provdes ackground for he nformaon n hs manual as well as general nformaon aou he ColdFre archecure. General Informaon The followng documenaon provdes useful nformaon aou he ColdFre archecure and compuer archecure n general: ColdFre Documenaon The ColdFre documenaon s avalale from he sources lsed on he ack cover of hs manual. Documen order numers are ncluded n parenheses for ease n orderng. ColdFre Programmers Reference Manual, R1.0 (MCF5200PRM/AD) ColdFre MCF5407 User s Manual, 0.1 (MCF5407UM/AD) Moorola M5407C3 User s Manual, R1.1 (M5407C3UM/AD). Slcon Laoraores S3044 Daa Shee, R2.01 (S3044-DS201) MOTOROLA Aou Ths Book xv
16 Acronyms and Arevaons nc. Acronyms and Arevaons Tale lss acronyms and arevaons used n hs documen. Tale. Acronyms and Arevaed Terms nc Term AGC AFE ANS BPF DAA DTMF DCE DTE DPSK EC FIR FSK FDM GSTN IIR LDR LPF HSP PSK PSTN SM QAM QDPSK UART USART Meanng Auomac Gan Conrol Analogue Fron End Answer one (see V.25) Bandpass fler Daa Access Arrangemen Dual Tone Mul Frequency Sgnalng Daa Crcu-ermnang Equpmen Daa Termnal Equpmen Dfferenal PSK Echo Cancelng Fne Impulse Response Frequency Shf Keyng Frequency Dvson Mulplexng General Swched Telephone Nework Infne Impulse Response Low Daa Rae Low-pass fler Hos Sgnal Processng Phase Shf Keyng Pulc Swched Telephone Nework Sof Modem Quadraure Amplude Modulaon Quadraure DPSK Unversal asynchronous recever / ransmer Unversal synchronous/asynchronous recever ransmer xv MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
17 nc. Chaper 1 Inroducon nc Ths documen descres he low daa rae (LDR) Sof Modem (wh daa raes up o 2400 s / second) for he MCF5407 ColdFre processor. The Sof Modem ncludes suppor for he Daa Pump n real-me sofware, as well as he AT command se and oher proocols (see elow). The chosen developmen plaform s he MCF5407C3 EVM, wh an addonal Daugher card. The Daugher card s used o provde he Daa Access Arrangemen (codec and phone lne nerface) such as Slcon Las S3044. In hs manual, you wll fnd he nformaon requred o use and manan he LDR Sof Modem nerfaces and algorhms. 1.1 Key Feaures The LDR Sof Modem suppors: Tale 1-1 lss Daa Pump Proocols mplemened n he Sof Modem. Tale 1-1. Daa Pump Proocols Suppored y Sof Modem ITU-T recommendaon Modulaon Daa Rae (ps) Modulaon Rae (auds) Carrer Frequency (Hz) Bs per Baud V.22s QAM / / V.22 DPSK / / V.23 FSK 75/ / / /600 75/ / V.21 FSK / ITU-T V.21, V.23, V.22 and V22s Physcal Handshake Sequences. ITU-T V.42 Error Correcon. ITU-T V.42s Daa Compresson. ITU-T V.14 sync-o-asynchronous converer. MOTOROLA Chaper 1. Inroducon 1-1
18 Relaed Fles nc. AT-command se. Tone generaon and deecon. DTMF and Pulse dalng. DAA nerface (S3044 Modem Daugher Card) va he on-chp USART module. DTE nerface va he on-chp UART module. 1.2 Relaed Fles nc The followng fles are relevan o he Sof Modem: man.c enry pon of he Sof Modem. modem.h hgh level funcons and man daa srucure defnons. modem.c mplemenaon of hgh level funcons. sae_machne.h defnon of sae machne daa srucure. sae_machne.c mplemenaon of man sae machne. v21.h defnons used y V.21 proocol. v21.c nalzaon of V.21 daa pump proocol and realzaon of physcal handshake sequence for V.21. v23.h defnons used y V.23 proocol. v23.c nalzaon of V.23 daa pump proocol and realzaon of physcal handshake sequence for V.23. v22.h defnons used y V.22 proocol. v22.c nalzaon of V.22 daa pump proocol and realzaon of physcal handshake sequence for V.22. v22s.h defnons used y V.22s proocol. v22s.c nalzaon of V.22s daa pump proocol and realzaon of physcal handshake sequence for V.22s. fsk.h FSK daa pump defnons. fsk.c realzaon of FSK daa pump. dpsk.h DPSK daa pump defnons. dpsk.c realzaon of 2,4-DPSK daa pump. qam.h QAM daa pump defnons. qam.c realzaon of 4,16-QAM daa pump. v14.h defnons used y V.14 proocol. v14.c realzaon of V.14 daa handler. V42.h defnons used y V.42 proocol. V42.c realzaon of V.42 proocol. 1-2 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
19 Relaed Fles nc. nc V42s.h defnons used y V.42s proocol. V42s.c realzaon of V.42s proocol. V8.h defnons used y V.8 proocol. V8.c realzaon of V.8 proocol. dmf.h DTMF daler defnons. dmf.c DTMF daler realzaon. pulse.h pulse daler defnons. pulse.c pulse daler realzaon. one_gende.h defnons used y one generaor and deecor. one_gende.c realzaon of one generaor and deecor. rng_de.h defnons used y rng deecor. rng_de.c realzaon of rng deecor. a_parser.h defnons used y AT command parser. a_parser.c realzaon of AT command parser. a_handler.h defnons used y AT command handler. a_handler.c realzaon of AT command handler. ex_response.h defnons used y ex response rounes accordng o V.25er. ex_response.c realzaon of ex response rounes accordng o V.25er. counres.h defnons of counry or area codes accordng o ITU-T T.35. msc.h defnons used y mscellaneous funcons. msc.c realzaon of mscellaneous funcons. The followng fles are HW and Compler dependen pars of he Sof Modem: SofMod.mcp Sof Modem projec fle. n.h general daa ypes and defnons. In funcon prooypes. s3044_daa.h defnons used y he DAA (S3044 Modem Daugher Card) nerface. s3044_daa.c realzaon of he DAA (S3044 Modem Daugher Card) nerface. mcf5407_uar.h defnons used y UART module rounes. mcf5407_uar.c realzaon of UART module rounes. mcf5407_mer.h defnons used y Tmer module rounes. mcf5407_mer.c realzaon of Tmer module rounes. prnf_uar.h defnons used y prnf_uar() roune. prnf_uar.c realzaon of prnf_uar() roune. Only for deug requremens. mcf5407.h MCF5407 defnons. MOTOROLA Chaper 1. Inroducon 1-3
20 Quck Sar nc. mcf5407_lo.s lowes level rounes for he MCF5407. vecor.s MCF5407 vecor ale. n_handlers.c nerrup handlers. sysn.c power-on rese confguraon of he MCF5407. ads_68k_mw.c lnker command fle. mwerks.h defnes consans used y he CodeWarror Preprocessor. nc 1.3 Quck Sar Carefully follow hese seps o prepare he LDR Sof Modem for operaon Properly nsall and se-up he Sof Modem daugher card: The daugher card can e nsalled on he M5407C3 evaluaon oard he wrong way. Please ensure ha he daugher card s correcly fed efore applyng power. The Moorola logos on he wo cards mus e read he oppose way up o each oher for correc operaon. When correcly nsalled, he RJ11 connecor wll e owards he PCI socke of he man oard and he speaker wll e adjacen o he DIMM memory card. Fgure 1-1 shows he correcly nsalled daugher card and s jumper sengs for correc communcaon wh he M5407C3 evaluaon oard. JP1 JP2 JP3 OD RU RW R 0 PRU ) 'LJLWDO'1$ /$ S 3021 BDM /$ M5407C3 CF Modem Card S 3015 'LJLWDO'1$ From Moorola RJ11 PCI DIMM Fgure 1-1. Modem Daugher Card Insallaon. Jumper Sengs. Proper se-up of he M5407C3 evaluaon oard: To seup he M5407C3 evaluaon oard, refer o he M5407C3 User s Manual, R1.1. When you are preparng he oard for he frs me, e sure o check ha all jumpers are n he correc locaons. In pracce, he locaons of J21, J22, J23 and J24 are ncorrec y defaul. The sengs can e 1-4 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
21 Quck Sar nc. nc deermned y allowng he oard o oo up under dbug conrol. Snce dbug drves he confguraon daa on PP[0:3] he daa wll e seen on he LEDs (D1-D4). If he LED s on hen he correspondng jumper should e OFF, and f he LED s off hen he jumper should e n poson 2-3 (see M5407C3 User s Manual, R1.1. Chaper SDRAM DIMM ). Use he RS-232 male/female DB-9 seral cale o connec he PC o he M5407C3. Plug n he Modem daugher card o he elephone lne hrough he RJ-11 socke (f you wan o make a connecon o anoher modem). Power-up he oard. Invoke he Hyper Termnal or smlar ermnal program on he PC o whch he evaluaon oard s conneced and confgure o: Bs per second: Daa s: 8 Pary: none Sop s: 1 Flow conrol: Hardware (CTS/RTS) Load \ SofMod.mcp ono Merowerks CodeWarror and uld he arge. Run projec. In your ermnal program wndow you should see he Sof Modem welcome message: ========================= LDR Sof Modem ========================= The Sof Modem s now ready o accep your AT commands (see MCF5407 Low Daa Rae Sof Modem. AT Command reference. User Manual.) MOTOROLA Chaper 1. Inroducon 1-5
22 Quck Sar nc. nc 1-6 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
23 nc. Chaper 2 General Archecure nc The Low Daa Rae Sof Modem runs on he M5407C3 oards wh an nsalled Modem daugher card ased on he Slcon Las S3044 DAA. The curren verson of he LDR Sof Modem works as a sand-alone applcaon whou he need for an operang sysem (see Fg 2). The wo funcons performed y he modem are: Modem Daa Pump funcons he modulaon/demodulaon funcons. Modem Conrol funcons error correcon, hardware compresson and AT command nerpreaon. Conroller Sof Modem Daa pump Dev oard M5407C3 UART 1 In Modem mode UART 0 Modem Daugher Card oard Expanson Connecors RJ 11 S3021 S3015 Fgure 2-1. Basc Archecure of he Sandalone Verson of he LDR Sof Modem All Conroller and Daa Pump funconaly s performed usng he ColdFre MCF5407 mcroprocessor, wh no addonal DSP processor. In general he MCF5407 performs he followng funcons: Modulaon/demodulaon Daa encodng/decodng Flerng Auomac gan conrol Tone dalng Call progress monorng RS Pho ln MOTOROLA Chaper 2. General Archecure 2-1
24 nc. AT command se nerpreaon Scramlng / descramlng Dalng Synchronous/asynchronous converson Modem confguraon conrol Proocol nalzaon The Modem Daugher Card s ased on he Slcon Laoraores S3044 Daa Access Arrangemen (DAA) (comned S3021 and S3015 chpse shown n Fg. 2), hs provdes a programmale lne nerface o mee gloal elephone lne nerface requremens (see S3044 Daa Shee, R2.01 (S3044-DS201)). nc Modem communcaon s a real-me process where daa mus e communcaed n oh drecons whn a fxed perod of me. If he modem does no mee real-me requremens, hen he modem mgh drop he connecon. In he SM, daa s sampled a 9.6KHz, so he SM mus process daa every Seconds. The LDR Sof Modem s capale of performng a full sue of modem funcons n real-me on he MCF5407. Daa ufferng s used o accommodae sress condons. The modem accumulaes a numer of samples n a uffer and processes hose samples whle gaherng he nex se of samples. Code opmzaon s also mporan, as opmzaon has archecural dependences. The mos crcal pars of he source code have een rewren n assemler, akng no accoun he ales of he MCF5407 (especally he MAC module). These assemly mplemenaons also nclude a C nerface. To enale he opmzed assemler source code, s requred o defne USE_OPTIMIZED_ASSEMBLER_CODE (By defaul hs s defned n n.h ). The mos mporan enef of usng he SM s he aly o upgrade he modem purely va sofware. Upgrades are ypcally provded o add new feaures, fx ugs or enhance modem performance. The feaures of he LDR Sof Modem archecure are: Flexle addon of new Daa Pump and Daa Handler proocols wh mnmum modfcaon requred o he curren source code. There s a poenal for use n mul-channel sysems. The daa nerface eween he Sof Modem modules uses a se of Crcular Buffers. I s eer o mplemen crcular uffers for he nerface. Ths approach nsulaes he modem locks runnng a dfferen synchronous and asynchronous raes. There s a well-defned dvson of daa processng eween he Daa Pump, he Daa Handler, and ohers modules of he Sof Modem. Separae modules can work synchronously y deecng he level o whch he Crcular Buffers are flled. 2-2 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
25 The Basc Blocks of he Sof Modem nc. 2.1 The Basc Blocks of he Sof Modem Ths secon s mporan for undersandng how he LDR Sof Modem works. Fgure 2-2 shows he Basc Blocks of he Sof Modem and he general flow of daa eween hem. Rx Daa Rx Daa Rx_uar_daa[] Rx_daa[] Rx_sample[] Handler Pump nc RS-232 Tx UART0 Rx UART0 Tx UART Inerface Rx UART Inerface Tex Response Tx_uar_daa[] Conrol ehavor of he Sof Modem Sae Machne Command Parser Tx Daa Handler Command Handler command[] Tx_daa[] Tx Daa Pump DAA Conrol Inerface Fgure 2-2. The Daa Flow Dagram Tx_sample[] Rx DAA Inerface Tx DAA Inerface Rx UART1 Tx UART1 The Sof Modem uses a se of seven crcular uffers, Tx_uar_daa[], Tx_daa[], Tx_sample[], Rx_uar_daa[], Rx_daa[], Rx_sample[] and command[], as daa nerfaces eween he funconal locks of he Sof Modem. Crcular n hs nsance, means ha he elemens are accessed sequenally unl he end of he uffer, hen wrap around o he egnnng agan. Block descrpons: Tx_sample[] s a crcular uffer ha he Tx Daa Pump wres he samples no. The Tx DAA Inerface reads hese samples drecly from Tx_sample[]. Tx_daa[] s a crcular uffer from whch he Tx Daa Pump ges he ransm daa symols. The Tx Daa Handler wres he daa symols o e ransmed no hs uffer. Tx_uar_daa[] s a crcular uffer from whch he Tx Daa Handler ges he ransm daa chars. The Rx UART Inerface wres daa chars receved from he DTE o e ransmed no hs uffer. Also, hs uffer s read y he Command Parser n order o deec AT commands enered y he user. DAA S3044 Phone Lne S/W Process Cyclc uffer H/W Module MOTOROLA Chaper 2. General Archecure 2-3
26 The Basc Blocks of he Sof Modem nc. nc Rx_sample[] s a crcular uffer from whch he Rx Daa Pump reads samples. The Rx DAA Inerface wres hese samples drecly no Rx_sample[]. Rx_daa[] s a crcular uffer no whch he Rx Daa Pump places receved daa symols. The Rx Daa Handler reads demodulaed or deeced daa symols from hs uffer. Rx_uar_daa[] s a crcular uffer no whch he Rx Daa Handler pus he receved daa chars. The Tx UART Inerface reads daa chars from hs uffer and sends hem o he DTE. Also hs uffer s used o wre daa y Tex Response funcons, n order o send nformave ex messages o he DTE. Command[] s a crcular uffer from whch he Command Handler ges he deeced commands and her parameers. The Command Parser wres deeced sequences of user commands wh parameers no hs uffer. Sae Machne s a op-level eny ha deermnes he ehavour of he Sof Modem, whch mplemens he role of he scheduler (supervsor). And has he capaly o change he parameers of any Sof Modem lock. Daa Handler s a op-level eny ha s nvoked y he scheduler o manage ransmsson of acual daa. Possle Daa Handlers can e: 1. Daa handler accordng o he ITU-T V.14 recommendaon. 2. Daa handler accordng o he ITU-T V.42 and V.42s recommendaon. 3. Daa handler ha performs physcal handshake, for example, accordng o V.22 or V.22s. 4. Daa handler accordng o he ITU-T V.8 recommendaon. The Daa Handler performs he acual handlng of s of daa. Daa Pump s a op-level eny ha s nvoked y he scheduler o manage he converson of dgal daa no sgnal samples ha can e sen over a phone lne and vce versa. Possle Daa Pump arrangemens can e: 1. Daa Pump accordng o he ITU-T V.21/V.22/V.22s or V.23 recommendaons. 2. Daa Pump ha mplemens a DTMF generaor. 3. Daa Pump ha mplemens a Tone Generaor and Deecor. 4. Daa Pump ha mplemens Rng deecon. Command Parser s a op-level eny ha s nvoked y he scheduler o mplemen AT command synax handlng. Ths wres all sequences of vald sysem commands o he command[] crcular uffer. Command Handler s a op-level eny ha s nvoked y he scheduler o nerpre AT commands and execue hem. I reads formaed commands from he command[] crcular uffer, ha are wren no y he Command Parser, n response o vald AT commands. 2-4 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
27 Samplng Frequency nc. Tex Response s a se of funcons ha perform nformave messagng o he DTE accordng o V.25er. DTE Inerface s a se of funcons ha perform communcaon eween he DCE and he DTE. I uses he UART0 module. DAA Inerface s a se of funcons ha mplemen conrol and neracon wh he Modem Daugher card ased on an negraed drec access arrangemen (DAA) S3044. I uses he UART1 module n modem mode (USART). 2.2 Samplng Frequency nc The samplng frequency used s 9600Hz. The 9600Hz samplng rae s praccal for several reasons: I s hgher han he Nyqus samplng frequency of approxmaely 8KHz for he elephone channel. I s a convenen mulple of he popular modem aud raes (75, 300, 600, 1200 and 2400 aud ec.) 2.3 Numerc Formas The Source code uses neger mah funcons only, no floang-pon operaon; hs allows he algorhms o e opmzed o he arge processor for speed. A lo of varales used n he modem are 16 sgned fraconal negers n Q14 and Q15 formas. In he case of Q14, hs means ha he ms s a sgn, he efore he ms s o he lef of he decmal pon and he remanng 14 s are o he rgh of he decmal pon. Therefore he numerc range s o correspondng o o , wh a quanzaon sep of 1/ For example, Q14 forma s used y he daa pump modules o represen a PCM sgnal. The header fle n.h conans a se of useful macros for operaon wh fraconal daa: //Samples ype represenaon #defne COS_BITS (14) //Q14 #defne COS_BASE (1 << COS_BITS) //One n Q14 /********************************************************************** MOTOROLA Chaper 2. General Archecure 2-5
28 Channel nc. * Converson from floa o fraconal ype Q14 **********************************************************************/ #defne CFF(x) (n16)((x)*cos_base) /********************************************************************** * Ge fraconal mulplcaon of Q14 **********************************************************************/ #defne MULT_FRAC(x,y) (((x)*(y))>>cos_bits) nc /********************************************************************** * Ge fraconal dvson of Q14 **********************************************************************/ #defne DIV_FRAC(x,y) (((x)<<cos_bits)/(y)) 2.4 Channel The Channel s he man conrol daa srucure, and s a mandaory parameer for mos of he Sof Modem funcons. I s acually a unon of he conrol srucures ha conans poners o he Transmer, Recever, DTE and DAA conrol srucures assocaed wh hs Channel. In oher words, he Channel s he roo of he Sof Modem. Through he Channel daa srucure, s possle o ge any curren parameer of he Sof Modem. The channel_ srucure s defned n modem.h : /********************************************************************** * Channel Srucure ***********************************************************************/ sruc channel_ { sruc Tx_conrol_ *Tx_conrol_pr; sruc Rx_conrol_ *Rx_conrol_pr; sruc sae_machne_ * sae_machne_pr; sruc uar_params_ * uar_conrol; 2-6 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
29 Channel nc. sruc daa_conrol_ * daa_conrol; }; nc The channel_ srucure parameer descrpons: Tx_conrol_pr - Poner o he Transmer conrol daa srucure (see chaper Transmer). Inalzed n Tx_channel_n(). Rx_conrol_pr - Poner o he Recever conrol daa srucure (see chaper Recever). Inalzed n Rx_channel_n(). sae_machne_pr - Poner o he Sae Machne conrol daa srucure (see chaper 2.5. Gloal Sae Machne). Inalzed n sae_machne_n( ). uar_conrol - Poner o he UART module conrol daa srucure (see chaper UART module). Inalzed n mcf5407_uar_n ( ). daa_conrol - Poner o he DAA Inerface conrol daa srucure (see chaper DAA Inerface). ). Inalzed n daa_n ( ) Transmer The Transmer conrol srucure s a consuen par of he Channel. I conans he parameers requred for he Tx Daa Handler, he Tx Daa Pump, he Command Parser, he Command Handler and he ransmer crcular daa uffer operaon. The Tx_conrol_ srucure s defned n modem.h : /********************************************************************** * Transmer conrol Srucure ***********************************************************************/ sruc Tx_conrol_ { enum Tx_sae_ sae; n16 *sample_pr; n16 *sample_head; n16 *sample_al; n16 *sample_end; un32 sample_lengh; un8 *daa_pr; un8 *daa_head; un8 *daa_al; un8 *daa_end; MOTOROLA Chaper 2. General Archecure 2-7
30 Channel nc. un32 daa_lengh; un8 *uar_daa_pr; un8 *uar_daa_head; un8 *uar_daa_al; un8 *uar_daa_end; un32 uar_daa_lengh; un32 *command_pr; un32 *command_head; un32 *command_al; nc un32 *command_end; un32 command_lengh; vod * daa_pump_pr; call_func_ daa_pump_call_func; un32 numer_samples; un8 n_s; un8 n_s_mask; un32 aud_rae; un32 process_coun; vod * daa_handler_pr; call_func_ daa_handler_call_func; enum Tx_DH_sae_ daa_handler_sae; un32 numer_n_s; vod * command_parser_pr; call_func_ command_parser_call_func; call_func_ command_handler_call_func; }; The Tx_conrol_ srucure parameer descrpons: sae - Sae denfer. I conans he curren sae of he ransmer. I s nalzed n Tx_channel_n() o TX_SILENCE_STATE. sample_pr - Poner o he Tx_sample[] crcular uffer. Users should no modfy hs poner. I s nalzed n Tx_channel_n() o he sar of Tx_sample[]. 2-8 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
31 Channel nc. nc sample_head - The Tx_sample[] crcular uffer wre poner. The Daa Pump modules modfy hs poner when wrng her samples no Tx_sample[]. I s nalzed n Tx_channel_n() o he sar of Tx_sample[]. sample_al - The Tx_sample[] crcular uffer read poner. The Tx DAA Inerface modfes hs poner when readng samples from Tx_sample[]. The Daa Pump modules don modfy hs poner. I s nalzed n Tx_channel_n() o he sar of Tx_sample[]. sample_end - Poner o he end of he Tx_sample[] crcular uffer. Users should no modfy hs poner. I s nalzed n Tx_channel_n() o he end of Tx_sample[]. sample_lengh - Lengh of he Tx_sample[] crcular uffer. Inalzed n Tx_channel_n(). The user mus ensure ha he sample_lengh s large enough o hold all of he samples generaed per call as specfed y he value of numer_samples. daa_pr - Poner o he Tx_daa[] crcular uffer. Users should no modfy hs poner. I s nalzed n Tx_channel_n() o he sar of Tx_daa[]. daa_head - The Tx_daa[] crcular uffer wre poner. The Daa Handler modules modfy hs poner when wrng symols o Tx_daa[]. I s nalzed n Tx_channel_n() o he sar of Tx_daa[]. daa_al - The Tx_daa[] crcular uffer read poner. The Daa Pump modules modfy hs poner when readng symols from Tx_daa[] for modulaon. I s nalzed n Tx_channel_n() o he sar of Tx_daa[]. daa_end - Poner o he end of he Tx_daa[] crcular uffer. Users should no modfy hs poner. I s nalzed n Tx_channel_n() o he end of Tx_daa[]. daa_lengh - Lengh of he Tx_daa[] crcular uffer. Inalzed n Tx_channel_n(). Users mus ensure ha he daa_lengh s large enough o hold all of he symols ha wll e modulaed y he curren Daa Pump. uar_daa_pr - Poner o he Tx_uar_daa[] crcular uffer. Users should no modfy hs poner. I s nalzed n Tx_channel_n() o he sar of Tx_uar_daa[]. uar_daa_head - The Tx_uar_daa[] crcular uffer wre poner. The UART nerface modfes hs poner when wrng characers no Tx_uar_daa[]. I s nalzed n Tx_channel_n() o he sar of Tx_uar_daa[]. uar_daa_al - The Tx_uar_daa[] crcular uffer read poner. The Daa Handler or Command Parser modfes hs poner when readng characers from Tx_uar_daa[] for furher processng. I s nalzed n Tx_channel_n() o he sar of Tx_uar_daa[]. uar_daa_end - Poner o he end of he Tx_uar_daa[] crcular uffer. Users should no modfy hs poner. I s nalzed n Tx_channel_n() o he end of Tx_uar_daa[]. MOTOROLA Chaper 2. General Archecure 2-9
32 Channel nc. nc uar_daa_lengh - Lengh of he Tx_uar_daa[] crcular uffer. Inalzed n Tx_channel_n(). command_pr - Poner o he command[] crcular uffer. Users should no modfy hs poner. I s nalzed n Tx_channel_n() o he sar of command[]. command_head - The command[] crcular uffer wre poner. The Command Parser modfes hs poner when wrng deeced sequences of user commands wh parameers o he command[]. I s nalzed n Tx_channel_n() o he sar of command[]. command_al - The command[] crcular uffer read poner. The Command Handler module modfes hs poner when readng commands and parameers from command[] for furher execuon. I s nalzed n Tx_channel_n() o he sar of command[]. command_end - Poner o he end of he command[] crcular uffer. Users should no modfy hs poner. I s nalzed n Tx_channel_n() o he end of command[]. command_lengh - Lengh of he command[] crcular uffer. Inalzed n Tx_channel_n(). daa_pump_pr - Poner o he curren Tx Daa Pump conrol srucure. Every Tx Daa Pump module can have s own conrol daa srucure. I s nalzed n Tx_channel_n() o NULL. daa_pump_call_func - Poner o he funcon call assocaed wh he curren Tx Daa Pump. The Tx_daa_pump() funcon smply calls whaever funcon hs poner s ponng o. I s nalzed n Tx_channel_n() o Tx_slence_gen() (Generaes slence). numer_samples - Specfes he numer of samples generaed y Tx_sample[] per call o he Tx_daa_pump(). I s nalzed n Tx_channel_n() o DEFAULT_NUMBER_SAMPLES (defned n modem.h ). n_s - Numer of s per symol for he curren modulaor. I s nalzed n Tx_channel_n() o 1. n_s_mask - B mask correspondng o (1<< n_s)-1. Can e used o mask for vald s when converng o symols for Tx_daa[]. I s nalzed n Tx_channel_n() o 1. aud_rae - Modulaor aud rae. I s nalzed n Tx_channel_n() o 0. process_coun - Specfes he maxmum numer of modulaor specfc operaons for compleon of he curren sae. For example, he DTMF generaor uses as a numer of modulaed dgs. I s nalzed n Tx_channel_n() o -1. daa_handler_pr - Poner o he curren Tx Daa Handler conrol srucure. Every Tx Daa Handler module can have s own conrol srucure. I s nalzed n Tx_channel_n() o NULL MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
33 Channel nc. nc daa_handler_call_func - Poner o he funcon call assocaed wh he curren Tx Daa Handler. The Tx_daa_handler() funcon smply calls whaever funcon hs poner s ponng o. I s nalzed n Tx_channel_n() o NULL. daa_handler_sae - Curren Tx Daa Handler sae denfer. I s nalzed n Tx_channel_n() o TX_DH_STATE_NORMAL. numer_n_s - Numer of elemens ha should e generaed n Tx_daa[] per call o Tx_daa_handler(). I s nalzed n Tx_channel_n() o DEFAULT_NUMBER_NBITS (defned n modem.h ). command_parser_pr - Poner o he curren Command Parser conrol daa srucure. I s nalzed n Tx_channel_n() o NULL. command_parser_call_func - Poner o he funcon call assocaed wh he curren Command Parser. The command_parser() funcon smply calls whaever funcon hs poner s ponng o. I s nalzed n Tx_channel_n() o NULL. command_handler_call_func - Poner o he funcon call assocaed wh he curren Command Handler. The command_handler() funcon smply calls whaever funcon hs poner s ponng o. I s nalzed n Tx_channel_n() o NULL Recever The Recever conrol srucure s a consuen par of he Channel. I conans he parameers requred for he Rx Daa Handler, he Rx Daa Pump and he recever crcular daa uffer operaon. The Rx_conrol_ srucure s defned n modem.h /********************************************************************** * Recever conrol Srucure ***********************************************************************/ sruc Rx_conrol_ { enum Rx_sae_ sae; n16 *sample_pr; n16 *sample_head; n16 *sample_al; n16 *sample_end; un32 sample_lengh; un8 *daa_pr; un8 *daa_head; MOTOROLA Chaper 2. General Archecure 2-11
34 Channel nc. un8 *daa_al; un8 *daa_end; un32 daa_lengh; un8 *uar_daa_pr; un8 *uar_daa_head; un8 *uar_daa_al; un8 *uar_daa_end; un32 uar_daa_lengh; vod * daa_pump_pr; nc }; call_func_ daa_pump_call_func; un32 numer_samples; un8 n_s; un8 n_s_mask; un32 aud_rae; un32 process_coun; vod * daa_handler_pr; call_func_ daa_handler_call_func; enum Rx_DH_sae_ daa_handler_sae; un32 numer_n_s; un32 connecon_code; The Tx_conrol_ srucure parameer descrpons: sae - Sae denfer. I conans he curren sae of he recever. I s nalzed n Rx_channel_n() o RX_IDLE_STATE. sample_pr - Poner o he Rx_sample[] crcular uffer. Users should no modfy hs poner. I s nalzed n Rx_channel_n() o he sar of Rx_sample[]. sample_head - The Rx_sample[] crcular uffer wre poner. The Rx DAA Inerface modfes hs poner when wrng he samples no Rx_sample[]. I s nalzed n Rx_channel_n() o he sar of Rx_sample[]. sample_al - The Rx_sample[] crcular uffer read poner. The Rx Daa Pump modules modfy hs poner when readng samples from Rx_sample[]. I s nalzed n Rx_channel_n() o he sar of Rx_sample[] MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
35 Channel nc. nc sample_end - Poner o he end of he Rx_sample[] crcular uffer. Users should no modfy hs poner. I s nalzed n Rx_channel_n() o he end of Rx_sample[]. sample_lengh - Lengh of he Rx_sample[] crcular uffer. Inalzed n Rx_channel_n(). daa_pr - Poner o he Rx_daa[] crcular uffer. Users should no modfy hs poner. I s nalzed n Rx_channel_n() o he sar of Rx_daa[]. daa_head - The Rx_daa[] crcular uffer wre poner. The Daa Pump modules modfy hs poner when wrng symols no Rx_daa[]. I s nalzed n Rx_channel_n() o he sar of Rx_daa[]. daa_al - The Rx_daa[] crcular uffer read poner. The Daa Handler modules modfy hs poner when readng symols from Rx_daa[] for furher processng. I s nalzed n Rx_channel_n() o he sar of Rx_daa[]. daa_end - Poner o he end of he Rx_daa[] crcular uffer. Users should no modfy hs poner. I s nalzed n Rx_channel_n() o he end of Rx_daa[]. daa_lengh - Lengh of he Rx_daa[] crcular uffer. Inalzed n Rx_channel_n(). Users mus ensure ha he daa_lengh s large enough o hold all of he symols ha wll e demodulaed y he curren Daa Pump. uar_daa_pr - Poner o he Rx_uar_daa[] crcular uffer. Users should no modfy hs poner. I s nalzed n Rx_channel_n() o he sar of Rx_uar_daa[]. uar_daa_head - The Rx_uar_daa[] crcular uffer wre poner. The Daa Handler modules modfy hs poner when wrng characers no Rx_uar_daa[]. I s nalzed n Rx_channel_n() o he sar of Rx_uar_daa[]. uar_daa_al - The Rx_uar_daa[] crcular uffer read poner. The UART Inerface modfes hs poner when readng characers from Rx_uar_daa[] for sendng o he DTE. I s nalzed n Rx_channel_n() o he sar of Rx_uar_daa[]. uar_daa_end - Poner o he end of he Rx_uar_daa[] crcular uffer. Users should no modfy hs poner. I s nalzed n Rx_channel_n() o he end of Rx_uar_daa[]. uar_daa_lengh - Lengh of he Rx_uar_daa[] crcular uffer. Inalzed n Rx_channel_n(). daa_pump_pr - Poner o he curren Rx Daa Pump conrol srucure. Every Daa Pump module can have s own conrol daa srucure. Inalzed n Rx_channel_n() o NULL. daa_pump_call_func - Poner o he funcon call assocaed wh he curren Rx Daa Pump. The Rx_daa_pump() funcon smply calls whaever funcon hs MOTOROLA Chaper 2. General Archecure 2-13
36 Gloal Sae Machne nc. nc poner s ponng o. I s nalzed n Rx_channel_n() o Rx_dle() (Dscards samples from he Rx_sample[] ). numer_samples - Specfes he numer of samples ha should e n Rx_sample[] efore an Rx_daa_pump() call. I s nalzed n Rx_channel_n() o DEFAULT_NUMBER_SAMPLES (defned n modem.h ). n_s - Numer of s per symol for he curren demodulaor. Inalzed n Rx_channel_n() o 1. n_s_mask - B mask correspondng o (1<< n_s)-1. Can e used o mask for vald s when converng o symols from Rx_daa[]. Inalzed n Rx_channel_n() o 1. aud_rae - Demodulaor aud rae. I s nalzed n Rx_channel_n() o 0. process_coun - Specfes he maxmum numer of demodulaor specfc operaons for compleon of he curren sae. For example, Rng deecor uses as numer of Rng cadence o e deeced. I s nalzed n Rx_channel_n() o -1. daa_handler_pr - Poner o curren Rx Daa Handler conrol srucure. Every Rx Daa Handler module can have s own conrol srucure. I s nalzed n Rx_channel_n() o NULL. daa_handler_call_func - Poner o he funcon call assocaed wh he curren Rx Daa Handler. The Rx_daa_handler() funcon smply calls whaever funcon hs poner s ponng o. I s nalzed n Rx_channel_n() o NULL. daa_handler_sae - Curren Rx Daa Handler sae denfer. I s nalzed n Rx_channel_n() o RX_DH_STATE_NORMAL. numer_n_s - Specfes he numer of elemens ha should e n Rx_daa[] efore a daa_handler_call_func() call. I s nalzed n Rx_channel_n() o DEFAULT_NUMBER_NBITS (defned n modem.h ). connecon_code - Conans wo connecon responses used for prnng o he DTE afer he Handshake s complee. The Daa Handler module modfes hs value afer proocol handshake compleon. I s nalzed n Rx_channel_n() o Gloal Sae Machne The Gloal Sae Machne deermnes he ehavor of he Sof Modem. I mplemens he role of he scheduler (supervsor). The Sae Machne s responsle for proper nalzaon and callng of he Daa Pump, he Daa Handler, he Command Parser and Command Handler and oher locks accordng o he Sof Modem sengs. The descrpon of he Gloal Sae Machne saes can e found n Tale 2.5. The graphcal represenaon of s represened n Fg 2.5. The sae_machne_ srucure s defned n sae_machne.h : 2-14 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
37 Gloal Sae Machne nc. /************************************************************************ * Saes of he Gloal Sae Machne ************************************************************************/ enum sm_sae_ {SM_INITIALIZATION_STATE, SM_RESET_COMMAND_STATE, SM_COMMAND_STATE, SM_INIT_ON_LINE_COMMAND_STATE, SM_ON_LINE_COMMAND_STATE, SM_INIT_ON_LINE_STATE, nc SM_ON_LINE_STATE, SM_INIT_PRE_DIAL_STATE, SM_PRE_DIAL_PAUSE_STATE, SM_DIALTONE_DET_STATE, SM_INIT_DIALING_STATE, SM_DIALING_STATE, SM_PRE_PHISICAL_HANDSHAKING_STATE, SM_PHISICAL_HANDSHAKING_STATE, SM_PROTOCOL_HANDSHAKING_STATE, SM_INIT_RETRAIN_STATE, SM_RETRAIN_STATE, SM_INIT_PRE_ANSWERTONE_PAUSE_STATE, SM_PRE_ANSWERTONE_PAUSE_STATE, SM_INIT_AFTER_ANSWERTONE_PAUSE_STATE, SM_AFTER_ANSWERTONE_PAUSE_STATE, SM_INIT_ANSWERTONE_GEN_STATE, SM_ANSWERTONE_GEN_STATE, SM_INIT_ANSWERTONE_DET_STATE, SM_ANSWERTONE_DET_STATE, SM_INIT_V8_HANDSHAKING_STATE, SM_V8_HANDSHAKING_STATE, SM_INIT_LOOPBACK_STATE}; MOTOROLA Chaper 2. General Archecure 2-15
38 Gloal Sae Machne nc. /************************************************************************ * The Sae Machne Srucure *************************************************************************/ sruc sae_machne_ { enum sm_sae_ sae; }; nc The sae_machne_ srucure parameer descrpons: sae - Conans he curren sae of he Gloal Sae Machne. I s nalzed n sae_machne_n () o SM_INITIALIZATION_STATE. Tale 2-1. The Gloal Sae Machne Saes Name of he Sae Acves Ex Saes SM_INITIALIZATION_STATE SM_RESET_COMMAND_STATE SM_COMMAND_STATE SM_INIT_ON_LINE_COMMAND_STATE SM_ON_LINE_COMMAND_STATE Inalses he Command Parser and he Command Handler. Reses he Recever and he Transmer. Inalses he Rng Deecor. Calls he Command Parser, he Command Handler and he Rx Daa Pump (Rng Deecor). If a Rng s deeced, sends a RING response o he DTE. Sends an OK response o he DTE. Ses he mode of he Rx & Tx Daa Handler and he Command Parser o he Onlne command mode. Calls he Tx & Rx Daa Pumps. Calls he Tx & Rx Daa Handlers. Calls he Command Parser and he Command Handler. On he reak of lne even, goes on-hook and sends he NO CARRIER response o he DTE. SM_RESET_COMMAND_STATE SM_COMMAND_STATE 1)SM_COMMAND_STATE : By defaul. 2)SM_INIT_PRE_ANSWERTONE_PAUS E_STATE: If S0 s less or equal o S1. On an AT A command. 3)SM_INIT_PRE_DIAL_STATE: On an AT D command. 4)SM_RESET_COMMAND_STATE: On an AT H command. 5)SM_INIT_LOOPBACK_STATE: On an AT &T command. 6)SM_INITIALIZATION_STATE: On an AT Z command. SM_ON_LINE_COMMAND_STATE 1)SM_ON_LINE_COMMAND_STATE: By defaul. 2) SM_ON_LINE_STATE: On an AT O command. 3)SM_INITIALIZATION_STATE: On an AT Z command MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
39 Gloal Sae Machne nc. Tale 2-1. The Gloal Sae Machne Saes (connued) Name of he Sae Acves Ex Saes nc SM_INIT_ON_LINE_STATE SM_ON_LINE_STATE SM_INIT_PRE_DIAL_STATE SM_PRE_DIAL_PAUSE_STATE SM_DIALTONE_DET_STATE SM_INIT_DIALING_STATE Inalses he Rx & Tx Daa Pumps, and he Rx & Tx Daa Handlers (Handshaker) accordng o he chosen proocol and speed (V.21, V.23, V.22, V.22s) Calls he Tx & Rx Daa Pumps. Calls he Tx & Rx Daa Handlers. Calls he Command Parser for he Escape Sequence deecon. On he reak of lne even, goes on-hook. If AT X2 or X4 s se, nalses he Tone Deecor as he Dal one deecor, oherwse (No Dal one deecon or Blnd Dalng) nalses he Tone Generaor as he Slence one generaor. And goes off-hook. Calls he Rx Daa Pump (Idle mode) and he Tx Daa Pump (Slence Generaor). On recep of any characer from he DTE, goes on-hook and sends he NO CARRIER response o he DTE. Calls he Tx Daa Pump (Slence generaor) and he Rx Daa Pump (Dal Tone Deecor). On he recep of any characer from he DTE, goes on-hook and sends he NO CARRIER response o he DTE. If he Dal Tone was no deeced durng a fxed perod of me, goes on-hook and sends he NO DIAL TONE response o he DTE. Flls he Tx_daa[] uffer wh dal dgs. nalzes he DTMF daler or he Pulse daler (f Pulse dalng s enaled n he S[13] regser) 1)SM_PRE_PHISICAL_HANDSHAKING_ STATE: If he Channel s n he callng mode. 2)SM_PHISICAL_HANDSHAKING_STAT E: If he Channel s n he answerng mode. 1)SM_ON_LINE_STATE: By defaul. 2)SM_INIT_RETRAIN_STATE: On Reran sequence deecon. 3)SM_RESET_COMMAND_STATE: On he Break of he lne. 4)SM_INIT_ON_LINE_COMMAND_STAT E: If he Escape sequence s deeced and he Go o On-lne command mode on escape code s se n he S18 regser. 1)SM_PRE_DIAL_PAUSE_STATE: If AT X0 was se efore. If AT X1 was se efore. If AT X3 was se efore. 2)SM_DIALTONE_DET_STATE: If AT X2 was se efore. If AT X4 was se efore. 1)SM_PRE_DIAL_PAUSE_STATE: By defaul. 2)SM_INIT_DIALING_STATE: On he compleon of he Slence Generaon. 3)SM_RESET_COMMAND_STATE: On he recepon of any characer from he DTE. 1)SM_DIALTONE_DET_STATE: By defaul. 2)SM_INIT_DIALING_STATE: If he Dal Tone s deeced durng a fxed me. 3)SM_RESET_COMMAND_STATE: On he recepon of any characer from he DTE. If he Dal Tone s no deeced durng a fxed perod of me. SM_DIALING_STATE MOTOROLA Chaper 2. General Archecure 2-17
40 Gloal Sae Machne nc. Tale 2-1. The Gloal Sae Machne Saes (connued) Name of he Sae Acves Ex Saes nc SM_DIALING_STATE SM_PRE_PHISICAL_HANDSHAKING_STAT E SM_PHISICAL_HANDSHAKING_STATE SM_PROTOCOL_HANDSHAKING_STATE Calls he Tx Daa Pump (The DTMF or Pulse daler) and he Rx Daa Pump (Idle mode). On he recep of any characer from he DTE, goes on-hook and sends he NO CARRIER response o he DTE. Calls he Rx Daa Handler (Handshaker) and he Rx Daa Pump. On he recep of any characer from he DTE and on he reak of he lne even, goes on-hook and sends he NO CARRIER response o he DTE. Calls he Tx & Rx Daa Handlers (Handshaker) and he Tx & Rx Daa Pumps. When he Rx Daa Handler (Handshaker) curren sae s complee, nalzes he V.14 or V.42 Daa Handler, and mues he speaker on he modem daugher card. On recevng any characer from he DTE and on he reak of he lne even, goes on-hook and sends he NO CARRIER response o he DTE. Calls he Tx & Rx Daa Handlers (Handshaker) and he Tx & Rx Daa Pumps. When he Rx Daa Handler (Handshaker) curren sae s complee, sends he CONNECT XXX response o he DTE. On he recep of any characer from he DTE or on he reak of he lne even, goes on-hook and sends he NO CARRIER response o he DTE. 1)SM_DIALING_STATE : By defaul. 2)SM_INIT_ANSWERTONE_DET_STAT E: If dalng s compleed and reurn o command mode afer dalng (H[2] regser) s dsaled. 3)SM_RESET_COMMAND_STATE: On he recepon of any characer from he DTE. If dalng s compleed and reurn o command mode afer dalng (H[2] regser) s enaled. 1)SM_PRE_PHISICAL_HANDSHAKING_ STATE: By defaul. 2)SM_PHISICAL_HANDSHAKING_STAT E: If he Rx Daa Handler (Handshaker) curren sae s complee. 3)SM_RESET_COMMAND_STATE: On he recepon of any characer from he DTE. On he Break of lne. 1)SM_PHISICAL_HANDSHAKING_STAT E: By defaul. 2)SM_PROTOCOL_HANDSHAKING_ST ATE: When he Rx Daa Handler (Handshaker) curren sae s complee. 3)SM_INIT_RETRAIN_STATE: On he Reran sequence deecon. 4)SM_RESET_COMMAND_STATE: On he recepon of any characer from he DTE. On he Break of he lne. 1)SM_PROTOCOL_HANDSHAKING_ST ATE: By defaul. 2) SM_ON_LINE_STATE: When he Rx Daa Handler (Handshaker) curren sae s complee. 3)SM_INIT_RETRAIN_STATE: On he Reran sequence deecon. 4)SM_RESET_COMMAND_STATE: On he recepon of any characer from he DTE. On he Break of he lne MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
41 Gloal Sae Machne nc. Tale 2-1. The Gloal Sae Machne Saes (connued) Name of he Sae Acves Ex Saes nc SM_INIT_RETRAIN_STATE SM_RETRAIN_STATE SM_INIT_PRE_ANSWERTONE_PAUSE_STA TE SM_PRE_ANSWERTONE_PAUSE_STATE SM_INIT_AFTER_ANSWERTONE_PAUSE_S TATE If he curren Daa Pump s n he 2400ps V.22s mode, nalzes V.22s Handshake n he Reran mode. Calls he Tx & Rx Daa Handlers (Handshaker) and he Tx & Rx Daa Pumps. When he Rx Daa Handler (Handshaker) curren sae s complee, loads he saved parameers of he old Daa Handler. If he varale reurn_sm_sae s equal o SM_ON_LINE_STATE, calls he Command Parser for Escape Sequence deecon, oherwse on he recep of any characer from he DTE goes on-hook and sends he NO CARRIER response o he DTE. On he reak of he lne even, goes on-hook and sends he NO CARRIER response o he DTE. I nalzes he Tone Generaor as he Slence one generaor. And goes off-hook. Calls he Rx Daa Pump (Idle mode) and he Tx Daa Pump (Slence Generaor). On he recep of any characer from he DTE, goes on-hook and sends he NO CARRIER response o he DTE. I nalzes he Tone Generaor as he Slence one generaor. 1)SM_RETRAIN_STATE: ² By defaul. 2)SM_PHISICAL_HANDSHAKING_STAT E: ² If he varale reurn_sm_sae s equal o SM_PHISICAL_HANDSHAKING_STATE. 3) The sae s equal o he value of he reurn_sm_sae varale: ² If he curren Daa Pump s no n he 2400ps V.22s mode. 1)SM_RETRAIN_STATE: By defaul. 2) The sae equals o he value of he reurn_sm_sae varale: When he Rx Daa Handler (Handshaker) curren sae s complee. 3)SM_INIT_RETRAIN_STATE: On he Reran sequence deecon. 4)SM_RESET_COMMAND_STATE: On he recepon of any characer from he DTE and when he reurn_sm_sae varale s no equal o SM_ON_LINE_STATE. On he Break of he lne. 4)SM_INIT_ON_LINE_COMMAND_STAT E: On Escape sequence s deeced, Go o On-lne command mode on escape code s se n he S18 regser, and he reurn_sm_sae varale s equal o SM_ON_LINE_STAT. SM_PRE_ANSWERTONE_PAUSE_STAT E 1)SM_PRE_ANSWERTONE_PAUSE_ST ATE : By defaul. 2)SM_INIT_ANSWERTONE_GEN_STAT E: If Slence Generaon s compleed. 3)SM_RESET_COMMAND_STATE: On he recepon of any characer from he DTE. SM_AFTER_ANSWERTONE_PAUSE_S TATE MOTOROLA Chaper 2. General Archecure 2-19
42 Gloal Sae Machne nc. Tale 2-1. The Gloal Sae Machne Saes (connued) Name of he Sae Acves Ex Saes nc SM_AFTER_ANSWERTONE_PAUSE_STATE Calls he Rx Daa Pump (Idle mode) and he Tx Daa Pump (Slence Generaor). On he recep of any characer from he DTE, goes on-hook and sends he NO CARRIER response o he DTE. SM_INIT_ANSWERTONE_GEN_STATE SM_ANSWERTONE_GEN_STATE SM_INIT_ANSWERTONE_DET_STATE SM_ANSWERTONE_DET_STATE SM_INIT_V8_HANDSHAKING_STATE If V.8 s dsaled (S[19] regser), nalzes he Tone Generaor as he Answer (ANS) one generaor, oherwse as he ANSam one generaor. Calls he Tx Daa Pump (ANS or ANSam generaor). If V.8 s enaled calls he Rx Daa Handler (V.8) and he Rx Daa Pump (V.21), oherwse calls only he Rx Daa Pump (Idle mode). If V.8 s enaled, on he end of an Answer one generaon, nalzes he V.21 Tx Daa Pump. On he recep of any characer from he DTE, goes on-hook and sends he NO CARRIER response o he DTE. If AT X3 or X4 s se, adds he Busy one deecon o he Tone Deecor. I also adds he End of Answer (ANS) Tone deecon o he Tone Deecor. If V8 proocol s enaled (S[19] regser), adds he ANSam one deecon o he Tone Deecor. Calls he Tx Daa Pump (Slence generaor) and he Rx Daa Pump (Tone Deecor). On he recep of any characer from he DTE, goes on-hook and sends he NO CARRIER response o he DTE. If he Busy Tone was deeced, goes on-hook and sends he BUSY response o he DTE. If no ones were deeced durng a fxed perod of me, goes on-hook and sends he NO ANSWER response o he DTE. Inalses he V.8 Rx and Tx Daa Handlers. Inalses he V.21 Rx Daa Pump. If he Channel s n callng mode (S[13] regser), nalzes he V.21 Tx Daa Pump. 1)SM_AFTER_ANSWERTONE_PAUSE_ STATE: By defaul. 2)SM_INIT_ON_LINE_STATE: If he Slence Generaon s compleed. 3)SM_RESET_COMMAND_STATE: On he recepon of any characer from he DTE. 1)SM_ANSWERTONE_GEN_STATE: If V.8 s dsaled. 2)SM_INIT_V8_HANDSHAKING_STATE: If V.8 s enaled. 1) SM_ANSWERTONE_GEN_STATE: By defaul. 2) SM_V8_HANDSHAKING_STATE: A he end of Answer Tone generaon f V.8 s enaled. 3)SM_INIT_AFTER_ANSWERTONE_PA USE_STATE: A he end of Answer Tone generaon, f V.8 s dsaled.. 4)SM_RESET_COMMAND_STATE: On he recepon of any characer from he DTE. SM_ANSWERTONE_DET_STATE 1)SM_ANSWERTONE_DET_STATE : By defaul. 2)SM_INIT_ON_LINE_STATE: When he End of Answer (ANS) Tone s deeced. 3)SM_INIT_V8_HANDSHAKING_STATE: When he ANSam Tone s deeced. 3)SM_RESET_COMMAND_STATE: On he recepon of any characer from he DTE. When no ones were deeced durng a fxed perod of me. When he Busy one s deeced. 1) SM_V8_HANDSHAKING_STATE : If he Channel s n callng mode. 2) SM_ANSWERTONE_GEN_STATE: If he Channel s n answerng mode MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
43 Gloal Sae Machne nc. Tale 2-1. The Gloal Sae Machne Saes (connued) Name of he Sae Acves Ex Saes nc SM_V8_HANDSHAKING_STATE SM_INIT_LOOPBACK_STATE Calls he Tx & Rx Daa Handlers (V.8 Handshaker) and he Tx & Rx Daa Pumps. On he recep of any characer from he DTE and on he reak of he lne even, goes on-hook and sends he NO CARRIER response o he DTE. Ses UART1 o local loop ack mode. Inalses he Rx & Tx Daa Pumps, and he Rx & Tx Daa Handlers (Handshaker) accordng o he chosen proocol and speed ( V.21, V.23, V.22, V.22s). 1)SM_V8_HANDSHAKING_STATE: By defaul. 2)SM_INIT_AFTER_ANSWERTONE_PA USE_STATE: When he Rx Daa Handler (Handshaker) curren sae s complee. 3)SM_RESET_COMMAND_STATE: On he recepon of any characer from he DTE. On he Break of he lne. SM_PHISICAL_HANDSHAKING_STATE 5HVHW %(*,1 60B,1,7,$/,=$7,21B67$7( 60B5(6(7B&200$1'B67$7( 5HVHW 60B&200$1'B67$7( 60B,1,7B35(B',$/B67$7( 60B',$/721(B'(7B67$7( 60B35(B',$/B3$86(B67$7( 5HVHW 60B,1,7B',$/,1*B67$7( 60B',$/,1*B67$7( 60B,1,7B$16:(5721(B'(7B67$7( 60B$16:(5721(B'(7B67$7( 60B,1,7B9B+$1'6+$.,1*B67$7( 60B9B+$1'6+$.,1*B67$7( 5HVHW 60B,1,7B21B/,1(B67$7( 60B35(B3+,6,&$/B+$1'6+$.,1*B67$7( 5HWUDLQ 60B3+,6,&$/B+$1'6+$.,1*B67$7( 60B35272&2/B+$1'6+$.,1*B67$7( 60B,1,7B35(B$16:(5721(B3$86(B67$7( 60B35(B$16:(5721(B3$86(B67$7( 60B,1,7B$16:(5721(B*(1B67$7( 60B$16:(5721(B*(1B67$7( 60B,1,7B$)7(5B$16:(5721(B3$86(B67$7( 60B$)7(5B$16:(5721(B3$86(B67$7( 5HVHW 5HVHW 60B,1,7B5(75$,1B67$7( 60B5(75$,1B67$7( 60B21B/,1(B67$7( 60B,1,7B21B/,1(B&200$1'B67$7( 5HWUDLQ 60B21B/,1(B&200$1'B67$7( 6WDWH Fgure 2-3. Gloal Sae Machne MOTOROLA Chaper 2. General Archecure 2-21
44 Gloal Sae Machne nc. sae_machne_n Call(s): vod sae_machne_n(sruc channel_* channel, Argumens: sruc sae_machne_* sm); Tale 2-2. sae_machne_n argumens channel n Poner o he Channel conrol daa srucure sm n Poner o he Sae Machne conrol daa srucure nc Descrpon: Ths funcon nalzes he Sae Machne conrol daa srucure. I mus e called efore callng he sae_machne() funcon. Ths funcon s called once n man(). Reurns: None. Code example: sruc channel_ channel; sruc sae_machne_ sm; sae_machne_n(&channel, &sm); 2-22 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
45 Gloal Sae Machne nc. sae_machne Call(s): vod sae_machne(sruc channel_ * channel); Argumens: Tale 2-3. sae_machne argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Ths funcon mplemens he Gloal Sae Machne of he Sof Modem. The descrpon of each sae s n Tale 2.5. Ths funcon s called n man(). Reurns: None. Code example: sruc channel_ channel; sruc sae_machne_ sm; sae_machne_n(&channel, &sm); sae_machne(&channel); MOTOROLA Chaper 2. General Archecure 2-23
46 Inerface nc. 2.6 Inerface Ths secon descres he common funcons and some daa srucures used n he Sof Modem Gloal Daa Srucures Ths secon descres he gloal daa srucures ha are used n he Sof Modem. They are declared n he modem.c fle. Tale 2-4. Gloal Daa Srucures nc sruc channel_* CURRENT_CHANNEL cons un8 SUPPORT_COUNTRIES[NUMBER_SUPPORT_COUNTRIES] un8 S[S_NUMBER] cons un8 S_FACTORY_DEFAULT [S_NUMBER] un8 H[H_NUMBER] cons un8 H_FACTORY_DEFAULT [H_NUMBER] Crcular Buffer Inlne Funcons Poner o he Curren Channel conrol srucure used y he nerrup rounes. I s nalzed y he gloal_srucure_n() funcon. Array of counres ha are suppored y he curren verson of he Sof Modem. Array of "S Regsers". I s nalzed y he gloal_srucure_n() funcon. These regsers are accessed va AT commands for seng he modem confguraon parameers and esalshng modem defaul ehavor. The S regsers are used o provde adjusaly whle avodng unnecessary codng changes. Facory-defned Confguraon of he S-regsers, conans he defaul characers and values used y he Sof Modem modules, hese are frmware, and can e modfed a comple me. Array of "Hdden Regsers". I s nalzed y he gloal_srucure_n() funcon. Ths array of regsers s no accessed va AT commands drecly and s nernally used y he Sof Modem modules. Facory-defned Confguraon of H-regsers, conans he defaul values used y he Sof Modem modules, hese are frmware, and can e modfed a comple me. These funcons nroduce convenen access o he elemens of he Sof Modem crcular uffers: Tx_sample[], Rx_sample[], Tx_daa[], Rx_daa[], Tx_uar_daa[], Rx_uar_daa[] and command[] MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
47 Inerface nc. Tx_sample_wre Call(s): nlne vod Tx_sample_wre (sruc Tx_conrol_ *Tx_conrol, Argumens: n16 sample); Tale 2-5. Tx_sample_wre argumens Tx_conrol n Poner o he Transmer conrol daa srucure sample n Sample for wrng o he Tx_sample[] crcular uffer nc Descrpon: Reurns: None. Code example: sruc Tx_conrol_ Tx_conrol; n16 sample=0; Ths funcon wres he sample no he Tx_sample[] crcular uffer o he poson poned o y Tx_conrol->sample_head, hen updaes he Tx_conrol->sample_head o he nex poson n he uffer. Tx_sample_wre (&Tx_conrol, sample); MOTOROLA Chaper 2. General Archecure 2-25
48 Inerface nc. Tx_sample_read Call(s): nlne n16 Tx_sample_read (sruc Tx_conrol_ *Tx_conrol); Argumens: Tale 2-6. Tx_sample_read argumens Tx_conrol n Poner o he Transmer conrol daa srucure nc Descrpon: Reurns: Code example: sruc Tx_conrol_ Tx_conrol; n16 sample; sample=tx_sample_read (&Tx_conrol); Ths funcon reads he value of he curren elemen n he Tx_sample[] crcular uffer poned o y Tx_conrol->sample_al, hen updaes Tx_conrol->sample_al o he nex poson n he uffer. Value of he elemen poned o y Tx_conrol->sample_al MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
49 Inerface nc. Rx_sample_wre Call(s): nlne vod Rx_sample_wre (sruc Rx_conrol_ *Rx_conrol, n16 sample); Argumens: Tale 2-7. Rx_sample_wre argumens Rx_conrol n Poner o he Recever conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon wres he sample no he Rx_sample[] crcular uffer o he poson poned o y Rx_conrol->sample_head, hen updaes Rx_conrol->sample_head o he nex poson n he uffer. None. sruc Rx_conrol_ Rx_conrol; n16 sample=0; Rx_sample_wre (&Rx_conrol, sample); sample n Sample for wrng o he Rx_sample[] crcular uffer MOTOROLA Chaper 2. General Archecure 2-27
50 Inerface nc. Rx_sample_read Call(s): nlne n16 Rx_sample_read (sruc Rx_conrol_ *Rx_conrol); Argumens: Tale 2-8. Rx_sample_read argumens Rx_conrol n Poner o he Recever conrol daa srucure nc Descrpon: Ths funcon reads he value of he curren elemen n he Rx_sample[] crcular uffer poned o y Rx_conrol->sample_al, hen updaes Rx_conrol->sample_al o he nex poson n he uffer. Reurns: Code example: sruc Rx_conrol_ Rx_conrol; n16 sample; sample=rx_sample_read (&Rx_conrol); Value of he elemen poned o y Rx_conrol->sample_al MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
51 Inerface nc. Tx_daa_wre Call(s): nlne vod Tx_daa_wre (sruc Tx_conrol_ *Tx_conrol, un8 daa) Argumens: Tale 2-9. Tx_daa_wre argumens Tx_conrol n Poner o he Transmer conrol daa srucure nc Descrpon: Reurns: None. Code example: sruc Tx_conrol_ Tx_conrol; un8 daa=0; Tx_daa_wre (&Tx_conrol, daa); daa n Symol for wrng o he Tx_daa[] crcular uffer Ths funcon wres daa no he Tx_daa[] crcular uffer o he poson poned o y Tx_conrol->daa_head, hen updaes Tx_conrol->daa_head o he nex poson n he uffer. MOTOROLA Chaper 2. General Archecure 2-29
52 Inerface nc. Tx_daa_read Call(s): nlne un8 Tx_daa_read (sruc Tx_conrol_ *Tx_conrol); Argumens: Tale Tx_daa_read argumens Tx_conrol n Poner o he Transmer conrol daa srucure nc Descrpon: Reurns: Code example: sruc Tx_conrol_ Tx_conrol; un8 daa; daa=tx_daa_read (&Tx_conrol); Ths funcon reads he value of he curren elemen n he Tx_daa[] crcular uffer poned o y Tx_conrol->daa_al, hen updaes Tx_conrol->daa_al o he nex poson n he uffer. Value of he elemen poned o y Tx_conrol->daa_al 2-30 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
53 Inerface nc. Rx_daa_wre Call(s): nlne vod Rx_daa_wre (sruc Rx_conrol_ *Rx_conrol, un8 daa) Argumens: Tale Rx_daa_wre argumens Rx_conrol n Poner o he Recever conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon wres he daa no he Rx_daa[] crcular uffer o he poson poned o y Rx_conrol->daa_head, hen updaes Rx_conrol->daa_head o he nex poson n he uffer. None. sruc Rx_conrol_ Rx_conrol; un8 daa=0; Rx_daa_wre (&Rx_conrol, daa); daa n Symol for wrng o he Rx_daa[] crcular uffer MOTOROLA Chaper 2. General Archecure 2-31
54 Inerface nc. Rx_daa_read Call(s): nlne un8 Rx_daa_read (sruc Rx_conrol_ *Rx_conrol); Argumens: Tale Rx_daa_read argumens Rx_conrol n Poner o he Recever conrol daa srucure nc Descrpon: Reurns: Code example: sruc Rx_conrol_ Rx_conrol; un8 daa; daa=rx_daa_read (&Rx_conrol); Ths funcon reads he value of he curren elemen n he Rx_daa[] crcular uffer poned o y Rx_conrol->daa_al, hen updaes Rx_conrol->daa_al o he nex poson n he uffer. Value of he elemen poned o y Rx_conrol->daa_al MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
55 Inerface nc. Tx_uar_daa_wre Call(s): nlne vod Tx_uar_daa_wre (sruc Tx_conrol_ *Tx_conrol, un8 uar_daa); Argumens: Tale Tx_uar_daa_wre argumens nc Descrpon: Reurns: Code example: Ths funcon wres he uar_daa no he Tx_uar_daa[] crcular uffer no he poson poned o y Tx_conrol->uar_daa_head, hen updaes Tx_conrol->uar_daa_head o he nex poson n he uffer. None. sruc Tx_conrol_ Tx_conrol; un8 characer= a ; Tx_uar_daa_wre (&Tx_conrol, characer); Tx_conrol n Poner o he Transmer conrol daa srucure uar_daa n Characer for wrng o he Tx_uar_daa[] crcular uffer MOTOROLA Chaper 2. General Archecure 2-33
56 Inerface nc. Tx_uar_daa_read Call(s): nlne un8 Tx_uar_daa_read (sruc Tx_conrol_ *Tx_conrol); Argumens: Tale Tx_uar_daa_read argumens Tx_conrol n Poner o he Transmer conrol daa srucure nc Descrpon: Reurns: Code example: sruc Tx_conrol_ Tx_conrol; un8 characer; Ths funcon reads he value of he curren elemen n he Tx_uar_daa[] crcular uffer poned o y Tx_conrol->uar_daa_al, hen updaes Tx_conrol->uar_daa_al o he nex poson n he uffer. Value of he elemen poned o y Tx_conrol->uar_daa_al. characer=tx_uar_daa_read (&Tx_conrol); 2-34 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
57 Inerface nc. Rx_uar_daa_wre Call(s): nlne vod Rx_uar_daa_wre (sruc Rx_conrol_ *Rx_conrol, un8 uar_daa) Argumens: Tale 1: Rx_uar_daa_wre argumens Rx_conrol n Poner o he Recever conrol daa srucure nc Descrpon: Reurns: uar_daa n Symol for wrng o he Rx_uar_daa[] crcular uffer Code example: Ths funcon wres he uar_daa no he Rx_daa[] crcular uffer o he poson poned o y Rx_conrol->uar_daa_head, hen updaes Rx_conrol->uar_daa_head o he nex poson n he uffer. None. sruc Rx_conrol_ Rx_conrol; un8 characer= a ; Rx_uar_daa_wre (&Rx_conrol, characer); MOTOROLA Chaper 2. General Archecure 2-35
58 Inerface nc. Rx_uar_daa_read Call(s): nlne un8 Rx_uar_daa_read (sruc Rx_conrol_ *Rx_conrol); Argumens: Tale Rx_uar_daa_read argumens Rx_conrol n Poner o he Recever conrol daa srucure nc Descrpon: Reurns: Code example: sruc Rx_conrol_ Rx_conrol; un8 characer; Ths funcon reads he value of he curren elemen of he Rx_uar_daa[] crcular uffer poned o y Rx_conrol->uar_daa_al, hen updaes Rx_conrol->uar_daa_al o he nex poson n he uffer. Value of he elemen poned o y Rx_conrol->uar_daa_al characer =Rx_uar_daa_read (&Rx_conrol); 2-36 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
59 Inerface nc. command_wre Call(s): nlne vod command_wre (sruc Tx_conrol_ *Tx_conrol, un32 command) Argumens: Tale command_wre argumens Tx_conrol n Poner o he Transmer conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon wres he command no he command[] crcular uffer o he poson poned o y Tx_conrol->command_head, hen updaes Tx_conrol->command_head o he nex poson n he uffer. None. #defne COMMANDAT 1 sruc Tx_conrol_ Tx_conrol; un32 command=commandat; command_wre (&Tx_conrol, command); command n Command numer and s hree parameers for wrng o he command[] crcular uffer. 4-h ye s he command numer; 3-rd ye s he 1-s parameer; 2-nd ye s he 2-nd parameer; 1-s ye s he 3-rd parameer; MOTOROLA Chaper 2. General Archecure 2-37
60 Inerface nc. command_read Call(s): nlne un32 command_read (sruc Tx_conrol_ *Tx_conrol); Argumens: Tale command_read argumens Tx_conrol n Poner o he Transmer conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon reads he value of he curren elemen n he command[] crcular uffer poned o y Tx_conrol->command_al, hen updaes Tx_conrol->command_al o he nex poson n he uffer. Value of he elemen poned o y Tx_conrol->command_al. sruc Tx_conrol_ Tx_conrol; un32 command; command=command_read (&Tx_conrol); 2-38 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
61 Inerface nc. gloal_srucure_n Call(s): vod gloal_srucure_n (sruc channel_ * channel); Argumens: Tale gloal_srucure_n argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Ths funcon nalzes he S[] and H[] gloal daa arrays (regsers) o he defaul values, and assgns he CURRENT_CHANNEL gloal poner (poner o he curren Channel used y he Inerrup Servce Rounes ) o he npu argumen channel. Ths funcon s called once n man(). Reurns: Code example: None. sruc channel_ channel; gloal_srucure_n(&channel); MOTOROLA Chaper 2. General Archecure 2-39
62 Inerface nc. Tx_channel_n Call(s): vod Tx_channel_n (sruc channel_ * channel, sruc Tx_conrol_ *Tx_conrol, un8 * daa, un32 daa_lengh, n16 * sample, un32 sample_lengh, nc un8 * uar_daa, un32 uar_daa_lengh, un32 * command, un32 command_lengh); Argumens: Tale Tx_channel_n argumens channel n Poner o he Channel conrol daa srucure Tx_conrol n Poner o he Transmer conrol daa srucure daa n Poner o he Tx_daa[] crcular uffer daa_lengh n Lengh of he Tx_daa[] crcular uffer sample n Poner o he Tx_sample[] crcular uffer sample_lengh n Lengh of he Tx_sample[] crcular uffer uar_daa n Poner o he Tx_uar_daa[] crcular uffer uar_daa_lengh n Lengh of he Tx_uar_daa[] crcular uffer command n Poner o he command[] crcular uffer command_lengh n Lengh of he command[] crcular uffer Descrpon: Reurns: Ths funcon nalzes all he felds of he Transmer conrol daa srucure, o he defaul values. Ths funcon should e called efore callng Tx_daa_pump(), Tx_daa_handler(), command_parser(), command_handler() and Transmer Proocols nalzaon funcons. Ths funcon s called once n man(). None MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
63 Inerface nc. Code example: #defne DATA_LENGTH (60) #defne SAMPLE_LENGTH (400) #defne COMMAND_LENGTH (40) #defne UART_DATA_LENGTH (300) sruc channel_ channel; nc sruc Tx_conrol_ Tx_conrol; un8 Tx_daa[DATA_LENGTH]; n16 Tx_sample[SAMPLE_LENGTH]; un8 Tx_uar_daa[UART_DATA_LENGTH]; un32 command[command_length]; Tx_channel_n (&channel, &Tx_conrol, Tx_daa, DATA_LENGTH, Tx_sample, SAMPLE_LENGTH, Tx_uar_daa, UART_DATA_LENGTH, command, COMMAND_LENGTH); MOTOROLA Chaper 2. General Archecure 2-41
64 Inerface nc. Rx_channel_n Call(s): vod Rx_channel_n (sruc channel_ * channel, sruc Rx_conrol_ *Rx_conrol, un8 * daa, un32 daa_lengh, n16 * sample, un32 sample_lengh, nc Argumens: Descrpon: un8 * uar_daa, un32 uar_daa_lengh); Tale Rx_channel_n argumens channel n Poner o he Channel conrol daa srucure Rx_conrol n Poner o he Recever conrol daa srucure daa n Poner o he Rx_daa[] crcular uffer daa_lengh n Lengh of he Rx_daa[] crcular uffer sample n Poner o he Rx_sample[] crcular uffer sample_lengh n Lengh of he Rx_sample[] crcular uffer uar_daa n Poner o he Rx_uar_daa[] crcular uffer uar_daa_lengh n Lengh of he Rx_uar_daa[] crcular uffer Ths funcon nalzes he Recever conrol daa srucure. Ths funcon should e called efore callng Rx_daa_pump(), Rx_daa_handler() and Recever Proocol nalzaon funcons. Ths funcon s called once n man(). Reurns: None. Code example: #defne DATA_LENGTH (60) #defne SAMPLE_LENGTH (400) #defne COMMAND_LENGTH (40) 2-42 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
65 Inerface nc. #defne UART_DATA_LENGTH (300) sruc channel_ channel; sruc Rx_conrol_ Rx_conrol; un8 Rx_daa[DATA_LENGTH]; n16 Rx_sample[SAMPLE_LENGTH]; un8 Rx_uar_daa[UART_DATA_LENGTH]; Rx_channel_n (&channel, &Rx_conrol, nc Rx_daa, DATA_LENGTH, Rx_sample, SAMPLE_LENGTH, Rx_uar_daa, UART_DATA_LENGTH); MOTOROLA Chaper 2. General Archecure 2-43
66 Inerface nc. S_regsers_n Call(s): vod S_regsers_n(vod); Argumens: None. Descrpon: Ths funcon nalzes he gloal S[] (regsers) daa array o he defaul values (profle) ha are conaned n he S_FACTORY_DEFAULT[] daa array (Facory-defned Confguraon of S regsers). Ths funcon s called y he gloal_srucure_n() funcon and y he Command Handler on he ATZ or AT&F commands. nc Reurns: None. Code example: S_regsers_n(); 2-44 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
67 Inerface nc. H_regsers_n Call(s): vod H_regsers_n(vod); Argumens: None. Descrpon: Ths funcon nalzes he gloal H[] (hdden regsers, ha are no drecly accessle o he user va AT commands) daa array o he defaul values (profle) ha are conaned n he H_FACTORY_DEFAULT[] daa array (Facory-defned Confguraon of H regsers). Ths funcon s called y he gloal_srucure_n() funcon and he Command Handler on ATZ or AT&F commands. nc Reurns: None. Code example: H_regsers_n(); MOTOROLA Chaper 2. General Archecure 2-45
68 Inerface nc. Tx_rese Call(s): vod Tx_rese(sruc channel_ * channel); Argumens: Tale Tx_rese argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon reses mos of he used felds of he Transmer conrol daa srucure (sample_head, sample_al, daa_head, daa_al, command_head, command_al, daa_pump_pr, daa_pump_call_func, sae, numer_samples, aud_rae, process_coun, n_s, n_s_mask) poned o y he channel->tx_conrol_pr o he defaul values. Ths funcon s called n sae_machne(). None. sruc channel_ channel; Tx_rese (&channel); 2-46 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
69 Inerface nc. Rx_rese Call(s): vod Rx_rese(sruc channel_ * channel); Argumens: Tale Rx_rese argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon reses mos of he used felds n he Recever conrol daa srucure (sample_head, sample_al, daa_head, daa_al, daa_pump_pr, daa_pump_call_func, sae, numer_samples, aud_rae, process_coun, n_s, n_s_mask, connecon_code) poned o y he channel->rx_conrol_pr o he defaul values. Ths funcon s called n sae_machne(). None. sruc channel_ channel; Rx_rese (&channel); MOTOROLA Chaper 2. General Archecure 2-47
70 Inerface nc. Tx_daa_pump Call(s): enum Tx_resul_ {TX_OK, TX_SAMPLE_BUF_FULL, TX_STATE_COMPLETED}; enum Tx_resul_ Tx_daa_pump (sruc channel_ * channel); Argumens: Tale Tx_daa_pump argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Ths s he Transmer (Tx) Daa Pump enry pon. A call o hs funcon wll execue, f possle, he funcon Tx_conrol->daa_pump_call_func assocaed wh he curren Tx Daa Pump. The Tx_daa_pump funcon conans logc o check he condon of Tx_conrol->sample_head and Tx_conrol->sample_al o deermne f he numer of samples specfed y Tx_conrol->numer_samples can e placed no he Tx_sample[] uffer ye. If he dsance eween he wo poners s equal o or less han he value Tx_conrol->numer_samples, calls he Tx_conrol->daa_pump_call_func. Ths funcon s called n he sae_machne(). Reurns: TX_OK - The Tx_conrol->daa_pump_call_func was called. TX_SAMPLE_BUF_FULL - The Tx_conrol->daa_pump_call_func was no called, ecause Tx_sample[] s already full. TX_STATE_COMPLETED - The curren sae of Tx Daa Pump s complee, hs means ha Tx_conrol->process_coun s equal o 0. Code example: sruc channel_ channel; f(tx_daa_pump (&channel)== TX_STATE_COMPLETED) { } 2-48 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
71 Inerface nc. Rx_daa_pump Call(s): enum Rx_resul_ {RX_OK, RX_SAMPLE_BUF_NOT_FILED, RX_STATE_COMPLETED}; enum Rx_resul_ Rx_daa_pump (sruc channel_ * channel) Argumens: Tale Rx_daa_pump argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Ths s he Recever (Rx) Daa Pump enry pon. A call o hs funcon wll execue, f possle, he funcon Rx_conrol->daa_pump_call_func assocaed wh he curren Rx Daa Pump. The Rx_daa_pump funcon conans logc o check he condon of Rx_conrol->sample_head and Rx_conrol->sample_al o deermne f he numer of samples specfed y Rx_conrol->numer_samples are presen n he Rx_sample[] uffer ye. If he dsance eween he wo poners s equal o or more han he value Rx_conrol->numer_samples, calls he Rx_conrol->daa_pump_call_func. Ths funcon s called n sae_machne(). Reurns: RX_OK - The Rx_conrol->daa_pump_call_func was called normally. RX_SAMPLE_BUF_NOT_FILED - The Rx_conrol->daa_pump_call_func was no called, ecause Rx_sample[] s no full enough. RX_STATE_COMPLETED - The curren sae of he Rx Daa Pump s complee, hs means ha Rx_conrol->process_coun s equal o 0. Code example: sruc channel_ channel; f(rx_daa_pump (&channel)== RX_STATE_COMPLETED) { } MOTOROLA Chaper 2. General Archecure 2-49
72 Inerface nc. Tx_daa_handler Call(s): enum Tx_DH_resul_ {TX_DH_OK, TX_DATA_BUF_FULL}; enum Tx_DH_resul_ Tx_daa_handler (sruc channel_ * channel); Argumens: Tale Tx_daa_handler argumens nc Descrpon: channel n Poner o he Channel conrol daa srucure Ths s he Transmer Daa Handler enry pon. A call o hs funcon wll execue, f possle, he funcon Tx_conrol->daa_handler_call_func assocaed wh he curren Tx Daa Handler. The Tx_daa_handler funcon conans logc o check he condon of Tx_conrol->daa_head and Tx_conrol->daa_al o deermne f he numer of symols specfed y Tx_conrol->numer_n_s can e placed no he Tx_daa[] uffer ye. If he dsance eween he wo poners s equal o or less han he value Tx_conrol->numer_n_s, calls he Tx_conrol->daa_handler_call_func. Ths funcon s called n sae_machne(). Reurns: TX_DH_OK - The Tx_conrol->daa_handler_call_func was called. TX_DATA_BUF_FULL - The Tx_conrol->daa_handler_call_func was no called, ecause Tx_daa[] s already full. Code example: sruc channel_ channel; Tx_daa_handler (&channel); 2-50 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
73 Inerface nc. Rx_daa_handler Call(s): enum Rx_DH_resul_ {RX_DH_OK, RX_DH_NO_DATA}; enum Rx_DH_resul_ Rx_daa_handler (sruc channel_ * channel); Argumens: Tale Rx_daa_handler argumens nc Descrpon: Ths s he Recever Daa Handler enry pon. A call o hs funcon wll execue, f possle, he funcon Rx_conrol->daa_handler_call_func assocaed wh he curren Rx Daa Handler. The Rx_daa_handler funcon conans logc o check he condon of Rx_conrol->daa_head and Rx_conrol->daa_al o deermne f he numer of symols specfed y Rx_conrol->numer_n_s are presen n he Rx_daa[] uffer ye. If he dsance eween he wo poners s equal o or more han he value Rx_conrol->numer_n_s, calls he Rx_conrol->daa_handler_call_func. Ths funcon s called n sae_machne(). Reurns: RX_DH_OK - The Rx_conrol->daa_handler_call_func was called normally. RX_DH_NO_DATA - The Rx_conrol->daa_handler_call_func was no called, ecause Rx_daa[] s no full enough. Code example: channel n Poner o he Channel conrol daa srucure sruc channel_ channel; Rx_daa_handler (&channel); MOTOROLA Chaper 2. General Archecure 2-51
74 Inerface nc. command_parser Call(s): vod command_parser (sruc channel_ * channel); Argumens: Tale command_parser argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths s he Command Parser enry pon. Ths funcon calls he funcon Tx_conrol->command_parser_call_func assocaed wh he curren Command Parser only. Ths funcon s called n sae_machne(). None. sruc channel_ channel; command_parser(&channel); 2-52 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
75 Inerface nc. command_handler Call(s): enum com_handler_resul_ {TX_COM_HANDLER_OK, TX_COM_HANDLER_NO_COMMAND}; enum com_handler_resul_ command_handler (sruc channel_ * channel); nc Argumens: Descrpon: Tale command_handler argumens channel n Poner o he Channel conrol daa srucure Ths s he Command Handler enry pon. A call o hs funcon wll execue, f possle, he funcon Tx_conrol->command_handler_call_func assocaed wh he curren Command Handler. The command_handler funcon conans logc o check he condon of Tx_conrol->command_head and Tx_conrol->command_al o deermne he exsence of elemens n he command[] uffer. If he command[] uffer s no empy, calls he Tx_conrol->command_handler_call_func. Ths funcon s called n sae_machne(). Reurns: TX_COM_HANDLER_OK - The Tx_conrol->command_handler_call_func was called. TX_COM_HANDLER_NO_COMMAND - The Tx_conrol->command_handler_call_func was no called, ecause command[] s empy. Code example: sruc channel_ channel; command_handler (&channel); MOTOROLA Chaper 2. General Archecure 2-53
76 Inerface nc. Tx_slence_gen Call(s): vod Tx_slence_gen (sruc channel_ * channel); Argumens: Tale Tx_slence_gen argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon generaes slence (samples of 0) no he Tx_sample[] uffer. The numer of generaed samples, per call s defned y Tx_conrol->numer_samples. Ths funcon s he defaul value for he channel->tx_conrol_pr-> daa_pump_call_func. Ths funcon s called y he Tx_daa_pump() funcon va he channel->tx_conrol_pr-> daa_pump_call_func (). None. sruc channel_ channel; Tx_slence_gen (&channel); 2-54 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
77 Inerface nc. Rx_dle Call(s): vod Rx_dle (sruc channel_ * channel); Argumens: Tale Rx_dle argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon reads and dscards samples from Rx_sample[]. The numer of samples s defned y channel->rx_conrol_pr->numer_samples. Ths funcon s he defaul value for Rx_conrol->daa_pump_call_func. Ths funcon s called y he Rx_daa_pump() funcon va he channel->rx_conrol_pr-> daa_pump_call_func (). None. sruc channel_ channel; Rx_dle (&channel); MOTOROLA Chaper 2. General Archecure 2-55
78 Inerface nc. save_daa_handler_parameers Call(s): vod save_daa_handler_parameers (sruc channel_ * channel, sruc daa_handler_parameers_ * daa_handler_parameers); Argumens: Tale save_daa_handler_parameers argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon copes he parameers of channel->tx_conrol_pr and channel->rx_conrol_pr, concernng he curren Daa Handler (daa_handler_pr, daa_handler_call_func, numer_n_s), o he daa_handler_parameers srucure. Ths funcon s called n sae_machne(). None. sruc channel_ channel; sruc daa_handler_parameers_ daa_handler_parameers; save_daa_handler_parameers (&channel, &daa_handler_parameers); daa_handler_parameer s n Poner o he Daa handler parameers srucure 2-56 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
79 Inerface nc. load_daa_handler_parameers Call(s): vod load_daa_handler_parameers (sruc channel_ * channel, sruc daa_handler_parameers_ * daa_handler_parameers); Argumens: Tale load_daa_handler_parameers argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon loads he parameers of channel->tx_conrol_pr and channel->rx_conrol_pr, concernng he Daa Handler (daa_handler_pr, daa_handler_call_func, numer_n_s), from he daa_handler_parameers srucure. Ths funcon s called n sae_machne(). None. sruc channel_ channel; sruc daa_handler_parameers_ daa_handler_parameers; save_daa_handler_parameers (&channel, &daa_handler_parameers); daa_handler_parameers n Poner o he Daa handler parameers srucure load_daa_handler_parameers (&channel, &daa_handler_parameers); MOTOROLA Chaper 2. General Archecure 2-57
80 Inerface nc. nc 2-58 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
81 nc. Chaper 3 Module Descrpons nc The followng secons descre each module assocaed wh he Sof Modem ncludng ITU-T V-seres modems, asynchronous-synchronous converers, general elephony call progress sgnal generaors/deecors and oher suppor modules. 3.1 Daa Pump The daa pump s he hear of he modem, whch convers daa no a forma suale for ransmsson over an analogue lne. Lkewse, convers he analogue sgnal from he lne ack no dgal daa. Modulaon proocols deermne how he modem convers dgal daa no analog sgnals ha can e sen over a phone lne. The proocol sandards mplemened n he LDR Sof Modem are summarzed n Tale 1-1. The daa raes of he LDR Sof Modem specfed y he sandards vary from 300ps(V.21) o 2400ps(V.22s) V.21 The V.21 module mplemens he ITU V.21 recommendaon for a speed of up o 300ps for use n he GSTN. The V.21 mplemenaon uses Frequency Shf Keyng modulaon wh he symol (aud) rae equal o he rae. I s a 2-channel modem: For channel No.1, he mean frequency s 1080 Hz (low channel) For channel No.2, he mean frequency s 1750 Hz (hgh channel) The frequency devaon s ±100 Hz. In each channel, he hgher characersc frequency corresponds o a nary 0. Channel No.1 s used for ransmsson of he caller s daa (.e. he person makng he elephone call) owards he called saon, whle channel No.2 s used for ransmsson n he oher drecon. The V.21 module nalzes he FSK Daa Pump module, and also ncludes a Handshake Daa Handler for he process of negoang a connecon. The V.21 Daa Pump s mplemened n he FSK module (see chaper 3.1.5). MOTOROLA Chaper 3. Module Descrpons 3-1
82 Daa Pump nc. nc Esalshmen of connecon The V.21 recommendaon does no descre how a connecon s esalshed. The procedure used y he LDR Sof Modem s descred elow and llusraed n Fgure 3-1. Callng modem: On connecon o he lne, he callng modem shall e condoned o receve sgnals n he hgh channel and ransm sgnals n he low channel. Afer 155±10 ms of nary 1 s have een deeced, he modem shall reman slen for a furher 456±10 ms hen shall ransm nary 1 s. 755±10 ms (defned y 155ms+S[9]*100 ms) laer, he modem shall e ready o ransm and receve daa. Answerng modem: On connecon o he lne, he answerng modem shall e condoned o ransm sgnals n he hgh channel and receve sgnals n he low channel. Followng ransmsson of he answer sequence, he modem shall ransm nary 1 s. Afer 155±10 ms of nary 1 s have een deeced, he modem shall e ready o ransm and receve daa, afer wang a furher 600±10 ms (defned y S[9]*100 ms). Connec o lne&dal Slence Deec Ones for 155ms Wa for 456ms Bnary 1 s Ones Wa for 755 ms DATA Connec o lne afer rng valdaon Slence 2100Hz Answer Tone Bnary 1 s Ones DATA For 2150ms For 3300ms For 75ms Deec Ones for 155ms Wa for 600 ms Fgure 3-1. Tmng dagram of he V.21 Handshake sequence 3-2 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
83 Daa Pump nc. The V.21 Handshake rounes can e found n he v21.c fle. The Rx V.21 Handshake conrol daa srucure Rx_V21_DH_handshake_ s defned n he v21.h fle: /************************************************************************ * Saes of Rx V21 Handshake Daa Handler *************************************************************************/ enum Rx_V21_hadshake_sae_ {RX_V21_DH_DETECT_ONES,RX_V21_DH_WAIT_SEND,RX_V21_DH_WAIT_CARRIER}; nc /************************************************************************ * Rx V.21 Handshake conrol daa Srucure *************************************************************************/ sruc Rx_V21_DH_handshake_ { }; enum Rx_V21_hadshake_sae_ sae; un32 de_ones_ms; un32 wa_send_ms; un32 wa_carrer_ms; un32 curren_couner; un32 gloal_couner The Rx_V21_DH_handshake_ srucure parameer descrpons: sae - Curren sae of he Rx V21 Handshake Daa Handler. I can e equal o: RX_V21_DH_DETECT_ONES = The Handshaker s ryng o deec <de_ones_ms> ms of nary 1 s. RX_V21_DH_WAIT_SEND = The Handshaker remans slen for a <wa_send_ms> ms, efore ransmng nary 1 s. RX_V21_DH_WAIT_CARRIER = The Handshaker remans n hs sae durng <wa_carrer_ms> ms, on he compleon of he sae, he modem shall e ready o ransm and receve acual daa. I s nalzed n Rx_V21_handshake_n() o RX_V21_DH_DETECT_ONES. MOTOROLA Chaper 3. Module Descrpons 3-3
84 Daa Pump nc. nc de_ones_ms - Duraon of nary 1 deecon, n ms. I s nalzed n Rx_V21_handshake_n() o 155 ms. wa_send_ms - Tme efore sarng o ransm nary 1 s, n ms. I s nalzed n Rx_V21_handshake_n() o 456 ms, f he recever s n callng mode, oherwse s nalzed o 0. wa_carrer_ms - Tme efore he modem goes no he daa mode (ready o ransm and receve acual daa) n ms. I s nalzed n Rx_V21_handshake_n() o 755 ms, f he recever s n callng mode, oherwse s nalzed o 600 ms. curren_couner - Couner used n he curren sae for he calculaon of nares conducve o compleon of he curren sae (For example, numer of deeced nary 1 s n he RX_V21_DH_DETECT_ONES sae). I s nalzed n Rx_V21_handshake_n() o 0. gloal_couner - Couner of s receved hroughou he handshakng process. I s nalzed n Rx_V21_handshake_n() o MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
85 Daa Pump nc. Tx_V21_n Call(s): vod Tx_V21_n (sruc channel_ * channel, sruc Tx_conrol_FSK_ *Tx_conrol_FSK, ool callng); Argumens: Tale 3-1. Tx_V21_n argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Tx_conrol_FSK n Poner o he FSK ransmer conrol daa srucure callng n Conans TRUE f he ransmer s n callng mode, and FALSE f he ransmer s n answerng mode. Ths funcon ses he felds of he FSK ransmer conrol daa srucure, poned o y Tx_conrol_FSK (f_space, f_mark, amplude), and calls FSK_modulaor_n(). I also nalzes he felds of he Channel conrol daa srucure, poned o y he channel, ha are responsle for he Tx Daa Pump (daa_pump_pr, aud_rae, numer_samples, daa_pump_call_func, sae, n_s, n_s_mask, process_coun). Afer callng hs funcon, he Tx Daa Pump s nalzed o work accordng o V.21. Ths funcon s called n sae_machne(). None. sruc channel_ channel; sruc Tx_conrol_FSK_ Tx_conrol_FSK; ool callng=true; Tx_V21_n (&channel, &Tx_conrol_FSK, callng); MOTOROLA Chaper 3. Module Descrpons 3-5
86 Daa Pump nc. Rx_V21_n Call(s): vod Rx_V21_n (sruc channel_ * channel, sruc Rx_conrol_FSK_ *Rx_conrol_FSK, ool callng); Argumens: Tale 3-2. Rx_V21_n argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Rx_conrol_FSK n Poner o he FSK recever conrol daa srucure callng n Conans TRUE f he recever s n callng mode, and FALSE f he recever s n answerng mode. Ths funcon ses he felds of he FSK recever conrol daa srucure, poned o y he Rx_conrol_FSK (f_space, f_mark, lpf_coef, fler_sze,), and calls FSK_demodulaor_n(). I also nalzes he felds of he Channel conrol daa srucure, poned o y he channel, ha are responsle for he Rx Daa Pump (daa_pump_pr, aud_rae, numer_samples, daa_pump_call_func, sae, n_s, n_s_mask, process_coun). Afer callng hs funcon, he Rx Daa Pump s nalzed o work accordng o V.21. Ths funcon s called n sae_machne(). None. sruc channel_ channel; sruc Rx_conrol_FSK_ Rx_conrol_FSK; ool callng=true; Rx_V21_n (&channel, &Rx_conrol_FSK, callng); 3-6 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
87 Daa Pump nc. Tx_V21_handshake_n Call(s): vod Tx_V21_handshake_n (sruc channel_ * channel); Argumens: Tale 3-3. Tx_V21_handshake_n argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: sruc channel_ channel; Ths funcon nalzes he felds of he Channel conrol daa srucure, poned o y he channel, ha are responsle for he Tx Daa Handler (daa_handler_pr, daa_handler_sae, daa_handler_call_func, numer_n_s). Afer callng hs funcon, he Tx Daa Handler s nalzed o perform he Tx V.21 Handshake sequence. Ths funcon s called n sae_machne(). None. Tx_V21_handshake_n (&channel); MOTOROLA Chaper 3. Module Descrpons 3-7
88 Daa Pump nc. Tx_V21_handshake_roune Call(s): vod Tx_V21_handshake_roune(sruc channel_ * channel); Argumens: Tale 3-4. Tx_V21_handshake_roune argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths s he Tx V.21 Handshake Daa Handler roune. Ths funcon places 0xFF values (sequence of 1 s) no he Tx_daa[] uffer. Ths funcon s called y he Tx_daa_handler() funcon va he channel->tx_conrol_pr-> daa_handler_call_func (). None. sruc channel_ channel; Tx_V21_handshake_roune(&channel); 3-8 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
89 Daa Pump nc. Rx_V21_handshake_n Call(s): vod Rx_V21_handshake_n (sruc channel_ * channel, sruc Rx_V21_DH_handshake_ *Rx_V21_handshake, ool callng); Argumens: Tale 3-5. Rx_V21_handshake_n argumens nc Descrpon: Reurns: Code example: channel n Poner o he Channel conrol daa srucure Rx_V21_handshake n Poner o he Rx V.21 Handshake conrol daa srucure callng n Conans TRUE f he recever s n callng mode, and FALSE f he recever s n answerng mode. Ths funcon ses he felds of he Rx V.21 Handshake conrol daa srucure, poned o y Rx_V21_handshake (sae, de_ones_ms, wa_send_ms, wa_carrer_ms, curren_couner, gloal_couner). I also nalzes he felds of he Channel conrol daa srucure, poned o y he channel, ha are responsle for he Rx Daa Handler (daa_handler_pr, daa_handler_call_func, daa_handler_sae, numer_n_s). Afer callng hs funcon, he Rx Daa Handler s nalzed o perform he Rx V.21 Handshake sequence. Ths funcon s called n sae_machne(). None. sruc channel_ channel; sruc Rx_V21_DH_handshake_ Rx_V21_handshake; ool callng=true; Rx_V21_handshake_n (&channel, &Rx_V21_handshake, callng); MOTOROLA Chaper 3. Module Descrpons 3-9
90 Daa Pump nc. Rx_V21_handshake_roune Call(s): vod Rx_V21_handshake_roune(sruc channel_ * channel); Argumens: Tale 3-6. Rx_V21_handshake_roune argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths s he Rx V.21 Handshake Daa Handler roune. Ths funcon reads daa (symols) from he Rx_daa[] uffer. The funcon performs and conrols he V.21 Handshake sequence (see ). Afer successful compleon of he Handshake sequence, ses channel->rx_conrol_pr->daa_handler_sae o RX_DH_STATE_COMPLETED, oherwse o RX_DH_STATE_FAILED. Ths funcon s called y he Rx_daa_handler() funcon va he channel->rx_conrol_pr-> daa_handler_call_func (). None. sruc channel_ channel; Rx_V21_handshake_roune(&channel); 3-10 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
91 Daa Pump nc V.23 The V.23 module mplemens he ITU V.23 recommendaon for speeds of 600ps and 1200ps ( also suppors a ackward channel of 75ps) for use n he GSTN. The V.23 mplemenaon uses Frequency Shf Keyng modulaon wh he symol (aud) rae equal o he rae. nc I s a 2-channel modem: For channel No.1 (ackward): The modulaon rae s 75 auds; he mean frequency s 420 Hz; he frequency devaon s ±30 Hz For channel No.2 (forward): Mode 1: The modulaon rae s 600 auds; he mean frequency s 1500 Hz; he Frequency devaon s ±200 Hz Mode 2: The modulaon rae s 1200 auds; he mean frequency s 1700 Hz; he frequency devaon s ±400 Hz In each channel, he hgher characersc frequency corresponds o a nary 0. Channel No.1 s used for ransmng he caller s daa (.e. he person makng he elephone call) owards he called saon, whle channel No.2 s used for ransmsson n he oher drecon. Mos hardware modems suppor Mode 2 only (1200ps) for channel No.2. The V.23 module nalzes he FSK Daa Pump module, and also ncludes a Handshake Daa Handler for he process of negoang a connecon. The V.23 Daa Pump s mplemened n he FSK module (see chaper 3.1.5) Esalshmen of connecon The V.23 recommendaon does no descre how a connecon s esalshed. The procedure used y he LDR Sof Modem s descred elow and llusraed n Fg Callng modem: On connecon o he lne, he callng modem shall e condoned o receve sgnals n he hgh channel and ransm sgnals n he low channel. Afer 155±10 ms of nary 1 s have een deeced, he modem shall reman slen for a furher 456±10 ms hen shall ransm nary 1 s. 755±10 ms (defned y 155ms+S[9]*100 ms) laer, he modem shall e ready o ransm and receve daa. Answerng modem: On connecon o he lne, he answerng modem shall e condoned o ransm sgnals n he hgh channel and receve sgnals n he low channel. Followng ransmsson of he answer sequence he modem shall ransm nary 1 s. MOTOROLA Chaper 3. Module Descrpons 3-11
92 Daa Pump nc. Afer 155±10 ms of nary 1 s have een deeced, he modem shall e ready o ransm and receve daa afer wang a furher 600±10 ms (defned y S[9]*100 ms). Deec Ones for 155ms Wa for 456ms Wa for 755 ms Connec o lne&dal Slence Bnary 1 s Ones DATA nc Connec o lne afer rng valdaon For 2150ms Slence For 3300ms 2100Hz Answer Tone For 75ms Deec Ones for 155ms Fgure 3-2. Tmng dagram of he V.23 Handshake sequence The V.23 Handshake rounes can e found n he v23.c fle. The Rx V.23 Handshake conrol daa srucure Rx_V23_DH_handshake_ s defned n he v23.h fle: /************************************************************************ * Saes of Rx V21 Handshake Daa Handler Bnary 1 s Ones Wa for 600 ms DATA *************************************************************************/ enum Rx_V23_hadshake_sae_ {RX_V23_DH_DETECT_ONES,RX_V23_DH_WAIT_SEND,RX_V23_DH_WAIT_CARRIER}; /************************************************************************ * Rx V.23 Handshake conrol daa Srucure *************************************************************************/ sruc Rx_V23_DH_handshake_ { 3-12 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
93 Daa Pump nc. enum Rx_V23_hadshake_sae_ sae; un32 de_ones_ms; un32 wa_send_ms; un32 wa_carrer_ms; un32 curren_couner; un32 gloal_couner }; nc The Rx_V23_DH_handshake_ srucure parameer descrpons: sae - Curren sae of he Rx V23 Handshake Daa Handler. I can e equal o: RX_V23_DH_DETECT_ONES = The Handshaker s ryng o deec <de_ones_ms> ms of nary 1 s. RX_V23_DH_WAIT_SEND = The Handshaker remans slen for a perod of <wa_send_ms> ms, efore ransmng nary 1 s. RX_V23_DH_WAIT_CARRIER = The Handshaker remans n hs sae durng <wa_carrer_ms> ms, on he compleon of he sae, he modem shall e ready o ransm and receve acual daa. I s nalzed n Rx_V23_handshake_n() o RX_V23_DH_DETECT_ONES. de_ones_ms - Duraon of nary 1 s deecon, n ms. I s nalzed n Rx_V23_handshake_n() o 155 ms. wa_send_ms - Tme efore sarng o ransm nary 1 s, n ms. I s nalzed n Rx_V23_handshake_n() o 456 ms, f he recever s n callng mode, oherwse s nalzed o 0. wa_carrer_ms - Tme efore he modem goes no he daa mode (ready o ransm and receve acual daa) n ms. I s nalzed n Rx_V23_handshake_n() o 755 ms, f he recever s n callng mode, oherwse s nalzed o 600 ms. curren_couner - Couner used n he curren sae for he calculaon of nares conducve o compleon of he curren sae (For example, numer of nary 1 s n he RX_V23_DH_DETECT_ONES sae). I s nalzed n Rx_V23_handshake_n() o 0. gloal_couner - Couner of s receved hroughou he handshakng process. I s nalzed n Rx_V23_handshake_n() o 0. MOTOROLA Chaper 3. Module Descrpons 3-13
94 Daa Pump nc. Tx_V23_n Call(s): vod Tx_V23_n (sruc channel_ * channel, sruc Tx_conrol_FSK_ *Tx_conrol_FSK, ool callng, enum v23_mode_ mode); Argumens: Tale 3-7. Tx_V23_n argumens nc Descrpon: Reurns: Code example: channel n Poner o he Channel conrol daa srucure Tx_conrol_FSK n Poner o he FSK ransmer conrol daa srucure callng n Conans TRUE f he ransmer s n callng mode, and FALSE f he ransmer s n answerng mode. mode n Defnes mode for channel No.2. I can e equal o: V23_MODE_600 = Mode 1 (600 auds). V23_MODE_1200 = Mode 2 (1200 auds). Ths funcon ses he felds of he FSK ransmer conrol daa srucure, poned y Tx_conrol_FSK (f_space, f_mark, amplude), and calls FSK_modulaor_n(). I also nalzes he felds of he Channel conrol daa srucure, poned o y he channel, ha are responsle for he Tx Daa Pump (daa_pump_pr, aud_rae, numer_samples, daa_pump_call_func, sae, n_s, n_s_mask, process_coun). Afer callng hs funcon, he Tx Daa Pump s nalzed o work accordng o V.23. Ths funcon s called n sae_machne(). None. sruc channel_ channel; sruc Tx_conrol_FSK_ Tx_conrol_FSK; ool callng=true; Tx_V23_n (&channel, &Tx_conrol_FSK, callng, V23_MODE_600); 3-14 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
95 Daa Pump nc. Rx_V23_n Call(s): vod Rx_V23_n (sruc channel_ * channel, sruc Rx_conrol_FSK_ *Rx_conrol_FSK, ool callng, enum v23_mode_ mode); nc Argumens: Descrpon: Reurns: Code example: Tale 3-8. Rx_V23_n argumens channel n Poner o he Channel conrol daa srucure Rx_conrol_FSK n Poner o he FSK recever conrol daa srucure callng n Conans TRUE f he recever s n callng mode, and FALSE f he recever s n answerng mode. mode n Defnes mode for he channel No.2. I can e equal o: V23_MODE_600 = Mode 1 (600 auds). V23_MODE_1200 = Mode 2 (1200 auds). Ths funcon ses he felds of he FSK recever conrol daa srucure, poned o y he Rx_conrol_FSK (f_space, f_mark, lpf_coef, fler_sze), and calls FSK_demodulaor_n(). I also nalzes he felds of he Channel conrol daa srucure, poned o y he channel, ha are responsle for he Rx Daa Pump (daa_pump_pr, aud_rae, numer_samples, daa_pump_call_func, sae, n_s, n_s_mask, process_coun). Afer callng hs funcon, he Rx Daa Pump s nalzed o work accordng o V.23. Ths funcon s called n sae_machne(). None. sruc channel_ channel; sruc Rx_conrol_FSK_ Rx_conrol_FSK; ool callng=true; Rx_V23_n (&channel, &Rx_conrol_FSK, callng, V23_MODE_600); MOTOROLA Chaper 3. Module Descrpons 3-15
96 Daa Pump nc. Tx_V23_handshake_n Call(s): vod Tx_V23_handshake_n (sruc channel_ * channel); Argumens: Tale 3-9. Tx_V23_handshake_n argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon nalzes he felds of he Channel conrol daa srucure, poned o y he channel, ha are responsle for he Tx Daa Handler (daa_handler_pr, daa_handler_sae, daa_handler_call_func, numer_n_s). Afer callng hs funcon, he Tx Daa Handler s nalzed o perform he Tx V.23 Handshake sequence. Ths funcon s called n sae_machne(). None. sruc channel_ channel; Tx_V23_handshake_n (&channel); 3-16 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
97 Daa Pump nc. Tx_V23_handshake_roune Call(s): vod Tx_V23_handshake_roune(sruc channel_ * channel); Argumens: Tale Tx_V23_handshake_roune argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths s he Tx V.23 Handshake Daa Handler roune. Ths funcon places 0xFF values (sequence of 1 s) no he Tx_daa[] uffer. Ths funcon s called y he Tx_daa_handler() funcon va he channel->tx_conrol_pr-> daa_handler_call_func (). None. sruc channel_ channel; Tx_V23_handshake_roune(&channel); MOTOROLA Chaper 3. Module Descrpons 3-17
98 Daa Pump nc. Rx_V23_handshake_n Call(s): vod Rx_V23_handshake_n (sruc channel_ * channel, sruc Rx_V23_DH_handshake_ *Rx_V23_handshake, ool callng); Argumens: Tale Rx_V23_handshake_n argumens nc Descrpon: Ths funcon ses he felds of he Rx V.23 Handshake conrol daa srucure, poned o y Rx_V23_handshake (sae, de_ones_ms, wa_send_ms, wa_carrer_ms, curren_couner, gloal_couner). I also nalzes he felds of he Channel conrol daa srucure, poned o y he channel, ha are responsle for he Rx Daa Handler (daa_handler_pr, daa_handler_call_func, daa_handler_sae, numer_n_s). Afer callng hs funcon, he Rx Daa Handler s nalzed o perform he Rx V.23 Handshake sequence. Ths funcon s called n sae_machne(). Reurns: Code example: channel n Poner o he Channel conrol daa srucure Rx_V23_handshake n Poner o he Rx V.23 Handshake conrol daa srucure callng n Conans TRUE f he recever s n callng mode, and FALSE f he recever s n answerng mode. None. sruc channel_ channel; sruc Rx_V23_DH_handshake_ Rx_V23_handshake; ool callng=true; Rx_V23_handshake_n (&channel, &Rx_V23_handshake, callng); 3-18 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
99 Daa Pump nc. Rx_V23_handshake_roune Call(s): vod Rx_V23_handshake_roune(sruc channel_ * channel); Argumens: Tale Rx_V23_handshake_roune argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths s he Rx V.23 Handshake Daa Handler roune. Ths funcon reads daa (symols) from he Rx_daa[] uffer. The funcon performs and conrols he V.23 Handshake sequence (see ). Afer successful compleon of he Handshake sequence, ses channel->rx_conrol_pr->daa_handler_sae o RX_DH_STATE_COMPLETED, oherwse o RX_DH_STATE_FAILED. Ths funcon s called y he Rx_daa_handler() funcon va he channel->rx_conrol_pr-> daa_handler_call_func (). None. sruc channel_ channel; Rx_V23_handshake_roune(&channel); MOTOROLA Chaper 3. Module Descrpons 3-19
100 Daa Pump nc. nc V.22 The V.22 modem s nended for use on connecons on he General Swched Telephone Nework (GSTN), and on pon-o-pon crcus when sualy condoned. Ths s a full-duplex modem wh he recever and ransmer sharng he avalale andwdh of he communcaon channel. Ths modem can operae n eher orgnae or answer mode. In he orgnae mode, naes he communcaon process, ransms wh a carrer frequency of 1200 Hz, and receves a he frequency of 2400 Hz. A he oher end of he communcaons channel here s a remoe modem n answer mode. Ths remoe modem receves a 1200 Hz and ransms a 2400 Hz. The Dfferenal Phase Shf Keyng (DPSK) modulaon echnque s used for each channel wh synchronous lne ransmsson a 600 aud (mplemened n he dpsk.c fle). The V.22, wh a 600-aud rae, accomplshes he ransmsson of 1200 ps y encodng wo ncomng s (a d) n a sngle aud or 600 ps y encodng one ncomng n a sngle aud. Snce here are four possle values for every d (00, 01, 10, 11), he consellaon dagram for he V.22 conans four pons. Fgure shows he consellaon dagram for he V.22. The four consellaon pons noaed A, B, C, and D le on a crcle. Snce here s no amplude nformaon ransmed, he radus of hs crcle s normalzed o uny. A scramler s ncluded n he npu o he ransmer and a descramler a he oupu of he recever. A guard one of 1800 ±20 Hz or 550 ±20 Hz may e used whle ransmng only n he hgh channel (ransmer of he answerng modem). The guard one ndcaes o an auomac elephone sysem ha he lne s occuped y he modem. Fxed compromse equalzaon (flerng he npu/oupu sgnal wh a fxed fler) shall e ncorporaed n he modem. Such equalzaon shall e equally shared eween he ransmer and he recever. Fgure 3-3. Sgnal Consellaon for V.22 For 1200 s per second he daa sream o e ransmed shall e dvded no groups of 2 consecuve s (ds). Each d shall e encoded as a phase change relave o he phase 3-20 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
101 Daa Pump nc. of he precedng sgnal elemen (see ale ). A he recever, he ds shall e decoded and he s reassemled n he correc order. The lef-hand dg of he d s he one occurrng frs n he daa sream as eners he modulaor poron of he modem afer he scramler. Tale Bs encodng n V.22 modem D values (1200 /s) B values (600 /s) Phase change nc The phase change s he acual on-lne phase shf n he ranson regon from he cener of one sgnalng elemen o he cener of he followng sgnalng elemen. For 600 s/s each shall e encoded as a phase change relave o he phase of he precedng sgnal elemen Scramler A self-synchronzng scramler, whch has he generang polynomal 1 x -14 x 17, s ncluded n he modem ransmer. The purpose of he scramler s o randomze he npu nary daa sequence, whch means ha convers hs sequence no a pseudo-random nary sequence. For example, f he DTE sends a seres of 01 ds, from ale can e seen ha each d corresponds o a 0-degree phase change. Therefore he oal phase ransmed s he same (or he same consellaon pon). However a phase change s requred for correc clock recovery (oherwse he energy of he samples remans consan). To avod hs, he scramler s nroduced o mnmze he proaly ha such ll-condoned ds occur. In oher words makes he daa sream look lke a random sream of ones and zeros regardless of he daa eng ransmed. Ths s requred for he clock recovery module. Consderng d(nt) s he npu o he scramler, he oupu d s (nt) s gven y: d s (nt) = d(nt) XOR d s ((n-14)t) XOR d s ((n-17)t) Where T s he daa perod. The sgnal flowchar of he modem scramler s shown n Fgure 3-4. MOTOROLA Chaper 3. Module Descrpons 3-21
102 Daa Pump nc. d -17 d -16 d -15 d -14 d -2 d -1 d(nt) XOR d s (nt) Fgure 3-4. V.22 scramler nc Descramler The descramler s nended o recover he orgnally ransmed d. The oupu of he descramler s descred y: d(nt) = d s (nt) XOR d s ((n-14)t) XOR d s ((n-17)t) Where T s he daa perod. The sgnal flowchar of he modem descramler s shown n Fgure 3-5. d s (nt) Handshake d -1 d -2 d -14 d -15 d -16 d -17 Fgure 3-5. V.22 descramler The handshake sequence for achevng synchronzaon eween callng and answerng modems s shown n Fgure 3-6. XOR d(nt) 3-22 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
103 Daa Pump nc. Deec Unscramled Ones for 155ms Wa for 456ms Deec Scramled Ones for 270ms Wa for 765 ms Connec o lne&dal Slence Scramled Ones 1 s DATA nc Connec o lne afer rng valdaon For 2150ms Slence For 3300ms Handshake sequence for callng modem 1800Hz or 550Hz Guard Tone 2100Hz Answer Tone Unscramled 1 s Ones Scramled Ones 1 s DATA For 75ms Deec Scramled Ones for 270ms Fgure 3-6. Handshake sequence Wa for 765 ms a) Once he callng modem has conneced o he lne, shall e condoned o receve sgnals n he hgh channel. ) The modem shall reman slen unl unscramled nary 1 s are deeced for a perod of 155 ± 50 ms. Afer wang for a furher 456 ± 10 ms shall ransm scramled nary 1 s n he low channel. c) Upon deecng scramled nary 1 s n he hgh channel for a perod of 270 ± 40 ms, he modem shall wa a furher 765 ± 10 ms, hen s ready o ransm and receve daa. Handshake sequence for answerng modem a) Once he answerng modem has conneced o he lne, mmedaely followng he V.25 answer sequence, he modem shall e condoned o receve sgnals n he low channel. I shall hen ransm unscramled nary 1 s. ) Upon deecng scramled nary 1 s n he low channel for a perod of 270 ± 40 ms, he modem shall ransm scramled nary 1 s n he hgh channel, and wa for a furher 765 ± 10 ms. The modem s hen ready o ransm and receve daa. c) Afer compleon of he handshake sequence, any nadveren loss and reappearance of he receved lne sgnal should no cause anoher handshake sequence o e generaed. MOTOROLA Chaper 3. Module Descrpons 3-23
104 Daa Pump nc Implemenaon The requremens of V.22 are mplemened n he v22.c fle. Ths module s responsle for he nalzaon of he V.22 handshake conrol srucures (Rx(Tx)_V22_DH_handshake_), he nalzaon of he DPSK conrol srucures (Rx(Tx)_conrol_DPSK_, for deals aou hese srucures refer o Secons / ), scramlng, descramlng, and conrollng he handshake process (Rx_V22_handshake_roune). A descrpon of he man funcons and conrol srucures of v22.c are gven elow RX V.22 Handshake daa handler srucure sruc Rx_V22_DH_handshake_ nc { }; enum Rx_V22_hadshake_sae_ sae; un32 de_unscr_ones_ms; un32 de_scr_ones_ms; un32 wa_send_ms; un32 wa_carrer_ms; un32 curren_couner; un32 gloal_couner; sae - Curren sae of he Rx V22 Handshake Daa Handler. The ls of possle saes can e seen n Fg de_unscr_ones_ms - Duraon of he unscramled nary 1 s deecon n ms. Ths feld s nalzed n funcon Rx_V22_handshake_n. de_scr_ones_ms - Duraon of he scramled nary 1 s deecon n ms. Ths feld s nalzed n funcon Rx_V22_handshake_n. wa_send_ms Specfed me efore sarng o ransm scramled nary 1 s n ms. Ths feld s nalzed n funcon Rx_V22_handshake_n. wa_carrer_ms Specfed me efore Carrer Deec Response n ms. Ths feld s nalzed n funcon Rx_V22_handshake_n. curren_couner The couner ha s used for counng he dfferen daa sequences (e.g. for deecng consecuve 1 s). Ths feld s nalzed n funcon Rx_V22_handshake_n o 0. gloal_couner - Couner of he s receved hroughou he handshake phase. Ths feld s nalzed n funcon Rx_V22_handshake_n o MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
105 Daa Pump nc. V22_scramle_ Call(s): un8 V22_scramle_(sruc channel_ * channel, un8 ) Argumens: Tale V22_scramle_ argumens channel n Poner o he channel conrol daa srucure n B o scramle nc Descrpon: Scramles npu s accordng o he V.22 recommendaon. d s (nt) = d(nt) XOR d s ((n-14)t) XOR d s ((n-17)t). Scramler regser s sored n channel->tx_conrol_pr->daa_pump_pr->scramler_regser. Reurns: Scramled. Code example: un8 emp_curren_ns, curren_ns; sruc channel_ * channel; emp_curren_ns = V22_scramle_(channel, curren_ns); MOTOROLA Chaper 3. Module Descrpons 3-25
106 Daa Pump nc. V22_descramle_ Call(s): un8 V22_descramle_(sruc channel_ * channel, un8 ) Argumens: Tale V22_descramle_ argumens channel n Poner o he channel conrol daa srucure n B o descramle nc Descrpon: Descramles npu s accordng o he V.22 recommendaon. d(nt) = d s (nt) XOR d s ((n-14)t) XOR d s ((n-17)t). Descramler regser s sored n channel->rx_conrol_pr->daa_pump_pr->descramler_regser. Reurns: Descramled. Code example: un8 emp_curren_ns, curren_ns; sruc channel_ * channel; emp_curren_ns = V22_descramle_(channel, curren_ns); 3-26 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
107 Daa Pump nc. Tx_V22_n Call(s): vod Tx_V22_n (sruc channel_ * channel,sruc Tx_conrol_DPSK_ *Tx_conrol_DPSK, ool callng,enum v22_mode_ mode) Argumens: Tale Tx_V22_n argumens channel n Poner o he channel conrol daa srucure Tx_conrol_DPSK n Poner o he DPSK ransmer conrol daa srucure nc Descrpon: Reurns: Code example: callng n Indcaes eher modem n call or answer mode mode n Specfes 600 /s (V22_MODE_600) or 1200 /s (V22_MODE_1200) mode Ths funcon nalzes he Transmer conrol Srucures poned o y Tx_conrol_DPSK and channel accordng o V.22 and calls DPSK_modulaor_n(). I flls he approprae felds of he Tx_conrol_ srucure, poned o y channel->tx_conrol_pr (felds: n_s, n_s_mask, aud_rae, numer_samples, daa_pump_call_func, sae, process_coun) and he Tx_conrol_DPSK srucure (felds: f_carrer, f_guard, amplude_carrer, amplude_guard, omega_pr, scramler). Ths funcon s called from sae_machne(). None sruc channel_ * channel; sruc Tx_conrol_DPSK_ *Tx_conrol_DPSK; Tx_V22_n (channel, Tx_conrol_DPSK, TRUE, V22_MODE_1200); MOTOROLA Chaper 3. Module Descrpons 3-27
108 Daa Pump nc. Rx_V22_n Call(s): vod Rx_V22_n (sruc channel_ * channel,sruc Rx_conrol_DPSK_ *Rx_conrol_DPSK, ool callng,enum v22_mode_ mode) Argumens: Tale Rx_V22_n argumens channel n Poner o he channel conrol daa srucure Rx_conrol_DPSK n Poner o he DPSK recever conrol daa srucure nc Descrpon: Reurns: Code example: callng n Indcaes eher modem n call or answer mode mode n Specfes 600 /s (V22_MODE_600) or 1200 /s (V22_MODE_1200) mode Ths funcon nalzes he Recever conrol Srucure accordng o V.22. I flls he approprae felds of he Rx_conrol_ srucure, poned o y channel->rx_conrol_pr (felds: n_s, n_s_mask, aud_rae, numer_samples, daa_pump_call_func, sae, process_coun) and he Rx_conrol_DPSK srucure (felds: f_carrer, omega_pr, nose_hreshold, descramler). Ths funcon s called from sae_machne(). None sruc channel_ * channel; sruc Rx_conrol_DPSK_ *Rx_conrol_DPSK; Rx_V22_n (channel, Rx_conrol_DPSK, TRUE, V22_MODE_1200); 3-28 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
109 Daa Pump nc. Rx_V22_handshake_n Call(s): vod Rx_V22_handshake_n (sruc channel_ * channel, sruc Rx_V22_DH_handshake_ *Rx_V22_handshake, ool callng) Argumens: Tale Rx_V22_handshake_n argumens channel n Poner o he channel conrol daa srucure nc Descrpon: Reurns: Code example: Rx_V22_handshak e Ths funcon nalzes he recever V.22 handshake daa handler conrol srucure. I flls he approprae felds of Rx_conrol_ srucure, poned o y channel->rx_conrol_pr (felds: daa_handler_call_func, daa_handler_sae, numer_n_s) and he Rx_V22_handshake srucure (felds: sae, de_scr_ones_ms, de_unscr_ones_ms, wa_send_ms, wa_carrer_ms, curren_couner, gloal_couner). I ses up he daa handler for he recever o perform he Rx_V22_handshake_roune. Ths funcon s called from sae_machne(). None sruc channel_ * channel; sruc Rx_V22_DH_handshake_ Rx_V22_DH_handshake; n Poner o he RX handshake daa handler srucure callng n Indcaes eher modem n call or answer mode Rx_V22_handshake_n (channel, &Rx_V22_DH_handshake, TRUE); MOTOROLA Chaper 3. Module Descrpons 3-29
110 Daa Pump nc. Rx_V22_handshake_roune Call(s): vod Rx_V22_handshake_roune(sruc channel_ * channel) Argumens: Tale Rx_V22_handshake_roune argumens channel n Poner o he channel conrol daa srucure nc Descrpon: Ths s he RX V.22 Handshake Daa Handler roune. Ths funcon reads daa (symols) from he Rx_daa[] uffer. I conrols he handshake process. The nner sae dagram for hs roune durng he handshake s shown n Fgure 3-7. If handshake s compleed successfully Rx_conrol->daa_handler_sae s se o RX_DH_STATE_COMPLETED, else o RX_DH_STATE_FAILED. Ths funcon s called y he Rx_daa_handler() funcon va he channel->rx_conrol_pr-> daa_handler_call_func (). No BEGIN Orgnaor? Yes RX_V22_DH_DETECT_UNSCR_ONES_INIT RX_V22_DH_DETECT_UNSCR_ONES RX_V22_DH_WAIT_SEND RX_V22_DH_DETECT_SCR_ONES_INIT RX_V22_DH_DETECT_SCR_ONES RX_V22_DH_WAIT_CARRIER CONNECT Fgure 3-7. Handshake sae dagram Reurns: Code example: None sruc channel_ * channel; Rx_V22_handshake_roune (channel); 3-30 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
111 Daa Pump nc. Tx_V22_handshake_n Call(s): vod Tx_V22_handshake_n (sruc channel_ * channel) Argumens: Tale Tx_V22_handshake_n argumens channel n Poner o he channel conrol daa srucure nc Descrpon: Reurns: Code example: sruc channel_ * channel; Ths funcon nalzes he ransmer o he V.22 handshake daa handler conrol srucure. I flls he approprae felds of Tx_conrol_ srucure, poned o y channel->tx_conrol_pr (felds: daa_handler_call_func, daa_handler_sae, numer_n_s). I ses up he daa handler for he ransmer o perform he Tx_V22_handshake_roune. Ths funcon s called from sae_machne(). None Rx_V22_handshake_n (channel); MOTOROLA Chaper 3. Module Descrpons 3-31
112 Daa Pump nc. Tx_V22_handshake_roune Call(s): vod Tx_V22_handshake_roune(sruc channel_ * channel) Argumens: Tale Tx_V22_handshake_roune argumens channel n Poner o he channel conrol daa srucure nc Descrpon: Ths s he TX V.22 Handshake Daa Handler roune. Ths funcon places 0xFF values (sequence of 1 s) o he Tx_daa[] uffer. Ths funcon s called y he Tx_daa_handler() funcon va he channel->tx_conrol_pr-> daa_handler_call_func (). Reurns: None Code example: sruc channel_ * channel; Tx_V22_handshake_roune (channel); 3-32 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
113 Daa Pump nc. nc V.22s The V.22s modem s nended for use on connecons on he General Swched Telephone Nework (GSTN), and on pon-o-pon 2-wre leased elephone-ype crcus. Ths s a full-duplex modem wh he recever and ransmer sharng he avalale andwdh of he communcaon channel. Ths modem can operae n eher orgnae or answer mode. In he orgnae mode, naes he communcaon process, ransms wh a carrer frequency of 1200Hz, and receves a he frequency of 2400Hz. A he oher end of he communcaons channel here s a remoe modem n answer mode. Ths remoe modem receves a 1200Hz and ransms a 2400Hz. The Quadraure Amplude modulaon (QAM) echnque s used for each channel wh synchronous lne ransmsson a 600 aud (mplemened n he qam.c fle). The consellaon could e eher 16 pons, 4 s/aud supporng an npu rae of 2400 /s (See Fg ), or 4 pon, 2 /aud supporng 1200 /s. I s compale wh a V.22 modem a he 1200 /s sgnallng rae and ncludes auomac rae recognon. A scramler s ncluded n he npu o he ransmer and a descramler a he oupu of he recever. A guard one of 1800 ±20 Hz or 550 ±20 Hz may e used whle ransmng only n he hgh channel (ransmer of he answerng modem). Fxed compromse equalzaon and adapve equalzaon shall e ncorporaed n he modem. For 2400 s per second he daa sream o e ransmed shall e dvded no groups of four consecuve s (quads). The frs wo s of a quad shall e encoded as a phase quadran change relave o he quadran occuped y he precedng sgnal elemen. (See Fg and Tale ). The las wo s of each quad defne one of four sgnallng elemens assocaed wh he new quadran (see Fg ). Example: The frs d s encoded as a phase change accordng o ale (as n V.22). The second d defnes he sgnallng elemen (he pon n a new quadran). For example, when recevng he curren aud, he phase change s 90 degrees from he prevous aud (.e. he curren pon {I, Q} s n he frs quadran and he prevous one was n he fourh, hen, he frs d s 00 (accordng otale 3-22). If he I and Q values rereved pon o he op-rgh pon of he op-rgh quadran (.e I=3 and Q=3, see fg ) hen he second d s 11. Therefore he whole quad = Tale Bs encodng n V.22s modem Frs wo s n quad (2400 /s) or d values (1200 /s) Phase change MOTOROLA Chaper 3. Module Descrpons 3-33
114 Daa Pump nc. nc A he recever, he ds are decoded and he s reassemled n he correc order. The lef hand s n Tale 3-22 and Fgure 3-8 are he frs of each par n he daa sream as eners he modulaor poron of he modem afer he scramler. For 1200 s/s he daa sream o e ransmed shall e dvded no groups of 2 consecuve s (ds). The ds shall e encoded as a phase quadran change relave o he quadran occuped y he precedng sgnal elemen (see Tale ). The sgnallng elemens correspondng o 01 n he sgnal consellaon (Fgure 3-8) shall e ransmed rrespecve of he quadran concerned. Ths ensures compaly wh Recommendaon V.22. The phase change s he acual on-lne phase shf n he ranson regon from he cener of one sgnalng elemen o he cener of he followng sgnalng elemen Scramler Fgure 3-8. V.22s 16-pon consellaon dagram A self-synchronzng scramler, whch has he generang polynomal 1 x -14 x-17 shall e ncluded n he modem ransmer. The purpose of he scramler s o randomze npu nary daa sequence, whch means ha convers hs sequence n a pseudo-random nary sequence. Ths s requred for he clock recovery module. Consderng d(nt) s he npu o he scramler, he oupu d s (nt) s gven y: d s (nt) = d(nt) XOR d s ((n-14)t) XOR d s ((n-17)t) 3-34 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
115 Daa Pump nc. where T s he daa perod. The sgnal flowchar of he modem scramler s shown n Fgure 3-9. G G G G G G GQ7 ;25 G V Q7 Fgure 3-9. V.22s scramler nc Descramler The descramler s nended for recoverng he orgnally ransmed quad. The oupu of he descramler s descred y: d(nt) = d s (nt) XOR d s ((n-14)t) XOR d s ((n-17)t) Where T s he daa perod. The sgnal flowchar of he modem scramler s shown n Fgure G G G G G G G V Q Handshake Fgure V.22s descramler ;25 GQ7 The handshake sequence for achevng synchronzaon eween callng and answerng modems s shown n Fgure If oh callng and answerng modems are V.22s modems, he handshake wll normally condon oh modems o operae a 2400 /s. If however one or oh of he modems has een se o operae a 1200 /s, hen he handshake wll condon oh modems o operae a 1200 /s. If eher he callng or answerng modem s a V.22 modem he handshake wll condon oh he V.22s and V.22 modem o operae a 1200 /s. MOTOROLA Chaper 3. Module Descrpons 3-35
116 Daa Pump nc. Wa for 456ms Deec Unscramled Ones for 155ms For 100ms Deec end of S1 For 450ms Begn 16 way decsons n recever Deec 32 consecuve 1 s For 150ms For 200ms Connec o lne&dal Slence S1 Scramled 1 s Ones a 1200 /s Scramled 1 s Ones a 2400 /s DATA Enalng of Adapve Equalzer For 100ms nc Connec o lne afer rng valdaon For 2150ms Slence For 3300ms 1800Hz or 550Hz Guard Tone Unscramled Ones 1 s Scramled 1 s Ones Scramled 1 s Ones 2100Hz Answer Tone S1 a 1200 /s a 1200 /s a 2400 /s For 75ms Deec end of S1 For 100ms For 350ms Begn 16 way decsons n recever Fgure V.22s handshake sequence Handshake sequence for callng modem (2400 /s operaon) For 150ms For 200ms a) On connecon o he lne he callng modem shall e condoned o receve sgnals n he hgh channel a 1200 /s and ransm sgnals n he low channel a 1200 /s. The modem shall nally reman slen. ) Afer 155 ± 10ms of unscramled nary 1 s have een deeced, he modem shall reman slen for a furher 456 ± 10ms hen ransm an unscramled repeve doule d paern of 00 and 11 a 1200 /s for 100 ± 3 ms. Followng hs sgnal he modem shall ransm scramled nary 1 s a 1200 /s. c) If he modem deecs scramled nary 1 s n he hgh channel a 1200 /s for 270 ± 40ms, he handshake shall connue accordng o he 1200 /s Handshake sequence for a callng modem. However, f unscramled repeve doule d 00 and 11 a 1200 /s are deeced n he hgh channel, hen he end of recep of hs sgnal should e deeced. d) 600 ± 10ms afer deecon of he end of repeve doule d 00 and 11 a 1200 /s n he hgh channel, he modem shall egn ransmng scramled nary 1 s a 2400 /s, and 450 ± 10ms afer deecng hs doule d sgnal he recever may egn makng 16-way decsons. e) Followng ransmsson of scramled nary 1 s a 2400 /s for 200 ± 10ms, he modem shall e ready o ransm daa a 2400 /s. f) When 32 consecuve scramled 1 s a 2400 /s have een deeced n he hgh DATA Deec 32 consecuve 1 s 3-36 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
117 Daa Pump nc. channel he modem shall e ready o receve daa a 2400 /s. Handshake sequence for answerng modem (2400 /s operaon) nc a) On connecon o he lne he answerng modem shall e condoned o ransm sgnals n he hgh channel a 1200 /s and receve sgnals n he low channel a 1200 /s. Followng ransmsson of he answer sequence n accordance wh Recommendaon V.25, he modem shall ransm unscramled nary 1 a 1200 /s. ) If he modem deecs scramled nary 1 s n he low channel a 1200 /s for 270 ± 40ms, he handshake shall connue accordng o he 1200 /s Handshake sequence for an answerng modem. However, f unscramled repeve doule d 00 and 11 a 1200 /s s deeced n he low channel, a he end of recep of hs sgnal he modem shall e deeced and hen ransm an unscramled repeve doule d paern of 00 and 11 a 1200 /s for 100 ± 3ms. Followng hese sgnals he modem shall ransm scramled nary 1 s a 1200 /s. c) 600 ± 10ms afer he deecon of he end of doule d 00 and 11 a 1200 /s he modem shall egn ransmng scramled nary 1 s a 2400 /s. 450 ± 10ms afer deecon he recever may egn makng 16-way decsons. d) Followng ransmsson of scramled nary 1 s a 2400 /s for 200 ± 10ms, he modem shall e ready o ransm daa a 2400 /s. e) When 32 consecuve scramled nary 1 s a 2400 /s have een deeced n he low channel he modem shall e ready o receve daa a 2400 /s. Handshake sequence for callng modem (1200 /s operaon) The followng handshake s dencal o he Recommended V.22 handshake. a) On connecon o he lne he callng modem shall e condoned o receve sgnals n he hgh channel a 1200 /s and ransm sgnals n he low channel a 1200 /s. The modem shall nally reman slen. ) Afer 155 ± 10ms of unscramled nary 1 s have een deeced, he modem shall reman slen for a furher 456 ± 10ms hen ransm scramled nary 1 s a 1200 /s. c) On deecon of scramled nary 1 s n he hgh channel a 1200 /s for 270 ± 40ms he modem shall e ready o receve daa a 1200 /s. d) 765 ± 10ms afer ha he modem shall e ready o ransm daa a 1200 /s. Handshake sequence for answerng modem (1200 /s operaon) The followng handshake s dencal o he Recommended V.22 handshake. a) On connecon o he lne he answerng modem shall e condoned o ransm sgnals n he hgh channel a 1200 /s and receve sgnals n he low channel a 1200 /s. Followng ransmsson of he answer sequence n accordance wh V.25 he modem shall ransm unscramled nary 1 s a 1200 /s. ) On deecon of scramled nary 1 s n he low channel a 1200 /s for 270 ± 40ms MOTOROLA Chaper 3. Module Descrpons 3-37
118 Daa Pump nc. he modem shall ransm scramled nary 1 a 1200 /s. c) Afer scramled nary 1 s have een ransmed a 1200 /s for 765 ± 10ms he modem shall e ready o ransm and receve daa a 1200 /s. nc Reran sequence (2400 /s operaon) A reran sequence may e naed durng daa ransmsson eween wo V.22s modems f eher modem ncorporaes a means of deecng loss of equalzaon. Transmsson of a reran sequence shall e naed eher y deecon a loss of equalzaon or y deecon of unscramled repeve doule d 00 and 11 a 1200 /s from he remoe modem (S1 sequence). The followng sequence of evens shall ake place durng he reran: a) Followng deecon of a loss of equalzaon or he end of deecon of unscramled repeve doule d 00 and 11 a 1200 /s from he remoe modem. The modem shall ransm an unscramled repeve doule d paern of 00 and 11 a 1200 /s for 100 ± 3ms. Followng hs sgnal he modem shall ransm scramled nary 1 s a 1200 /s. ) 600 ± 10ms afer he end of deecon of unscramled repeve doule d 00 and 11 a 1200 /s from he remoe modem, he modem shall egn ransmng scramled nary 1 s a 2400 /s. 450 ± 10ms afer he end of hs doule d deecon he recever may egn makng 16-way decsons. c) Followng ransmsson of scramled nary 1 s a 2400 /s for 200 ± 10ms, he modem shall e ready o ransm daa a 2400 /s. d) When 32 consecuve scramled nary 1 s a 2400 /s have een deeced from he remoe modem, he modem shall e ready o receve daa a 2400 /s. A reran eween wo modems s shown n Fgure MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
119 Daa Pump nc. For 100ms Deec end of S1 For 450ms Begn 16 way decsons n recever Deec 32 consecuve 1 s For 150ms For 200ms Modem 1 DATA S1 Scramled Ones 1 s a 1200 /s Scramled Ones 1 s a 2400 /s DATA Modem 2 nc DATA Deec end of S1 For 100ms Fgure V.22s reran sequence If a modem has ransmed a reran sgnal and has no receved unscramled repeve doule d 00 and 11 a 1200 /s mmedaely pror, or durng, or whn a me nerval equal o he maxmum expeced wo-way propagaon delay, he modem shall reurn o he egnnng of he reran sgnal as defned aove and repea he procedure unl unscramled repeve doule d 00 and 11 s receved from he remoe modem. A me nerval of 1.2 seconds s recommended for he maxmum expeced wo-way propagaon delay. If he modem fals o synchronze on he receved reran sequence, he modem shall ransm anoher reran sgnal Implemenaon S1 For 350ms Begn 16 way decsons n recever Scramled Ones 1 s a 1200 /s Scramled Ones 1 s a 2400 /s For 200ms For 150ms DATA Deec 32 consecuve 1 s The requremens of V.22s are mplemened n he v22s.c fle. Ths module s responsle for he nalzaon of he V.22s handshake conrol srucures (Rx(Tx)_V22s_DH_handshake_), he nalzaon of he QAM conrol srucures (Rx(Tx)_conrol_QAM_, for deals aou hese srucures refer o Secons / ), scramlng, descramlng, and conrollng he handshake process (Rx_V22s_handshake_roune). The descrpon of he man funcons and conrol srucures of v22s.c are gven elow RX V.22s handshake daa handler srucure sruc Rx_V22s_DH_handshake_ { MOTOROLA Chaper 3. Module Descrpons 3-39
120 Daa Pump nc. enum Rx_V22s_hadshake_sae_ sae; ool reran; un32 de_unscr_ones_ms; un32 de_scr_ones_1200_ms; un32 wa_send_ms; un32 wa_daa_1200_ms; nc }; un32 send_s1_ms; un32 de_s1_ms; un8 curren_s1; un32 ones_couner; un32 wa_adapve_equalzer_ms; un32 wa_16_way_decson_ms; un32 wa_scr_ones_2400_ms; un32 send_scr_ones_2400_ms; un8 de_scr_ones_2400_s; un32 curren_couner; un32 gloal_couner; sae - Curren sae of he RX V22s Handshake Daa Handler. Ths feld s nalzed n funcon Rx_V22s_handshake_n. reran Indcaes he reran mode. Ths feld s nalzed n funcon Rx_V22s_handshake_n. de_unscr_ones_ms - Duraon of unscramled nary 1 s deecon n ms. Ths feld s nalzed n funcon Rx_V22s_handshake_n. de_scr_ones_1200_ms - Duraon of he scramled nary 1 s on 1200 /s deecon n ms. Ths feld s nalzed n funcon Rx_V22s_handshake_n. wa_send_ms Specfed me efore sarng o ransm scramled nary 1 s n ms. Ths feld s nalzed n funcon Rx_V22s_handshake_n. wa_daa_1200_ms Specfed me efore Carrer Deec Response n ms. Ths feld s nalzed n funcon Rx_V22s_handshake_n MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
121 Daa Pump nc. nc send_s1_ms Duraon of he S1 sequence. Ths feld s nalzed n funcon Rx_V22s_handshake_n. de_s1_ms Deecon me of he S1 sequence. Ths feld s nalzed n funcon Rx_V22s_handshake_n. curren_s1 Conans one or zero. Is used for S1 deecon. Ths feld s nalzed n funcon Rx_V22s_handshake_n o 0. ones_couner - Couner used n he S1 deecon sae. Ths feld s nalzed n funcon Rx_V22s_handshake_n o 0. wa_adapve_equalzer_ms Tme perod afer whch he Adapve equalzer s enaled. Ths feld s nalzed n funcon Rx_V22s_handshake_n. ranng_adapve_equalzer_ms - Tme perod of he Adapve equalzer ranng n ms. Ths feld s nalzed n funcon Rx_V22s_handshake_n. wa_16_way_decson_ms, wa_scr_ones_2400_ms, send_scr_ones_2400_ms, de_scr_ones_2400_s Tme nervals durng he handshake process accordng o V.22s recommendaons. These felds are nalzed n funcon Rx_V22s_handshake_n. curren_couner The couner ha s used for counng he dfferen daa sequences (e.g. for deecng 32 consecuve 1 s). Ths feld s nalzed n funcon Rx_V22s_handshake_n o 0. gloal_couner - Curren couner of he s receved hroughou he handshakng phase. Ths feld s nalzed n funcon Rx_V22s_handshake_n o 0. mode - Specfes 1200 /s (V22BIS_MODE_1200) or 2400 /s (V22BIS_MODE_2400) mode. Ths feld s nalzed n funcon Rx_V22s_handshake_n TX V.22s handshake daa handler srucure sruc Tx_V22s_DH_handshake_ { enum Tx_V22s_hadshake_sae_ sae; un8 curren_; }; sae - Curren sae of he Tx V22s Handshake Daa Handler. Ths feld s nalzed n funcon Tx_V22s_handshake_n. curren_ Conans he curren quad (d) o e ransmed. Ths feld s nalzed n funcon Tx_V22s_handshake_n o 1. MOTOROLA Chaper 3. Module Descrpons 3-41
122 Daa Pump nc. V22s_scramle_ Call(s): un8 V22s_scramle_(sruc channel_ * channel, un8 ) Argumens: Tale V22s_scramle_ argumens channel n Poner o he channel conrol daa srucure n B o scramle nc Descrpon: Scramles npu s accordng o he V.22s recommendaon. d s (nt) = d(nt) XOR d s ((n-14)t) XOR d s ((n-17)t). Scramler regser s sored n channel->tx_conrol_pr->daa_pump_pr->scramler_regser. Reurns: Scramled. Code example: un8 emp_curren_ns, curren_ns; sruc channel_ * channel; emp_curren_ns = V22s_scramle_(channel, curren_ns); 3-42 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
123 Daa Pump nc. V22s_descramle_ Call(s): un8 V22s_descramle_(sruc channel_ * channel, un8 ) Argumens: Tale V22s_descramle_ argumens channel n Poner o he channel conrol daa srucure n B o descramle nc Descrpon: Descramles npu s accordng o he V.22s recommendaon. d(nt) = d s (nt) XOR d s ((n-14)t) XOR d s ((n-17)t). Descramler regser s sored n channel->rx_conrol_pr->daa_pump_pr->descramler_regser. Reurns: Descramled. Code example: un8 emp_curren_ns, curren_ns; sruc channel_ * channel; emp_curren_ns = V22s_descramle_(channel, curren_ns); MOTOROLA Chaper 3. Module Descrpons 3-43
124 Daa Pump nc. Tx_V22s_n Call(s): vod Tx_V22_n (sruc channel_ * channel,sruc Tx_conrol_QAM_ *Tx_conrol_QAM, ool callng,enum v22s_mode_ mode) Argumens: Tale Tx_V22s_n argumens channel n Poner o he channel conrol daa srucure Tx_conrol_QAM n Poner o he QAM ransmer conrol daa srucure nc callng n Indcaes eher modem n call or answer mode mode n Specfes 1200 /s (V22BIS_MODE_1200) or 2400 /s (V22BIS_MODE_2400) mode Descrpon: Reurns: Code example: Ths funcon nalzes he Transmer conrol Srucures poned o y Tx_conrol_QAM and channel accordng o V.22s and calls QAM_modulaor_n(). I flls he approprae felds of he Tx_conrol_ srucure, poned o y channel->tx_conrol_pr (felds: n_s, n_s_mask, aud_rae, numer_samples, daa_pump_call_func, sae, process_coun) and he Tx_conrol_QAM srucure (felds: f_carrer, f_guard, amplude_carrer, amplude_guard, consellaon_phase_quadran, phase_quadran_change, scramler). Ths funcon s called from sae_machne(). None sruc channel_ * channel; sruc Tx_conrol_QAM_ *Tx_conrol_QAM; Tx_V22s_n (channel, Tx_conrol_QAM, TRUE, V22s_MODE_2400); 3-44 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
125 Daa Pump nc. Rx_V22s_n Call(s): vod Rx_V22s_n (sruc channel_ * channel,sruc Rx_conrol_QAM_ *Rx_conrol_QAM, ool callng,enum v22s_mode_ mode) Argumens: Tale Rx_V22s_n argumens channel n Poner o he channel conrol daa srucure Rx_conrol_QAM n Poner o he QAM recever conrol daa srucure nc Descrpon: Reurns: Code example: callng n Indcaes eher modem n call or answer mode mode n Specfes 1200 /s (V22BIS_MODE_1200) or 2400 /s (V22BIS_MODE_2400) mode Ths funcon nalzes he Recever conrol Srucure accordng o V.22s. I flls he approprae felds of he Rx_conrol_ srucure, poned o y channel->rx_conrol_pr (felds: n_s, n_s_mask, aud_rae, numer_samples, daa_pump_call_func, sae, process_coun) and he Rx_conrol_QAM srucure (felds: f_carrer, consellaon_phase_quadran, consellaon _hreshold, nose_hreshold, phase_quadran_change, descramler). Ths funcon s called from sae_machne(). None sruc channel_ * channel; sruc Rx_conrol_QAM_ *Rx_conrol_QAM; Rx_V22s_n (channel, Rx_conrol_QAM, TRUE, V22s_MODE_1200); MOTOROLA Chaper 3. Module Descrpons 3-45
126 Daa Pump nc. Rx_V22s_handshake_n Call(s): vod Rx_V22s_handshake_n (sruc channel_ * channel, sruc Rx_V22s_DH_handshake_ *Rx_V22s_handshake, ool callng, ool reran) Argumens: Tale Rx_V22s_handshake_n argumens channel n Poner o he channel conrol daa srucure Rx_V22s_handshake n Poner o RX handshake daa handler srucure nc Descrpon: Reurns: callng n Indcaes eher modem n call or answer mode reran n Indcaes reran mode mode n Specfes 1200 /s (V22BIS_MODE_1200) or 2400 /s (V22BIS_MODE_2400) mode Ths funcon nalzes he recever V.22s handshake daa handler conrol srucure. I flls he approprae felds of Rx_conrol_ srucure, poned o y channel->rx_conrol_pr (felds: daa_handler_call_func, daa_handler_sae, numer_n_s) and he Rx_V22s_handshake srucure (felds: reran, sae, send_s1_ms, de_s1_ms, send_scr_ones_2400_ms, de_scr_ones_2400_ms, wa_adapve_equalzer_ms, de_scr_ones_1200_ms, de_unscr_ones_ms, wa_send_ms, wa_daa_1200_ms, wa_16_way_decson_ms, wa_scr_ones_2400_ms, curren_s1, ones_couner, curren_couner, gloal_couner). I ses up he daa handler for he recever o perform he Rx_V22s_handshake_roune. Ths funcon s called from sae_machne(). None Code example: sruc channel_ * channel; sruc Rx_V22s_DH_handshake_ Rx_V22_DH_hshake; Rx_V22s_handshake_n(channel,&Rx_V22s_DH_hshake,TRUE,FALSE); 3-46 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
127 Daa Pump nc. Rx_V22s_handshake_roune Call(s): vod Rx_V22s_handshake_roune(sruc channel_ * channel) Argumens: Tale Rx_V22s_handshake_roune argumens channel n Poner o he channel conrol daa srucure nc Descrpon: Ths s he RX V.22s Handshake Daa Handler roune. Ths funcon reads daa (symols) from he Rx_daa[] uffer. I conrols he handshake process. The nner sae dagram for hs roune durng handshake s shown n Fg If handshake s compleed successfully Rx_conrol->daa_handler_sae s se o RX_DH_STATE_COMPLETED, else o RX_DH_STATE_FAILED. Ths funcon s called y he Rx_daa_handler() funcon va he channel->rx_conrol_pr-> daa_handler_call_func (). RX_V22_DH_DETECT_UNSCR_ONES RX_V22_DH_WAIT_SEND RX_V22BIS_DH_SEND_S1_INIT RX_V22BIS_DH_SEND_S1 RX_V22BIS_DH_WAIT_ADAPTIVE_EQUALIZER RX_V22BIS_DH_WAIT_16_WAY_DECISION RX_V22BIS_DH_WAIT_SCR_ONES_2400 RX_V22BIS_DH_DETECT_SCR_ONES_2400 RX_V22BIS_DH_WAIT_DATA_2400 RX_V22BIS_HANDSHAKE_INIT RX_V22BIS_DH_DETECT_S1_INIT RX_V22BIS_DH_DETECT_S1 RX_V22BIS_DH_DETECT_END_S1 RX_V22BIS_DH_DETECT_SCR_ONES_1200 RX_V22BIS_DH_WAIT_DATA_1200 Reurns: None Code example: sruc channel_ * channel; Rx_V22s_handshake_roune (channel); CONNECT Fgure Handshake Sae Dagram MOTOROLA Chaper 3. Module Descrpons 3-47
128 Daa Pump nc. Tx_V22s_handshake_n Call(s): vod Tx_V22s_handshake_n (sruc channel_ * channel, sruc Tx_V22s_DH_handshake_ *Tx_V22s_handshake) Argumens: Tale Tx_V22s_handshake_n argumens channel n Poner o he channel conrol daa srucure Tx_V22s_handshake n Poner o he TX V.22s handshake daa handler srucure nc Descrpon: Reurns: Code example: sruc channel_ * channel; Ths funcon nalzes he ransmer V.22s handshake daa handler conrol srucure. I flls he approprae felds of Tx_conrol_ srucure, poned o y channel->tx_conrol_pr (felds: daa_handler_pr, daa_handler_call_func, daa_handler_sae, numer_n_s) and he Tx_V22s_handshake srucure (felds: sae, curren_). I ses up he daa handler for he recever o perform he Tx_V22s_handshake_roune. Ths funcon s called from sae_machne(). None Rx_V22s_handshake_n (channel); 3-48 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
129 Daa Pump nc. Tx_V22s_handshake_roune Call(s): vod Tx_V22s_handshake_roune(sruc channel_ * channel) Argumens: Tale Tx_V22s_handshake_roune argumens channel n Poner o he channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths s he TX V.22s Handshake Daa Handler roune. Wres sequences of 1 s or S1 no he TX_daa[] uffer dependng on he sae of he TX handshake daa handler. Ths funcon s called y he Tx_daa_handler() funcon va he channel->tx_conrol_pr-> daa_handler_call_func (). None sruc channel_ * channel; Tx_V22s_handshake_roune (channel); MOTOROLA Chaper 3. Module Descrpons 3-49
130 Daa Pump nc. Tx_V22s_change_mode Call(s): vod Tx_V22s_change_mode(sruc channel_ * channel,enum v22s_mode_ mode) Argumens: Tale Tx_V22s_change_mode argumens channel n Poner o he channel conrol daa srucure mode n Specfes he mode o swch o (eher 2400 /s or 1200 /s). nc Descrpon: Reurns: Code example: Changes he mode of he Tx V22s Daa Pump o 1200 /s or o 2400 /s y assgnng new values o n_s (he numer of s n symol), n_s_mask (he mask for rerevng n_s from he ye) and consellaon_phase_quadran (he consellaon pons). None sruc channel_ * channel; Tx_V22s_change_mode(channel, V22BIS_MODE_1200); 3-50 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
131 Daa Pump nc. Rx_V22s_change_mode Call(s): vod Rx_V22s_change_mode(sruc channel_ * channel,enum v22s_mode_ mode) Argumens: Tale Rx_V22s_change_mode argumens channel n Poner o he channel conrol daa srucure mode n Specfes he mode o swch o (eher 2400 /s or 1200 /s). nc Descrpon: Reurns: Code example: Changes he mode of he Rx V22s Daa Pump o 1200 /s or o 2400 /s y assgnng new values o n_s (he numer of s n symol), n_s_mask (he mask for rerevng n_s from he ye) and consellaon_phase_quadran (he consellaon pons). None sruc channel_ * channel; Rx_V22s_change_mode(channel, V22BIS_MODE_1200); MOTOROLA Chaper 3. Module Descrpons 3-51
132 Daa Pump nc FSK The FSK (Frequency Shf Keyng) module s used y he V.21 and V.23 modems. Ths module consss of wo locks: a FSK ransmer and recever. In he followng susecons, he operaon of he FSK modem ransmer and recever are descred. Bnary FSK (usually referred o smply as FSK) s a modulaon scheme used o send dgal nformaon eween dgal equpmen. The daa s ransmed y shfng he frequency of a connuous carrer n a nary manner o one or he oher of wo dscree frequences. One frequency s desgnaed as he mark frequency and he oher as he space frequency. The mark and space correspond o nary 1 and 0 respecvely. nc FSK Transmer The ransmer akes daa from he Tx_daa[] uffer, performs FSK modulaon akng no accoun he s for ransmng, and pus he resulan samples no he Tx_sample[] uffer (see Fgure 3-14). Tx_daa[] Fgure FSK Tx Daa Pump The FSK modulaon s represened n he followng manner: S(n) = A * cos( (ω c ω)*n + φ) Where S(n) = Transmed sgnal A = Amplude of ransmed sgnal ω c = Carrer (mean) frequency ω = Frequency devaon n = Numer of a sample φ = Phase shf FSK Tx Daa Pump Tx_sample[] For V.21: ω c = 1080 Hz (channel No.1); 1750 Hz (channel No.2). ω = 100Hz For V.23: ω c = 1500 Hz (channel 600 aud); 1700 Hz (channel 1200 aud); 420 Hz (channel 75 auds) 3-52 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
133 Daa Pump nc. ω = 200 Hz (channel 600 aud); 600 Hz (channel 1200 aud); 30 Hz (channel 75 aud) The hgher characersc frequency corresponds o he Space frequency (nary 0), he second one corresponds o he Mark frequency (nary 1). The srucure of he FSK Transmer (modulaor) s shown n Fgure D( nt ) Encoder Z ( nt ) Frequency Modulaor S( nts )=A * cos ( Z * n) nc Fgure FSK Transmer srucure The encoder akes nares for ransmng from he Tx_daa[] uffer. Dependng on he nary he encoder changes he curren phase sep (shf) hs means ha changes he curren frequency (Mark or Space) of he Frequency modulaor. The Frequency modulaor generaes he curren frequency one. Some of he generaed harmoncs fall no he frequency regon reserved for he recever. To elmnae hese harmoncs, he modulaor oupu mus e dgally flered. For hs purpose a 38-ap andpass fler (BPF) s used. The generaed resul samples are placed no he Tx_sample[] uffer. The FSK Tx Daa Pump s mplemened n he FSK_modulaor() roune FSK Recever The recever akes samples from he Rx_sample[] uffer, demodulaes hem and pus he resulan s no he Rx_daa[] crcular uffer (see Fgure 3-16). Rx_daa[] FSK Rx Daa Pump Fgure FSK Rx Daa Pump Sample Rae = 9600 Ts=1/ Sample Rae T=1/ Baud rae Rx_sample[] The srucure of he FSK Recever (demodulaor) s shown n Fgure MOTOROLA Chaper 3. Module Descrpons 3-53
134 Daa Pump nc. Clock Recovery MARK BPF I I 1 (nts) Squarer R1 S(nTs) Inpu BPF AGC MARK BPF Q SPACE BPF I Q 1 (nts) I 0 (nts) Squarer Squarer Comparaor Decson D(nT) SPACE BPF Q Q 0 (nts) Squarer R0 Sample Rae = 9600 Ts=1/ Sample Rae T=1/ Baud rae nc Fgure FSK Demodulaor srucure The receved sgnal from he Rx_sample[] uffer s flered y he Inpu BPF n order o rejec unwaned ou-of-and nose componens. Then he flered sgnal goes o he AGC (Auomac Gan Conrol) lock. Ths adapvely manans he oupu sgnal a a consan level ha s necessary for proper operaon of he algorhms of he modem recever. The algorhm of he AGC ha s used n he curren mplemenaon s descred elow. The AGC monors he sgnal and calculaes he gan correcon facor. The npu sgnal s mulpled y hs gan correcon facor so ha he sgnal maxmum remans whn a ceran range. The gan correcon facor s calculaed once every hree auds y a wo-sep process. Frs, he hree maxmum values of he sgnal, each one correspondng o one aud, are monored and added o each oher. The prevous value of he average sgnal level s hen added o hs sum and dvded y four o oan he new average sgnal level. A he second sep, he gan correcon facor s calculaed. The gan correcon facor s he resul of dvdng he maxmum-allowed sgnal level y he average sgnal level. Also he AGC lock deermnes f a carrer s presen n he receved sgnal y comparng he average sgnal level wh he nose hreshold. Afer AGC he sgnal goes o he acual FSK demodulaor. Ths ype of FSK demodulaor uses wo ypes of flers, one s cenered a he Mark frequency and he oher a he Space frequency. The Inpu BPF s cenered aou a mean frequency, Mark and Space BPFs are cenered aou he desred mark and space frequency. A smplfed specrum for he demodulaor s shown n Fg MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
135 Daa Pump nc. AMPLITUDE Mark Fler Inpu Band Pass Fler Space Fler nc Fgure Smplfed demodulaon specrum of a nary FSK sgnal Also he Mark and Space flers are desgned o make he sgnal complex. The complex sgnal has wo componens, a real (I channel) and an magnary par (Q channel). The oupus of hese flers are exacly 90 degrees ou of phase wh respec o each oher. The oupus of he Mark and Space flers are squared, hen I and Q energes are summersed: R1=(I 2 1) + (Q 2 1) R0=(I 0) 2 + (Q 0) 2 F MARK The powers of ampludes of he wo fler oupus (R1 and R0) are compared o deermne wheher he sgnal nsananeously falls mosly n he vcny of he Mark(R1>R0) or s closer o he space (R0>R1). The resulan demodulaed s are hen placed no he Rx_daa[] uffer. The FSK Rx Daa Pump s mplemened n he FSK_demodulaor() roune. The FSK module rounes can e found n he fsk.c fle. The FSK Tx and Rx conrol daa srucures are defned n fsk.h". The Tx FSK conrol daa srucure: F SPACE FREQUENCY /********************************************************************** * FSK Transmer conrol daa srucure ***********************************************************************/ ypedef sruc Tx_conrol_FSK_ { un32 f_space; un32 f_mark; MOTOROLA Chaper 3. Module Descrpons 3-55
136 Daa Pump nc. un16 phase; un16 phase_ncr[2]; un16 aud_frac; un16 aud_ncr; un8 curren_; n16 amplude; }; nc The Tx_conrol_FSK_ srucure parameer descrpons: f_space - Space frequency, n Hz. I s used o represen nary 0. I s nalzed n Tx_V21_n() or Tx_V23_n(). f_mark - Mark frequency, n Hz. I s used o represen nary 1. I s nalzed n Tx_V21_n() or Tx_V23_n(). phase Curren phase of he frequency generaor, n Q15 forma. I s nalzed n FSK_modulaor_n() o 0. phase_ncr - Frequency phase ncremen per sample, n Q15 forma. phase_ncr[0] s used for Space frequency and phase_ncr[1] s used for Mark frequency. I s nalzed n FSK_modulaor_n(). aud_frac - Fraconal par of he aud, n Q15 forma. I s nalzed n FSK_modulaor_n() o 0. aud_ncr - Incremen o <aud_frac> per sample, n Q15 forma. I s nalzed n FSK_modulaor_n(). curren_ - Curren of daa for modulaon. I s nalzed n FSK_modulaor_n() o 0. amplude - Amplude of he oupu sgnal, n Q14. I s nalzed n Tx_V21_n () or Tx_V23_n(). fler_sze - The numer of coeffcens used y he BPF. Ths feld s nalzed n FSK_modulaor_n(). fler_coef - Coeffcens of he BPF. Ths feld s nalzed n QAM_modulaor_n(). fler_uf - Cyclc uffer used y he fler algorhm of he BPF. Ths feld s nalzed n FSK_modulaor_n() o 0. fler_uf_pr - Poner o he curren elemen of he fler_uf[]. Ths feld s nalzed n FSK_modulaor_n() MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
137 Daa Pump nc. The Rx FSK conrol daa srucure: /********************************************************************** * FSK Recever conrol daa srucure ***********************************************************************/ ypedef sruc Rx_conrol_FSK_ { un32 f_space; un32 f_mark; n16 * lpf_coef; nc un32 fler_sze; n16 fler_space_[fsk_filter_coef_number]; n16 fler_space_q[fsk_filter_coef_number]; n16 fler_mark_[fsk_filter_coef_number]; n16 fler_mark_q[fsk_filter_coef_number]; n16 fler_uf[fsk_filter_buf_size]; un32 fler_uf_pr; un16 aud_ncr; un16 aud_frac; un8 las_; un32 fler_pf_sze; n16 fler_pf_coef[fsk_bpf_coef_number]; n16 fler_pf_uf[fsk_bpf_buf_size]; un32 fler_pf_uf_pr; un32 agc; un32 agc_average; n16 agc_cn; n16 sgnal_max; n16 sgnal_presen; }; The Rx_conrol_FSK_ srucure Memer Descrpons: f_space - Space frequency, n Hz. I s used o represen nary 0. I s nalzed n Rx_V21_n() or Rx_V23_n(). MOTOROLA Chaper 3. Module Descrpons 3-57
138 Daa Pump nc. nc f_mark - Mark frequency, n Hz. I s used for o represen nary 1. I s nalzed n Rx_V21_n() or Rx_V23_n(). lpf_coef - Poner o coeffcens of he FIR LPF(low-pass fler). I s used for calculaon of coeffcens for Space and Mark BPF flers. I s nalzed n Rx_V21_n() or Rx_V23_n(). fler_sze - The numer of coeffcens used y he Space and Mark BPF flers. I s nalzed n Rx_V21_n() or Rx_V23_n(). fler_space_ - Array of I channel coeffcens of he Space BPF fler. I s nalzed n FSK_demodulaor_n(). fler_space_q - Array of Q channel coeffcens of he Space BPF fler. I s nalzed n FSK_demodulaor_n(). fler_mark_ - Array of I channel coeffcens of he Mark BPF fler. I s nalzed n FSK_demodulaor_n(). fler_mark_q - Array of Q channel coeffcens of he Mark BPF fler. I s nalzed n FSK_demodulaor_n(). fler_uf - Cyclc uffer used y he Mark and Space BPF flers. I conans he samples passed hrough he npu BPF and AGC locks. I s nalzed n FSK_demodulaor_n() o 0 s. fler_uf_pr - Relave poner o he curren elemen n fler_uf[]. I s nalzed n FSK_demodulaor_n(). aud_ncr - Incremen o <aud_frac> per sample, n Q15 forma. I s nalzed n FSK_demodulaor_n(). aud_frac - Fraconal par of he aud, n Q15 forma. I s nalzed n FSK_demodulaor_n() o 0. las_ - Las demodulaed of daa (0 or 1). I s nalzed n FSK_demodulaor_n() o 0. fler_pf_sze - The numer of coeffcens used y he Inpu BPF fler. I s nalzed n FSK_demodulaor_n(). fler_pf_coef - Array of coeffcens of he Inpu BPF fler. I s nalzed n FSK_demodulaor_n(). fler_pf_uf - Cyclc uffer used y he Inpu BPF fler. I conans he samples receved from he Rx_sample[] uffer. I s nalzed n FSK_demodulaor_n() o 0 s. fler_pf_uf_pr - Relave poner o he curren elemen n fler_pf_uf[]. I s nalzed n FSK_demodulaor_n(). agc - The AGC gan correcon facor, n Q14 forma. I s nalzed n FSK_demodulaor_n() o 1 n Q14 forma (COS_BASE) MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
139 Daa Pump nc. agc_average - The curren average sgnal level n Q14 forma. I s nalzed n FSK_demodulaor_n() o 0. agc_cn - Couner of auds lef for calculaon of he new gan correcon facor. I s nalzed n FSK_demodulaor_n() o 3. sgnal_max - The maxmum value of he npu sgnal durng a aud n Q14 forma. I s nalzed n FSK_demodulaor_n() o 0. sgnal_presen - Indcaes he carrer sgnal presence. I s equal o TRUE f he sgnal s presen and o FALSE oherwse. I s nalzed n FSK_demodulaor_n() o FALSE. nc MOTOROLA Chaper 3. Module Descrpons 3-59
140 Daa Pump nc. FSK_modulaor_n Call(s): vod FSK_modulaor_n(sruc channel_ * channel); Argumens: Tale FSK_modulaor_n argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon ses he felds of he Tx FSK conrol daa srucure (phase_ncr, aud_ncr, phase, aud_frac, curren_), poned o y he channel->tx_conrol_pr->daa_pump_pr o her defaul values.. Ths funcon s called y he Tx_V21_n() and Tx_V23_n() funcons. None. sruc channel_ channel; FSK_modulaor_n(&channel); 3-60 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
141 Daa Pump nc. FSK_modulaor Call(s): vod FSK_modulaor(sruc channel_ * channel); Argumens: Tale FSK_modulaor argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon ges s of daa from he Tx_daa[] uffer, processes hem performng nary FSK modulaon (see ), and places he resulan samples no he Tx_sample[] uffer. The numer of generaed samples, per call, s defned y channel->tx_conrol_pr->numer_samples. Ths funcon s called y he Tx_daa_pump() funcon va he channel->tx_conrol_pr-> daa_pump_call_func (). None. sruc channel_ channel; FSK_modulaor (&channel); MOTOROLA Chaper 3. Module Descrpons 3-61
142 Daa Pump nc. FSK_demodulaor_n Call(s): vod FSK_demodulaor_n(sruc channel_ * channel); Argumens: Tale FSK_demodulaor_n argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon ses he felds of he Rx FSK conrol daa srucure (aud_ncr, aud_frac, fler_uf, fler_uf_pr, las_, fler_space_, fler_space_q, fler_mark_, fler_mark_q, fler_pf_sze, fler_pf_uf, fler_pf_uf_pr, fler_pf_coef, agc, agc_average, agc_cn, sgnal_max, sgnal_presen), poned o y channel->rx_conrol_pr->daa_pump_pr o her defaul values.. Ths funcon s called y he Rx_V21_n() and Rx_V23_n() funcons. None. sruc channel_ channel; FSK_demodulaor_n(&channel); 3-62 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
143 Daa Pump nc. FSK_demodulaor Call(s): vod FSK_demodulaor(sruc channel_ * channel); Argumens: Tale FSK_demodulaor argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon ges samples from he Rx_sample[] uffer, processes hem performng nary FSK demodulaon (see ), and places he resulan s no he Rx_daa[] uffer. Ths funcon s called y he Rx_daa_pump() funcon va he channel->rx_conrol_pr-> daa_pump_call_func (). None. sruc channel_ channel; FSK_demodulaor (&channel); MOTOROLA Chaper 3. Module Descrpons 3-63
144 Daa Pump nc. nc DPSK The Dfferenal Phase Shf Keyng (DPSK) modulaon echnque s used n he V.22 modem. Ths echnque s mplemened n he module dpsk.c. Ths module consss of wo man locks: he DPSK ransmer and DPSK recever. In he followng susecons, he operaon of he modem ransmer and recever are descred. The ransmer acceps daa (s) from he Daa Termnal Equpmen (DTE). I hen performs he necessary processng n order o place hs daa no he proper form for ransmsson hrough he Pulc Swched Telephone Nework. Ths process ascally consss of he modulaon of he aseand nformaon (logcal 1 s and 0 s sen y he DTE) no he passand of he communcaons channel for ransmsson. The recever collecs he nformaon from he elephone nework and convers ack no s orgnal form,.e. he s sen y he DTE. The dpsk.c module consss of wo man locks: he DPSK ransmer and he DPSK recever. These locks are called he daa pump. They are execued every me he Tx_sample uffer s almos empy (he modulaor or TX daa pump s execued) or when Rx_sample s full enough (he demodulaor or RX daa pump s execued). They are called from he modem.c module DPSK ransmer In Dfferenal Phase Shf Keyng, he nformaon s encoded as he phase change of he ransmer carrer. Wh φ(n) denong he phase ha conans he nformaon o e ransmed, he ransmed sgnal s(n) s represened mahemacally y: s(n) = A cos(ωn + φ(n))(1) Where ω s he carrer frequency. The parameer A deermnes he amplude of he ransmed sgnal. I can also e wren as: s(n) = A (cos(ωn) cos(φ(n)) - sn(ωn) sn(φ(n)))(2) The susuon of I(n) = A cos(φ(n)) Q(n) = -A sn(φ(n)) no (2) resuls n (3) used o descre DPSK modulaon sysems: s(n) = I(n) cos(ωn) + Q(n) sn(ωn)(3) Each value of he {I(n),Q(n)} sequence corresponds o one sgnalng elemen (symol) ransmed. The numer of sgnalng elemens ransmed per second s commonly referred o as he aud rae, whch for V.22 s se y he proocol o 600. The se of possle values of he sequence {I(n),Q(n)} deermnes he sgnal consellaon, whch s gven n wo-dmensonal represenaon. The sgnal consellaon, commonly referred o as he 3-64 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
145 Daa Pump nc. consellaon dagram, s a geomerc pcure ha emphaszes he fac ha he wo channels are 90 degrees (Quadraure) ou-of-phase. The V.22, wh 600 aud rae, accomplshes he ransmsson of 1200 ps y encodng wo ncomng s (d) n a sngle aud. Snce here are four possle values for every d, he consellaon dagram for V.22 conans four pons. The overall lock dagram for he DPSK ransmer s shown n Fgure The asc srucural locks are he scramler, encoder, dgal modulaor and dgal fler. Guard Tone Generaor nc D(nT) D s (nt) P(nT) Modulaor BPF Scramler Encoder Scramler Sample Rae = 9600 Baud rae= 600 Ts=1/ Sample Rae T=1/ Baud rae Fgure DPSK ransmer lock dagram The purpose of he scramler s o randomze he npu nary daa sequence, whch means ha convers hs sequence n a pseudo-random nary sequence wh some defned perod. Ths s requred for he clock recovery module. For more dealed nformaon aou he scramler refer o secon Encoder The encoder mplemens encodng of he ncomng sequence d s (n) no he approprae phase changes.e. s funcon s o map every wo ncomng s of he ncomng sequence d s (n) o a oal phase. The oal phase s hen ransmed. The mappng rule can e seen n secon In he curren mplemenaon of he encoder, changes he carrer phase accordng o he ncomng d and s execued once per aud (.e. wh sample rae = 9600 he phase changes once per 16 samples) Modulaor The modulaor modulaes he cosne wave (whch conans he phase change). The modulang frequency for V.22 s 1200 Hz for a callng modem and 2400 Hz for an answerng modem. + S(nTs) Bandpass fler Afer modulaon, he sgnal canno e drecly ransmed hrough he elephone lne. The reason s ha he nsananeous changes of I(nT ) and Q(nT ) generae hgher-order harmoncs. Some of hese harmoncs fall no he frequency regon reserved for he recever. MOTOROLA Chaper 3. Module Descrpons 3-65
146 Daa Pump nc. To elmnae hese harmoncs, he modulaor oupu mus e dgally flered. For hs purpose a 38-ap andpass fler (BPF) s used. Ths fler s ased on a lowpass (LPF) FIR fler and s coeffcens are calculaed accordng o he followng rule: h (nt s ) = 2 h l (nt s ) cos (nωt s ) Where T s s he samplng perod and h l (nt s ) are he coeffcens of he LPF. The coeffcens of he BPF are calculaed n he nalzaon roune (DPSK_modulaor_n) and depend on he carrer frequency Guard one generaor nc Ths module generaes he guard one, whch s hen added o he man sgnal. For V.22 he frequency of he guard one s 1800 Hz ± 20 Hz or 550 ± 20 Hz, and s only ransmed when he modem s ransmng n he hgh channel (carrer frequency s 2400 Hz) DPSK recever Ths susecon descres he funconal locks requred o mplemen a DPSK recever. The recever srucure s more sophscaed han ha of he ransmer. An overall dagram of he modem recever s shown n Fg The asc srucural locks of he modem recever are he npu andpass flers, he auomac gan conrol (AGC), he demodulaor, he decson lock, he decoder, he descramler, he carrer recovery, and he clock recovery. S(nTs) BPF I BPF Q I(nTs) Q(nTs) AGC X X Demodulaor I d (nts) Q d (nts) Clock Recovery Carrer Recovery Decson I dec (nt) Q dec (nt) Decoder D s (nt) Descramler D(nT) Bandpass flers Fgure DPSK modem recever lock dagram The npu sgnal s andpass flered for he followng reasons: Rejecon of ou-of-and nose, ncludng he rejecon of he ransm sgnal specrum Inroducon of a 90-degree relave phase shf requred for I and Q channel separaon 3-66 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
147 Daa Pump nc. Fxed equalzaon for lne dsoron In he curren mplemenaon a 38-ap andpass FIR fler s used. nc Auomac Gan Conrol (AGC) The ncomng sgnal level may vary over a large range due o aenuaons n he elephone lne. However for clock and carrer recovery modules he sgnal level mus e ndependen of he aenuaon nroduced y he communcaons channel and reman consan. Auomac Gan Conrol performs hs ask. I adjuss he envelope of he I and Q channels so ha hey are of he same magnude. The algorhm of he AGC ha s used n he curren mplemenaon s descred elow. The AGC monors he I channel of he recever and calculaes he gan correcon facor. The gan correcon facor s calculaed once every hree aud y a wo-sep process. Frs, he hree maxmum values of he sgnal, each one correspondng o one aud (16 samples), are monored and added o each oher. The prevous value of he average sgnal level s hen added o hs sum and dvded y four o oan he new average sgnal level. In he second sep, he gan correcon facor s calculaed. The gan correcon facor s he resul of dvdng he maxmum-allowed sgnal level y he average sgnal level. The AGC lock also deermnes f a carrer s presen n he receved sgnal y comparng he average sgnal level wh he hreshold Demodulaor Wh I p (nt s ) and Q p (nt s ) as npus o he demodulaor, he oupus I (nt s ) and Q (nt s ) are gven y: I (nt s ) = I p (nt s ) cos(φ(nt s) ) + Q p (nt s ) sn (φ(nt s )) Q (nt s ) = - I p (nt s ) sn(φ(nt s )) + Q p (nt s ) cos (φ(nt s )) Where φ s he local carrer phase Decson lock and Decoder The decson lock calculaes he curren phase from he values of he aseand I and Q. The phase change s hen calculaed y suracng he prevous value of he phase from he curren value of he phase. The decoder hen fnds he d ha corresponds o he las phase change (accordng o ale 3.1.3). MOTOROLA Chaper 3. Module Descrpons 3-67
148 Daa Pump nc Descramler The descramler s nended o recover he orgnally ransmed d. For more dealed nformaon aou he descramler refer o secon nc Clock Recovery The purpose of Clock Recovery s o deec he mddle of a aud. The decson lock makes decsons exacly n he mddle of he aud. The energy of he ncomng sgnal a hs pon s maxmal, so he proaly of a msake durng decson makng s mnmal. In he curren mplemenaon he early-lae mehod of Clock Recovery s used. Fgure 3-21 shows he energy values for each sample over he aud. I can e seen n hs fgure ha f he energy sample E7 s n he mddle of he aud, has he hghes energy value and he res of he samples are locaed symmercally around,.e. E1=E13, E2=E12, E3=E11 and so on. In oher words E1-E13 = 0, E3-E11 = 0. If E7 s shfed lef and s no on op of he energy hll, hen E11 ecomes greaer han E3 or E3 E11 < 0. If E7 s shfed rgh, E3 E11 > 0. So he dfference (E3-E11) may e used as an error value. If hs value s negave, means ha he mddle of he local aud occurred earler han he mddle of he ncomng aud. Therefore, he local aud clock mus e delayed. If posve he local aud clock mus e advanced. (QHUJ\ ( ( ( ( ( ( ( ( ( (( ( ( ( ( ( Fgure Sgnal energes over a aud 7LPH In he curren mplemenaon he energy of he hrd and elevenh samples are calculaed. The dfference eween hese energes s hen found. Ths dfference s hen lowpass flered y a frs-order IIR fler. The oupu of he fler s used for local aud clock adjusng. The lock dagram of he clock recovery algorhm s shown n Fgure MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
149 Daa Pump nc., 4 (UURU VLJQDO JHQHUDWRU H HBVLJ 'HFLVLRQ /RRSILOWHU %DXGFORFN Fgure Clock Recovery lock dagram nc Carrer Recovery Carrer Recovery s used for adjusng he phase of he local carrer o mach he phase of he ncomng carrer. I s mporan o generae a local carrer ha has he same phase and frequency as he ncomng carrer ecause s used n he demodulaor o demodulae he ncomng sgnal and rereve he aseand nformaon. To mplemen Carrer Recovery a phase-locked loop s used (Fgure 3-23).,QFRPLQJ FDUULHU 3KDVH GHWHFWRU HUURU JHQHUDWRU /RRSILOWHU Fgure Carrer Recovery lock dagram The phase deecor generaes an error ha s used o synchronze he local carrer o he ncomng carrer. Ths error sgnal conans he nformaon aou he phase and frequency dfference eween he local and he ncomng carrers. The consellaon pons ha were chosen n he curren mplemenaon are shown n Fgure The oupu of he phase deecor s of he form: E(nT ) = sgn(q (nt )) I (nt ) - sgn(i (nt )) Q (nt ) H HBVLJ &DUULHU JHQHUDWRU /RFDO FDUULHU MOTOROLA Chaper 3. Module Descrpons 3-69
150 Daa Pump nc. 1 Q 1 1 I nc 1 Fgure DPSK recever decson pons The error E(nT ) s a geomercal dsance from he pon used o make he decson and he lne ha nersecs he pons (0,0) and he opmum decson pon. The opmum decson pons are he deal pons for a decson o e made (he lack pons n Fg ). If he local carrer does no mach he remoe carrer, he acual receved pons are roaed from he deal pons y some angle. Now, draw a lne hrough he wo pons: he opmum or deal pon and he orgn (0,0). The error E s he dsance from hs lne o he pon ha s used o make he decson. Therefore, E shows how far ou our new pon (he pon whch s used o make decson) s from s deal poson (he opmum pon). Ths error s hen lowpass flered y he loop fler (frs-order IIR fler) and s used o adjus he curren value of he local carrer phase (eher delay or advance he phase of he local carrer). So, as a resul he Clock Recovery lock roaes he consellaon dagram o mach he one shown n Fg The fler coeffcens and hresholds change dependng on he sae of he recever (handshake mode or daa mode). The phase correcon s made once per aud and s performed n he mddle of he aud DPSK modulaor conrol srucure ypedef sruc Tx_conrol_DPSK_ { un32 f_carrer; un32 f_guard; 3-70 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
151 Daa Pump nc. un16 carrer_phase; un16 guard_phase; un16 carrer_phase_ncr; un16 guard_phase_ncr; un16 aud_frac; un16 aud_ncr; nc }; un16 * omega_pr; un8 curren_ns; n16 amplude_carrer; n16 amplude_guard; scramler_call_func_ scramler; ool scramler_enaled; un32 scramler_regser; un32 fler_sze; n16 fler_coef[dpsk_fixed_eq_coef_number]; n16 fler_uf[dpsk_filter_buf_size]; un32 fler_uf_pr; f_carrer - Carrer frequency n Hz. Ths feld s nalzed n funcon Tx_V22_n. f_guard - Guard one frequency n Hz. Ths feld s nalzed n funcon Tx_V22_n. carrer_phase - Curren phase of he carrer frequency generaor n Q15 forma. Ths feld s nalzed n funcon DPSK_modulaor_n o 0. guard_phase - Curren phase of he guard one generaor n Q15 forma. Ths feld s nalzed n funcon DPSK_modulaor_n o 0. carrer_phase_ncr - Carrer frequency phase ncremen per sample n Q15 forma. Ths feld s nalzed n funcon DPSK_modulaor_n. MOTOROLA Chaper 3. Module Descrpons 3-71
152 Daa Pump nc. nc guard_phase_ncr - Guard one frequency phase ncremen per sample n Q15 forma. Ths feld s nalzed n funcon DPSK_modulaor_n. aud_frac - Fraconal par of he aud n Q14 forma. (.e. 0.5 = he mddle of he aud). Ths feld s nalzed n funcon DPSK_modulaor_n o 0. aud_ncr - Incremen o <aud_frac> per sample n Q15 forma. Ths feld s nalzed n funcon DPSK_modulaor_n. omega_pr - Poner o Ns-o-Phase Change Correspondence ale. Ths feld s nalzed n funcon Tx_V22_n. curren_ns - N-s of daa for modulaon. Ths feld s nalzed n funcon DPSK_modulaor_n o 0. amplude_carrer - Amplude of he oupu sgnal. Ths feld s nalzed n funcon Tx_V22_n. amplude_guard - Amplude of he Guard one sgnal. Ths feld s nalzed n funcon Tx_V22_n. scramler - Poner o he scramler funcon. Ths feld s nalzed n funcon Tx_V22_n. scramler_enaled Indcaes f he scramler s enaled. Ths feld s nalzed n funcon DPSK_modulaor_n o TRUE. scramler_regser - Shf Regser used y he scramler. Ths feld s nalzed n funcon DPSK_modulaor_n o 0. fler_sze - The numer of coeffcens used y he BPF. Ths feld s nalzed n funcon DPSK_modulaor_n. fler_coef - Coeffcens of he BPF. Ths feld s nalzed n funcon DPSK_modulaor_n. fler_uf - Cyclc uffer used y he fler algorhm of he npu BPFs. Ths feld s nalzed n funcon DPSK_modulaor_n o 0. fler_uf_pr - Poner o he curren elemen of he fler_uf[].ths feld s nalzed n funcon DPSK_modulaor_n DPSK demodulaor conrol srucure ypedef sruc Rx_conrol_DPSK_ { un32 f_carrer un16 carrer_phase; un16 carrer_phase_ncr; un16 aud_frac; 3-72 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
153 Daa Pump nc. un16 aud_ncr; un16 * omega_pr; un16 oal_phase; un32 fler_sze; n16 fler_mark_[dpsk_fixed_eq_coef_number]; n16 fler_mark_q[dpsk_fixed_eq_coef_number]; nc n16 fler_uf[dpsk_filter_buf_size]; un32 fler_uf_pr; un16 arrary_phase; ool decson_enaled; scramler_call_func_ descramler; ool descramler_enaled; un32 descramler_regser; n16 nose_hreshold; n16 agc; un32 agcave; n16 avecn; n16 smax; n16 carrer_locked; n16 PLL1; n16 CPLL1; n32 cerror_sg; MOTOROLA Chaper 3. Module Descrpons 3-73
154 Daa Pump nc. nc }; n32 clerror_sg; n32 clerror2_sg; un32 aud_nrg3; un32 aud_nrg7; n16 sgnal_presen; n16 clock_correced; f_carrer - Carrer frequency n Hz. Ths feld s nalzed n funcon Rx_V22_n. carrer_phase - Curren phase of he carrer frequency generaor n Q15 forma. Ths feld s nalzed n funcon DPSK_demodulaor_n o 0. carrer_phase_ncr - Carrer frequency phase ncremen per sample n Q15 forma. Ths feld s nalzed n funcon DPSK_demodulaor_n. aud_frac - Fraconal par of he aud n Q15 forma. (.e. 0.5 = he mddle of he aud). Ths feld s nalzed n funcon DPSK_demodulaor_n o 0. aud_ncr - Incremen o <aud_frac> per sample n Q15 forma. Ths feld s nalzed n funcon DPSK_demodulaor_n. omega_pr - Poner o Ns-o-Phase Change Correspondence ale. Ths feld s nalzed n funcon Rx_V22_n. oal_phase - The phase ransmed durng he prevous aud nerval n Q15 forma. Ths feld s nalzed n funcon DPSK_demodulaor_n o 0. fler_sze - The numer of coeffcens used y he npu BPF. Ths feld s nalzed n funcon DPSK_demodulaor_n. fler_mark_i - Coeffcens of he BPF for I channel n Q14 forma. Ths feld s nalzed n funcon DPSK_demodulaor_n. fler_mark_q - Coeffcens of he BPF for Q channel n Q14 forma. Ths feld s nalzed n funcon DPSK_demodulaor_n. fler_uf - Cyclc uffer used y he fler algorhm of he npu BPFs. Ths feld s nalzed n funcon DPSK_demodulaor_n o 0. fler_uf_pr - Poner o he curren elemen of he fler_uf[].ths feld s nalzed n funcon DPSK_demodulaor_n. decson_enaled - Indcaes f he decson lock s enaled. Ths feld s nalzed n funcon DPSK_demodulaor_n o TRUE. descramler - Poner o he descramler funcon. Ths feld s nalzed n funcon Rx_V22_n. descramler_enaled - Indcaes f he descramler s enaled. Ths feld s nalzed n funcon DPSK_demodulaor_n o TRUE MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
155 Daa Pump nc. nc descramler_regser - Shf Regser used y he descramler. Ths feld s nalzed n funcon DPSK_demodulaor_n o 0. nose_hreshold - Threshold for sgnal/nose deecon n Q14 forma. Ths feld s nalzed n funcon Rx_V22_n. agc - The AGC gan facor n Q11 forma. Ths feld s nalzed n funcon DPSK_demodulaor_n o 1. agcave - The curren average sgnal level n Q14 forma. Ths feld s nalzed n funcon DPSK_demodulaor_n o avecn - The couner of he aud n he AGC lock. Ths feld s nalzed n funcon DPSK_demodulaor_n o 0. smax - The maxmum I value over he aud n Q14 forma. Ths feld s nalzed n funcon DPSK_demodulaor_n o 0. carrer_locked - Indcaes ha he carrer s locked and he recever s n daa mode. Ths feld s nalzed n funcon DPSK_demodulaor_n o FALSE. PLL1 - Fler coeffcen for he Carrer Recovery loop fler. Ths feld s nalzed n funcon DPSK_demodulaor_n. CPLL1 - Fler coeffcen for he Clock Recovery loop fler. Ths feld s nalzed n funcon DPSK_demodulaor_n. cerror_sg Flered error sgnal for Carrer Recovery and he sae of he loop fler. Ths feld s nalzed n funcon DPSK_demodulaor_n o 0. clerror_sg Flered error sgnal for Clock Recovery and he sae of he loop fler. Ths feld s nalzed n funcon DPSK_demodulaor_n o 0. clerror2_sg - Indcaes he false lock of aud clock for Clock Recovery. Ths feld s nalzed n funcon DPSK_demodulaor_n o 0. aud_nrg3 - Energy value of he 3rd sample. Ths feld s nalzed n funcon DPSK_demodulaor_n o 0. aud_nrg7 - Energy value of he 7h sample. Ths feld s nalzed n funcon DPSK_demodulaor_n o 0. sgnal_presen - Indcaes he carrer frequency sgnal presence. Ths feld s nalzed n funcon DPSK_demodulaor_n o FALSE. clock_correced - Indcaes ha he Clock was correced durng he curren aud. Ths feld s nalzed n funcon DPSK_demodulaor_n o FALSE. MOTOROLA Chaper 3. Module Descrpons 3-75
156 Daa Pump nc. DPSK_modulaor_n Call(s): vod DPSK_modulaor_n(sruc channel_ * channel) Argumens: Tale DPSK_modulaor_n argumens channel n Poner o he channel conrol daa srucure nc Descrpon: Reurns: Code example: Inalzaon of he DPSK ransmer conrol srucure (Tx_conrol_DPSK_). The poner o hs srucure s conaned n channel->tx_conrol_pr->daa_pump_pr. Flls up he approprae felds of hs srucure wh defaul values (carrer_phase, aud_frac, scramler_regser and so on (refer o Secon for deals)). Ths funcon s called y he Tx_V22_n() funcons of he v22.c module. None sruc channel_ * channel; DPSK_modulaor_n (channel); 3-76 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
157 Daa Pump nc. DPSK_modulaor Call(s): vod DPSK_modulaor(sruc channel_ * channel) Argumens: Tale DPSK_modulaor argumens channel n Poner o he channel conrol daa srucure nc Descrpon: Reurns: Code example: sruc channel_ * channel; DPSK_modulaor(channel); Ths funcon performs all he operaons of he DPSK ransmer. I ges s of daa from he Tx_daa[] uffer, processes hem, and places he resulan samples no he Tx_sample[] uffer. The numer of generaed samples, per call, s defned y channel->tx_conrol_pr->numer_samples. Ths funcon conans he scramler, he encoder, dgal modulaor and dgal fler. For more dealed nformaon aou hese locks refer o Secon Ths funcon s called y he Tx_daa_pump() funcon of he modem.c module va he channel->tx_conrol_pr-> daa_pump_call_func (). None MOTOROLA Chaper 3. Module Descrpons 3-77
158 Daa Pump nc. DPSK_demodulaor_n Call(s): vod DPSK_demodulaor_n(sruc channel_ * channel) Argumens: Tale DPSK_demodulaor_n argumens channel n Poner o he channel conrol daa srucure nc Descrpon: Reurns: Code example: Inalzaon of he DPSK recever conrol srucure (Rx_conrol_DPSK_). The poner o hs srucure s conaned n channel->rx_conrol_pr->daa_pump_pr. Flls up he approprae felds of hs srucure wh defaul values (carrer_phase, carrer_phase_ncr, oal_phase, aud_frac, descramler_regser, fler_uf and so on (refer o Secon for more deals)). Ths funcon s called y he Rx_V22_n() funcons of he v22.c module. None sruc channel_ * channel; DPSK_demodulaor_n (channel); 3-78 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
159 Daa Pump nc. DPSK_demodulaor Call(s): vod DPSK_demodulaor(sruc channel_ * channel) Argumens: Tale DPSK_demodulaor argumens channel n Poner o he channel conrol daa srucure nc Descrpon: Reurns: Code example: sruc channel_ * channel; DPSK_demodulaor (channel); Ths funcon performs all he operaons of he DPSK recever. I ges samples from he Rx_sample[] uffer, processes hem, and places he resulan s no he Rx_daa[] uffer. I conans he npu andpass flers, he auomac gan conrol (AGC), he demodulaor, he decson lock, he decoder, he descramler, he carrer recovery, and he clock recovery. For more dealed nformaon aou hese locks refer o Secon Ths funcon s called y he Rx_daa_pump() funcon va channel->rx_conrol_pr-> daa_pump_call_func (). None MOTOROLA Chaper 3. Module Descrpons 3-79
160 Daa Pump nc. nc QAM The Quadraure Amplude modulaon (QAM) echnque s requred o e used n he V.22s modem. Ths echnque s mplemened n he qam.c module. Ths module consss of wo man locks: he QAM ransmer and he QAM recever. In he followng susecons, he operaon of he modem ransmer and recever are descred. The ransmer acceps daa (s) from he Daa Termnal Equpmen (DTE). I hen performs he necessary processng o place hs daa no he proper form for ransmsson hrough he Pulc Swched Telephone Nework. Ths process ascally consss of he modulaon of he aseand nformaon (logcal 1 s and 0 s sen y he DTE) no he passand of he communcaons channel for ransmsson. The recever collecs he nformaon from he elephone nework and convers ack no s orgnal form,.e. he s sen y he DTE. The qam.c module consss of wo man locks: he QAM ransmer and he QAM recever. These locks are called he daa pump. They are execued every me he Tx_sample uffer s almos empy (he modulaor or TX daa pump s execued) or when he Rx_sample s full enough (he demodulaor or RX daa pump s execued). They are called from he modem.c module QAM ransmer In QAM, he nformaon s encoded as he phase and amplude change of he ransmer carrer. Wh φ(n) denong he phase ha conans he nformaon o e ransmed, he ransmed sgnal s(n) s represened mahemacally y s(n) = A(n) cos(ωn + φ(n)) (4) Where ω s he carrer frequency. The parameer A(n) deermnes he amplude of he ransmed sgnal. I can also e wren as: s(n) = A(n) (cos(ωn) cos(φ(n)) - sn(ωn) sn(φ(n))) (5) The susuon of I(n) = A(n) cos(φ(n)) Q(n) = -A(n) sn(φ(n)) no (5) resuls n (6) used o descre QAM modulaon sysems: s(n) = I(n) cos(ωn) + Q(n) sn(ωn) (6) Each value of he {I(n),Q(n)} sequence corresponds o one sgnalng elemen (symol) ransmed. The numer of sgnalng elemens ransmed per second s commonly referred o as he aud rae, whch for V.22s s se y he proocol o 600. The se of possle values of he sequence {I(n),Q(n)} deermnes he sgnal consellaon, whch s 3-80 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
161 Daa Pump nc. gven n a wo-dmensonal represenaon. The sgnal consellaon, commonly referred o as he consellaon dagram, s a geomerc pcure ha emphaszes he fac ha he wo channels are 90 degrees (Quadraure) ou-of-phase. The V.22s, wh 600-aud rae, accomplshes he ransmsson of 2400 ps y encodng four ncomng s (quad) n a sngle aud. Snce here are sxeen possle values for every quad, he consellaon dagram for V.22s conans sxeen pons. The overall lock dagram for he QAM ransmer s shown n Fg The asc srucural locks are he scramler, encoder, dgal modulaor and dgal fler. nc D(nT) I(nT) D s (nt) QAM BPF Q(nT) Modulaor Scramler Fgure QAM ransmer lock dagram Scramler The purpose of he scramler s o randomze he npu nary daa sequence, whch means ha convers hs sequence no a pseudo-random nary sequence wh some defned perod. Ths s requred for he clock recovery module. For more dealed nformaon aou he scramler refer o Secon Encoder Encoder Guard Tone Generaor Sample Rae = 9600 Baud rae= 600 Ts=1/ Sample Rae T=1/ Baud rae The encoder mplemens encodng of he ncomng sequence d s (n) no he values of he sequence {I(n),Q(n)},.e. s funcon s o map every wo ncomng s of he ncomng sequence d s (n) o a oal phase. The oal phase s hen represened y he values of he sequence {I(n),Q(n)}, and he laer s ransmed. The mappng rule can e seen n Secon In he curren mplemenaon of he encoder, fnds he approprae I and Q values for he ncomng quad (or d) and s execued once per aud. + S(nTs) Modulaor The modulaor modulaes he cosne wave. The oupu of he modulaor s gven y: s(n) = I(n) cos(φ(n)) + Q(n) sn(φ(n)) Where φ(n) s he curren carrer phase and s(n) s he sample ready for ransmsson. The modulang frequency for V.22s s 1200 Hz for a callng modem and 2400 Hz for an answerng modem. MOTOROLA Chaper 3. Module Descrpons 3-81
162 Daa Pump nc Transm fler The ransm lowpass flers are mplemened usng 48-ap FIR srucures, whose frequency responses exh a rased-cosne shape. The rased-cosne response s used snce mnmzes he nersymol nerference Guard one generaor Ths module generaes he guard one, whch s hen added o he man sgnal. For V.22s he frequency of he guard one s 1800 Hz ± 20 Hz or 550 ± 20 Hz, and s only ransmed when he modem s ransmng n he hgh channel (carrer frequency s 2400 Hz). nc QAM recever Ths susecon descres he funconal locks requred o mplemen a QAM recever. The recever srucure s more sophscaed han ha of he ransmer. An overall dagram of he modem recever s shown n Fg The asc srucural locks of he modem recever are he npu andpass flers (he fxed equalzer), he auomac gan conrol (AGC), he demodulaor, he adapve equalzer, he decson lock, he decoder, he descramler, he carrer recovery, and he clock recovery. S(nTs) BPF I BPF Q I(nTs) Q(nTs) AGC X X Fgure QAM modem recever lock dagram Bandpass flers The npu sgnal s andpass flered for he followng reasons: Rejecon of ou-of-and nose, ncludng he rejecon of he ransm sgnal specrum Inroducon of 90-degree relave phase shf requred for I and Q channel separaon Fxed equalzaon for lne dsoron In he curren mplemenaon a 38-ap andpass FIR fler s used. Demodulaor I d (nts) Q d (nts) Clock Recovery Adapve Equalzer I eq (nts) Q eq (nts) Carrer Recovery Decson I dec (nt) Q dec (nt) Decoder D s (nt) Descramler D(nT) MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
163 Daa Pump nc. nc Auomac Gan Conrol (AGC) The ncomng sgnal level may vary over a wde range due o aenuaon n he elephone lne. However for clock and carrer recovery modules he sgnal level mus e ndependen of he aenuaon nroduced y he communcaons channel and reman consan. Auomac Gan Conrol performs hs ask. I adjuss he envelope of he I and Q channels so ha hey are of he same magnude. The algorhm of AGC ha s used n he curren mplemenaon s descred elow. The AGC monors he I channel of he recever and calculaes he gan correcon facor. The gan correcon facor s calculaed once every hree aud n a wo-sep process. Frs, he hree maxmum values of he sgnal, each one correspondng o one aud (16 samples), are monored and added o each oher. The prevous value of he average sgnal level s hen added o hs sum and dvded y four o oan he new average sgnal level. The average sgnal level s hen flered y a frs-order IIR fler. In he second sep, he gan correcon facor s calculaed. The gan correcon facor s he resul of dvdng he maxmum-allowed sgnal level (or he mddle value of he sgnal level wndow for 2400 /s) y he flered average sgnal level. For a ransmsson speed of 2400 /s he AGC adjuss he sgnal o keep n a ceran wndow, ecause s amplude may vary. Also he AGC lock deermnes f a carrer s presen n he receved sgnal y comparng he average sgnal level wh he hreshold Demodulaor Wh I p (nt s ) and Q p (nt s ) as npus o he demodulaor, he oupus I (nt s ) and Q (nt s ) are gven y: I (nt s ) = I p (nt s ) cos(φ(nt s) ) + Q p (nt s ) sn (φ(nt s )) Q (nt s ) = - I p (nt s ) sn(φ(nt s )) + Q p (nt s ) cos (φ(nt s )) Where φ s he local carrer phase Decson lock and Decoder The decson lock denfes he curren quadran from he values of he aseand I and Q and compares wh he prevous quadran o oan he phase change. Usng hs phase change, he decoder rereves he frs wo s of he orgnal quad (or whole d) accordng o Tale The las wo s of quad are hen rereved usng he consellaon dagram (see Fg ). MOTOROLA Chaper 3. Module Descrpons 3-83
164 Daa Pump nc Descramler The descramler s nended o recover he orgnally ransmed d. For more dealed nformaon aou he descramler refer o Secon nc Adapve Equalzer The Adapve Equalzer s an adapve fler ha compensaes for nersymol nerference (ISI) and elephone lne dsoron. Adapve equalzers are ased on eher a sascal approach, such as he leas-mean square (LMS), or a deermnsc approach, such as he recursve leas-squares (RLS) algorhm. The major advanage of he LMS algorhm ha s used n he curren mplemenaon s s compuaonal smplcy. An adapve fler consss of wo pars: an FIR fler and an adapaon algorhm ha adjuss he coeffcens of he fler o mprove s performance. In he curren mplemenaon an LMS adapaon echnque s used, so he equalzer s coeffcens are updaed usng he followng equaon: C k+1 = C k + ε k V k Where C k s he vecor of equalzer coeffcens on he k eraon, defnes he convergence speed of he equalzer, ε k = I k I k^ (he dfference eween he opmal and he acual value of I or Q) s he error sgnal on he k eraon, V k s he vecor of demodulaed I or Q values (aken from he equalzer s uffer). There are wo separae flers, one for he I-channel, and he oher for he Q-channel. Therefore he coeffcens of hese flers are updaed separaely as well Clock Recovery The purpose of Clock Recovery s o deec he mddle of he aud. The decson lock makes decsons exacly n he mddle of he aud. The energy of he ncomng sgnal a hs pon s maxmal, so he proaly of a msake ocurrng durng he decson process s mnmal. In he curren mplemenaon he early-lae mehod of Clock Recovery s used. Fg shows he energy values for each sample over he aud. I can e seen n hs Fgure ha f he energy sample E7 s n he mddle of he aud, has he hghes energy value and he res of he samples are locaed symmercally around,.e. E1=E13, E2=E12, E3=E11 and so on. In oher words E1-E13 = 0, E3-E11 = 0. If E7 s shfed lef and s no on op of he energy hll, hen E11 ecomes greaer han E3 or E3 E11 < 0. If E7 s shfed rgh, E3 E11 > 0. So he dfference (E3-E11) may e used as an error value. If hs value s negave, means ha he mddle of he local aud 3-84 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
165 Daa Pump nc. occurred earler han he mddle of he ncomng aud. Therefore, he local aud clock mus e delayed. If posve he local aud clock mus e advanced. (QHUJ\ ( ( ( ( ( ( ( ( (( ( ( ( ( ( ( 7LPH Fgure Sgnal energes over a aud nc For smooh clock adjusmen an Inerpolaon fler s used (In I and In Q n Fg ). Ths has 16 fler coeffcens from 64 fler anks. Each ank phase shfs he ncomng sgnal y a ceran value. In he curren mplemenaon he energy of he hrd and he elevenh samples s calculaed. The dfference eween hese energes s hen found. Ths dfference s hen lowpass flered y a frs-order IIR fler. The oupu of he fler s used as he npu o he accumulaor. If he value accumulaed over a ceran amoun of me exceeds he hreshold, he local aud clock s adjused y choosng a dfferen flerank n he nerpolaon fler. The lock dagram of he clock recovery algorhm s shown n Fgure 3-28., 4 (UURU VLJQDO JHQHUDWRU Carrer Recovery H HBVLJ 'HFLVLRQ /RRSILOWHU $FFXPXODWRU %DXGFORFN Fgure QAM Clock Recovery lock dagram Carrer Recovery s used for adjusng he phase of he local carrer o mach wh he phase of he ncomng carrer. I s very mporan o generae a local carrer ha has he same phase and frequency as he ncomng carrer ecause s used n he demodulaor o demodulae he ncomng sgnal and rereve he aseand nformaon. For mplemenaon of Carrer Recovery a phase-locked loop s used (see Fgure 3-29). MOTOROLA Chaper 3. Module Descrpons 3-85
166 Daa Pump nc.,qfrplqj FDUULHU 3KDVH GHWHFWRU HUURU JHQHUDWRU H /RRSILOWHU HBVLJ &DUULHU JHQHUDWRU /RFDO FDUULHU Fgure QAM Carrer Recovery lock dagram nc The phase deecor generaes an error ha s used o synchronze he local carrer o he ncomng carrer. Ths error sgnal conans he nformaon aou he phase and frequency dfference eween he local and he ncomng carrers. The consellaon pons are shown n Fgure The oupu of he phase deecor s of he form Q^(nT ) I (nt ) - I^(nT ) Q (nt ) E(nT ) = Q^(nT ) Q (nt ) + I^(nT ) I (nt ) Where (I^(nT ) and Q^(nT )) are he opmum decson pons, (I (nt ) and Q (nt )) are he pons used o make a decson. The error E(nT ) s a geomercal dsance from he pon used o make he decson and he opmum decson pon. Ths error s hen lowpass flered y he loop fler (frs-order IIR fler) and used o adjus he curren value of he local carrer phase (eher delay or advance he phase of he local carrer). So as a resul he Clock Recovery lock roaes he consellaon dagram o mach he one shown n Fgure The fler coeffcens and hresholds change dependng on he sae of he recever (handshake mode or daa mode). The phase correcon s made once per aud and s performed n he mddle of he aud MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
167 Daa Pump nc. nc Fgure QAM recever decson pons QAM modulaor conrol srucure ypedef sruc Tx_conrol_QAM_ { un32 f_carrer; un32 f_guard; un16 carrer_phase; un16 guard_phase; un16 carrer_phase_ncr; un16 guard_phase_ncr; un16 aud_frac; un16 aud_ncr; n16 amplude_carrer; n16 amplude_guard; MOTOROLA Chaper 3. Module Descrpons 3-87
168 Daa Pump nc. scramler_call_func_ scramler; ool scramler_enaled; un32 scramler_regser; n16 * consellaon_phase_quadran; un8 * phase_quadran_change; n16 curren_i; n16 curren_q; un8 curren_quadran; nc }; un32 fler_sze; n16 fler_coef[tx_qam_fixed_eq_coef_number]; n16 fler_uf[tx_qam_filter_buf_size]; un32 fler_uf_pr; f_carrer - Carrer frequency n Hz. Ths feld s nalzed n funcon Tx_V22s_n. f_guard - Guard one frequency n Hz. Ths feld s nalzed n funcon Tx_V22s_n. carrer_phase - Curren phase of he carrer frequency generaor n Q15 forma. Ths feld s nalzed n funcon QAM_modulaor_n o 0. guard_phase - Curren phase of he guard one generaor n Q15 forma. Ths feld s nalzed n funcon QAM_modulaor_n o 0. carrer_phase_ncr - Carrer frequency phase ncremen per sample n Q15 forma. Ths feld s nalzed n funcon QAM_modulaor_n. guard_phase_ncr - Guard one frequency phase ncremen per sample n Q15 forma. Ths feld s nalzed n funcon QAM_modulaor_n. aud_frac - Fraconal par of he aud n Q14 forma. (.e. 0.5 = he mddle of he aud). Ths feld s nalzed n funcon QAM_modulaor_n o 0. aud_ncr - Incremen o <aud_frac> per sample n Q15 forma. Ths feld s nalzed n funcon QAM_modulaor_n. amplude_carrer - Amplude of he oupu sgnal. Ths feld s nalzed n funcon Tx_V22s_n MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
169 Daa Pump nc. nc amplude_guard - Amplude of he Guard one sgnal. Ths feld s nalzed n funcon Tx_V22s_n. scramler - Poner o he scramler funcon. Ths feld s nalzed n funcon Tx_V22s_n. scramler_enaled Indcaes f he scramler s enaled. Ths feld s nalzed n funcon QAM_modulaor_n o TRUE. scramler_regser - Shf Regser used y he scramler. Ths feld s nalzed n funcon QAM_modulaor_n o 0. consellaon_phase_quadran - Poner o he sgnal consellaon of he frs quadran. Ths feld s nalzed n funcon Tx_V22s_n. phase_quadran_change - Quadran change accordng o he frs wo s of quad. Ths feld s nalzed n funcon Tx_V22s_n. curren_i - Curren In-phase sgnal for modulaon. Ths feld s nalzed n funcon QAM_modulaor_n o 0. curren_q - Curren Quadraure-phase sgnal for modulaon. Ths feld s nalzed n funcon QAM_modulaor_n o 0. curren_quadran - Curren Phase Quadran. Ths feld s nalzed n funcon QAM_modulaor_n o 0. fler_sze - The numer of coeffcens used y he BPF. Ths feld s nalzed n funcon QAM_modulaor_n. fler_coef - Coeffcens of he BPF. Ths feld s nalzed n funcon QAM_modulaor_n. fler_uf_i - Cyclc uffer used y he fler algorhm of he I channel. Ths feld s nalzed n funcon QAM_modulaor_n o 0. fler_uf_q - Cyclc uffer used y he fler algorhm of he Q channel. Ths feld s nalzed n funcon QAM_modulaor_n o 0. fler_uf_pr - Poner o he curren elemen of he fler_uf[]. Ths feld s nalzed n funcon QAM_modulaor_n QAM demodulaor conrol srucure ypedef sruc Rx_conrol_QAM_ { un32 f_carrer un16 carrer_phase; un16 carrer_phase_ncr; un16 aud_frac; MOTOROLA Chaper 3. Module Descrpons 3-89
170 Daa Pump nc. un16 aud_ncr; un32 fler_sze; n16 fler_mark_[rx_qam_fixed_eq_coef_number]; n16 fler_mark_q[rx_qam_fixed_eq_coef_number]; n16 fler_uf[rx_qam_filter_buf_size]; un32 fler_uf_pr; nc ool decson_enaled; scramler_call_func_ descramler; ool descramler_enaled; un32 descramler_regser; n16 * consellaon_phase_quadran; un8 * phase_quadran_change; un8 las_quadran; n16 consellaon_reshold; n16 nose_hreshold; n16 agc; un32 agcave; n16 avecn; n16 smax; n16 CPLL1; n16 CPLL2; n16 BPLL1; n16 BPLL2; n16 BCNT; n16 AGCPLL1; 3-90 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
171 Daa Pump nc. n16 AGCPLL2; n32 cerror_sg; n32 clerror_sg; n32 clerror2_sg; un32 aud_nrg4; un32 aud_nrg8; n16 sgnal_presen; n16 clock_correced; n32 agc_lp; nc n16 phase_sep; n16 BINTG; n16 AGC_GC; n16 BAUD_TH; n16 PHASE_TH; n16 cl_cn; ool adapve_equalzer_enaled; n32 fler_adapve_ffe_i_coef[adaptive_filter_ffe_coef_number]; n16 fler_adapve_ffe_i_uf[adaptive_filter_ffe_buf_size]; n32 fler_adapve_ffe_q_coef[adaptive_filter_ffe_coef_number]; n16 fler_adapve_ffe_q_uf[adaptive_filter_ffe_buf_size]; un32 fler_adapve_ffe_uf_pr; ool reran_enaled; un8 reran_curren_s1; un32 reran_s1_couner; }; f_carrer - Carrer frequency n Hz. Ths feld s nalzed n funcon Rx_V22s_n. MOTOROLA Chaper 3. Module Descrpons 3-91
172 Daa Pump nc. nc carrer_phase - Curren phase of he carrer frequency generaor n Q15 forma. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. carrer_phase_ncr - Carrer frequency phase ncremen per sample n Q15 forma. Ths feld s nalzed n funcon QAM_demodulaor_n. aud_frac - Fraconal par of he aud n Q15 forma. (.e. 0.5 = he mddle of he aud). Ths feld s nalzed n funcon QAM_demodulaor_n o 0. aud_ncr - Incremen o <aud_frac> per sample n Q15 forma. Ths feld s nalzed n funcon QAM_demodulaor_n. fler_sze - The numer of coeffcens used y he npu BPF. Ths feld s nalzed n funcon QAM_demodulaor_n. fler_mark_i - Coeffcens of BPF for he I channel n Q14 forma. Ths feld s nalzed n funcon QAM_demodulaor_n. fler_mark_q - Coeffcens of BPF for he Q channel n Q14 forma. Ths feld s nalzed n funcon QAM_demodulaor_n. fler_uf - Cyclc uffer used y he fler algorhm of he npu BPFs. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. fler_uf_pr - Poner o he curren elemen of he fler_uf[].ths feld s nalzed n funcon QAM_demodulaor_n. decson_enaled - Indcaes f he decson lock s enaled. Ths feld s nalzed n funcon QAM_demodulaor_n o TRUE. descramler - Poner o he descramler funcon. Ths feld s nalzed n funcon Rx_V22s_n. descramler_enaled - Indcaes f he descramler s enaled. Ths feld s nalzed n funcon QAM_demodulaor_n o TRUE. descramler_regser - Shf Regser used y he descramler. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. consellaon_phase_quadran - Poner o he sgnal consellaon of he frs quadran. Ths feld s nalzed n funcon Rx_V22s_n. phase_quadran_change - Quadran change accordng o he frs wo s of he quad. Ths feld s nalzed n funcon Rx_V22s_n. las_quadran The las phase Quadran. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. consellaon_hreshold - Threshold for consellaon pon deecon. Ths feld s nalzed n funcon Rx_V22s_n. nose_hreshold - Threshold for sgnal/nose deecon n Q14 forma. Ths feld s nalzed n funcon Rx_V22s_n. agc - The AGC gan facor n Q11 forma. Ths feld s nalzed n funcon QAM_demodulaor_n o MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
173 Daa Pump nc. nc agcave - The curren average sgnal level oaned afer AGC n Q14 forma. Ths feld s nalzed n funcon QAM_demodulaor_n o avecn - The couner of he aud n he AGC lock. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. smax - The maxmum I value oaned afer AGC over he aud n Q14 forma. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. pre_agcave - The curren average sgnal level n Q14 forma. Ths feld s nalzed n funcon QAM_demodulaor_n o pre_smax - The maxmum I value over he aud n Q14 forma. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. CPLL1, CPLL2 - Fler coeffcens for he Carrer Recovery loop fler. Ths feld s nalzed n funcon QAM_demodulaor_n. BPLL1, BPLL2 - Fler coeffcens for he Clock Recovery loop fler. Ths feld s nalzed n funcon QAM_demodulaor_n. BCNT The correcon of he Baud Clock s performed once per BCNT aud. Ths feld s nalzed n funcon QAM_demodulaor_n. AGCPLL1, AGCPLL2 - Fler coeffcens for he fler of he AGC lock. Ths feld s nalzed n funcon QAM_demodulaor_n. cerror_sg Flered error sgnal for Carrer Recovery and he sae of he loop fler. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. clerror_sg Flered error sgnal for Clock Recovery and he sae of he loop fler. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. clerror2_sg - Indcaes false lock of he aud clock for Clock Recovery. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. aud_nrg4 - Energy value of he 4h sample. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. aud_nrg8 - Energy value of he 8h sample. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. sgnal_presen - Indcaes he carrer frequency sgnal presence. Ths feld s nalzed n funcon QAM_demodulaor_n o FALSE. clock_correced - Indcaes ha he Clock was correced durng he curren aud. Ths feld s nalzed n funcon QAM_demodulaor_n o FALSE. agc_lp The sae of he fler of he AGC lock. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. las_cerror Conans he prevous phase error n he Carrer Recovery lock. Ths feld s nalzed n funcon QAM_demodulaor_n. phase_unwrap_enaled Indcaes wheher phase unwrappng wll e performed or no. Ths feld s nalzed n funcon QAM_demodulaor_n. MOTOROLA Chaper 3. Module Descrpons 3-93
174 Daa Pump nc. nc phase_sep The sep of phase correcon n he Carrer Recovery lock. Ths feld s nalzed n funcon QAM_demodulaor_n. BINTG Accumulaes an error n Clock Recovery lock. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. AGC_GC AGC gan correcon coeffcen. Ths feld s nalzed n funcon QAM_demodulaor_n. BAUD_TH The hreshold for he clock error n Clock Recovery lock. Ths feld s nalzed n funcon QAM_demodulaor_n. PHASE_TH The hreshold for he phase error n Carrer Recovery lock. Ths feld s nalzed n funcon QAM_demodulaor_n. cl_cn - The couner of aud n he Clock Recovery lock. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. ranng_mode s TRUE f he modem s n ranng mode and FALSE f he modem s n daa mode. Ths feld s used n he Clock Recovery lock and s Inalzed n funcon QAM_demodulaor_n o FALSE. adapve_equalzer_enaled Indcaes f he adapve equalzer s enaled. Ths feld s nalzed n funcon QAM_demodulaor_n. adapve_equalzer_ranng - Indcaes f he adapve equalzer s n ranng mode. Ths feld s nalzed n funcon QAM_demodulaor_n. fler_adapve_ffe_i_coef, fler_adapve_ffe_q_coef The coeffcens of he adapve fler for he I and Q channels. Ths feld s nalzed n funcon QAM_demodulaor_n. fler_adapve_ffe_i_uf, fler_adapve_ffe_q_uf Buffer of he adapve fler for he I and Q channels. Ths feld s nalzed n funcon QAM_demodulaor_n. fler_adapve_ffe_uf_pr - Poner o he curren elemen of fler_uf[]. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. mu - Defnes he speed of adapaon of he adapve equalzer, n Q14 forma. Ths feld s nalzed n funcon QAM_demodulaor_n. n_fler_sze - The numer of coeffcens used y he nerpolaon fler. Ths feld s nalzed n funcon QAM_demodulaor_n. n_fler_coef - Coeffcens of he nerpolaon fler n Q14 forma. Ths feld s nalzed n funcon QAM_demodulaor_n. n_fler_ufi - Cyclc uffer used y he nerpolaon fler algorhm for I channel. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. n_fler_ufq - Cyclc uffer used y he nerpolaon fler algorhm for Q channel. Ths feld s nalzed n funcon QAM_demodulaor_n o MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
175 Daa Pump nc. nc n_fler_uf_pr - Poner o he curren elemen of he n_fler_ufi[].ths feld s nalzed n funcon QAM_demodulaor_n. n_fler_numer Specfes he numer of acve fleranks of he nerpolaon fler. Ths feld s nalzed n funcon QAM_demodulaor_n o 32. reran_enaled Specfes f auo reran s enaled or dsaled. Ths feld s nalzed n funcon Rx_V22s_n. reran_curren_s1 Conans one or zero. Used for S1 deecon. Ths feld s nalzed n funcon Rx_V22s_handshake_n o 0. reran_s1_couner Couner ha s used n he S1 deecon sae durng he reran. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. reran_nose Accumulaor of sgnal error, used for reran naon n Q14 forma. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. reran_nose_cn Baud couner when reran_nose s greaer han QAM_RETRAIN_NOISE_THRESHOLD. Ths feld s nalzed n funcon QAM_demodulaor_n o 0. MOTOROLA Chaper 3. Module Descrpons 3-95
176 Daa Pump nc. QAM_modulaor_n Call(s): vod QAM_modulaor_n(sruc channel_ * channel) Argumens: Tale QAM_modulaor_n argumens channel n Poner o he channel conrol daa srucure nc Descrpon: Reurns: Code example: Inalzaon of he QAM ransmer conrol srucure (Tx_conrol_QAM_). The poner o hs srucure s conaned n channel->tx_conrol_pr->daa_pump_pr. Flls up he approprae felds of hs srucure wh defaul values (carrer_phase, aud_frac, scramler_regser and so on (refer o Secon for more deals)). Ths funcon s called y he Tx_V22s_n() funcons of he v22s.c module. None sruc channel_ * channel; QAM_modulaor_n (channel); 3-96 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
177 Daa Pump nc. QAM_modulaor Call(s): vod QAM_modulaor(sruc channel_ * channel) Argumens: Tale QAM_modulaor argumens channel n Poner o he channel conrol daa srucure nc Descrpon: Reurns: Code example: sruc channel_ * channel; QAM_modulaor(channel); Ths funcon performs all operaons of he QAM ransmer. I ges s of daa from he Tx_daa[] uffer, processes hem, and places he resulan samples no he Tx_sample[] uffer. The numer of generaed samples, per call, s defned y channel->tx_conrol_pr->numer_samples. Ths funcon conans he scramler, he encoder, dgal modulaor and dgal fler. For more dealed nformaon aou hese locks refer o Secon Ths funcon s called y he Tx_daa_pump() funcon of modem.c module va he channel->tx_conrol_pr-> daa_pump_call_func (). None MOTOROLA Chaper 3. Module Descrpons 3-97
178 Daa Pump nc. QAM_demodulaor_n Call(s): vod QAM_demodulaor_n(sruc channel_ * channel) Argumens: Tale QAM_demodulaor_n argumens channel n Poner o he channel conrol daa srucure nc Descrpon: Reurns: Code example: Inalzaon of he QAM recever conrol srucure (Rx_conrol_QAM_). The poner o hs srucure s conaned n channel->rx_conrol_pr->daa_pump_pr. Flls up he approprae felds of hs srucure wh defaul values (carrer_phase, carrer_phase_ncr, oal_phase, aud_frac, descramler_regser, fler_uf and so on (refer o Secon for more deals)). Ths funcon s called y he Rx_V22s_n() funcons of he v22s.c module. None sruc channel_ * channel; QAM_demodulaor_n (channel); 3-98 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
179 Daa Pump nc. QAM_demodulaor Call(s): vod QAM_demodulaor(sruc channel_ * channel) Argumens: Tale QAM_demodulaor argumens channel n Poner o he channel conrol daa srucure nc Descrpon: Reurns: Code example: sruc channel_ * channel; QAM_demodulaor (channel); Ths funcon performs all operaons of he QAM recever. I ges samples from he Rx_sample[] uffer, processes hem performng QAM demodulaon (see ), and places he resulan s no he Rx_daa[] uffer. I conans he npu andpass flers, he auomac gan conrol (AGC), he demodulaor, he adapve equalzer, he decson lock, he decoder, he descramler, he carrer recovery, and he clock recovery. For more dealed nformaon aou hese locks refer o Secon Ths funcon s called from he funcon Rx_daa_pump of modem.c module va he channel->rx_conrol_pr-> daa_pump_call_func (). None MOTOROLA Chaper 3. Module Descrpons 3-99
180 V.42 Error Correcon nc. 3.2 V.42 Error Correcon nc The V.42 error correcng proocol s used o delver daa correcly eween wo DCEs. Daa s sen n frames. Each frame has a Frame Check Sequence (FCS) feld. Ths feld s used o deermne wheher a frame was damaged durng ransmsson or no. If a frame was damaged, wll e auomacally resen y he remoe modem. Addonally, hs proocol mplemens flow conrol eween wo DCEs. The relaonshp of he V.42 module wh he oher modules s shown n Fg The recever akes daa from he Rx_daa[] uffer, processes accordng o he V.42 (V.14) proocol, and pus useful daa no he Rx_uar_daa[] uffer (from hs uffer daa goes o he ermnal). The ransmer akes daa from he Tx_uar_daa[] uffer (daa from he ermnal comes o hs uffer), wraps accordng o he V.42 (V.14) proocol, and pus he resul daa no he Tx_daa[] uffer. If he V.42s module s enaled and used, performs daa compresson (n he ransmer) and daa decompresson (n he recever). Channel Rx_uar_daa[] Tx_uar_daa[] V.42s Module n Modem Sae Machne execue V.42 Module daa handler sae Fgure Exernal relaonshps of he V.42 module Rx_daa[] Tx_daa[] The V.42 module consss of hree man funcons: v42_n(), v42_rx_daa(), and v42_x_daa(). The modem sae machne calls he v42_n() funcon when physcal handshakng s compleed. I nalzes he daa srucure and oans he requred parameers. Each channel needs o have s own daa srucure, n order o handle ncomng and ougong daa ndependenly of he oher channels. The v42_n() funcon assgns he V.42 daa srucure o he Rx and Tx daa conrol srucures: MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
181 V.42 Error Correcon nc. vod v42_n (sruc channel_ * channel,v42_data_struct * daa_pr, ) { channel->rx_conrol_pr->daa_handler_pr = daa_pr; channel->tx_conrol_pr->daa_handler_pr = daa_pr; } nc Snce he V.42 recever nfluences he V.42 ransmer, all recever, ransmer and common (shared) felds are grouped no one daa srucure, havng ype V42_DATA_STRUCT, and he same nsance of ha srucure s assgned o oh he recever and he ransmer. Addonally, he daa handler funcon has o e assgned o oh he Rx and Tx daa conrol srucures: vod v42_n (sruc channel_ * channel, ) { channel->rx_conrol_pr->daa_handler_call_func = v42_rx_daa; } channel->tx_conrol_pr->daa_handler_call_func = v42_x_daa; Snce ncomng and ougong daa s handled n a dfferen way y naure, dfferen daa handlers are requred for each drecon of daa ransfer. Bu, for he same channel, hey wll dal usng he same V.42 daa srucure. The v42_rx_daa() funcon s called only f he amoun of daa n he Rx_daa[] uffer exceeds a prese hreshold. The same akes place wh he v42_x_daa() funcon. I s called only f he amoun of daa n he Tx_daa[] uffer s less han a prese hreshold. These hresholds are also se n he v42_n() funcon: vod v42_n (sruc channel_ * channel, ) MOTOROLA Chaper 3. Module Descrpons 3-101
182 V.42 Error Correcon nc. { channel->tx_conrol_pr->numer_n_s = 8; channel->rx_conrol_pr->numer_n_s = 8; } nc General srucure of he V.42 module The srucure of he V.42 module s shown n Fg A receved lock of daa s checked for he FCS frs, (excep f s no a flag or f s daa accordng o he V.14 proocol), hen s passed o he recever f he check sum s correc. The recever handles ha frame n complance wh he sae of he V.42 module. Addonally, can change he sae of he V.42 module. If s an nformaon frame, he user daa wll e passed o he ermnal (Rx_uar_daa[] uffer). The daa can e decompressed n he V42s decoder f he V.42s proocol was negoaed wh he remoe modem. The ransmer akes daa from he ermnal (Tx_uar_daa[] uffer), encodes wh he use of V.42s compresson, forms an I frame, calculaes he FCS and passes o he Tx_daa[] uffer. Dependng on he sae of he V.42 module, he ransmer can also ssue supervsor and unnumered frames MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
183 V.42 Error Correcon nc. Rx_uar_daa[] V.42s decoder Error njecor nc V.42 conrol and sae un Recever Transmer V.42s encoder Tx_uar_daa[] FCS check FCS generaor B-level npu B-level oupu Error njecor Fgure General srucure of he V.42 module Rx_daa[] Tx_daa[] For demo and es purposes, an error njecor can e used. Once per each perod of me nvers one of receved and/or ransmed daa. Ths smulaes a nosy lne. The me perod eween njecons s a pseudorandom value. The me perods are derved from he pseudorandom generaor ased on he feedack shf regser ( feedack shf regser s he name of a regser ype ha (regser) can e shfed and has a feedack lnk). To enale he error njecor n each drecon, consans V42_TX_ERROR_INJECTOR and V42_RX_ERROR_INJECTOR have o e defned n he v.42.h fle. A more dealed descrpon of he recever and ransmer s gven n he followng secons Accessng he daa uffers Each ye of he Rx_daa[] and Tx_daa[] uffers conans only ns of useful daa. Ths daa occupes he leas sgnfcan s of he ye. The res of he s are useless. MOTOROLA Chaper 3. Module Descrpons 3-103
184 V.42 Error Correcon nc. Address: 0x00 0xFF x x x x x x x x x x x x useful s useful s useful s +1 ye +2 ye +3 ye nc Bye +1 s a ye ha was receved earler han ye +2, ye +2 was receved earler han ye +3 and so on. Insde of each group of s, numer 0 s he leas sgnfcan (ls), and numer 3 (f ns s 4) s he mos sgnfcan (ms). I s no convenen o process hs daa as s. Some ransposon s requred. The followng approach s mplemened. Useful s are sored consecuvely n a 32- uffer rx_uffer (n he recever): x x x x x x x x x x x x Now, yes or, raher, ns are placed consecuvely one afer anoher whou gaps eween hem. The ls of each ye resdes n he nex avalale n he rx_uffer wh he lowes numer and he ms resdes n he of he rx_uffer havng a hgher numer. In he aove example, numer 0 s he frs receved, whle numer 11 s he las receved. Readng from hs 32- uffer s performed from he ls n order o follow he orgnal daa order. When daa s read, he conens of he uffer can e sored easly n a regser, rgh shfed y he numer of read yes, and hen sored ack no a uffer. In he recever, wo npu funcons are mplemened: v42_ges() and v42_vews() o access he 32- uffer. A he egnnng of he v42_rx_daa() funcon, hs 32- uffer s flled. In he ody of hs funcon he 32- uffer s read va he v42_ges() and v42_vews() funcons. I s mporan o undersand, ha he numer of s o read MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
185 V.42 Error Correcon nc. nc (n parameer of hese funcons) canno e greaer han he sze of he uffer (n hs case 32 s) mnus he value of ns. If he v42_ges() funcon s called wh a ransparen parameer se o TRUE, dscardng he ransparen s also needs o e aken no accoun. So, he value passed o n parameer mus e even less han 32 mnus ns. The ransmer works n he same way. A he egnnng of ransmsson, n fxed locks of daa are read from he 32 uffer, hs daa s hen sored n he Tx_daa[] uffer. The v42_pus() funcon s called n he ody of he ransmer o place daa no he 32- x_uffer uffer. I s mporan o undersand ha he numer of s o e wren (n parameer) should no e graer han he sze of he uffer (32 s) mnus ns and mnus he numer of any nsered ransparen s (f he v42_pus() funcon s called wh he ransparen parameer se o TRUE) Tmng conrol Four mers are mplemened n he V.42 module: T400, T401, T403, and TI. A descrpon of he frs hree mers s gven n Secon 9 Sysem parameers of he ITU-T V.42 Recommendaon. TI s an nerval mer. I s descred n Appendx II Daa forwardng condons (paragraph c) of he ITU-T V.42 Recommendaon. These mers are clocked y he v42_ges() and v42_pus() funcons. When a corresponden funcon s called, adds he numer of s requesed o read/send o he couner of a mer. T400, T401, and T403 mers are clocked y oh funcons. Ths s done n order o ake no accoun dfferen aud raes of he ransmer and recever, whch akes place, for example, n he V.23 proocol. The hresholds of hese hree mers are orened on a fxed amoun of sen/receved s, regardless of he daa pump proocol used. Ths means ha, for example, he T400 mer overruns when s couner conans a value greaer han T400_THRESHOLD. Ths value corresponds o dfferen values of asolue me, when V.21 (300 ps) and V.22 (1200 ps) are used. The Inerval Tmer (TI) calculaes asolue me. I deermnes a perod, durng whch characers are accumulaed o e sen n a sngle nformaon frame. So, he hreshold for hs mer s se up n v42_n() funcon and depends on he daa pump proocol used Deecon phase The V.42 recever s a sae machne shown n Fg I works, manly, n wo saes: ge daa accordng o he V.42 proocol, and ge daa accordng o he V.14 proocol. The nal sae s se up n he v42_n() funcon dependng on he user s sengs. If V.42 s desred and he deecon phase s enaled, he recever deermnes he role of he modem va an orgnaor varale. If acs as he orgnaor, he recever deecs an (answerer deecon paern) ADP sequence. If hs sequence s recognzed whn a T400 MOTOROLA Chaper 3. Module Descrpons 3-105
186 V.42 Error Correcon nc. me perod, he recever changes s sae and was for a frame openng flag. Oherwse, sars workng accordng o he V.14 proocol or reaks he connecon dependng on he user s sengs. nc ODP was no recognzed whn a T400 me perod Deec ODP ODP recognzed Deec frs flag frs proocol flag receved closng flag deeced Deec ADP ADP recognzed Deec openng flag Ge daa (V.42) Ge daa (V.14) openng flag receved Fgure Sae machne of he V.42 recever ADP was no recognzed whn a T400 me perod MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
187 V.42 Error Correcon nc. Send 1 ODP recognzed Send ODP nc ODP was no recognzed whn a T400 me perod Send ADP frs proocol flag receved ransmsson of he curren poron of daa s compleed ADP recognzed Decson BOX Send daa (V.42) Send daa (V.14) new poron of daa o send s prepared ADP was no recognzed whn a T400 me perod Fgure Sae machne of he V.42 ransmer If he modem acs as an answerer, he recever deecs an (orgnaor deecon paern) an ODP sequence. When an ODP sequence s receved, he recever changes s sae and was for he frs proocol flag. Ths s done o change he ransmer o he correc sae. Afer recevng he frs flag, he recever changes s sae and was for a frame openng flag. If ODP was no recognzed whn a T400 me perod, sars workng accordng o he V.14 proocol or reaks he connecon dependng on he user s sengs. If he modem s he orgnaor, he ransmer sends an ODP sequence unl an ADP sequence s recognzed n he recever. The sae machne of he ransmer s shown n Fg When an ADP sequence s receved, he recever changes he sae of he ransmer o DECISION_BOX. In hs sae, he ransmer makes a decson on wha daa o MOTOROLA Chaper 3. Module Descrpons 3-107
188 V.42 Error Correcon nc. send: flag, unnumered frame, supervsor frame or nformaon. Before sendng he frs proocol frame (command XID), ssues 16 flags. If he modem s n answerng mode, he ransmer sends 1 unl he recever receves an ODP sequence. When ODP s receved, he recever changes he sae of he ransmer and fnally sars sendng an ADP sequence. When he remoe modem ges he ADP sequence, sars sendng he frs proocol frame flags. When a frs flag s receved, he recever moves he ransmer o a DECISION_BOX sae. nc V.42 Recever The srucure of he V.42 recever s shown n Fgure The followng susecons gve dealed nformaon aou he mplemenaon of each lock. Rx_uar_daa[] V.42s decoder Ge daa from sequenal I frames Process B Process A RX I Frame sorage o Decson Box Rx_daa[] B-level npu & FCS calculaon FCS check Frame handler o TX I Frame sorage Error njecor V.42 Conrol and Sae un B-level npu Fgure Srucure of he V.42 recever The recever works n wo saes when ges daa accordng o he V.42 proocol: V42_GETTING_FLAG and V42_GETTING_DATA. In he V42_GETTING_FLAG sae, monors he rx_uffer n order o recognze a frame openng flag. ( s a frame openng and a frame closng flag. Each frame has o MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
189 V.42 Error Correcon nc. nc e preceded wh a frame openng flag and a frame-closng flag mus follow he frame. The closng flag for one frame can serve as an openng flag for he nex frame.) Unl any flag s recognzed, he recever exracs y from he rx_uffer usng he v42_ges(dp, &value, 1, FALSE) funcon. If a flag s recognzed u s no a frame openng flag (oher flag follows hs one), he recever ges usng he v42_ges(dp, &value, 8, FALSE) funcon. The las parameer deermnes wheher a read s performed dscardng ransparen s (TRUE) or no (FALSE). When a frame openng flag s receved, ndex and sze varales are nalzed o her defaul values. The recever changes s sae o V42_GETTING_DATA. When he recever ges a frame, places he conens of he value varale no he rx_frame uffer. Fllng of he rx_frame uffer wh a frame, sars from he end of uffer, ha s he frs ye of he frame wll e place no he las ye of he uffer, he second ye of he frame goes no he nex o las poson and so on. Before a ye s placed no he rx_frame uffer, some analyss of he receved daa s requred. Readng he daa from he rx_uffer s performed y dscardng any 0 s ha drecly follow fve consecuve 1 s. If nose occurred on he lne, some s (yes) can change her value. There s a proaly ha some false ransparen s can occur (or some rue ransparen s can e nvered o 1 ) n he sream. As a resul, a frame has an ncorrec lengh a he recevng modem, afer he ransparen s are dscarded from he sream. So, on he recevng sde, he frame-closng flag can e msalgned from a ye oundary. In he same way, seven consecuve 1 s or greaer may occur n he sream. Such suaons have o e elmnaed and daa already receved should e gnored. 17 s have o e examned a once. If here s a flag n he ls, or he flag s placed as shown n he dagram elow and rx_coun1 (curren amoun of las consecuve 1 s) s equal o fve, s assumed ha he frame-closng flag has een receved. B numer 0 conans a ransparen (no a daa ), ecause he rx_coun1 varale s equal o fve. Accordng o he specfcaon, he ransmer mus nser a 0 afer 5 consecuve 1 s, regardless of he followng, and he recever mus dscard any 0 s ha follow 5 consecuve 1 s. So, efore he prevous readng, he 32- uffer could conan he xxxxxxxx yy value. Durng he prevous readng, he value yy was aken from he uffer, he rx_coun1 varale ecame equal o fve, and he uffer was rgh shfed y 8 s. The ransparen remaned n he uffer. I wll e dscarded when he nex ye s aken from he 32- uffer, or when he closng flag occurs x x x x x x x x So, recevng of hs frame s now complee and he frame check sequence (already calculaed) can e examned. When a frame has een processed, he recever reurns o he V42_GETTING_FLAG sae. MOTOROLA Chaper 3. Module Descrpons 3-109
190 V.42 Error Correcon nc. Three dfferen suaons can aor he recepon of daa. The frs suaon occurs when one par of he flag les n he rgh mos ye, and anoher n he nex o rgh mos ye: x x x x x x x x x The second suaon akes place when geng a ye from he rx_uffer (dscardng ransparen s) causes damage o he flag and as a resul, he frame-closng flag wll no e recognzed. Assume he rx_uffer s flled wh he followng s and he rx_coun1 varale s equal o fve: nc Durng execuon of he v42_ges(dp, &value, 8, TRUE) funcon, a 0 suaed n numer 0 wll e dscarded as a ransparen along wh a 0, suaed n numer 6 of he rx_uffer. As a resul, numer 8 moves o poson 6, whle numer 9 (he frs of he flag) moves o poson 7. Afer ha, he value 0xFF s reurned as a parameer no &value parameer, and he rx_uffer s rgh shfed y 10 s: x x x x x x x x x x The sream s also examned for he occurrence of seven or more consecuve 1 s. I s merged wh checkng on flag msalgnmen. The hrd suaon, when recepon of daa has o e aored, s when a frame eng receved s unounded (Secon of ITU-T V.42 Recommendaon). In hs mplemenaon, he rx_ndex varale equals 0. For all of hese suaons he recever moves ack no he V42_GETTING_FLAG sae, where dscards all s precedng he frame-closng flag (and ohers flags unl anoher frame-openng flag s deeced). In all oher cases one ye can e read from he rx_uffer whou he hrea of damagng he flag, excep one. If he flag s placed n he second ye (s 8 o 15 nclusve), readng he frs ye has o e performed whou dscardng any ransparen zeroes. Afer such a readng, he frame-closng flag wll e appropraely algned n he uffer. Any error wll e dsclosed afer checkng he FCS FCS check Ths mplemenaon suppors 16- and 32- FCS. Calculaon of he frame check sequence s performed durng he recepon of a frame. Ths means ha hs checksum s updaed MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
191 V.42 Error Correcon nc. upon recevng each ye from he sream. Such an approach reduces he peak load of he processor and mproves overall sysem performance. Dependng on whch sequence s used (16- or 32-), he approprae checksum s calculaed. In some cases, calculaon of oh checksums s requred (Secon of ITU-T V.42 Recommendaon). When a whole frame s receved, he calculaed check sum(s) s examned. The recever only handles a frame f has a vald FCS. Oherwse, he frame s dscarded and he recever changes s sae o V42_GETTING_FLAG Frame handler nc The frame handler receves conrol, f he FCS check passed successfully. Dependng on he conrol feld of he frame, denfes he correspondng parser o handle he frame n he approprae way. If he receved frame s no one of he frames lsed n secon of he ITU-T V.42 Recommendaon, hen he FRMR frame wll e ssued Informaon frame handlng Incomng I frames are sored n he rx_frame cyclc sorage. Ths sorage can accep (k_receive + 1) frames. Ths numer mus e 2 X. Two ndexes are used whn hs sorage: rx_frs and rx_las. rx_frs conans an ndex of he frs vald (feld v s TRUE) frame n sorage ha has no een coped o he Rx_uar_daa[] uffer ye. rx_las conans an ndex of he poson where he nex expeced frame wll e placed (s NS s equal o VR). If he rx_frs ndex s equal o he rx_las ndex, means ha here s no frame avalale o place s daa no he Rx_uar_daa[] uffer. Sorage s full when ((rx_frs + 1) & k_receive) == rx_las. Upon recevng an I frame, wo condons have o e analyzed: 1. Own-recever s usy 2. Frame Rejec condon Own-recever s usy condon. The recever acceps I frames only f s no n a usy condon. Seng hs flag s performed n wo sages. In he frs sage, he V42_OWN_RECEIVER_IS_FULL flag s se up along wh V42_ACCEPT_I_FRAME f here s space n he rx_frame sorage for one addonal I frame (((rx_las + 2) & k_receive) == rx_frs). So, whle he RNR frame s eng sen o he remoe modem, ha modem has enough me o sar sendng he nex I frame followng he las frame already sen. Snce he V42_ACCEPT_I_FRAME flag s se, he recever acceps ha frame and clears ha flag. Ths s he second sage. Ths approach avods reransmsson of he las frame when he recever ecomes empy. MOTOROLA Chaper 3. Module Descrpons 3-111
192 V.42 Error Correcon nc. (rx_las + 2) & k_receive ecome equal o rx_frs. Las I frame s receved Recever s no full, so all ncomng I frames can e acceped! V42_OWN_RECEIVER_IS_FULL! V42_ACCEPT_I_FRAME Only one I frame can e receved V42_OWN_RECEIVER_IS_FULL V42_ACCEPT_I_FRAME All ncomng frames wll e gnored V42_OWN_RECEIVER_IS_FULL! V42_ACCEPT_I_FRAME nc There s a case, when he V42_ACCEPT_I_FRAME flag wll no e se up. If SREJ s used, hen he nex o las frame ( las means a las frame ha can e sored no rx_frame sorage, u no he las frame n he seres) can e damaged. Afer ha he las frame s receved. Laer on, he nex o las frame s receved agan afer reransmsson. In hs case he rx_las ndex pons o he poson nex o he one poned o y rx_frs. Only he V42_OWN_RECEIVER_IS_FULL flag has o e se up n hs case. Frame-rejec condon. Two felds n rx_frame sorage are dedcaed o frame-rejec conrol. If nofy_rej s se, he ransmer ssues a rejec frame (REJ or SREJ) for he correspondng frame. nofy_rej s se only f he sen_rej feld s cleared. Ths s done o avod mulple rejecon of he same I frame. The accepance of I frames depends on he usage of he selecve rejec funcon. If selecve rejec s no used, or he V42_ACCEPT_I_FRAME flag s se, only ha frame s sored n rx_frame sorage, whch corresponds o a poson poned o y rx_las. If a dfferen frame s receved, s no acceped and he nofy_rej and sen_rej felds are processed appropraely. If selecve rejec s used, he recever checks f here s a correspondng poson n he rx_frame uffer for he receved I frame. Wh he selecve rejec funcon enaled, he followng suaons are possle MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
193 V.42 Error Correcon nc. rx_frame v nofy_rej sen_rej rx_las nc Remoe modem RR, p=1 I, NS=23 RR, f=1, NR=20 I, NS=20 SREJ, NR=20 I, NS=20 RR, p=1 RR, f=1, NR=20 I, NS=23 SREJ, NR=20 Sof modem I, NS=20 (VR ecomes equal o 21 and rx_las moves o he nex poson) I, NS=20 (poson for hs frame wll no e found and should e gnored) The remoe modem ssues a recever ready (RR) reques wh he p se, and jus afer ha sars o send an nformaon frame (e.g. 23). The Sof modem receves he RR command and sends a reply RR wh f se. Accordng o he ITU-T V.42 recommendaon, he remoe modem has o resend all unacknowledged I frames, sarng from I20. When he Sof modem receves I23, ses he nofy_rej feld for frames 20, 21, and 22. As a resul he ransmer ssues he SREJ frame, wh he value 20 n s NR feld. When he frs I frame wh NS=20 s receved (whch was sen y remoe modem n reacon o he receved RR reply), varale VR s ncremened y 1 and he rx_las poner moves o he nex poson. When he remoe modem receves SREJ, assumes ha frame I20 was no receved and resends agan. The sof modem has o gnore hs frame. MOTOROLA Chaper 3. Module Descrpons 3-113
194 V.42 Error Correcon nc. Anoher suaon s shown elow. rx_frame v nofy_rej sen_rej rx_las nc Remoe modem RR, p=1 I, NS=18 RR, f=1, NR=14 I, NS=14 I, NS=15 I, NS=16 I, NS=17 I, NS=18 Sof modem RR, p=1 RR, f=1, NR=14 I, NS=18 I, NS=14 I, NS=15 I, NS=16 I, NS=17 I, NS=18 The remoe modem ssues a RR reques wh he p se, and jus afer ha sars o send an nformaon frame (e.g. 18). The Sof modem receves he RR command and sends a reply RR wh f se. Accordng o he ITU-T V.42 recommendaon, he remoe modem has o resend all unacknowledged I frames, sarng from I14 o I18 nclusve. Assume, I18 was properly receved along wh I14, I15, I16 and I17. When frame I17 s receved, he VR varale ecomes equal o 19 nsead of 18. The rx_las poner s ncreased y 2 nsead 1, ecause I18 s already n rx_frame sorage. So, when he I18 frame s receved agan, he Sof modem has o gnore MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
195 V.42 Error Correcon nc. nc As a resul, only when he approprae poson s found, s daa from he recenly receved frame placed here. nofy_rej and sen_rej felds of all prevous no receved frames are processed appropraely. Along wh recevng frames, he recever pus daa from rx_frame sorage no he Rx_uar_daa[] uffer. Ths s shown as ndependen Process B on Fg Also, he recever handles he suaon here, when he rx_frame uffer ecomes empy. The sof modem can ssue an early REJ frame, f selecve rejec s no used. Ths s done o mprove proocol performance. If a frame was no receved properly ( was no properly ounded y wo flags, or was receved wh a CRC error), u s sze s greaer han EARLY_REJ_CONDITION, hen here s a relavely hgh proaly ha was an nformaon frame. nofy_rej and sen_rej felds are processed appropraely o ssue a REJ frame whou wang for he nex I frame wh an ncorrec NS Supervsor frame handlng Frames RR, RNR, REJ, and SREJ are handled n a specfed way descred n he ITU-T V.42 Recommendaon. The wo cases o e focused on here are he recepon of a reply frame wh he f se and he recepon of an SREJ frame. As menoned earler, he ransmer has o resend all I frames ha are sll eng unacknowledged afer recevng a reply frame wh he f se. Assume an I frame has a sequence numer (NS) equal o k ha s currenly eng ransmed o he remoe modem. If he receve sequence numer (NR) of he receved reply frame s less han k (y module 127), sendng of hs I frame should no e sopped f he selecve rejec funcon s used. Moreover, he flag for reransmsson of hs frame should no e se. Ths ncreases proocol performance. An example s descred elow. Assume he ransmer s sendng an I frame wh NS equal o 18, when he recever acceps an RR frame wh he f se, and he NR feld equal o 17. Afer he ransmer resends frame 17, wll sar o resend frame 19, ecause frame 18 wll have een receved y he remoe modem efore frame 17. x_frame ns rery V x_frs x_las The same has o e done f a vald SREJ frame s receved. MOTOROLA Chaper 3. Module Descrpons 3-115
196 V.42 Error Correcon nc. If selecve rejec s no used, ransmsson of he curren I frame has o e sopped, f s NS s no equal o he NR of he receved reply. Oherwse, ransmsson of hs I frame s connued and he rery flag should no e se up. Ths ncreases proocol performance as well The V.42 Transmer The srucure of he V.42 ransmer s shown n Fg The followng susecons gve more dealed nformaon aou mplemenaon of some of hese locks. from RX I Frame sorage from Frame handler nc V.42 Conrol and Sae un Error njecor Decson Box Frame consrucor B-level oupu & FCS generaon Tx_daa[] TX I Frame sorage V.42s encoder Process C Fgure Srucure of he V.42 ransmer Frame Capsulaon and Sendng Daa Tx_uar_daa[] The ransmer operaes n four saes when sends daa accordng o he V.42 proocol: V42_DECISION_BOX, V42_DATA_SENDING, V42_FCS_SENDING, and V42_FLAG_SENDING. When he decson ox receves conrol has o make a decson on wha frame o send. If here s no frame o send, sends a flag and changes s sae o V42_FLAG_SENDING. Ths lock can e dvded logcally no hree su locks: he frs lock makes a decson when he V.42 proocol s n he proocol esalshmen phase (sae < V42_CONNECTED), he second lock makes a decson when he V.42 proocol s n conneced sae (sae == V42_CONNECTED), and a hrd lock makes a decson when he V.42 dsconnecon procedure sars (sae == V42_DISCONNECTING). The decson ox also deermnes wheher a frame wll e sen as a command or a reply, and f he p/f s se or cleared MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
197 V.42 Error Correcon nc. If s decded o send a frame, he ransmer consrucs. Afer hs s done, he ransmer changes s sae o V42_DATA_SENDING. In hs sae, he ransmer pus daa, whch has prepared n he prevous sae, no he x_uffer. Upon placng a ye of daa no ha uffer, he ransmer updaes he frame conrol sum wh hs value. When all he daa s sen (address, conrol and, possly, nformaon felds), he ransmer places he calculaed frame conrol sum no he x_frame uffer drecly afer he sen daa, and changes s sae o V42_FCS_SENDING. When he FCS feld has een sen, he ransmer sends a frame closng flag y changng s sae o V42_FLAG_SENDING. Afer hs s done, he ransmer reurns ack no he V42_DECISION_BOX sae. nc Sendng Informaon frames Ougong I frames are sored n x_frame sorage. Two flags are assocaed wh each row n ha sorage: v (vald), and rery. If v s se, means ha he frame has no een acknowledged ye, and should no e removed from x_frame. The rery flag ndcaes wheher a frame should e reransmed or no. If he numer of unacknowledged frames s equal o he wndow sze, a new frame wll no e pu no hs sorage Sendng Supervsor frames Transmsson of m-srej frames has o e descred. These frames mplemen an acknowledgemen funcon. So, on he recevng sde, he NR feld of hese frames s used as acknowledgemen of all prevous frames. Assume he Sof Modem s n he followng sae n rx_frame sorage: rx_frame v nofy_rej sen_rej x_las Ths means ha frames sarng from NS 16 are no acknowledged. So, all frames, whch have v cleared have o e added o he ls of m-srej frame regardless of her sen_rej feld (hs s done n he decson ox y seng he nofy_rej feld for all nvald frames, whou akng no accoun he sen_rej feld). Oherwse, he NR feld wll e equal o 18 (ncorrec) havng no receved acknowledgemen for frames 16 and 17 from he remoe modem. Ths suaon causes a proocol error. MOTOROLA Chaper 3. Module Descrpons 3-117
198 V.42 Error Correcon nc Suppor of he V.14 proocol The V.42 module suppors daa ransfer accordng o he V.14 proocol. Ths proocol s used when he error-correcng proocol canno e esalshed. The V.14 proocol canno guaranee ha daa wll e delvered o he remoe modem correcly. Also, canno guaranee ha receved daa was no damaged ecause of nose on he lne. The V.42 module falls ack o he V.14 proocol, when he V.42 error-correcng proocol canno e esalshed eween wo modems, or when use of he V.42 proocol s dened y he user. The ranson o he V.14 proocol s shown n he Fgures and nc When he recever receves daa y he V.14 proocol, operaes n he V14_DATA_IN sae. The recever moves o he V14_EMPTY_BUFFER su-sae, f he aemp o esalsh he V.42 proocol fals. Durng he V.42 deecon phase he modem could have receved daa, n whch dd no recognze he ADP/ODP paerns. In hs su-sae oupus all ha daa o he Rx_uar_daa[] uffer. Afer ha, changes s sae o V14_1_GETTING. In he V14_1_GETTING sae, he recever ges daa y from he rx_uffer unl denfes a 0. Ths n he V.14 proocol acs as a sar of a ye. Egh daa s plus one 1 sop follows hs sar. So, he recever changes s sae o V14_SYMBOL_GETTING n order o ge nne s (egh daa s plus one sop ) from he rx_uffer and places he daa s no he Rx_uar_daa[] uffer. When s fnshed, he recever reurns ack o he V14_1_GETTING sae. When he ransmer sends daa accordng o he V.14 proocol, operaes n he V14_DATA_OUT sae. If here s no daa o send (here s no daa n he Tx_uar_daa[] uffer), sends a seres of 1 s. Oherwse, akes one ye from he Tx_uar_daa[] uffer, pus a sar 0 a he egnnng and a sop 1 a he end of he sequence, and places he resulan en s no he x_uffer The V.42 module funcon descrpon Ths chaper descres he funcons mplemened n he V.42 module. Funcon argumens for each roune are descred as n or nou. An n argumen means ha he parameer value s an npu only o he funcon. An nou argumen means ha a parameer s an npu o he funcon, u he same parameer s also an oupu from he funcon. Inou parameers are ypcally npu poner varales n whch he caller passes he address of a pre-allocaed daa srucure o a funcon. The funcon sores s resul whn ha daa srucure. The acual value of he nou poner parameer s no changed MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
199 V.42 Error Correcon nc. re_connecon_code Call(s): vod re_connecon_code(sruc channel_ * channel, un8 v42_esalshed, un8 params) Argumens: Tale re_connecon_code argumens channel n Poner o he Channel conrol daa srucure. v42_esalshed n TRUE, f he V.42 proocol s esalshed, FALSE oherwse. nc Descrpon: Reurns: Code example: params n Conans a mask of negoaed oponal funcons of he V.42 proocol for esalshed connecon. Ths funcon ses he connecon_code feld of he channel->rx_conrol_pr daa srucure accordng o he esalshed connecon. As a resul, he approprae answer codes appear n he ermnal wndow, wh he descrpon of he proocols used and he compresson. None. re_connecon_code(channel, TRUE, dp->oponal_funcons); MOTOROLA Chaper 3. Module Descrpons 3-119
200 V.42 Error Correcon nc. v42_ges Call(s): un32 v42_ges(v42_data_struct * dp, un32 * value, un32 n, un32 ransparency) Argumens: Tale v42_ges argumens dp n Poner o he V42 daa srucure. nc Descrpon: Reurns: Code example: value nou Poner o a secon of memory, where read s are placed. n n Numer of s o read. ransparency n If TRUE, each 0 ha follows 5 conguous 1 s wll e dscarded as ransparen. un32 value; Ths funcon ges n s from he rx_uffer. These s are placed no he ls of he varale, poned o y value. The remanng s of ha varale are cleared. If ransparency == TRUE, he funcon dscards ransparen s from he sream. V42_READ_SUCCESS, f he rx_uffer conans he requred numer of s, and V42_RX_BUFFER_EMPTY oherwse. V42_DATA_STRUCT * dp = channel->rx_conrol_pr->daa_handler_pr; v42_ges(dp, &value, 8, TRUE); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
201 V.42 Error Correcon nc. nc v42_n Call(s): vod v42_n (sruc channel_ * channel, V42_DATA_STRUCT * daa_pr, un8 orgnaor, un8 ec_mode, un8 dphase_enaled, un8 srej, un8 exended_fcs, un8 es_frames, un8 compresson) Argumens: Tale v42_n argumens channel n Poner o he channel conrol daa srucure. daa_pr n Poner o nalse he V.42 daa srucure. orgnaor n TRUE, f he modem acs as he orgnaor of he connecon, FALSE, f he modem acs as an answerer. ec_mode n Error-correcon mode: 0x00: no error correcon (V.14); 0x01: ARQ (V.42) / no error correcon (V.14) - auodeec; 0x02: ARQ (V.42) only - hang up f V.42 canno e esalshed. dphase_enaled n Deecon phase enaled (TRUE) / dsaled (FALSE) - vald only f ec_mode == 0x02. srej n 0x00: use of SREJ s dened y user; 0x01: use of sngle SREJ only s permed y user; 0x02: use of mulple SREJ only s permed y user; 0x03: use of oh sngle and mulple SREJ permed y user. exended_fcs n TRUE, f he use of a 32- FCS s permed y he user, FALSE oherwse. es_frames n TRUE, f he use of TEST frames s permed y he user, FALSE oherwse. compresson n Reques for daa compresson: 0x00: daa compresson dsaled; 0x01: daa compresson s permed for ransmng; 0x02: daa compresson s permed for recevng; 0x03: daa compresson s permed for oh drecons of ransfer. Descrpon: Ths funcon ses he felds of he curren V.42 daa srucure, poned o y he daa_pr, o her defaul values. Addonally, assgns he V.42 ransm and V.42 receve daa handler rounes o he channel conrol daa srucure. Reurns: None. Code example: MOTOROLA Chaper 3. Module Descrpons 3-121
202 V.42 Error Correcon nc. sac V42_DATA_STRUCT v42daa; v42_n(channel, v42daa, ((S[13] & S13_ORIGINATE_MODE) == S13_ORIGINATE_MODE), (S[22] & S22_M1), nc ((S[22] & S22_ENABLE_DETECTION) == S22_ENABLE_DETECTION), ((S[22] & S22_SREJ) >> BIT_SREJ), ((S[22] & S22_FCS_32) == S22_FCS_32), ((S[22] & S22_TEST_FRAMES) == S22_TEST_FRAMES), (S[23] & S23_COMPRESSION)); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
203 V.42 Error Correcon nc. v42_pus Call(s): un32 v42_pus(v42_data_struct * dp, un32 value, un32 n, un32 ransparency) Argumens: Tale v42_pus argumens dp n Poner o he V42 daa srucure. value n Daa o wre no he x_uffer. nc Descrpon: Reurns: Code example: n n Numer of s o wre. ransparency n If TRUE, a 0 wll e nsered afer 5 conguous 1 s as a ransparen. un32 saus, value; Ths funcon wres n s from value o he x_uffer. If ransparency == TRUE, he funcon nsers a 0 afer each sequence of 5 conguous 1 s. V42_WRITE_SUCCESS, f he x_uffer conans enough space o place he requred amoun of s (ncludng nseron of ransparen s), and V42_TX_BUFFER_FULL oherwse. V42_DATA_STRUCT * dp = channel->tx_conrol_pr->daa_handler_pr; saus = v42_pus(dp, value, 8, TRUE); f (saus == V42_WRITE_SUCCESS) { } MOTOROLA Chaper 3. Module Descrpons 3-123
204 V.42 Error Correcon nc. v42_rx_daa Call(s): vod v42_rx_daa(sruc channel_ * channel) Argumens: Tale v42_rx_daa argumens channel n Poner o he channel conrol daa srucure. nc Descrpon: Reurns: Code example: Ths funcon ges daa from he Rx_daa[] uffer, processes accordng o he V.42 proocol, and places he user s daa no he Rx_uar_daa[] uffer. None. channel->rx_conrol_pr->daa_handler_call_func = v42_rx_daa; sruc Rx_conrol_ *Rx_conrol = channel->rx_conrol_pr; Rx_conrol->daa_handler_call_func (channel); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
205 V.42 Error Correcon nc. v42_x_daa Call(s): vod v42_x_daa(sruc channel_ * channel) Argumens: Tale v42_x_daa argumens channel n Poner o he channel conrol daa srucure. nc Descrpon: Reurns: Code example: Ths funcon ges daa from he Tx_uar_daa[] uffer, processes accordng o he V.42 proocol, and places he resulan daa no he Tx_daa[] uffer. None. channel->tx_conrol_pr->daa_handler_call_func = v42_x_daa; sruc Tx_conrol_ *Tx_conrol = channel->tx_conrol_pr; Tx_conrol->daa_handler_call_func (channel); MOTOROLA Chaper 3. Module Descrpons 3-125
206 V.42 Error Correcon nc. v42_vews Call(s): un32 v42_vews(v42_data_struct * dp, un32 * value, un32 n) Argumens: Tale v42_vews argumens dp n Poner o he V42 daa srucure. nc Descrpon: Reurns: Code example: value nou Poner o he memory space where read s are placed. n n Numer of s o read. un32 saus, value; Ths funcon reads n s from he rx_uffer, u hey reman n he rx_uffer. Read s are placed no he ls of he varale, poned o y value. The res of he s of ha varale are cleared. V42_READ_SUCCESS, f he rx_uffer conans he requred numer of s, and V42_RX_BUFFER_EMPTY oherwse. V42_DATA_STRUCT * dp = channel->rx_conrol_pr->daa_handler_pr; saus = v42_vews(dp, &value, 17); f (saus == V42_READ_SUCCESS) { } MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
207 V.42s Daa Compresson Proocol nc. 3.3 V.42s Daa Compresson Proocol nc Proocol Background Informaon The V.42s algorhm defnes a loss-less, sngle-pass, real-me compresson scheme. I uses a varan of he Lempel-Zv-Welch (LZW) algorhm. The encoder ranslaes 8 characer sequences (srngs) no a numer of shor ransmsson okens - codewords. The algorhm uses adapve dconares o sore he mos encounered srngs along wh codewords, whch are used o represen hose srngs on eher sde of a V.42s connecon. The ransmer dconary assemles self from he npu daa fle, whle he recever dconary s assemled from he ransmsson okens. The sze of he dconary can vary; he CCITT sandard defnes he mnmal dconary sze as 512 nodes (srngs). The acual dconary sze s esalshed eween modems a he V.42 negoaon me. Boh he sof modem and he remoe modem exchange nformaon on he sze of dconary hey can suppor. The lower value s hen seleced. Boh modems also negoae a maxmum srng lengh, whch can e sored n he dconary, n he range from 6 o 250 characers. DATA FILE Adapve Dconary Adapve Dconary Fgure V.42s Connecon DATA FILE The dconary can e represened as a ree nework, where each roo node represens a sngle alphae characer, and vce versa, each characer corresponds o he ree n he dconary. All he rees represen a se of known srngs ha reak ou wh a roo node characer. Each ree node corresponds o a se of srngs of he dconary, and a leaf node corresponds o a sngle known srng. To egn wh, each ree consss of only a roo node wh a unque codeword. Daa compresson s acheved y growng a duplcae dconary n oh he encoder and decoder. The dconares are grown n locksep usng he ransmed address okens. Wh a few excepons (For he encoder when oupus an address oken (codeword) ha s already n he dconary, for he decoder when npus an address oken (codeword) ha s already n he dconary), each address oken creaes a new dconary node. The dconary conans a pre-loaded secon, and a learnng secon where new nodes are added durng ransmsson. New nodes are creaed n oh he encoder and decoder dconares so ha oh reman dencal a all mes. Before encodng a daa fle, he dconares n oh he encoder and decoder are pre-loaded from addresses 0 o 258. The frs hree dconary addresses represen specal conrol codes MOTOROLA Chaper 3. Module Descrpons 3-127
208 V.42s Daa Compresson Proocol nc. nc (ETM, FLUSH, STEPUP - for compressed mode, ECM, EID, RESET for ransparen mode), whch enale he encoder o communcae wh he decoder. Followng daa ransmssons grow a new dconary. An orgnal 9 ransmsson code suppors a dconary wh up o 512 nodes. When he dconary exceeds 512 nodes, a 10 ransmsson code s ulsed. A 1K nodes hs ransmsson code s ncreased o 11 s and so on. Ths s acheved y consanly clearng old dconary nodes and recyclng hem accordng o a leas recenly used scheme. The nex 256 nodes are hen pre-loaded wh an ASCII characer code. A sarng node s hus provded for each of he 256 ASCII characers,.e., a roo for 256 separae rees. Snce he dconary enres are shfed up y he hree conrol codes, each ASCII code s sored n he address ASCII + 3. The acual srng learnng dconary sars a address 259 and usually goes o 2K nodes. Durng he encodng process, a ree dconary s grown from he npu fle daa. Each srng of npu characers, n effec, clms he ree nodes o fnd machng srngs already sored n he dconary. The srng machng process comes o an end when a codeword canno e found n he dconary. The codeword hen denfes he longes machng srng n he dconary as learned durng prevous ransmssons. Ths srng s ransmed as he oupu codeword. Ths codeword, ogeher wh he las unmached characer, s sored n he nex empy dconary enry o add a new ranch o he ree dconary. The unmached characer s used as he frs characer of he nex daa srng, connung he srng machng and ransmsson process. Wh few excepons, each ransmsson creaes a new node n oh he encoder and decoder dconary. The decoder uses he npu codeword code o rereve a daa srng from s own duplcae dconary. Ths s done y followng he codeword ral ackwards hrough he ree dconary unl a codeword smaller han 259 s deeced. Whle jumpng ackwards from node o node hrough he dconary, an ASCII characer s recovered n each sep. The characer srng s recovered n reverse order. The recovered srng s he oupu daa from he decoder. The decoder saves he npu codeword n a uffer and was for he nex npu codeword. The nex npu codeword s smlarly convered ack no an oupu daa srng. The frs characer of ha nex srng s comned wh he prevous codeword (whch was saved n he uffer) o creae a new node n he recever dconary y sorng he codeword - characer par n a nex empy dconary locaon. The nex empy dconary nodes are compued n he same way n oh he encoder and decoder so ha oh he encoder dconary node and he decoder dconary node are sored n an dencal dconary codeword. Noe ha he encoder sores s new node one ransmsson earler han he recever. Ths can cause a prolem f he encoder uses he jus-creaed node o encode he nex srng. The recever would hen rereve he wrong srng ecause does no ye have he correc node. The soluon s for he ransmer o avod usng a newly-creaed node address o encode he srng mmedaely followng. The ITU sandard defnes 2 modes of compresson funcon: ransparen and compressed. In he compressed mode, as menoned aove, he ransmsson s ased on codewords. In he ransparen mode, here s no codeword ransmsson and he characers enerng he MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
209 Implemenaon Overvew nc. nc encoder are no ranslaed, eng sen as a normal characer. The ransparen mode s very useful when a very mxed characer sream s npu o he encoder. There s a hgh proaly, ha each of he ncomng characers wll no e "mached" (such a suaon ofen exss mmedaely afer dconary nalzaon). Wh every ncomng "unmached" characer, he encoder oupus a ye, however he mnmal codeword sze s equal o 9, so n such a case he compresson effcency wll e negave o a consderale percenage. The V.42s module conans a Daa Compresson Tes ha deermnes when daa compresson wll e effecve. Bascally he es performs a comparson of s efore and afer compresson and calculaes he effcency of he mode used. The compresson effcency reques s used o swch from he ransparen o he compressed mode and vce versa, dependng upon he characerscs of he ransmed daa. Accordng o he ITU sandard, swchng o compresson mode s necessary when prevous daa (whch was already ransmed and hus canno e compressed) could have een compressed, ncreasng overall effcency. Conversely swchng no he ransparen mode s requred when he already compressed and ransmed daa s eng compressed wh negave effcency. I has o e poned ou ha hs swchng from ransparen o compressed modes s crucal o he effcen operaon of he algorhm. The sandard self does no defne a compresson effcency esmaon procedure for when he swch s possle or requred. Furher deals on hs algorhm are ncluded n secon of hs documen. The Flush reques s used o flush all ousandng daa from he encoder. The sandard does no noe when he Flush reques should e ssued, u he assumpon s made ha should e ssued a leas afer a predefned meou perod (n he case of a user, workng n he ermnal mode). The re-nalzaon reques can e ssued y he V.42 funcon as a reacon o an exernal even, or relaed o an neffcency of compresson wh he curren dconary followng an nalzaon. For he ransmer hs means ha he srng machng procedure mus e ermnaed. I s essenal ha he recever s decoder undersands hs command. 3.4 Implemenaon Overvew The module mplemens he V.42s daa compresson proocol used n conjuncon wh he error-correcon proocol V.42, accordng o he CCITT Recommendaon V.42s. To enale V.42s operaon n a sofware modem, oh V.42 and V.42s mus e compled usng he V42BIS defnon drecve. In hs case, he V.42 error-correcon module uses V.42s compresson s an negral par. Ths V.42s mplemenaon provdes uffered ye-orened compresson and decompresson servces, so does no have o nerface wh he DTE uffers and can also e used as a sandalone compressor on any plaform, or used along wh dfferen v.42 mplemenaons. MOTOROLA Chaper 3. Module Descrpons 3-129
210 Implemenaon Overvew nc. The followng declaraon n he v42s.h fle defnes defaul negoaon values suggesed y he CCITT Recommendaon V.42s (Appendx II.1). #defne V42BIS_MAX_STRING 32 // Maxmum dconary srng lengh nc #defne V42BIS_CODEWORD_BITS 11 // Maxmum s per codeword These values can e redefned wh alernave values accordng o he CCITT Recommendaon V.42s. The maxmum s per codeword can e up o he value of 2 16, ecause he mplemenaon uses a 16- daa ype o represen he dconary codewords. Because he nodes n he dconary are organzed as a TRIE srucure: (Tre s a knd of dgal search ree. [Fredkn1960] nroduced he re ermnology, whch s arevaed from "Rereval".), he sysem provdes fas dconary look-up for a mached srng and he curren characer, and effecve dconary modfcaon (appendng a new srng and removng a node n he dconary recovery mode). The V.42s algorhm consanly monors he curren compresson raos. If he rao ecomes negave, hen he compresson esmaon funcon s swched off and communcaon changes o sandard egh characer codes (ransparen mode). If he rao ecomes posve, communcaon changes o codeword ransmsson. The compresson esmaon funcon s used o measure he dfference eween he amoun of s ransferred o an encoder oupu (gnorng conrol codewords), and he amoun of s of all yes acceped y an encoder npu. The ransmer can e n he ransparen mode and ransfer yes o an oupu "as s", however he encoder can nernally call he Daa Compresson Tes. If hs funcon ecomes posve, means ha ransmsson usng he ransparen mode (he s ransferred s more han he s acceped) s more effecve, oherwse s more useful o work n he compresson mode. If he compresson esmaon funcon falls elow a negave hreshold hen a decson s made o swch over. Smlarly, f he compresson esmaon funcon exceeds a posve hreshold whle sll n he ransparen mode - he ransmer s swched o he compresson mode. The hreshold for swchng no he ransparen mode s seleced o e hgher, o avod connual swchng away from compresson mode for mnor negave excursons Communcaon wh V.42 The V.42 Error Conrol module nvokes he V.42s prmves durng normal operaons. The V.42 XID frames handle V42s negoaon parameers durng call nalzaon. There are wo s n he S23 regser ha eher perm or dsallow compresson. Compresson can e enaled from he caller o he answerer, from he answerer o he caller, or n oh drecons. To ransm daa wh V.42s compresson enaled, he V.42 ransmer under normal condons nvokes V.42s o encode daa from he ermnal. The encoded daa s used for all furher V.42 daa processng. The specal cyclc uffer encode uffer, s used o MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
211 Implemenaon Overvew nc. communcae eween he V.42 ransmer and he V.42s encoder. Two dfferen funconal locks share hs uffer: The V.42s Encodng lock The V.42 Frame Encapsulaon lock The V.42s encodng lock compresses ncomng daa (from Tx_uar_daa) and pus no he encode uffer. The V.42 Frame Encapsulaon lock reads he daa from ha uffer and encapsulaes n he nformaon feld of an I-Frame. When he decson o encapsulae an I-Frame s made y he V.42 ransmer, s possle ha he encode uffer could e empy. In hs case he V.42s Flush reques s used o produce non-zero nformaon feld daa nsde he encoder. (See Fgure 3-38 ). nc V.42 TX Daa Handler Tx_uar_daa Encodng Flush Encode Buffer Fgure Compresson flow I-Frame Encapsulaon Frame Sorage Tx_daa To receve daa wh V.42s decompresson enaled, he V.42 recever under normal condons nvokes V.42s o decode daa from he remoe modem. The specal uffer decode uffer, s used o communcae eween he V.42 recever and V.42s decoder. The sze of he decode uffer s esmaed o f he maxmum possle compresson rao for he maxmum nformaon feld lengh of he I-Frame. Thus, every processed frame ecomes fully decompressed. All daa from he decode uffer s hen drecly ransferred no he DTE. The daa ha can no e ransferred no he DTE mmedaely, ecause of flow conrol, remans n he decode uffer and he wll e ransferred nex me, when I-Frame decapsulaon resars. (See Fg ) MOTOROLA Chaper 3. Module Descrpons 3-131
212 Implemenaon Overvew nc. Rx_daa V.42 RX Daa Handler Frame Sorage I-Frame De- Decode Buffer Decodng Rx_uar_daa Fgure Decompresson flow nc Ths logc s enaled n he V.42 module when he V42BIS defne saemen s compled. If compresson n one drecon s dsaled, he V.42 module uses s own DTE daa delvery scheme o/from he DCE. All he daa srucures of V.42s are defned nsde he V.42 module and have no relaons wh ohers, so he negral operaon of V.42 and V.42s proocols s compleely ransparen o oher pars of he sysem Programmng Inerface The programmng nerface wh he v.42s module consss of he followng se of prmves: Tale V42s Funcons Funcon Descrpon Reference v42s_in Inalze v.42s daa compresson v42s_encode Encode an npu characer v42s_decode Decode an uffer of characers v42s_flush Flush ousandng daa from he encoder The V.42s module manans s nernal encoder and decoder saes n he v42s_ daa srucure. The srucure self can e locaed n he V.42s servce user memory lock. The poner o hs srucure mus e specfed o any nerface funcon of hs module. Mos of he funcons reurn a value, specfyng he amoun of daa ha was processed. A specal reurn value C_ERROR s used o ndcae a V.42s algorhm error, whch may occur n he developmen phase only and s useful for developer. V.42s shouldn reurn hs value on a esed & deugged produc. Noe he rounes do no verfy npu parameers for conssency. Thus he code speed s ncreased and code sze s mnmzed. Ths s economcal for emedded sysems. The parameer valdy s assumed o e he responsly of a V.42s servce user. Invald parameers may cause ncorrec V.42s funcon ehavor or a sysem crash. The vald parameer condons can e found n he Descrpon susecon for each roune MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
213 Implemenaon Overvew v42s_in Call(s): nc. vod v42s_in (v42s_ *dp, un16 p1, un8 p2) Argumens: Tale v42s_in argumens dp n poner o he V.42s conrol daa srucure p1 n Maxmum numer of codewords p2 n Maxmum V.42s srng lengh nc Descrpon: Inalzes he daa compresson funcon accordng o he CCITT Recommendaon V.42s secon 7.2. The funcon nalzes he V.42s daa srucure accordng o he negoaed parameers. The roune shall e nvoked mmedaely afer XID negoaon y he V.42 proocol The correc v.42s funcon ehavor s expeced o adhere o he followng condons: 512 <= p1 <= <= p2 <= 250 accordng o he CCITT Recommendaon V.42s. Reurns: Code example: v42s_ v42s; None. un16 code_words_num; un8 max_sr_lengh; v42s_in(&v42s, code_words_num, max_sr_lengh); MOTOROLA Chaper 3. Module Descrpons 3-133
214 Implemenaon Overvew v42s_encode Call(s): nc. n v42s_encode(v42s_ *dp, un8 ch, un8 *ouf) Argumens: Tale v42s_encode argumens dp n Poner o he v42s daa srucure ch n Characer o encode ouf n Oupu uffer for compressed daa. nc Descrpon: Performs npu characer encodng accordng o he CCITT Recommendaon V.42s secon 7.1. The funcon encodes a sngle characer ch no a sequence of X s, where 0 <= X <= 48 (wh a 2048 codeword dconary), and pus yes of ha sequence no he oupu uffer ouf. Bs ha do no algn o yes wll e aken no accoun durng furher v42s_flush or v42s_encode roune calls. Noe ha he user mus specfy an oupu uffer large enough oherwse he funcon can pu daa no an nvald memory locaon whou reporng any error. The sze of hs uffer should e a leas 6 yes ou of 2048 codewords. All yes n he uffer should e nalsed o zero efore callng hs funcon. Reurns: The numer of yes pu no he oupu uffer (can e zero), or C_ERROR f an nernal error has occurred (dconary was overwren wh nvald daa) Code example vod Tx_daa(,v42s_ *v42s, un8 *npu_daa, un8 len) } { un8 comp_uf[256*6]; un8 nbyes; un8 *ou = comp_uf; memse(comp_uf,0,szeof(comp_uf)); /*Perform compresson from npu_daa uffer char y char*/ for (=0; <len; ++) nbyes = v42s_encode(v42s, npu_daa[], ou); ou += nbyes; } MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
215 Implemenaon Overvew v42s_decode Call(s): nc. n v42s_decode (v42s_ *dp, un8 *uf, un32 len, Argumens: Tale v42s_encode argumens un8 *ouf, un32 *olen) dp n poner o he v42s daa srucure uf n poner o he npu uffer nc Descrpon: Reurns: len n numer of yes n he npu uffer ouf n poner o he uffer o oupu decompressed daa. olen ou reurns he acual ye coun ha was decoded and pu no he oupu uffer ouf Ths funcon performs npu uffer decodng accordng o he CCITT Recommendaon V.42s secon 8. I decodes len yes from he npu uffer uf and pus decompressed olen yes no he oupu uffer ouf. The sze of he oupu uffer ouf mus no e less han he esalshed maxmum srng lengh (value of parameer p2 of v42s_in) for each characer n he npu uffer,.e olen len * (maxmum v.42s srng lengh) 0 f all yes from npu he uffer were processed C_ERROR f an nvald codeword n he npu uffer was reached oherwse no all yes from he npu uffer were processed Code example: res = v42s_decode( &v42s, /* v42s daa lock */ comp_uf, /* npu frame uffer */ comp_uf_len, /* npu uffer lengh */ decomp_uf, /* oupu uffer */ &decomp_len); /* oupu uffer lengh */ f (res == C_ERROR) { /* >> Dsconnec code here << */ } MOTOROLA Chaper 3. Module Descrpons 3-135
216 Implemenaon Overvew v42s_flush Call(s): nc. n v42s_flush (v42s_ *dp, un8 *ouf) Argumens: Tale v42s_flush argumens dp n poner o he v42s daa srucure ouf n poner o he oupu uffer o flush reman daa nc Descrpon: Ths funcon performs a FLUSH reques accordng o he CCITT Recommendaon V.42s secon 7.9. I flushes he ousandng s from he encoder and reurns he resul as a ye algned oupu, ready for ransmsson. Noe ha he user mus specfy an oupu uffer large enough oherwse he funcon can pu daa no an nvald memory locaon whou reporng any error. The sze of hs uffer should e a leas 4 yes on 2048 codewords dconary. All yes n he uffer should e se o zero. Reurns: Code example: The numer of yes ha were pu no he oupu uffer (can e zero). vod Tx_daa(,v42s_* v42s, un8 *npu_daa, un8 len) { un8 flush_uf[6]; un8 nbyes; un16 encoded_yes = 0; un8 needed_o_send_somehng = 1; /* >> Encodng goes here << */ encoded_yes += v42s_encode(); f ((encoded_yes == 0) && (needed_o_send_somehng)) { n nbyes; } } memse(flush_uf, 0, szeof(flush_uf)); nbyes = v42s_flush(v42s, flush_uf); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
217 The V.14 Sofware Module nc Compresson Rao Ths secon descres a V.42s compresson rao comparson for several fles provded y he ITU-T V.56er Recommendaon. The resuls are oaned wh he followng V.42s negoaon values: Maxmum Numer Of Codewords = 2048 Maxmum Srng Lengh = 32 nc These defaul values are used y mos modems and placed no he scope of he recommendaon. However, s useful o know, ha changng he aove parameers has a grea effec on he compresson rao, whch depends very much on he characerscs of he daa. Tale Compresson Rao Comparson V.56er Compresson capaly Orgnal Sze 3.5 The V.14 Sofware Module The V.14 Sofware module mplemens asynchronous-o-synchronous converson accordng o he ITU-T V.14 recommendaon. The V.14 Sofware module conans wo pars: hetx V.14 Daa Handler and he Rx V.14 Daa Handler V.14 Daa Handler V.56er spec. Compressed V.42s module Sze Rao Sze Rao 1x30.TST Excellen % % 2x10.TST Good % % 3x06.TST Poor % % 4x04.TST Caasrophc % % Tx channel Tx_uar_daa[] V.14 Tx Daa Handler Tx_daa[] Fgure Tx V.14 Daa Handler n he Tx channel MOTOROLA Chaper 3. Module Descrpons 3-137
218 3-138 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA The V.14 Sofware Module The Tx V.14 Daa Handler akes daa from he Tx_uar_daa[] uffer encodes and pus no he Tx_daa[] uffer. Each uffer elemen n he Tx_uar_daa[] uffer conans 8 daa s(characer). If he Tx_uar_daa[] uffer conans daa, he Tx V.14 Daa Handler akes he characer from he Tx_uar_daa[] usng he Tx_uar_daa_read() funcon (see chaper Crcular Buffer Inlne funcons). The Tx V.14 Daa Handler hen encodes he daa accordng o he V.14 Recommendaon (each characer (8 daa s) s preceded y a Sar (Sar = 0 ) and s followed y a Sop (Sop = 1 )). The general daa flow accordng o he V.14 Recommendaon s shown n Fg The Tx V.14 Daa Handler hen pus he encoded daa no he Tx_daa[] uffer usng he v14_pu_s() funcon. In he Tx_daa[] uffer each elemen conans x_ns used s. x_ns conans he numer of s per aud. Dependng on he modulaon proocol used, he value of x_ns can e changed. Tx_conrol->n_s conans he numer of x_ns. The v14_pu_s() funcon dvdes he encoded daa y x_ns daa s and pus he resul no he Tx_daa[] uffer. The general operaon of he Tx V.14 Daa Handler s shown n Fgure Fgure Tx V.14 Daa Handler S T O P S T A R T Elemen 0 Elemen 1 Tx_uar_daa[] S T A R T Elemen 1 Elemen 0 Tx_daa[] x_ns x_ns v14_pu_s Tx_v14_DH_roune Tx_uar_daa_read S T O P S T A R T S T O P S T A R T S T O P S T A R T Elemen 0 Elemen 1 Tx_uar_daa[] Elemen 0 Elemen 1 Tx_uar_daa[] Elemen 0 Elemen 1 Tx_uar_daa[] S T A R T Elemen 1 Elemen 0 Tx_daa[] x_ns x_ns 1 0 S T A R T Elemen 1 Elemen 0 Tx_daa[] x_ns x_ns x_ns x_ns x_ns x_ns v14_pu_s v14_pu_s Tx_v14_DH_roune Tx_uar_daa_read Tx_v14_DH_roune Tx_uar_daa_read nc. nc
219 The V.14 Sofware Module nc. If he Tx_uar_daa uffer doesn conan any daa, he Tx V.14 Daa Handler pus all 1 s no he Tx_daa[] uffer usng he v14_pu_s() funcon, accordng o he ITU V.14 Recommendaon. Transmer Recever S T O P S T A R T S T O P S T A R T nc Characer Markng Sae No Daa Sen Characer Fgure General Daa Flow Accordng o he V.14 Recommendaon The Tx V.14 Daa Handler conans he followng funcons: Tx_V14_DH_n(), Tx_V14_DH_roune() and v14_pu_s(). MOTOROLA Chaper 3. Module Descrpons 3-139
220 The V.14 Sofware Module Tx_V14_DH_n Call(s): nc. vod Tx_V14_DH_n(sruc channel_ * channel); Argumens: Tale Tx_V14_DH_n argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Inalsaon of he Tx V14 Daa Handler. The Tx V14 Daa Handler akes conrol of he daa srucure. The user mus call hs funcon efore callng he Tx_V14_DH_roune() and v14_pu_s() funcons. I s only necessary o call once efore Daa Handler operaon. None. sruc channel_ channel; Tx_V14_DH_n(channel); Tx_conrol->daa_handler_call_func=Tx_V14_DH_roune; MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
221 The V.14 Sofware Module Tx_V14_DH_roune Call(s): vod Tx_V14_DH_roune(sruc channel_ * channel); Argumens: nc. Tale Tx_V14_DH_roune argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon ges he daa from he Tx_uar_daa[] uffer usng he Tx_uar_daa_read() funcon, encodes and pus he encoded daa no he Tx_daa[] uffer usng he v14_pu_s() funcon. None. sruc channel_ channel; Tx_conrol->daa_handler_call_func (channel); Code explanaon: swch(tx_conrol->daa_handler_sae) { defaul: case TX_DH_STATE_NORMAL: Tx_conrol->daa_handler_sae conans he curren sae of he x daa handler. If s se o TX_DH_STATE_NORMAL, he x daa handler can ransm he daa. f (Tx_conrol->uar_daa_al!= Tx_conrol->uar_daa_head) { value = 0x200 ((Tx_uar_daa_read(Tx_conrol)) << 1); v14_pu_s(channel, value, 10); } If he Tx_uar_daa[] uffer conans daa, ake he daa characer(8 s) from he Tx_uar_daa[] uffer, add sar and sop s, and sore he resul n he varale value, hen call he v14_pu_s() funcon o pu 10 daa s from value no he Tx_daa[] uffer. else v14_pu_s(channel, 0xFF, 8); If he Tx_uar_daa[] uffer doesn conan daa, pu 8 1 s no he Tx_daa[] uffer. MOTOROLA Chaper 3. Module Descrpons 3-141
222 The V.14 Sofware Module v14_pu_s Call(s): un32 v14_pu_s(sruc channel_ * channel, un32 value, un8 n); Argumens: nc. Tale v14_pus argumens channel n Poner o he Channel conrol daa srucure value n Conans he daa s eng pu no he Tx_daa[] uffer n n Conans he numer of daa s eng pu no he Tx_daa[] uffer nc Descrpon: Ths funcon pus daa no he Tx_daa[] uffer. Reurns: None. Code example: sruc channel_ channel; value = 0x200 ((Tx_uar_daa_read(Tx_conrol)) << 1); v14_pu_s(channel, value, 10); Code explanaon: x_ns = Tx_conrol->n_s; Ges he value of n_s (numer of s per aud specfed durng daa pump proocol nalzaon) from he Tx_conrol srucure. numer_n_s = n/x_ns+((n%x_ns)!=0); Calculaes, how many elemens n he Tx_daa[] uffer are requred for n curren daa s accordng o he curren value of x_ns. As you can see on he Fg.1-2, each elemen n he Tx_daa[] uffer conans x_ns daa s only (n Fg.1-2 x_ns=3). The oher s n he Tx_daa[] uffer elemen are no used. In hs case, he n=10 s mus e spl no porons, each 3 s long so ha each poron can e placed n a separae Tx_daa[] uffer elemen. Example #1: n=10, x_ns=3. There are 3 porons of 3 s and one poron of 1. Porons of 3 s mus e pu n elemens #0-2 of he Tx_daa[] uffer, he las poron of one mus e flled up wh 1 s ( see f (n<x_ns && n!=0) n he v14_pu_s() funcon) and mus e pu no elemen #3 of he Tx_daa[] uffer. Fllng up wh 1 s s requred o elmnae msundersandng 0 s as he egnnng of he characer MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
223 The V.14 Sofware Module Example #2: n=10, x_ns=2. There are 5 porons of 2 s. I sn requred o fll any porons wh 1 s. The daa pump akes only x_ns s from each Tx_daa[] uffer elemen. Example: nc. daa = value; daa <<= 32 - x_ns; daa >>= 32 - x_ns; nc The varale daa ges daa s from he varale value, and sores only x_ns daa s o e pu no he Tx_daa[] uffer. Tx_daa_wre(Tx_conrol,daa); Inlne funcon. Furher descrpon can e found n chaper Crcular Buffer Inlne funcons. n -= x_ns; Afer sendng x_ns daa s, n mus e decremened y x_ns. value = value >> x_ns; x_ns daa s are suraced from he varale value. f (n<x_ns && n!=0) { for(j=0; j<x_ns-n; j++) } { value = value (1<<(n+j)); } If he remanng daa s are greaer han 0 and less hen x_ns, he elemen mus e flled up wh 1 s, o conan x_ns daa s. MOTOROLA Chaper 3. Module Descrpons 3-143
224 3-144 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA The V.14 Sofware Module Rx V.14 Daa Handler The Rx V.14 Daa Handler akes encoded daa from he Rx_daa[] uffer, decodes and pus he decoded daa no he Rx_uar_daa[] uffer. The Rx_daa[] uffer conans rx_ns daa s n each elemen. The Rx_uar_daa[] uffer conans a daa characer (8 daa s) n each elemen. The Rx V.14 Daa Handler ges he daa from he Rx_daa[] uffer and sores n he nernal rx_uffer[] usng he v14_ge_s() funcon, decodes he daa usng he Rx_V14_DH_roune() funcon and pus he encoded daa no he Rx_uar_daa[] uffer usng he Rx_uar_daa_wre() funcon (see chaper Crcular Buffer Inlne funcons). The Rx V.14 Daa Handler conans he followng funcons: R_V14_DH_n(), Rx_V14_DH_roune() and v14_ge_s(). Fgure The Rx V.14 Daa handler The Rx_V14_DH_ srucure s defned n v14.h /************************************************************************ * Rx V.14 Daa Handler Srucure *************************************************************************/ sruc Rx_V14_DH_ Elemen 0 Elemen 1 Rx_uar_daa[] S T A R T Elemen 1 Elemen 0 Rx_daa[] rx_ns rx_ns v14_ge_s Rx_uar_daa_wre S T O P S T A R T Rx_v14_DH_roune Elemen 0 Elemen 1 Rx_uar_daa[] Elemen 0 Elemen 1 Rx_uar_daa[] Elemen 0 Elemen 1 Rx_uar_daa[] S T A R T Elemen 1 Elemen 0 Rx_daa[] rx_ns rx_ns 1 0 S T A R T Elemen 1 Elemen 0 Rx_daa[] rx_ns rx_ns rx_ns rx_ns rx_ns rx_ns v14_ge_s v14_ge_s Rx_uar_daa_wre Rx_uar_daa_wre S T O P S T A R T S T O P S T A R T S T O P S T A R T Rx_v14_DH_roune Rx_v14_DH_roune nc. nc
225 The V.14 Sofware Module nc. { un32 rx_uffer; un32 rx_num_s; }; enum V14_sae_ rx_susae; un16 rx_null_coun; nc The Rx_V14_DH_ srucure parameer descrpons are as follows: rx_uffer Inernal uffer for he Rx Daa Handler no whch he Rx Daa Handler accumulaes s from he Rx_daa[] uffer and from whch he Rx Daa Handler akes daa and pus no he Rx_uar_daa[] uffer. I s nalsed n Rx_V14_DH_n () o 0. rx_num_s numer of daa s n he rx_uffer[]. I s nalsed n Rx_V14_DH_n() o 0. rx_susae - Sae denfer. I conans he curren sae of he Rx Daa Handler. I s nalsed n Rx_V14_DH_n() o V14_DH_1_GETTING. rx_null_coun Specfes he numer of receved zeros o deermne when here s no carrer. I s nalsed n Rx_V14_DH_n() o 0. MOTOROLA Chaper 3. Module Descrpons 3-145
226 The V.14 Sofware Module Rx_V14_DH_n Call(s): nc. vod Rx_V14_DH_n(sruc channel_ * channel, sruc Rx_V14_DH_ *dp); Argumens: Tale Rx_V14_DH_n argumens channel n Poner o he Channel conrol daa srucure dp n Poner o he Rx V14 Daa Handler daa srucure nc Descrpon: Reurns: Code example: sruc channel_ channel; Inalsaon of he Rx V14 Daa Handler. The Rx V14 Daa Handler akes conrol of he daa srucure. The user mus call hs funcon efore callng he Rx_V14_DH_roune() and v14_ge_s() funcons. I s only necessary o call once efore Daa Handler operaon. None. sac sruc Rx_V14_DH_ Rx_V14_DH; Rx_V14_DH_n(channel,&Rx_V14_DH); Rx_conrol->daa_handler_call_func=Rx_V14_DH_roune; MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
227 The V.14 Sofware Module Rx_V14_DH_roune Call(s): nc. vod Rx_V14_DH_roune(sruc channel_ * channel); Argumens: Tale Rx_V14_DH_roune argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: sruc channel_ channel; Ths funcon ges he daa from he Rx_daa[] uffer usng he v14_ge_s() funcon, decodes and pus he encoded daa no he Rx_uar_daa[] uffer usng he Rx_uar_daa_wre() funcon. None. Rx_conrol->daa_handler_call_func (channel); Code explanaon: case V14_DH_1_GETTING: value = v14_ge_s(channel, dp, 1); f (value) dp->rx_null_coun = 0; else { dp->rx_null_coun ++; dp->rx_susae = V14_DH_SYMBOL_GETTING; } reak; MOTOROLA Chaper 3. Module Descrpons 3-147
228 The V.14 Sofware Module nc. dp->rx_susae conans V14_DH_1_GETTING. The Rx_V14_DH_roune() funcon ges 1 daa from he nernal rx_uffer usng he v14_ge_s() funcon unl a zero occurs n he daa. dp->rx_susae hen swches no V14_DH_SYMBOL_GETTING. dp->rx_null_coun specfes he numer of receved zeros o deermne he carrer loss. case V14_DH_SYMBOL_GETTING: nc f (dp->rx_null_coun > ((CARRIER_DETECT_TIME*Rx_conrol->aud_rae*Rx_conrol->n_s)/1000)) { Rx_conrol->daa_handler_sae = RX_DH_STATE_FAILED; reurn; } else { value = v14_ge_s(channel, dp, 9); f (value == 0) else dp->rx_null_coun += 9; dp->rx_null_coun = 0; f (value & 0x100) { f (Rx_conrol->daa_handler_sae!= RX_DH_STATE_ONLINE_COMMAND) { Rx_uar_daa_wre(Rx_conrol,(un8) value); } } dp->rx_susae = V14_DH_1_GETTING; } reak; MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
229 The V.14 Sofware Module nc. In susae V14_DH_SYMBOL_GETTING he Rx_V14_DH_roune() funcon deermnes he loss of he carrer. If here s no loss of carrer, ges 9 daa s from he nernal uffer dp->rx_uffer[] usng he v14_ge_s() funcon, and f he daa packe sn roken (Sop = 1) and he Daa Handler sae sn n he Onlne command sae, pus he daa characer (8 daa s) no he Rx_uar_daa[] uffer usng he Rx_uar_daa_wre() funcon (see chaper Crcular Buffer Inlne funcons). If here s a loss of carrer he Daa Handler goes o RX_DH_STATE_FAILED. nc MOTOROLA Chaper 3. Module Descrpons 3-149
230 The V.14 Sofware Module v14_ge_s Call(s): un32 v14_ge_s(sruc channel_ * channel, sruc Rx_V14_DH_ * dp, un32 n); Argumens: nc. Tale v14_ges argumens channel n Poner o he Channel conrol daa srucure dp n Poner o he Rx V14 Daa Handler daa srucure n n Conans he numer of daa s requred from he Rx_daa[] uffer nc Descrpon: Ths funcon ges daa from he Rx_daa[] uffer. Reurns: Code example: sruc channel_ channel; sruc Rx_V14_DH_ *dp; un32 value; value = v14_ge_s(channel, dp, 1); Code explanaon: whle (dp->rx_num_s < n) { Daa oaned from he Rx_daa[] uffer. daa = Rx_daa_read(Rx_conrol); daa <<= dp->rx_num_s; dp->rx_uffer = daa; dp->rx_num_s += rx_ns; } Ge daa s from Rx_daa[] uffer, unl he varale daa conans n daa s, requred y he v14_ge_s() funcon. dp->rx_num_s numer of daa s n he varale daa. dp->rx_uffer nernal uffer for daa s. re_val = dp->rx_uffer; MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
231 V.8 Sofware Module nc. re_val <<= 32 - n; re_val >>= 32 - n; dp->rx_uffer >>= n; dp->rx_num_s -= n; reurn re_val; nc When dp->rx_uffer conans he requred numer of daa s, he daa s sored n he varale re_val and reurned o Rx_V14_DH_roune() funcon. 3.6 V.8 Sofware Module The V.8 Sofware Module deermnes auomacally, pror o he naon of modem handshake, he es avalale operaonal mode eween wo DCEs conneced va he PSTN. I provdes a mely ndcaon o he Crcu Mulplcaon Equpmen on he V-seres modulaon o e employed n a new sesson of daa ransmsson. I also provdes a means o enale a PSTN call o e passed on auomacally o an approprae DCE V8 Daa Handler The Tx V8 Daa Handler s used for ransmsson of CM, JM or CJ messages o he Remoe Modem. The Tx V8 Daa Handler composes CM, JM or CJ sequences and pus hem no he Tx_daa[] uffer. The Tx V8 Daa Handler conans he followng funcons: Tx_V8_DH_n(), Tx_V8_DH_roune() and v8_pu_s(). The Tx_V8_DH_ srucure, as defned n v8.h. /************************************************************************ * Tx V.8 Daa Handler Srucure *************************************************************************/ sruc Tx_V8_DH_ { enum v8_sae_ype v8_sae; enum v8_su_sae_ype v8_su_sae; }; un8 JM_success; un8 CJ_couner; MOTOROLA Chaper 3. Module Descrpons 3-151
232 V.8 Sofware Module nc. nc The Tx_V8_DH_ srucure parameer descrpons: v8_sae Sae denfer. I conans he curren sae of he Tx V8 Daa Handler. I s nalzed n Tx_V8_DH_n () o V8_DCE_CM. v8_su_sae Sae denfer. I conans he curren su sae of he Tx V8 Daa Handler. I s nalzed n Tx_V8_DH_n() o V8_TEN_ONES. JM_success Ths varale allows he Tx_V8_DH_roune() funcon o wre daa no he Tx_daa[] uffer and o send o he oher modem. I s nalzed n Tx_V8_DH_n () o 1 f he Sof Modem s n Callng Mode, and o 0 f he Modem s n Answerng Mode. CJ_couner Couner of he CJ messages sen. I s nalsed n Tx_V8_DH_n () o MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
233 V.8 Sofware Module nc. Tx_V8_DH_n Call(s): vod Tx_V8_DH_n(sruc channel_ * channel, sruc Tx_V8_DH_ *x_s, ool callng); Argumens: Tale Tx_V8_DH_n argumens channel n Poner o he Channel conrol daa srucure x_s n Poner o he Tx V8 Daa Handler daa srucure callng n Boolean varale. Conans TRUE f he Sof Modem s n Callng Mode, and FALSE f he Sof Modem s n Answerng Mode. nc Descrpon: Reurns: Code example: Inalsaon of he Tx V8 Daa Handler. The Tx V8 Daa Handler akes conrol of he daa srucure. The user mus call hs funcon efore callng he Tx_V8_DH_roune() and v8_pu_s() funcons. I s only necessary o call once efore Daa Handler operaon. None. sruc channel_ channel; sac sruc Tx_V8_DH_ Tx_V8_DH; ool callng; callng = TRUE; Tx_V8_DH_n(channel,&Tx_V8_DH, callng); Tx_conrol->daa_handler_call_func=Tx_V8_DH_roune; MOTOROLA Chaper 3. Module Descrpons 3-153
234 V.8 Sofware Module nc. Tx_V8_DH_roune Call(s): vod Tx_V8_DH_roune(sruc channel_ * channel); Argumens: Tale Tx_V8_DH_roune argumens channel n Poner o he Channel conrol daa srucure Descrpon: Ths funcon composes CM, JM or CJ messages and pus hem no he Tx_daa[] uffer usng he v8_pu_s() funcon. nc Reurns: Code example: None. sruc channel_ channel; Tx_conrol->daa_handler_call_func (channel); Code explanaon: f (x_s->jm_success) Allows he Tx_V8_DH_roune o send daa. JM_success allows daa o e sen f he Sof Modem s n Callng Mode and n Answerng Mode, f he JM message should e sen. The sae denfer v8_sae can e n one of he followng saes: case V8_DCE_CM: The V8 Daa Handler wll send he CM message n Callng Mode or he JM message n Answerng Mode. Sae denfer v8_su_sae: case V8_TEN_ONES: MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
235 V.8 Sofware Module nc. The V8 Daa Handler sends en nary Ones and goes o he V8_SYNC sae. case V8_SYNC: The V8 Daa Handler sends he sync message and goes o he V8_CALL_FUNCTION sae. case V8_CALL_FUNCTION: nc The V8 Daa Handler sends he call funcon message and goes o he V8_MODN0 sae. case V8_MODN0: case V8_MODN1: case V8_MODN2: case V8_ACCESS0: The V8 Daa Handler sends modn0, modn1, modn2 and access0 messages. The Boolean varales n V8_MODN0, V8_MODN1, V8_MODN2 and V8_ACCESS0 are used o allow hese messages o e sen (hey are always sen n he CM message (Callng Mode)) and hey are sen n he JM message, f hese messages occurred n he receved CM message (Answerng Mode), accordng o he ITU-T V.8 Recommendaon). case V8_DCE_CJ: In hs case he V8 Daa Handler wll send he CJ message. MOTOROLA Chaper 3. Module Descrpons 3-155
236 V.8 Sofware Module nc. v8_pu_s Call(s): un16 v8_pu_s(sruc channel_ * channel, un16 curren_daa); Argumens: Tale v8_pu_s argumens channel n Poner o he Channel conrol daa srucure curren_daa n Conans daa eng pu no he Tx_daa[] uffer Descrpon: Ths funcon pus he daa no he Tx_daa[] uffer. nc Reurns: Code example: None. sruc channel_ channel; #defne TEN_ONES 1023 // v8_pu_s(channel, TEN_ONES); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
237 V.8 Sofware Module nc Rx V8 Daa Handler The Rx V8 Daa Handler s used o receve CM, JM or CJ messages. The Rx V8 Daa Handler akes daa from he Rx_daa[] uffer usng he v8_ge_s() funcon, analyses receved messages and ransons he Tx and Rx V8 Daa Handlers no suale saes. The Rx V8 Daa Handler conans he followng funcons: Rx_V8_DH_n(), Rx_V8_DH_roune() and v8_ge_s(). The Rx_V8_DH_ srucure, as defned n v8.h. nc /************************************************************************ * Rx V.8 Daa Handler Srucure *************************************************************************/ sruc Rx_V8_DH_ { enum v8_callng_sae_ype v8_callng_sae; enum v8_sae_ype v8_sae; enum v8_su_sae_ype v8_su_sae; }; un8 CM_OK_couner; un8 ones_couner; un8 CJ_couner; un8 mod_oce_num; un8 null_coun; un8 zeros_cj; ool modn0_oc; ool modn1_oc; ool modn2_oc; ool pro0_oc; ool access0_oc; ool V21_avalale; ool V23_avalale; ool V22_V22s_avalale; The Rx_V8_DH_ srucure parameer descrpons: v8_callng_sae Sae denfer. I conans he curren mode of he Sof Modem. I s nalzed n Rx_V8_DH_n () o CALLING_TRUE f he Sof Modem s n Callng Mode, and o CALLING_FALSE f he Sof Modem s n Answerng Mode. v8_sae - Sae denfer. I conans he curren sae of he Rx V8 Daa Handler. I s nalzed n Rx_V8_DH_n () o V8_DCE_CM. v8_su_sae Sae denfer. I conans he curren su sae of he Rx V8 Daa Handler. I s nalsed n Rx_V8_DH_n() o V8_TEN_ONES. CM_OK_couner Couner of he receved CM messages. I s nalsed n Rx_V8_DH_n() o 0. MOTOROLA Chaper 3. Module Descrpons 3-157
238 V.8 Sofware Module nc. nc ones_couner Couner of he 1 s precedng each nformaon sequence. I s nalsed n Rx_V8_DH_n() o 0. CJ_couner Couner of he receved CJ messages. I s nalsed n Rx_V8_DH_n() o 0. mod_oce_num Conans 0 f he numer of receved modulaon oces s modn1, and 1 f he numer of receved modulaon oces s modn2. I s nalsed n Rx_V8_DH_n() o 0. null_coun Specfes he numer of receved 0 s o deermne he carrer loss. I s nalsed n Rx_V8_DH_n() o 0. zeros_cj Couner of he 0 s n he Synchronzaon sequence ( conans 9 0 s and one 1). I s nalzed n Rx_V8_DH_n() o 0. modn0_oc Boolean varale. The JM message wll nclude he same oces as n he CM message. modn0_oc s TRUE f he receved CM message conans he modn0 oce. I s nalsed n Rx_V8_DH_n() o TRUE f he Sof Modem s n Callng Mode, and o FALSE f he Sof Modem s n Answerng Mode. modn1_oc Boolean varale. The JM message wll nclude he same oces as n he CM message. modn1_oc s TRUE f he receved CM message conans he modn1 oce. I s nalsed n Rx_V8_DH_n() o TRUE f he Sof Modem s n Callng Mode, and o FALSE f he Sof Modem s n Answerng Mode. modn2_oc Boolean varale. The JM message wll nclude he same oces as n he CM message. modn2_oc s TRUE f he receved CM message conans he modn2 oce. I s nalsed n Rx_V8_DH_n() o TRUE f he Sof Modem s n Callng Mode, and o FALSE f he Sof Modem s n Answerng Mode. pro0_oc Boolean varale. The JM message wll nclude he same oces as n he CM message. pro0_oc s TRUE f he receved CM message conans he pro0 oce. I s nalsed n Rx_V8_DH_n() o TRUE f he Sof Modem s n Callng Mode, and o FALSE f he Sof Modem s n Answerng Mode. access0_oc Boolean varale. The JM message wll nclude he same oces as n he CM message. access0_oc s TRUE f he receved CM message conans he access0 oce. I s nalsed n Rx_V8_DH_n() o TRUE f he Sof Modem s n Callng Mode, and o FALSE f he Sof Modem s n Answerng Mode. V21_avalale Boolean varale. V21_avalale s TRUE f he Sof Modem s n Callng Mode, or f he Sof Modem s n Answerng Mode and he Remoe Modem suppors V.21 Modulaon proocol. I s nalsed n Rx_V8_DH_n() o TRUE f he Sof Modem s n Callng Mode, and o FALSE f he Sof Modem s n Answerng Mode. V23_avalale Boolean varale. V23_avalale s TRUE f he Sof Modem s n Callng Mode, or f he Sof Modem s n Answerng Mode and he Remoe Modem suppors V.23 Modulaon proocol. I s nalsed n Rx_V8_DH_n() o TRUE f MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
239 V.8 Sofware Module nc. he Sof Modem s n Callng Mode, and o FALSE f he Sof Modem s n Answerng Mode. V22_V22s_avalale Boolean varale. V22_V22s_avalale s TRUE f he Sof Modem s n Callng Mode, or f he Sof Modem s n Answerng Mode and he Remoe Modem suppors V.22 or V.22s Modulaon proocols. I s nalsed n Rx_V8_DH_n() o TRUE f he Sof Modem s n Callng Mode, and o FALSE f he Sof Modem s n Answerng Mode. nc MOTOROLA Chaper 3. Module Descrpons 3-159
240 V.8 Sofware Module nc. Rx_V8_DH_n Call(s): vod Rx_V8_DH_n(sruc channel_ * channel, sruc Rx_V8_DH_ *rx_s, ool callng); Argumens: Tale Rx_V8_DH_n argumens channel n Poner o he Channel conrol daa srucure rx_s n Poner o he Rx V8 Daa Handler daa srucure callng n Boolean varale. Conans TRUE, f he Sof Modem s n Callng Mode, and FALSE, f he Sof Modem s n Answerng Mode. nc Descrpon: Reurns: Code example: Inalsaon of he Rx V8 Daa Handler. The Rx V8 Daa Handler akes conrol of he daa srucure. The user mus call hs funcon efore callng he Rx_V8_DH_roune() and v8_ge_s() funcons. I s only necessary o call once efore Daa Handler operaon. None. sruc channel_ channel; sac sruc Rx_V8_DH_ Rx_V8_DH; ool callng; callng = TRUE; Rx_V8_DH_n(channel,&Rx_V8_DH, callng); Rx_conrol->daa_handler_call_func=x_V8_DH_roune; MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
241 V.8 Sofware Module nc. Rx_V8_DH_roune Call(s): vod Rx_V8_DH_roune(sruc channel_ * channel); Argumens: Tale Rx_V8_DH_roune argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon ges daa from he Rx_daa[] uffer usng he v8_ge_s() funcon, analyzes CM, JM or CJ messages and ransons he Tx and Rx V8 Daa Handlers no suale saes. None. sruc channel_ channel; Rx_conrol->daa_handler_call_func (channel); Code explanaon: The sae denfer v8_sae can e n he followng sae: case V8_DCE_CM: In hs case he V8 Daa Handler wll receve he CM message n Answerng Mode or JM message n Callng Mode. The sae denfer v8_su_sae can e n one of he followng saes: case V8_TEN_ONES: In hs case he V8 Daa Handler receves en nary 1 s and goes o he V8_PRE_SYNC sae. case V8_PRE_SYNC: In hs case he V8 Daa Handler deermnes he egnnng of he sync message and goes o he V8_SYNC sae. case V8_SYNC: In hs case he V8 Daa Handler nerpres he sync message and goes o he V8_CALL_FUNCTION sae. If he sync message wasn receved he V8 Daa Handler wll go ack o he V8_TEN_ONES sae. MOTOROLA Chaper 3. Module Descrpons 3-161
242 V.8 Sofware Module nc. case V8_CALL_FUNCTION: case V8_MODN1: In hese cases he V8 Daa Handler nerpres he call funcon, modn0, modn1 and modn2 messages, sores he TRUE value no he correspondng Boolean varales f he correspondng message was nerpreed, and sores he TRUE value no he correspondng Boolean varales f he correspondng modulaon proocol s suppored y he remoe modem. Afer recevng wo nerpreed CM (Answerng Mode) or JM (Callng Mode) messages he V8 Daa Handler sores he avalale modulaon proocols n hdden regsers, and allows he CJ message o e sen (Callng Mode) or allows he JM message o e sen and goes o he V8_DCE_CJ sae (Answerng Mode). nc case V8_DCE_CJ: In hs case he V8 Daa Handler wll receve he CJ message, deec he loss of carrer (loss of connecon) and drec he Sof Modem o esalsh a connecon accordng he chosen modulaon proocol or o reak he connecon f he modulaon proocol wasn chosen MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
243 V.8 Sofware Module nc. v8_ge_s Call(s): un16 v8_ge_s(sruc channel_ * channel); Argumens: Tale v8_ge_s argumens channel n Poner o he Channel conrol daa srucure Descrpon: Ths funcon ges daa from he Rx_daa[] uffer. nc Reurns: Daa oaned from Rx_daa[] uffer. Code example: sruc channel_ channel; un16 curren_daa=0; curren_daa=v8_ge_s(channel); MOTOROLA Chaper 3. Module Descrpons 3-163
244 V.8 Sofware Module nc. nc The V.8 sar-up procedure n callng mode The Sof Modem seeks o deec ANS or ANSam. If ANSam s deeced, he Sof Modem ransms no sgnal for a perod of a leas 1s pror o ransmng he CM message. If ANS s deeced, he Sof Modem wll go no he physcal handshake accordng o he preseleced V-seres modulaon mode. Afer no sgnal ransmsson he Sof Modem naes ransmsson of he CM message usng he Tx_V8_DH_roune() funcon and condons s recever o deec he JM message usng he Rx_V8_DH_roune() funcon. Afer a mnmum of 2 dencal JM sequences have een receved he Sof Modem ransms he CJ message usng he Tx_V8_DH_roune() funcon. Followng CJ, he Sof Modem ransms no sgnal for a perod of 75 ms hen proceeds n accordance wh he seleced V-seres modulaon mode The V.8 sar-up procedure n answerng mode For a perod of a leas 0.2 s afer connecon o he lne, he Sof Modem ransms no sgnal. If he V.8 sofware module s enaled, he Sof Modem ransms ANSam and deecs CM messages usng he Rx_V8_DH_roune() funcon. Upon recevng a mnmum of 2 dencal CM sequences, he Sof Modem ransms he JM messages. JM ransmsson connues unl hree CJ messages have een receved usng he Rx_V8_DH_roune() funcon. Upon recevng hree CJ messages, he Sof Modem wll proceed wh he physcal handshake accordng o he seleced V-seres modulaon mode MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
245 Suppor Modules nc. 75 ms 1 s Call DCE CM,CM,CM, CJ Sg C nc Answer DCE 3.7 Suppor Modules UART module ANSam JM, JM, JM, 75 ms The UART s he radonal physcal nerface o he Termnal. UART, or Unversal Asynchronous Recever/Transmer, s an negraed crcu ha convers parallel npu no seral oupu. The MCF5407 conans wo ndependen UARTs: UART0 UART1 can operae as a sandard UART (dencal o UART0) or n modem mode (as a USART). In he LDR Sof Modem, works n modem mode (16- CODEC). In he LDR Sof Modem UART0 s responsle for he DTE nerface, and UART1 s responsle for he nerface o he S3044 DAA. The UART module rounes can e found n he mcf5407_uar.c fle. Sg A The UART parameers srucure uar_params_ s defned n he mcf5407_uar.h" /************************************************************************ * Enumeraon ype defnons used y Parameers of UART module *************************************************************************/ enum daa_s_ {daa_s_5, daa_s_6, daa_s_7, daa_s_8}; MOTOROLA Chaper 3. Module Descrpons 3-165
246 Suppor Modules nc. nc enum pary_ enum sop_s_ {pary_none, pary_even, pary_odd, pary_mark, pary_space}; {sop_s_1, sop_s_1_5, sop_s_2}; enum channel_mode_ {channel_mode_normal, channel_mode_auomac_echo, channel_mode_local_loopack, channel_mode_remoe_loopack}; //Only for UART1 enum uar1_mode_ {uar_mode, codec_8, codec_16}; enum shf_drecon_ {ms_frs, ls_frs}; /************************************************************************ * UART Parameers Srucure *************************************************************************/ sruc uar_params_ { //Only for UART0 and UART1 n UART mode un8 uar_numer; un32 s_rae; enum daa_s_ daa_s; enum pary_ pary; enum sop_s_ sop_s; enum channel_mode_ channel_mode; ool flow_conrol_ransm_on_off; }; //Only for UART1 un8 rx_ffo_hreshold; un8 x_ffo_hreshold; enum uar1_mode_ mode; //Only for UART1 n modem mode enum shf_drecon_ shf_drecon; The uar_params_ srucure parameer descrpons: uar_numer - UART numer. The value mus e equal o 0 (for UART0) or 1 (for UART1). Inalzed n mcf5407_uar_n(). s_rae - B rae of he UART. Ths s no used n modem mode. Inalzed n mcf5407_uar_n(). daa_s - Bs per characer. Ths value does no nclude sar, pary, or sop s. I can e equal o: daa_s_5 = 5 s daa_s_6 = 6 s MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
247 Suppor Modules nc. daa_s_7 = 7 s daa_s_8 = 8 s Ths s no used n modem mode. Inalzed n mcf5407_uar_n(). pary - Pary ype. I can e equal o: pary_none = No pary pary_even = Even pary pary_odd = Odd pary pary_mark = Hgh pary pary_space = Low pary nc Ths s no used n modem mode. Inalzed n mcf5407_uar_n(). sop_s - Sop- lengh. Selecs he lengh of he sop appended o he ransmed characer. I can e equal o: sop_s_1 = 1 sop_s_1_5 = 1.5 sop_s_2 = 2 Ths s no used n modem mode. Inalzed n mcf5407_uar_n(). channel_mode - Channel mode. I can e equal o: channel_mode_normal = Normal channel_mode_auomac_echo = Auomac echo channel_mode_local_loopack = Local loop-ack channel_mode_remoe_loopack = Remoe loop-ack Ths s used n oh UART and modem modes. Inalzed n mcf5407_uar_n(). flow_conrol_ransm_on_off - The on/off flag for ransmsson. Ths s used o conrol flow eween he DTE and DCE n he flow_conrol() funcon. I can e equal o: True = Daa ransmsson from DTE o DCE s enaled False = Daa ransmsson from DTE o DCE s dsaled Ths s no used n modem mode. Inalzed n mcf5407_uar_n(). rx_ffo_hreshold - The Rx FIFO hreshold. The hreshold s one less han he value a whch he Rx FIFO s consdered o e full for he purpose of alerng he CPU ha he Rx FIFO needs o e read. The value should e no more han 0x1F. I suppors UART1 only and s used n oh UART and modem modes. Inalzed n mcf5407_uar_n(). MOTOROLA Chaper 3. Module Descrpons 3-167
248 Suppor Modules nc. x_ffo_hreshold - Tx FIFO hreshold. Ths hreshold s he value a whch he Tx FIFO s consdered o e empy for he purpose of alerng he CPU ha he Tx FIFO requres more daa/samples. The value should e no more han 0x1F. I suppors UART1 only and s used n oh UART and modem modes. Inalzed n mcf5407_uar_n(). mode - UART1 mode. I can e equal o: uar_mode = UART mode codec_8 = 8- CODEC nerface mode codec_16 = 16- CODEC nerface mode nc Ths suppors UART1 only. Inalzed n mcf5407_uar_n(). shf_drecon - Shf drecon. I can e equal o: ms_frs = Samples/me slos are ransferred ms frs ls_frs = Samples/me slos are ransferred ls frs Ths suppors UART1 only. Inalzed n mcf5407_uar_n() MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
249 Suppor Modules nc. mcf5407_uar_n Call(s): vod mcf5407_uar_n (sruc channel_ * channel, Argumens: sruc uar_params_ * uar_conrol); Tale mcf5407_uar_n argumens channel n Poner o he Channel conrol daa srucure uar_conrol n Array of he UART parameer srucure. Ths array should only conan wo elemens (The MCF5407 only conans wo UARTs). nc Descrpon: Reurns: Code example: Ths funcon nalses he uar_conrol[0] and he uar_conrol[1] srucures o he defaul parameers, hen ses he UART module parameers y usng he mcf5407_uar_parameers_se() funcon. Defaul parameers for UART0: daa_s=daa_s_8; pary=pary_none; sop_s=sop_s_1; channel_mode=channel_mode_normal; flow_conrol_ransm_on_off=false; Defaul parameers for UART1: channel_mode=channel_mode_normal; rx_ffo_hreshold=16; x_ffo_hreshold=16; mode=codec_16; shf_drecon=ms_frs; mcf5407_uar_n() enales nerrup deecon for UART0 on RxRDY (recever ready), and for UART1 on RxRDY and TxRDY (ransmer ready) y usng mcf5407_uar_nerrup_mask_se(). I mus e called efore callng daa_n(). Ths funcon s called n man(). None. sruc channel_ channel; sruc uar_params_ uar_conrol[2]; mcf5407_uar_n (&channel,uar_conrol); MOTOROLA Chaper 3. Module Descrpons 3-169
250 Suppor Modules nc. mcf5407_uar_parameers_se Call(s): vod mcf5407_uar_parameers_se(sruc uar_params_ * uar_params); Argumens: Tale mcf5407_uar_parameers_se argumens uar_params n Poner o he UART parameers srucure. nc Descrpon: Reurns: Code example: Ths funcon ses he parameers of he UART module accordng o he values conaned n he srucure poned o y uar_params. Ths funcon s called n mcf5407_uar_n() and sae_machne(). None. sruc uar_params_ uar_conrol; mcf5407_uar_parameers_se(&uar_conrol); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
251 Suppor Modules nc. mcf5407_uar_nerrup_mask_se Call(s): vod mcf5407_uar_nerrup_mask_se (un8 uar_numer, ool cos, ool d, ool rx_rdy, ool x_rdy); nc Argumens: Descrpon: Reurns: Code example: Tale mcf5407_uar_nerrup_mask_se argumens uar_numer n UART numer. Ths value mus e equal o 0 (for UART0) or 1 (for UART1). cos n Inerrup on change-of-sae. No used y UART1 n modem mode: FALSE = dsaled TRUE = enaled d n Inerrup on deecon of a reak. No used y UART1 n modem mode: FALSE = dsaled TRUE = enaled rx_rdy n Inerrup on recever ready: FALSE = dsaled TRUE = enaled x_rdy n Inerrup on ransmer ready: FALSE = dsaled TRUE = enaled Ths funcon ses he felds of he UART Inerrup Mask Regsers (UIMR) accordng o he npu parameers. Ths funcon s called n mcf5407_uar_n(). None. mcf5407_uar_nerrup_mask_se(1, FALSE, FALSE, TRUE, TRUE); MOTOROLA Chaper 3. Module Descrpons 3-171
252 Suppor Modules nc. Rx_uar Call(s): vod Rx_uar (sruc channel_ * channel); Argumens: Tale Rx_uar argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon wres a characer receved from he UART module o he Tx_uar_daa[] crcular uffer (usng n_char_uar()). None. sruc channel_ channel; Rx_uar(&channel); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
253 Suppor Modules nc. Tx_uar Call(s): vod Tx_uar (sruc channel_ * channel); Argumens: Tale Tx_uar argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon reads a characer from he Rx_uar_daa[] and sends o he UART module (usng ou_char_uar ()). None. sruc channel_ channel; Tx_uar(&channel); MOTOROLA Chaper 3. Module Descrpons 3-173
254 Suppor Modules nc. Tx_uar_all Call(s): vod Tx_uar_all (sruc channel_ * channel); Argumens: Tale Tx_uar_all argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon reads all avalale characers from Rx_uar_daa[] and sends hem o he UART module (usng ou_char_uar ()). None. sruc channel_ channel; Tx_uar_all(&channel); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
255 Suppor Modules nc. n_char_uar Call(s): un8 n_char_uar (vod); Argumens: None. Descrpon: Ths funcon ges a characer from UART0. Reurns: The characer oaned from UART0. nc Code example: un8 characer; characer=n_char_uar(); MOTOROLA Chaper 3. Module Descrpons 3-175
256 Suppor Modules nc. ou_char_uar Call(s): vod ou_char_uar (un8 ch); Argumens: Tale ou_char_uar argumens ch n Characer for sendng o UART0 Descrpon: Ths funcon sends he characer (ch) o he UART0. nc Reurns: Code example: None. un8 characer= a ; ou_char_uar(characer); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
257 Suppor Modules nc. char_presen_uar Call(s): ool char_presen_uar(vod); Argumens: None. Descrpon: Ths funcon checks he avalaly of a characer n UART0. nc Reurns: Code example: ool characer_s_avalale=false; characer_s_avalale=char_presen_uar(); TRUE = A characer s avalale n UART0 FALSE = A characer s no avalale n UART0 MOTOROLA Chaper 3. Module Descrpons 3-177
258 Suppor Modules nc. n_sample_codec Call(s): n16 n_sample_codec (vod); Argumens: None. Descrpon: Ths funcon ges a sample from UART1. Reurns: The sample oaned from UART1. nc Code example: n16 sample; sample=n_sample_codec(); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
259 Suppor Modules nc. ou_sample_codec Call(s): vod ou_sample_codec (n16 sample); Argumens: Tale ou_sample_codec argumens sample n Sample for sendng o UART1 nc Descrpon: Reurns: Code example: 1n16 sample=0; ou_sample_codec(sample); Ths funcon sends he sample o UART1. None. MOTOROLA Chaper 3. Module Descrpons 3-179
260 Suppor Modules nc. sample_presen_codec Call(s): ool sample_presen_codec (vod); Argumens: None. Descrpon: Ths funcon checks he avalaly of a sample n UART1. nc Reurns: Code example: ool sample_s_avalale=false; sample_s_avalale = sample_presen_codec(); TRUE = A sample s avalale n UART1 FALSE = A sample s no avalale n UART MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
261 Suppor Modules nc. flow_conrol Call(s): vod flow_conrol (sruc channel_ * channel); Argumens: Tale flow_conrol argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Ths funcon performs Daa Flow Conrol accordng o he S[18] regser sengs. The Sof Modem mplemens flow conrol y deecng ha Tx_uar_daa[] s full enough (defned y he UART_DATA_FLOW_STOP value, n modem.h ) and hen negaes he Reques o Send (RTS) sgnal n he case of Hardware flow conrol or sends a specal characer XOFF no he daa sream n he case of Sofware flow conrol, o sop he flow of daa. When he uffer Tx_uar_daa[] s empy enough agan (defned y he UART_DATA_FLOW_START value, n modem.h ), assers he RTS sgnal n he case of Hardware flow conrol or sends he specal characer XON no he daa sream n he case of Sofware flow conrol o resar he flow of daa. The prolem wh sofware flow conrol s ha he characers used o sop and sar he flow of daa can occur naurally n he daa flow, enalng sofware flow conrol nsrucons. Usng sofware flow conrol may prove sasfacory f you are ransferrng ex fles only. Hardware flow conrol s much faser and much more relale han sofware flow conrol, so s hghly recommended o use hs. Ths funcon s called n sae_machne(). None. Code example: sruc channel_ channel; flow_conrol(&channel); MOTOROLA Chaper 3. Module Descrpons 3-181
262 Suppor Modules nc DAA Inerface The DAA nerface s a se of funcons ha mplemen conrol and nerac wh he modem daugher card ased on he negraed drec access arrangemen (DAA) S3044. The daa communcaon, eween he M5407C3 and he modem daugher card, s performed va he UART1 module n modem mode (USART). The DAA s ehavor s modfed y programmng new coeffcens no he memory regser of he daa codec and he lne chp, hus can adhere o counry-specfc gloal elephone lne sandards whou hardware changes. For dealed nformaon aou he S3044 refer o he S3044 Daa Shee, R2.01 (S3044-DS201). nc The DAA module rounes can e found n he s3044_daa.c fle. The DAA conrol daa srucure daa_conrol_ s defned n s3044_daa.h". /********************************************************************** * Saes of DAA Rx&Tx Inerface ***********************************************************************/ enum x_daa_sae_ {TX_DAA_NORMAL, TX_DAA_PRE_READ_REG, TX_DAA_PRE_WRITE_REG, TX_DAA_READ_REG, TX_DAA_WRITE_REG}; enum rx_daa_sae_ {RX_DAA_NORMAL, RX_DAA_READ_REG, RX_DAA_WRITE_REG}; /********************************************************************** * DAA Inerface conrol Srucure ***********************************************************************/ sruc daa_conrol_ { volale enum x_daa_sae_ x_sae; volale enum rx_daa_sae_ rx_sae; un8 reg_numer; volale un8 value; volale ool value_s_rue; un8 delay; volale un32 sample_couner; }; The daa_conrol_ srucure parameer descrpons: x_sae - Inner Sae of he Tx DAA. I can e equal o: TX_DAA_NORMAL = Normal mode TX_DAA_PRE_READ_REG = The mode efore a Read regser cycle TX_DAA_PRE_WRITE_REG = The mode efore a Wre regser cycle TX_DAA_READ_REG = Read regser cycle MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
263 Suppor Modules nc. TX_DAA_WRITE_REG = Wre regser cycle I s nalzed n daa_n() o TX_DAA_NORMAL. rx_sae - Inner Sae of he Rx DAA. I can e equal o: RX_DAA_NORMAL = Normal mode RX_DAA_READ_REG = Read regser cycle RX_DAA_WRITE_REG = Wre regser cycle nc I s nalzed n daa_n() o RX_DAA_NORMAL. reg_numer - Regser numer. Ths can e a value from 1 o 19 (he S3044 has 19 conrol regsers). I s nalzed n daa_n() o 0. value - Regser value. I s nalzed n daa_n() o 0. value_s_rue - Flag ha he value s TRUE. I s nalzed n daa_n() o FALSE. delay - Delay eween sendng a command and recevng a response. I s nalzed n daa_n() o 0. sample_couner - Couner of receved samples. I s nalzed n daa_n() o 0. MOTOROLA Chaper 3. Module Descrpons 3-183
264 Suppor Modules nc. daa_n Call(s): vod daa_n (sruc channel_ * channel, sruc daa_conrol_ * daa_conrol); Argumens: Tale daa_n argumens channel In Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: daa_conrol In Poner o he DAA Inerface conrol srucure Ths funcon nalses he srucure poned o y daa_conrol. I programs he clock generaor seng regsers 7, 8 and 9 o he approprae dvder raos o oan he desred sample rae. Then wres a 0x80 no Regser 6. Ths enales he charge pump and powers up he lne-sde chp (S3015). The funcon ses he desred lne nerface parameers (callng daa_counry_se()), ses Analog Receve&Transm and AOUT (Speaker) Aenuaon Levels (callng daa_rx_level_se (), daa_x_level_se (), daa_aou_level_se ()). Ths funcon s called once n man(). None. sruc channel_ channel; sruc daa_conrol_ daa_conrol; daa_n (&channel,&daa_conrol); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
265 Suppor Modules nc. daa_counry_se Call(s): vod daa_counry_se (sruc daa_conrol_ * daa_conrol); Argumens: Tale daa_counry_se argumens daa_conrol n Poner o he DAA Inerface conrol srucure nc Descrpon: Ths funcon ses he desred lne nerface parameers (regsers 16, 17 and 18) accordng o he curren chosen counry (H[0] regser). The full ls of suppored counres y he LDR Sof Modem s placed n he SUPPORT_COUNTRIES[] array (n he modem.c fle) Ths funcon s called n daa_n() and n he Command Handler y AT+GCI=<Counry code accordng o he T.35> command. Reurns: Code example: None. sruc daa_conrol_ daa_conrol; daa_counry_se(&daa_conrol); MOTOROLA Chaper 3. Module Descrpons 3-185
266 Suppor Modules nc. daa_rx_level_se Call(s): vod daa_rx_level_se (sruc daa_conrol_ * daa_conrol); Argumens: Tale daa_rx_level_se argumens daa_conrol n Poner o he DAA Inerface conrol srucure nc Descrpon: Ths funcon ses he DAA Analog Receve Gan level (Regser 15, ARX[2:0]) accordng o he curren seng n he S[16] regser. I can e se o 0dB, 3dB, 6dB, 9dB or12db gan. Reurns: Code example: None. sruc daa_conrol_ daa_conrol; daa_rx_level_se (&daa_conrol); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
267 Suppor Modules nc. daa_x_level_se Call(s): vod daa_x_level_se (sruc daa_conrol_ * daa_conrol); Argumens: Tale daa_x_level_se argumens daa_conrol n Poner o he DAA Inerface conrol srucure nc Descrpon: Reurns: Code example: Ths funcon ses he DAA Analog Transm Aenuaon level (Regser 15, ATX[2:0]) accordng o he curren seng n he S[17] regser. I can e se o 0dB, 3dB, 6dB, 9dB or12db aenuaon. None. sruc daa_conrol_ daa_conrol; daa_x_level_se (&daa_conrol); MOTOROLA Chaper 3. Module Descrpons 3-187
268 Suppor Modules nc. daa_aou_level_se Call(s): vod daa_aou_level_se (sruc daa_conrol_ * daa_conrol); Argumens: Tale daa_aou_level_se argumens daa_conrol n Poner o he DAA Inerface conrol srucure nc Descrpon: Reurns: Code example: Ths funcon ses he DAA Transm&Receve Aenuaon level for he call progress AOUT pn (Regser 6 ATM[1:0], ARM[1:0]) accordng o he curren seng n he H[1] regser. None. sruc daa_conrol_ daa_conrol; daa_aou_level_se (&daa_conrol); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
269 Suppor Modules nc. daa_aou_mue Call(s): vod daa_aou_mue (sruc daa_conrol_ * daa_conrol); Argumens: Tale daa_aou_mue argumens daa_conrol n Poner o he DAA Inerface conrol srucure nc Descrpon: Ths funcon mues he receve and ransm pah for he call progress AOUT pn (Regser 6 ATM[1:0], ARM[1:0]). Reurns: Code example: None. sruc daa_conrol_ daa_conrol; daa_aou_mue (&daa_conrol); MOTOROLA Chaper 3. Module Descrpons 3-189
270 Suppor Modules nc. daa_rng_deec Call(s): ool daa_rng_deec (sruc daa_conrol_ * daa_conrol); Argumens: Tale daa_rng_deec argumens daa_conrol n Poner o he DAA Inerface conrol srucure nc Descrpon: Ths funcon reads and reurns a value of he Rng deec feld (RDT) from Regser 5. Ths funcon s called n sae_machne(). Reurns: The value of feld RDT of Regser 5: TRUE = Indcaes a rng s occurrng. FALSE = Rese eher seconds afer las posve rng s deeced or when he sysem execues an off-hook. Code example: sruc daa_conrol_ daa_conrol; ool rng=false; rng= daa_rng_deec (&daa_conrol); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
271 Suppor Modules nc. daa_go_off_hook Call(s): vod daa_go_off_hook (sruc daa_conrol_ * daa_conrol); Argumens: Tale daa_go_off_hook argumens daa_conrol n Poner o he DAA Inerface conrol srucure nc Descrpon: Reurns: Code example: Ths funcon causes he lne-sde chp o go off-hook. I generaes an off-hook command y applyng a logc 0 o he OFHK pn (f DAA_HW_HANG_UP s defned) or y seng he OH n Regser 5 (f DAA_HW_HANG_UP s no defned). Ths funcon s called n sae_machne(), Tx_pulse()and AT_handler_roune(). None. sruc daa_conrol_ daa_conrol; daa_go_off_hook (&daa_conrol); MOTOROLA Chaper 3. Module Descrpons 3-191
272 Suppor Modules nc. daa_go_on_hook Call(s): vod daa_go_on_hook (sruc daa_conrol_ * daa_conrol); Argumens: Tale daa_go_on_hook argumens daa_conrol n Poner o he DAA Inerface conrol srucure nc Descrpon: Reurns: Code example: Ths funcon causes he lne-sde chp o go on-hook I generaes an on-hook command y applyng a logc 1 o he OFHK pn (f DAA_HW_HANG_UP s defned) or y reseng he OH n Regser 5 (f DAA_HW_HANG_UP s no defned). Ths funcon s called n sae_machne(), Tx_pulse()and AT_handler_roune(). None. sruc daa_conrol_ daa_conrol; daa_go_on_hook (&daa_conrol); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
273 Suppor Modules nc. daa_read_reg Call(s): un8 daa_read_reg (sruc daa_conrol_ * daa_conrol, un8 reg_numer); Argumens: Tale daa_read_reg argumens daa_conrol n Poner o he DAA Inerface conrol srucure reg_numer n Regser numer nc Descrpon: Reurns: Code example: sruc daa_conrol_ daa_conrol; un8 reg_value; Ths funcon reads he value of he DAA conrol regser y numer reg_numer. I ses he regser numer (daa_conrol->reg_numer=reg_numer), changes he sae of he Tx DAA o TX_DAA_PRE_READ_REG (daa_conrol->x_sae=tx_daa_pre_read_reg), and was ll daa_conrol->value_s_rue ecomes TRUE. I hen reurns he value of he regser conaned n daa_conrol->value. Value of he DAA conrol regser y numer reg_numer. reg_value=daa_read_reg (&daa_conrol, 0x6); MOTOROLA Chaper 3. Module Descrpons 3-193
274 Suppor Modules nc. daa_wre_reg Call(s): vod daa_wre_reg (sruc daa_conrol_ * daa_conrol, un8 reg_numer, un8 value); Argumens: Tale daa_wre_reg argumens daa_conrol n Poner o he DAA Inerface conrol srucure nc Descrpon: Reurns: Code example: Ths funcon wres he value o he DAA conrol regser y reg_numer. I ses he regser numer (daa_conrol->reg_numer=reg_numer), ses he new regser value (daa_conrol->value=value), changes he sae of he Tx DAA o TX_DAA_PRE_WRITE_REG (daa_conrol->x_sae= TX_DAA_PRE_WRITE_REG), and was ll daa_conrol->value_s_rue ecomes TRUE. None. sruc daa_conrol_ daa_conrol; un8 reg_value=0; reg_numer n Regser numer value n Regser Value daa_wre_reg (&daa_conrol, 0x6, reg_value); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
275 Suppor Modules nc. Tx_daa Call(s): vod Tx_daa (sruc channel_ * channel); Argumens: Tale Tx_daa argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Ths funcon s responsle for ransmng daa o he DAA. Saes of operaon: TX_DAA_NORMAL = If he Tx_sample[] crcular uffer s no empy, he funcon reads one sample from and ses he leas sgnfcan o 0 (no secondary frame), oherwse ses he resulan sample equal o 0 (slence). Fnally sends he resulan sample o he DAA y usng ou_sample_codec (). TX_DAA_PRE_READ_REG = If he Tx_sample[] crcular uffer s no empy, he funcon reads one sample from and ses he leas sgnfcan o 1 (calls secondary frame), oherwse ses he resulan sample equal o 1 (generaes slence and calls secondary frame). Changes he Tx DAA sae o TX_DAA_READ_REG. Fnally sends he resulan sample o he DAA y usng ou_sample_codec (). TX_DAA_PRE_WRITE_REG = If he Tx_sample[] crcular uffer s no empy, he funcon reads one sample from and ses he leas sgnfcan o 1 (calls secondary frame), oherwse ses he resulan sample equal o 1 (generaes slence and calls secondary frame). Changes he Tx DAA sae o TX_DAA_WRITE_REG. Fnally sends he resulan sample o he DAA y usng ou_sample_codec (). TX_DAA_READ_REG = Prepares a specal frame for he Read cycle. The forma of he Read frame s (0x2000 ((0x1F&(channel->daa_conrol->reg_numer))<<8)). Changes he Tx DAA sae o TX_DAA_NORMAL. Changes he Rx DAA sae o RX_DAA_READ_REG. Calculaes he delay eween sendng he frame and recevng a response. Fnally sends he resul frame o he DAA y usng ou_sample_codec (). TX_DAA_WRITE_REG = Prepares a specal frame for he Wre cycle. The forma of he Wre frame s (((0x1F&( channel->daa_conrol->reg_numer))<<8) (0xFF&( MOTOROLA Chaper 3. Module Descrpons 3-195
276 Suppor Modules nc. channel->daa_conrol->value))). Changes he Tx DAA sae o TX_DAA_NORMAL. Changes he Rx DAA sae o RX_DAA_WRITE_REG. Calculaes he delay eween sendng he frame and recevng a response. Fnally sends he resulan frame o he DAA y usng ou_sample_codec (). Ths funcon s called y he Inerrup Servce Roune of UART1, on a Transmer ready even. Reurns: None. nc Code example: sruc channel_ channel; Tx_daa(&channel); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
277 Suppor Modules nc. Rx_daa Call(s): vod Rx_daa (sruc channel_ * channel); Argumens: Tale Rx_daa argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Ths funcon s responsle for recevng daa from he DAA. Saes of operaon: RX_DAA_NORMAL = I reads he receved sample from he DAA y usng n_sample_codec () and wres no he Rx_sample[] crcular uffer. RX_DAA_READ_REG = If daa_conrol->delay s equal o 0, reads he receved sample from he DAA y usng n_sample_codec () and wres no daa_conrol->value, ses daa_conrol->value_s_rue=true and changes he Rx DAA sae o RX_DAA_NORMAL, oherwse, decremens daa_conrol->delay and reads he receved sample from he DAA y usng n_sample_codec () and wres no he Rx_sample[] crcular uffer. RX_DAA_WRITE_REG = If daa_conrol->delay s equal o 0, reads he receved sample from he DAA y usng n_sample_codec (), ses daa_conrol->value_s_rue=true and changes he Rx DAA sae o RX_DAA_NORMAL, oherwse, decremens daa_conrol->delay and reads he receved sample from he DAA y usng n_sample_codec () and wres no he Rx_sample[] crcular uffer. Reurns: Code example: Ths funcon s called y he Inerrup Servce Roune of UART1, on a Recever ready even. None. sruc channel_ channel; Rx_daa(&channel); MOTOROLA Chaper 3. Module Descrpons 3-197
278 Suppor Modules nc Tone Generaor and Deecor The Tone Generaor & Deecor module provdes generaon and deecon of a varey of sgnals assocaed wh call progress Tone Generaor The sgnals ha are produced y he Tone Generaor are represened n Tale /************************************************************************ * Types of ones *************************************************************************/ nc enum gen_one_ype_ {GEN_ANS_TONE, GEN_ANSAM_TONE, GEN_ANS_REV_TONE, GEN_CALLING_TONE, GEN_SILENCE_TONE}; Tale Tones ha are suppored y he Tone Generaor Correspondence wh gen_one_ype_ ype GEN_ANS_TONE GEN_ANS_REV_TONE GEN_ANSAM_TONE Sgnal Answerng one (ANS) Answer one wh phase reversals (ANS) Modfed answer one (ANSam) Descrpon The one ransmed from he answerng end. The answerng one s a connuous 2100±15 Hz one wh a duraon of 3.3±0.7 s. The one ransmed from he answerng end. I consss of a sne wave sgnal a 2100±15 Hz wh phase reversals a an nerval of 450±25ms. The one ransmed from he answerng end. I consss of a sne wave sgnal a 2100±15 Hz wh phase reversals a an nerval of 450±25ms, amplude-modulaed y a sne wave a 15±0.1 Hz. The modulaed envelope ranges n amplude eween (0.8±0.01) and (1.2±0.01) mes s average amplude. GEN_CALLING_TONE Callng one The one ransmed from he callng end. The callng one consss of a seres of nerruped 1300Hz±15 Hz sgnals. ON for a duraon of no less han 0.7s and OFF for a duraon of no less han 1.5s no more han 2.0s GEN_SILENCE_TONE Slence The sgnal wh a zero frequency. The Tone Generaor rounes can e found n he one_gende.c fle MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
279 Suppor Modules nc. The Tone Generaor conrol srucure Tx_conrol_one_ s defned n he one_gende.h fle: /************************************************************************ * Tone generaor Srucrure *************************************************************************/ sruc Tx_conrol_one_ { un32 one_lengh_ms; un32 one_pause_ms; un32 one_rev_ms; n16 amplude; un32 one_frequency; un32 omega; un32 phase; nc } ; un32 one_samples_lef; un32 samples_lef; un32 one_samples_rev_lef un32 amplude_frequency; n16 amplude_rpple; un32 amplude_omega; un32 amplude_phase; The Tx_conrol_one_ srucure parameer descrpons: one_lengh_ms - Tone duraon (ON) n ms. I s nalzed n Tx_one_n(). one_pause_ms - The duraon of slence or a pause (OFF) afer one generaon, n ms. I s nalzed n Tx_one_n() one_rev_ms - Inerval of phase reversals, n ms. I s nalzed n Tx_one_n() amplude - Amplude of a generaed one, n Q14 forma. I s nalzed n Tx_one_n(). one_frequency - Frequency represenng he curren one, n Hz. I s nalzed n Tx_one_n(). omega - Phase shf of he cosne wave, durng ransfer from one generaed sample o nex, n Q15. I s calculaed from one_frequency and Sample Rae. I s nalzed n Tx_one_n(). phase - Curren phase, n Q15. I s nalzed n Tx_one_n() o 0. one_samples_lef - Numer of samples lef o generae curren one only (ON). I s nalzed n Tx_one_n() o 0. samples_lef - Numer of samples lef for generang curren one and pause (ON+OFF). I s nalzed n Tx_one_n() o 0. one_samples_rev_lef - Numer of samples lef o generae he curren phase reversed nerval. I s nalzed n Tx_one_n() o 0. MOTOROLA Chaper 3. Module Descrpons 3-199
280 Suppor Modules nc. amplude_frequency - Sne wave Frequency for he amplude-modulaed one, n Hz. I s nalzed n Tx_one_n(). amplude_rpple - Sne wave Rpple Amplude for he amplude-modulaed one, n Q14 forma. I s nalzed n Tx_one_n(). amplude_omega - Sne wave Phase Shf, durng ransferrng from one generaed sample o nex, for he amplude-modulaed one, n Q15 forma. amplude_phase - Sne wave Curren Phase for amplude-modulaed one, n Q15 forma. I s nalzed n Tx_one_n() o 0. nc MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
281 Suppor Modules nc. Tx_one_n Call(s): vod Tx_one_n(sruc channel_ * channel, sruc Tx_conrol_one_ *Tx_conrol_one, enum gen_one_ype_ one_ype ); Argumens: Tale Tx_one_n argumens nc Descrpon: Reurns: Code example: channel n Poner o he Channel conrol daa srucure Tx_conrol_one n Poner o he Tone Generaor conrol daa srucure one_ype n Type of one for generaon (see ale ) Ths funcon nalses he Tone Generaor conrol daa srucure accordng o he chosen ype of he one (one_ype). I also nalzes he felds of he Channel conrol daa srucure, poned o y channel, ha are responsle for he Tx Daa Pump (daa_pump_pr, aud_rae, numer_samples, daa_pump_call_func, sae, process_coun). Afer callng hs funcon, he Tx Daa Pump s nalzed o work as a Tone generaor. Ths funcon s called n sae_machne(). None. sruc channel_ channel; sruc Tx_conrol_one_ Tx_conrol_one; Tx_one_n(&channel,&Tx_conrol_one, GEN_ANSAM_TONE); MOTOROLA Chaper 3. Module Descrpons 3-201
282 Suppor Modules nc. Tx_one Call(s): vod Tx_one(sruc channel_ * channel); Argumens: Tale Tx_one argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Ths funcon generaes he sgnal and places he produced samples no he Tx_sample[] uffer. The numer of generaed samples, per call, s defned y Tx_conrol->numer_samples. Fgure Tone generaor The parameers of he sgnal are defned y he Tx_one_n() funcon. Ths funcon s called y he Tx_daa_pump() funcon va channel->tx_conrol_pr-> daa_pump_call_func (). Reurns: None. Code example: sruc channel_ channel; Tx_one(&channel); Tone generaor (Tx Daa Pump) Tx_sample[] MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
283 Suppor Modules nc Tone Deecor The Tone Deecor provdes he possly of parallel deecon of hree ones. I can deec connuous and cadence ones. I also dsngushes ones, conssng of one and wo frequences. The sgnals ha are suppored y he Tone Deecor are represened n Tale /************************************************************************ * Types of ones *************************************************************************/ nc enum de_one_ype_ {DET_ANS_TONE, Correspondence wh gen_one_ype_ ype DET_ANS_TONE DET_ANS_END_TONE DET_ANSAM_TONE DET_ANSAM_TONE, DET_ANS_END_TONE, DET_CALLING_TONE, DET_DIAL_TONE, DET_BUSY_TONE, DET_NONE}; Tale Tones ha are suppored y Tone Deecor Sgnal Answerng one whou (ANS) or wh phase reversals (ANS) Answerng one whou (ANS) or wh phase reversals (ANS) and pause afer. Modfed answer one (ANSam) Descrpon The one ransmed from he answerng end. The deeced one should e a connuous 2100±15 Hz one. The one ransmed from he answerng end. The deeced one should e a connuous 2100±15 Hz one and wh a pause afer. The one ransmed from he answerng end. The deeced one should e a connuous 2100±15 Hz one and s amplude-modulaed y a sne wave a 15±0.1 Hz. DET_CALLING_TONE Callng one The one ransmed from he callng end. The deeced one should conss of a seres of nerruped 1300Hz±15 Hz sgnals. ON for a duraon of no less han 0.7s and OFF for a duraon of no less han 1.5s no more han 2.0s MOTOROLA Chaper 3. Module Descrpons 3-203
284 Suppor Modules nc. DET_DIAL_TONE Dal one The one s used n he PSTN o ndcae ha he elephone nework swchng equpmen has recognzed ha a elephone has gone off-hook, and s prepared o receve a call. The Tone Deecor suppors several ypes of Dal one (deermned y S[24]): ex-ussr counres, Brazl: Connuous 425 Hz one. Norh Amercan counres: Connuous 350Hz + 440Hz one Uned Kngdom: Connuous 350Hz one nc DET_BUSY_TONE Busy one The one s used n he PSTN o ndcae ha he called pary s already akng anoher call. The Tone Deecor suppors several ypes of Busy one (deermned y S[24]): ex-ussr counres, Brazl: Cadence 425 Hz one, 0.25 sec. ON, 0.25 sec. OFF. Norh Amercan counres: Cadence 480Hz + 620Hz one, 0.5 sec. ON, 0.5 sec. OFF. Uned Kngdom: Cadence 400Hz one, 0.4 sec. ON, 0.4 sec. OFF. DET_NONE None I means he one deecor s dsaled The Tone Deecor rounes can e found n he one_gende.c fle. The scope of he Tone Deecor conrol srucure s defned n he one_gende.h fle: /************************************************************************ * Bquad Fler parameers Srucure *************************************************************************/ #defne DET_FILTER_A_NUMBER (5) #defne DET_FILTER_X_NUMBER (2) #defne DET_FILTER_Y_NUMBER (2) sruc quad_param_ { n16 a[det_filter_a_number]; n16 x[det_filter_x_number]; n16 y[det_filter_y_number]; }; The quad fler s represened as: Fler_oupu = a[0]*npu_sample + a[1]*x[0] + a[2]*x[1] - a[3]*y[0] - a[4]*y[1]; The quad_param_ srucure parameer descrpons: a - Array of quad fler coeffcens. I s nalzed n Rx_one_n () o values from he fler_coef_group[][] dependng on he ype of one. x Array of quad fler npus. I s nalzed n Rx_one_n () o 0 s MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
285 Suppor Modules nc. y Array of quad fler oupus. I s nalzed n Rx_one_n () o 0 s. /************************************************************************ * Doule Bquad Fler parameers Srucure *************************************************************************/ sruc doule_quad_param_ { ool enaled; sruc quad_param_ fler_1_param; sruc quad_param_ fler_2_param; }; nc The doule_quad_param_ srucure parameer descrpons: enaled - I s equal o TRUE f he frequency deecor s enaled, and o FALSE oherwse. I s nalzed n Rx_one_n () dependng on he ype of one. fler_1_param - Parameers of he frs Bquad Fler. fler_2_param - Parameers of he second Bquad Fler. /************************************************************************ * Saes of Tone Deecor *************************************************************************/ enum deecor_sae_ {RX_TONE_ON_DETECTION, RX_TONE_OFF_DETECTION}; /************************************************************************ * Tone deecor parameers Srucure *************************************************************************/ #defne DET_TONE_FREQUENCY_NUMBER (2) sruc Rx_one_ { sruc doule_quad_param_ frequency_param[det_tone_frequency_number]; enum deecor_sae_ deecor_sae; n16 y_ou; n16 x_ou; n16 x_ou_max; un32 one_on_ms; un32 max_one_on_ms; un32 one_off_ms; un32 deecon_me; un32 one_on_samples_lef; un32 max_one_on_samples_lef; un32 one_off_samples_lef; un32 deecon_saples_lef; } ; ool one_on_deeced; ool one_all_deeced; un32 process_coun; ool enaled; The Rx_one_ srucure parameer descrpons: MOTOROLA Chaper 3. Module Descrpons 3-205
286 Suppor Modules nc. nc frequency_param - Array of parameers of Doule Bquad Flers deecor_sae - Deermne he sae of he Tone deecor I can e equal o: RX_TONE_ON_DETECTION = sae of Tone ON deecon RX_TONE_OFF_DETECTION = sae of Tone OFF deecon y_ou - Oupu of he exponenal fler ased on he flered sgnal. I s nalzed n Rx_one_n() o 0. x_ou - Oupu of he exponenal fler ased on he gloal sgnal. I s nalzed n Rx_one_n() o 0. x_ou_max - Maxmum value of x_ou, deermned durng an ON deecon phase. I s nalzed n Rx_one_n() o 0. one_on_ms - Mnmum Tone ON duraon n ms (for rue deecon). I s nalzed n Rx_one_n(). max_one_on_ms - Maxmum Tone ON duraon n ms (for rue deecon). I s nalzed n Rx_one_n(). one_off_ms - Tone OFF duraon n ms (for rue deecon). I s nalzed n Rx_one_n(). deecon_me - Maxmum me of deecon process n ms. I s nalzed n Rx_one_n(). one_on_samples_lef - Numer of samples lef for deecng one ON. I s nalzed n Rx_one_n() o 0. max_one_on_samples_lef - Maxmum numer of samples for deecng one ON. I s nalzed n Rx_one_n() o 0. one_off_samples_lef - Numer of samples lef for deecng one OFF. I s nalzed n Rx_one_n() o 0. deecon_saples_lef - Numer of samples lef for he deecon process. I s nalzed n Rx_one_n() o 0. one_on_deeced - I s equal o TRUE f one ON s deeced, and o FALSE oherwse. I s nalzed n Rx_one_n() o 0. one_all_deeced - I s equal o TRUE f a one s deeced (ON and OFF phases), and o FALSE oherwse. I s nalzed n Rx_one_n() o TRUE. process_coun - Maxmum numer of phases (ON+OFF) lef for he whole one deecon. I s nalzed n Rx_one_n(). enaled - I s equal o TRUE f he Tone deecor s enaled, and o FALSE oherwse. I s nalzed n Rx_one_n (). /************************************************************************ * Tone deecor Conrol Srucure MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
287 Suppor Modules nc. *************************************************************************/ #defne DET_TONE_NUMBER (3) sruc Rx_conrol_one_ { sruc Rx_one_ one[det_tone_number]; } ; Rx_conrol_one_ s a roo srucure of he Tone Deecor. Rx_conrol_one_ srucure parameer descrpons: one - Array of Tone Deecor parameer srucure. nc MOTOROLA Chaper 3. Module Descrpons 3-207
288 Suppor Modules nc. Rx_one_n Call(s): vod Rx_one_n(sruc channel_ * channel, sruc Rx_conrol_one_ *Rx_conrol_one, Argumens: enum de_one_ype_ one [DET_TONE_NUMBER]); Tale Rx_one_n argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Rx_conrol_one n Poner o he Tone Deecor conrol daa srucure one n Array of one ypes (see ale ) Ths funcon nalses he Tone Deecor conrol daa srucure accordng o he chosen ypes of he ones (one[]). I also nalzes he felds of he Channel conrol daa srucure, poned o y channel, ha are responsle for he Rx Daa Pump (daa_pump_pr, aud_rae, numer_samples, daa_pump_call_func, sae, process_coun). Afer callng hs funcon, he Rx Daa Pump s nalzed o operae accordng o V.23. Ths funcon s called n sae_machne(). None. sruc channel_ channel; sruc Rx_conrol_one_ Rx_conrol_one; enum de_one_ype_ one [3]; one[0]=det_ans_end_tone; one[1]=det_busy_tone; one[2]=det_ansam_tone; Rx_one_n(&channel,&Rx_conrol_one, one); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
289 Suppor Modules nc. Rx_one Call(s): vod Rx_one(sruc channel_ * channel); Argumens: Tale Rx_one argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Ths funcon deecs ones accordng o he parameers ha were nalzed n Rx_one_n(). I can perform deecon of hree ones smulaneously. The one can conss of one or wo frequences and can e connuous or cadence. Ths funcon reads samples from Rx_sample[]. The numer of samples s defned y he Rx_conrol->numer_samples. Tone Deecor (Rx Daa Pump) Rx_sample[] Fgure Tone deecor The one deecon procedure s dvded no dfferen sages as shown n Fg x[n] Band Pass Fler (Doule quad IIR fler) y[n] Energy esmaon on y[n] (Exponenal fler) Energy esmaon on x[n] (Exponenal fler) Decson Fgure Sages of he Tone Deecon The frs sage s andpass flerng (ased on doule quad fler) of he npu sgnal. Ths s followed y an energy esmaon y means of exponenal flers ased on he flered sgnal and he gloal sgnal. The exponenal flers are gven y: y_ou[n]= DET_ALPHA* y[n] +(1- DET_ALPHA)*x_ou[n-1]; x_ou[n]= DET_ALPHA* y[n] +(1- DET_ALPHA)*y_ou[n-1]; MOTOROLA Chaper 3. Module Descrpons 3-209
290 Suppor Modules nc. The las sage consss of he decson wheher a one has een deeced or no. If one of he ones s deeced, or s no deeced durng he maxmum me of he deecon process, he channel->rx_conrol_pr->process_coun ecomes equal o 0. If he acual one s deeced or no s deeced, s defned y one_all_deeced n he srucure of Rx_one_ ype. Ths funcon s called y he Rx_daa_pump() funcon va channel->rx_conrol_pr-> daa_pump_call_func (). Reurns: None. nc Code example: sruc channel_ channel; Rx_one(&channel); Rng Deecor The Rng deecor module uses he seral communcaon nerface of he DAA o receve rng daa. When a rng s deeced, he samples n he Rx_sample[] uffer ecome equal o whle he rng sgnal s posve, hen go ack o when he rng s near zero and negave. Thus a near square wave s presened n Rx_sample[] ha swngs from o n cadence wh he rng sgnal. The Rng deecor module rounes can e found n he rng_de.c fle. The Rng deecor conrol daa srucure Rx_rng_de_ s defned n rng_de.h" /************************************************************************ * Rng deecor conrol daa srucure *************************************************************************/ sruc Rx_rng_de_ { un16 numer_on; un16 numer_off; } ; The Rx_rng_de_ srucure parameer descrpons: numer_on Curren numer of posve rngng sgnals. I s nalzed n Rx_rng_de_n() o 0. numer_off - Curren numer of negave rngng sgnals. I s nalzed n Rx_rng_de_n() o MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
291 Suppor Modules nc. Rx_rng_de_n Call(s): vod Rx_rng_de_n(sruc channel_ * channel, Argumens: sruc Rx_rng_de_* Rx_rng_de); Tale Rx_rng_de_n argumens channel n Poner o he Channel conrol daa srucure Rx_rng_de n Poner o he Rng deecor conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon nalses he Rng deecor conrol daa srucure. I also nalzes he felds of he Channel conrol daa srucure, poned o y channel, ha are responsle for he Rx Daa Pump (daa_pump_pr, aud_rae, numer_samples, daa_pump_call_func, sae, process_coun). Afer callng hs funcon, he Rx Daa Pump s nalzed o work accordng ov.23. Ths funcon s called n sae_machne(). None. sruc channel_ channel; sruc Rx_rng_de_ Rx_rng_de; Rx_rng_de_n(&channel,&Rx_rng_de); MOTOROLA Chaper 3. Module Descrpons 3-211
292 Suppor Modules nc. Rx_rng_deec Call(s): vod Rx_rng_deec(sruc channel_ * channel); Argumens: Tale Rx_rng_deec argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon deecs Rng sgnals. I uses he feaures of he DAA. When a rng s deeced, he samples n he Rx_sample[] uffer ecome equal o whle he rng sgnal s posve, hen go ack o whle he rng s near zero and negave. Thus a near square wave s presened n Rx_sample[] ha swngs from o n cadence wh he rng sgnal. Ths funcon handles he receved sample from he Rx_sample[] uffer n order o deec a rue Rng sgnal. Fgure Rng Deecor Ths funcon s called y he Rx_daa_pump() funcon va channel->rx_conrol_pr-> daa_pump_call_func (). None. sruc channel_ channel; Rx_rng_deec (&channel); Rng Deecor (Rx Daa Pump) Rx_sample[] DTMF Daler The DTMF daler mplemens he DTMF generaor MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
293 Suppor Modules nc. Dual Tone Mul-Frequency or DTMF s a mehod for nsrucng a elephone swchng sysem of he elephone numer o e daled. The DTMF sysem uses egh dfferen frequency sgnals ransmed n pars o represen sxeen dfferen numers, symols and leers. Tale shows how he frequences are organzed. Tale Frequences used y he DTMF generaor Column Frequency Group 1209Hz 1336H z 1477Hz 1633H z 697Hz A nc The DTMF Daler module rounes can e found n he dmf.c fle. The DTMF conrol daa srucure Tx_DTMF_conrol_ s defned n dmf.h" /************************************************************************ * DTMF generaor conrol daa srucure *************************************************************************/ ypedef sruc Tx_DTMF_conrol_ { un32 dg_lengh_ms; un32 dg_pause_ms; } ; Row Frequency Group un16 omega_row; un16 omega_column; un16 phase_row; un16 phase_column; un32 samples_lef; n16 amplude; 770Hz B 852Hz C 941Hz * 0 # D The Tx_DTMF_conrol_ srucure parameer descrpons: dg_lengh_ms - Duraon of dg, n ms. I s nalzed n Tx_DTMF_n(). dg_pause_ms - Duraon of he pause eween dgs, n ms. I s nalzed n Tx_DTMF_n(). MOTOROLA Chaper 3. Module Descrpons 3-213
294 Suppor Modules nc. nc omega_row - Row frequency Phase Shf per sample, n Q15. I s nalzed n Tx_DTMF_n() o 0. omega_column - Column frequency Phase Shf per sample, n Q15. I s nalzed n Tx_DTMF_n() o 0. phase_row - Row frequency Phase, n Q15. I s nalzed n Tx_DTMF_n() o 0. phase_column - Column frequency Phase, n Q15. I s nalzed n Tx_DTMF_n() o 0. samples_lef - Numer of samples lef o generae he curren dg or a pause. I s nalzed n Tx_DTMF_n() o 0. amplude - Amplude of he generaed sgnal, n Q14. I s nalzed n Tx_DTMF_n() MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
295 Suppor Modules nc. Tx_DTMF_n Call(s): vod Tx_DTMF_n(sruc channel_ * channel, sruc Tx_DTMF_conrol_ * Tx_DTMF_conrol); Argumens: Tale Tx_DTMF_n argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: Tx_DTMF_conrol n Poner o he DTMF generaor conrol daa srucure Ths funcon nalses he DTMF generaor conrol daa srucure. I also nalzes he felds of he Channel conrol daa srucure, poned o y channel, ha are responsle for he Tx Daa Pump (daa_pump_pr, aud_rae, numer_samples, daa_pump_call_func, sae). Afer callng hs funcon, he Tx Daa Pump s nalzed o work as a DTMF generaor. Ths funcon s called n sae_machne(). None. sruc channel_ channel; sruc Tx_DTMF_conrol_ Tx_DTMF_conrol; Tx_DTMF_n (&channel, &Tx_DTMF_conrol); MOTOROLA Chaper 3. Module Descrpons 3-215
296 Suppor Modules nc. Tx_DTMF Call(s): vod Tx_DTMF(sruc channel_ * channel); Argumens: Tale Tx_DTMF argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Ths funcon reads he dgs (symols) for DTMF dalng from he Tx_daa[] uffer, unl he numer of dgs equals channel->tx_conrol_pr->process_coun, and fnds he correspondng dg (or symol) o he row and column frequency accordng o ale The generaor of a DTMF sgnal smulaneously sends one frequency from he hgh-group and one frequency from he low group. For example, sendng 1209Hz and 770Hz ndcaes ha he 4 dg s eng sen. If he symol n Tx_daa[] s he wrong dg or s equal o he, symol, generaes a pause. Tx_daa[] DTMF daler (Tx Daa Pump) Fgure DTMF daler Tx_sample[] The pause eween dgs s defned y he S[11] regser, and he pause on comma, symol s defned he y S[8] regser. Ths funcon generaes he sgnal and places he produced samples no he Tx_sample[] uffer. The numer of generaed samples, per call, s defned y Tx_conrol->numer_samples. Ths funcon s called y he Tx_daa_pump() funcon va channel->tx_conrol_pr-> daa_pump_call_func (). Reurns: Code example: None. sruc channel_ channel; Tx_DTMF (&channel); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
297 Suppor Modules nc Pulse Daler Pulse dalng s one of he mehods for nsrucng a elephone swchng sysem of he elephone numer o e daled. Old-syle roary dal phones use hs mehod. Pulse dalng s accomplshed y gong off- and on-hook o generae make and reak pulses. The nomnal rae s 10 pulses per second. I can dal numers from 0 o 9 only. The Pulse Daler module rounes can e found n he pulse.c fle. The Pulse Daler conrol daa srucure Tx_pulse_conrol_ s defned n pulse.h" /************************************************************************ * Pulse daler conrol daa srucure nc *************************************************************************/ ypedef sruc Tx_pulse_conrol_ { } ; un32 make_ms; un32 reak_ms; un32 nerval_ms; un32 samples_lef; un32 pulse_lef; ool nex_reak; The Tx_pulse_conrol_ srucure parameer descrpons: make_ms - Duraon of Make (off-hook), n ms. I s nalzed n Tx_pulse_n(). reak_ms - Duraon of Break (on-hook), n ms. I s nalzed n Tx_pulse_n(). nerval_ms - Tme nerval eween dgs, n ms. I s nalzed n Tx_pulse_n(). samples_lef - Numer of samples lef o generae he pause eween dgs or he pause eween Make and Break. I s nalzed n Tx_pulse_n() o 0. pulse_lef - Numer of pulses lef o generae he curren dg. I s nalzed n Tx_pulse_n() o 0. nex_reak - I s equal o TRUE f he nex acon s Break and o FALSE oherwse. I s nalzed n Tx_pulse_n() o TRUE. MOTOROLA Chaper 3. Module Descrpons 3-217
298 Suppor Modules nc. Tx_pulse_n Call(s): vod Tx_pulse_n(sruc channel_ * channel, Argumens: sruc Tx_pulse_conrol_ *Tx_pulse_conrol); Tale Tx_pulse_n argumens channel n Poner o he Channel conrol daa srucure Tx_pulse_conrol n Poner o he Pulse daler conrol daa srucure nc Descrpon: Reurns: Code example: Ths funcon nalses he Tx_pulse_conrol Pulse daler conrol daa srucure. I also nalzes he felds of he Channel conrol daa srucure, poned o y channel, ha are responsle for he Tx Daa Pump (daa_pump_pr, aud_rae, numer_samples, daa_pump_call_func, sae). Afer callng hs funcon, he Tx Daa Pump s nalzed o work as a Pulse daler. Ths funcon s called n sae_machne(). None. sruc channel_ channel; sruc Tx_pulse_conrol_ Tx_pulse_conrol; Tx_pulse_n (&channel, &Tx_pulse_conrol); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
299 Suppor Modules nc. Tx_pulse Call(s): Tx_pulse(sruc channel_ * channel); Argumens: Tale Tx_pulse argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Ths funcon reads he dgs for Pulse dalng from he Tx_daa[] uffer, unl he numer of dgs equals o he channel->tx_conrol_pr->process_coun. I performs he off- and on-hook sgnals o generae make and reak pulses. The numer of make/reak pulses drecly depends on he dg, see Tale Tale Correspondence of dal dgs o he numer of Make/Break pulses Dg Numer of Make/Break pulses If he symol n Tx_daa[] s he wrong dg or s equal o he, symol, generaes a pause. Tx_daa[] Pulse daler (Tx Daa Pump) Tx_sample[] Fgure Pulse daler The pause eween dgs s defned y he S[15] regser, and he pause on a comma, symol s defned y he S[8] regser. Ths funcon generaes he sgnal and places he produced samples no he Tx_sample[] uffer. The numer of generaed samples, per call, s defned y Tx_conrol->numer_samples. MOTOROLA Chaper 3. Module Descrpons 3-219
300 Suppor Modules nc. Ths funcon s called y he Tx_daa_pump() funcon va channel->tx_conrol_pr-> daa_pump_call_func (). Reurns: None. Code example: sruc channel_ channel; Tx_pulse (&channel); nc Tex Response The ex response module s a se of funcons ha are responsle for nformave messagng o he DTE MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
301 Suppor Modules nc. prn_resul_code Call(s): vod prn_resul_code (sruc channel_ * channel, un8 code); Argumens: Tale prn_resul_code argumens channel n Poner o he Channel conrol daa srucure code n Numerc code of he Resul code nc Descrpon: Reurns: Ths funcon wres he Resul code defned y code, accordng ov.25er, no he Rx_uar_daa[] uffer. Resul codes conss of hree pars: a header, he resul ex, and a raler. The characers ransmed for he header and raler are deermned y a user seng. The ex may e ransmed as a numer or as a srng, dependng on a user-selecale seng (see Tale 3-107). Tale shows he effec of he seng of he AT Vn command on he forma of he resul code. All references o <cr> mean "he characer wh he ordnal value specfed n parameer S3"; all references o <lf> lkewse mean "he characer wh he ordnal value specfed n parameer S4". Tale Effec of he AT V command on he Resul code forma Resul codes All numerc and verose codes are defned n ex_response.h. None. AT V0 <numerc code><cr> AT V1 <cr><lf> <verose code><cr><lf> Code example: #nclude "ex_response.h" sruc channel_ channel; prn_resul_code (&channel, RESPONSE_CODE_CONNECT); MOTOROLA Chaper 3. Module Descrpons 3-221
302 Suppor Modules nc. prn_ex_response Call(s): vod prn_ex_response (sruc channel_ * channel, char * ex); Argumens: Tale prn_ex_response argumens channel n Poner o he Channel conrol daa srucure ex n Tex of he ex response nc Descrpon: Ths funcon wres he Tex response defned y ex, accordng o V.25er, no he Rx_uar_daa[] uffer. Informaon ex responses conss of hree pars: a header, ex, and a raler. The characers ransmed for he header, ex and raler are deermned y a user seng. Tale shows he effec of seng he AT Vn command o he Informaon ex forma. All references o <cr> mean "he characer wh he ordnal value specfed n parameer S3"; all references o <lf> lkewse mean "he characer wh he ordnal value specfed n parameer S4". Tale Effec of AT Vn command on Tex response forma Informaon responses AT V0 <ex><cr><lf> AT V1 <cr><lf> <ex><cr><lf> Informaon ex reurned n response o manufacurer-specfc commands may conan mulple lnes, and he ex may herefore nclude CR, LF, and oher formang characers o mprove readaly. Ths funcon s used y he AT Command handler. Reurns: None. Code example: sruc channel_ channel; prn_ex_response (&channel, "LDR SofModem"); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
303 Suppor Modules nc. prn_connec Call(s): vod prn_connec (sruc channel_ * channel); Argumens: Tale prn_connec argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Ths funcon wres he CONNECT resul code, accordng o V.25er, o he Rx_uar_daa[] uffer. Tale shows he effec of seng he AT Xn command o he forma of he CONNECT resul code. For prnng he CONNECT resul code he prn_resul_code() funcon s used. Tale Effec of he AT Xn command on he CONNECT resul code If he resul code s equal o CONNECT <ex>, he funcon prns he speed of he Tx and Rx Daa Pumps, and he parameers of he correcon and compresson proocols. The Gloal Sae Machne calls hs funcon upon enerng he onlne daa sae. Reurns: Code example: sruc channel_ channel; prn_connec (&channel); None. AT X0 AT X1; X2; X3; X4 Resul code CONNECT CONNECT <ex> MOTOROLA Chaper 3. Module Descrpons 3-223
304 Suppor Modules nc. ex_o_de Call(s): vod ex_o_de (sruc channel_ * channel, char *sr); Argumens: Tale ex_o_de argumens channel n Poner o he Channel conrol daa srucure sr n Null-ermnaed srng nc Descrpon: Reurns: Code example: Ths funcon wres he null-ermnaed srng (sr) no he Rx_uar_daa[] uffer. None. sruc channel_ channel; ex_o_de (&channel, Tex message ); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
305 Suppor Modules nc. ex_o_de_fxed Call(s): vod ex_o_de_fxed (sruc channel_ * channel, char *sr, un32 lengh); Argumens: Tale ex_o_de_fxed argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: sr n Srng lengh n The lengh of he sr srng Ths funcon wres he srng (sr) of he fxed lengh (lengh) no he Rx_uar_daa[] uffer. None. sruc channel_ channel; char mp_sr [2]; mp_sr[0]= O ; mp_sr[1]= K ; ex_o_de_fxed (&channel, mp_sr, 2); MOTOROLA Chaper 3. Module Descrpons 3-225
306 Suppor Modules nc. char_o_de Call(s): vod char_o_de (sruc channel_ * channel, char ch); Argumens: Tale char_o_de argumens channel n Poner o he Channel conrol daa srucure ch n Characer nc Descrpon: Ths funcon wres one characer (ch) no he Rx_uar_daa[] uffer. Reurns: Code example: None. sruc channel_ channel; char_o_de (&channel, a ); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
307 Suppor Modules nc. un8_o_sr_decmal Call(s): un8 un8_o_sr_decmal (char *num_sr, un8 num); Argumens: Tale un8_o_sr_decmal argumens num_sr n/ou Poner o an oupu null-ermnaed srng num n Unsgned numer nc Descrpon: Reurns: Code example: Ths funcon convers he unsgned numer (num) no a null-ermnaed srng n he decmal form and places no he srng poned o y num_sr. For example, f num=128, hen num_sr= 128. The numer of characers n he (num_sr) srng for represenng he npu numer n he decmal form. For he example aove reurns 3. char mp_sr [4]; un8 dg_num; dg_num=un8_o_sr_decmal (mp_sr, 100); MOTOROLA Chaper 3. Module Descrpons 3-227
308 Mscellaneous Funcons nc. un8_o_sr_hexadecmal Call(s): un8 un8_o_sr_hexadecmal (char *num_sr, un8 num); Argumens: Tale un8_o_sr_hexadecmal argumens num_sr n/ou Poner o an oupu null-ermnaed srng num n Unsgned numer nc Descrpon: Reurns: Code example: Ths funcon convers he unsgned numer (num) no a null-ermnaed srng n he hexadecmal form and places no he srng poned o y num_sr. For example, f num=43, hen num_sr= 2B. The numer of characers n he (num_sr) srng for represenng he npu numer n he hexadecmal form. For he example aove reurns 2. char mp_sr [3]; un8 dg_num; dg_num= un8_o_sr_hexadecmal (mp_sr, 100); 3.8 Mscellaneous Funcons The mscellaneous rounes can e found n he msc.c fle. These funcons are wdely used n he LDR Sof Modem MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
309 Mscellaneous Funcons nc. dsp_cos Call(s): n16 dsp_cos(un16 phase); Argumens: Tale dsp_cos argumens phase n Phase n Q15 forma (0 corresponds o 0 degrees; (1.0 n Q15) corresponds o 360 degrees) nc Descrpon: Reurns: Code example: n 16 phase=(1<<15); dsp_cos (phase); Ths funcon calculaes he cosne (2*p*phase). The phase s fraconal n Q15 forma. Resul of he cos(2*p*phase) calculaon. MOTOROLA Chaper 3. Module Descrpons 3-229
310 Mscellaneous Funcons nc. dsp_convoluon_frac Call(s): n16 dsp_convoluon_frac (cons n16 *a1, cons n16 *a2, un32 n); Argumens: Tale dsp_convoluon_frac argumens a1 n Poner o he frs vecor of he fraconal daa elemens a1 n Poner o he second vecor of he fraconal daa elemens n n Numer of elemens n one vecor nc Descrpon: Ths funcon compues a convoluon for a vecor of fraconal daa values: resul n = 1 k = 0 a1[ k]* a2[ k] The funcon s used for realzaon of he Fne Impulse Response (FIR) flers. n 1 Reurns: Resul of he a1[ k]* a2[ k] calculaon. Code example: #defne TAB_SIZE (16) n16 a1[tab_size]; n16 a2[tab_size]; n16 resul_convoluon; resul_convoluon = dsp_convoluon_frac(a1, a2, TAB_SIZE); k = MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
311 Mscellaneous Funcons nc. memcpy_mcf Call(s): vod memcpy_mcf (vod *des, vod *src, un32 n); Argumens: Tale memcpy_mcf argumens des n Poner o he desnaon src n Poner o he source n n Numer of yes nc Descrpon: Ths funcon copes n yes poned o y (src) o he desnaon o poned y (des) Reurns: Code example: #defne TAB_SIZE (16) n16 des[tab_size]; n16 src[tab_size]; None. memcpy_mcf(des, src, TAB_SIZE* szeof(n16)); AT command se suppor The LDR Sof Modem mplemens he AT command se. The AT command se s he user nerface, and n an emedded applcaon, s he ass of he API. The AT commands allow he user o aler he operaon of he Sof Modem n real-me. These commands are sen o he sysem va he UART from an RS-232 conneced ermnal devce. Please refer o he MCF5407 Low Daa Rae Sof Modem. AT Command reference. User Manual for a dealed descrpon of he AT commands and S regsers ha are suppored y he LDR Sof Modem. In he LDR Sof Modem, an nerpreaon of he AT commands s performed y wo sofware locks, he Command Parser and he Command Handler. MOTOROLA Chaper 3. Module Descrpons 3-231
312 Mscellaneous Funcons nc Command Parser Sae Machne Tx_uar_daa[] Command Parser Command[] nc The a_parser_conrol_ srucure, s defned n a_parser.h. /*********************************************************************** *Defnon of AT parser srucure ***********************************************************************/ sruc a_parser_conrol_ { un32 a_command_uf[buf_length]; //AT_command local uffer n8 a_uf_pr; //poner o a_command_uf[] un8 a_command_srng[buf_length]; //AT_command ener srng //uffer un8 dal_dgs[dial_length]; //Dal srng uffer n8 dgs_numer; n8 dal; n16 ackspace_couner; un32 sample_couner; un8 plus_couner; un8 * uar_daa_pr; n16 srng_couner; un32 command_code; enum parser_sae_ parser_sae; enum sm_parser_sae_ sm_parser_sae; }; //Used f sgn ";" fnshes he dal // srng The a_parser_conrol_ srucure parameer descrpons: a_command_uf[] Local crcular uffer ha he AT Parser wres all AT Commands no afer processng he receved AT command srng. Afer processng he receved AT commands, he AT Parser wres compeen commands from he a_command_uf[] uffer no he Tx_conrol->command[] uffer for he AT Handler o process. a_uf_pr Poner o he a_command_uf[] uffer. a_command_srng[] Array, no whch he AT Parser sores all characers receved followng AT characers MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
313 Mscellaneous Funcons nc. nc dal_dgs Array, no whch he AT Parser sores dal numer characers. dgs_numer Numer of characers n he dal_dgs array. dal Ths varale conans 1, f he ; sgn has occurred n he command srng. I s requred for execung of he commands followng he ; sgn n he nex call of he Command Parser only. ackspace_couner Couner o he a_commands_srng[] array. sample_couner Sample couner. Ths s used for calculang he me n wo cases: recevng he second characer of he Ener symol ( Ener conans 2 characers CR and LF (see a_parser.h defned values)); or recevng he escape sequence (see LDR Sof Modem User Manual for escape sequence descrpon). plus_couner Escape sequence symol couner. The defaul value of he escape sequence symol s +. uar_daa_pr Specal poner o he Tx_uar_daa[] uffer for monorng he escape sequence. srng_couner Poner o he a_command_srng[] array, hs shows whch elemen s requred o egn he processng of he a_command_srng[] array. command_code Ths varale conans he AT command and he parameers of hs command o e wren no he a_command_uf[]. parser_sae Sae denfer. I conans he curren susae of he AT Parser. I s nalzed n AT_parser_n() o ATP_WAIT_A. sm_parser_sae Sae denfer. I conans he curren sae of he AT Parser. I s nalzed n AT_parser_n() o ATP_COMMAND_MODE. MOTOROLA Chaper 3. Module Descrpons 3-233
314 Mscellaneous Funcons nc. AT_parser_n Call(s): vod AT_parser_n (sruc channel_ * channel, sruc a_parser_conrol_ *a_parser_conrol); Argumens: Tale AT_parser_n argumens channel n Poner o he Channel conrol daa srucure a_parser_conrol n Poner o he AT Parser daa srucure nc Descrpon: Reurns: Inalsaon of he AT Command Parser. The funcon nalses he channel->tx_conrol_pr->command_handler_call _func o AT_parser_roune. I mus e called efore he AT_parser_roune() funcon. Ths funcon s called y he Gloal Sae Machne. None. Code example: sruc a_parser_conrol_ *a_parser_conrol; sruc channel_ channel; AT_parser_n (channel, &a_parser_conrol); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
315 Mscellaneous Funcons nc. AT_parser_roune Call(s): vod AT_parser_roune (sruc channel_ * channel); Argumens: Tale AT_parser_n argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: sruc channel_ channel; Ths funcon mplemens he AT Command Parser. I ges characers from he x_uar_daa[] uffer, nerpres he AT Commands and wres he nerpreed AT Command no he command[] uffer. Ths funcon s called y he command_handler() roune. None. AT_parser_n (channel, &a_parser_conrol); AT_parser_roune(&channel); Code explanaon: The sae denfer sm_parser_sae can e n one of hree modes: ATP_COMMAND_MODE, ATP_ONLINE_COMMAND_MODE, ATP_ONLINE_DATA_MODE. In he case of ATP_COMMAND_MODE and ATP_ONLINE_COMMAND_MODE he AT Parser can process he AT Commands receved from he x_uar_daa[] uffer, and sore hem a frs n he local a_command_uf[] uffer. Afer processng all he AT Commands srng hey are hen sored n he command[] uffer. In hese cases he AT Parser operaon depends on he parser_sae sae denfer: MOTOROLA Chaper 3. Module Descrpons 3-235
316 Mscellaneous Funcons nc. nc case ATP_WAIT_A: Monors he x_uar_daa[] uffer o deermne an a or A characer. If hs characer has occurred, he AT Parser goes o he ATP_WAIT_T sae. If anoher characer was occurred, he AT Parser wll gnore. case ATP_WAIT_T: Monors he x_uar_daa[] uffer o deermne a, T or \ characer. If a or T characer has occurred, he AT Parser goes o he ATP_WRITE_BUFFER sae. If \ characer has occurred, he AT Parser goes o he ATP_BUFFER_HANDLING sae o repea he execuon of he prevous AT Command srng. If anoher characer has occurred, he AT Parser goes ack o he ATP_WAIT_A sae. case ATP_WRITE_BUFFER: In hs case he AT Parser sores all he characers receved from he x_uar_daa[] uffer afer recevng he AT characers unl recevng he Ener symol n he a_command_srng. If he Ener characer has occurred, he AT Parser goes o he ATP_CR_WAIT sae. The receved AT command srng can e more han 40 characer (END_STRING=40). The characers, followng he 40 h characer n he srng wll e gnored and AT Parser wll go o he ATP_BUFFER_HANDLING sae. case ATP_CR_WAIT: Ths case s used for processng he second Ener symol ( Ener symol can conan wo characers CR and LF (her values are specfed n he modem.h fle)). If he Ener symol conans wo characers, he second characer wll e read from x_uar daa. The AT Parser hen goes o he ATP_BUFFER_HANDLING sae. case ATP_BUFER_HANDLING: In hs case he AT Parser a frs deermnes he numer of characers n he a_command_srng and gnores all space characers. Then he AT Parser nerpres commands and parameers n he a_command_srng accordng o he V.25er ITU-T specfcaon, sores he nerpreed commands no he local a_command_uf[] uffer, and f no error has occurred, places he conens of he a_command_uf[] uffer no he command[] uffer for hese commands o e handled y he AT Command Handler. In he case of ATP_ONLINE_DATA_MODE he AT Parser only monors he x_uar_daa[] uffer o deermne he escape sequence MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
317 Mscellaneous Funcons nc. command_parameer_denfcaon Call(s): n16 command_parameer_denfcaon(sruc channel_ * channel, n16 curren_k, n16 mn, n16 max, un32 command_code); Argumens: Tale AT_parser_n argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: sruc channel_ channel; n16 k=0; curren_k n Poner o he elemen n he a_command_srng ha mus o e processed. mn n Mnmal value of parameer max n Maxmal value of parameer command_code n The varale conans he numer and parameers of he curren AT command. Ths funcon deermnes wheher he parameer followng he command n a_command_srng doesn exceed he ounds of mnmal and maxmal parameer values. If he parameer doesn exceed hese ounds he funcon sores n he varale command_code ogeher wh he sored command, f no he funcon wres n he varale command_code an ERROR. Poner o he elemen n he a_command_srng ha mus e processed. #defne E_RANGE_MIN 0 #defne E_RANGE_MAX 1 k=command_parameer_denfcaon(channel, k, E_RANGE_MIN, E_RANGE_MAX, a_parser_conrol->command_code); MOTOROLA Chaper 3. Module Descrpons 3-237
318 Mscellaneous Funcons nc. nc MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
319 Mscellaneous Funcons nc. command_uf_wre Call(s): un32 command_uf_wre (sruc channel_ * channel, un32 command_code); Argumens: Tale AT_parser_n argumens channel n Poner o he Channel conrol daa srucure command_code n The varale conans numer and parameers of he curren AT command. nc Descrpon: Reurns: Code example: Ths funcon sores he nerpreed AT command and s parameers n he local a_command_uf[] uffer. Afer processng all of he AT Command srng and f no error has occurred he conens of a_command_uf[] uffer wll e placed no he command[] uffer. Zero. sruc channel_ channel; un32 command_code; command_uf_wre(channel, a_parser_conrol->command_code); MOTOROLA Chaper 3. Module Descrpons 3-239
320 Mscellaneous Funcons nc Command Handler The Command Handler s a op-level eny ha s nvoked y he scheduler o nerpre AT commands and execue hem. I reads formaed commands from he command[] crcular uffer, ha are wren no y he Command Parser. The Command Handler mplemens he AT commands and conrols he sae of he Sof Modem. I also passes he command responses and saus messages o he DTE. See secon nc Tex Response Sae Machne Command Handler Fgure Command Handler command[] The Command Handler rounes and defnons can e found n he a_handler.h and a_handler.c fles MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
321 Mscellaneous Funcons nc. AT_handler_n Call(s): vod AT_handler_n (sruc channel_ * channel); Argumens: Tale AT_handler_n argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Reurns: Code example: sruc channel_ channel; AT_handler_n (&channel); Ths funcon nalses he channel->tx_conrol_pr->command_handler_call _func o he AT_handler_roune. I mus e called efore he command_handler() funcon. Ths funcon s called n sae_machne(). None. MOTOROLA Chaper 3. Module Descrpons 3-241
322 Mscellaneous Funcons nc. AT_handler_roune Call(s): vod AT_handler_roune(sruc channel_ * channel); Argumens: Tale AT_handler_roune argumens channel n Poner o he Channel conrol daa srucure nc Descrpon: Ths funcon mplemens he AT Command Handler. I reads commands, nerpreed y he AT Command Parser, from he command[] uffer. The forma of he command[] uffer elemen s: 4-h ye s he command numer (Command numers are specfed n he a_parser.h fle.) 3-rd ye s he 1s parameer (oponal) 2-nd ye s he 2nd parameer (oponal) 1-s ye s he 3rd parameer (oponal) Usng parameers s oponal and depends on a concree command. Dependng on he AT commands, he Command Handler can: Modfy S regsers Conrol mnmum and maxmum values of he S regsers Change he Gloal Sae Machne s curren sae Change he H regsers Send nformave messages o he DTE Send command response o he DTE If he command numer or any of he parameers s wrong he Command Handler reaks commands handlng, clears he command[] uffer and sends an ERROR response o he DTE. Ths funcon s called y he command_handler() funcon va channel->tx_conrol_pr-> command_handler_call_func (). For more nformaon aou AT Command Handler acons on AT commands, please refer o he MCF5407 Low Daa Rae Sof Modem. AT Command reference. User Manual. Reurns: None MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
323 Mscellaneous Funcons nc. Code example: sruc channel_ channel; AT_handler_n (&channel); AT_handler_roune(&channel); nc MOTOROLA Chaper 3. Module Descrpons 3-243
324 Mscellaneous Funcons nc. choose_daa_pump_proocol Call(s): vod choose_daa_pump_proocol(vod); nc Argumens: Descrpon: None. Ths funcon conrols he value of he H[3] regser (Curren Daa Pump Proocol). If he H[3] regser s equal o H3_DP_NONE (Daa Pump proocol s no chosen), he funcon makes a decson aou he Daa Pump proocol on he ass of he S[19] regser (Daa Pump proocol defned y user), afer ha changes he H[3] regser o correspond o ha Daa Pump proocol. Ths funcon s called n sae_machne(). Reurns: Code example: None. choose_daa_pump_proocol(); MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
325 nc. Alphaecal Ls of Funcons nc AT_handler_n AT_handler_roune AT_parser_n AT_parser_roune char_presen_uar char_o_de choose_daa_pump_proocol command_uf_wre command_handler 2-53 command_parameer_denfcaon command_parser 2-52 command_read 2-38 command_wre 2-37 daa_aou_level_se daa_aou_mue daa_counry_se daa_go_off_hook daa_go_on_hook daa_n daa_read_reg daa_rng_deec daa_rx_level_se daa_x_level_se daa_wre_reg DPSK_demodulaor 3-79 DPSK_demodulaor_n 3-78 DPSK_modulaor 3-77 DPSK_modulaor_n 3-76 dsp_convoluon_frac dsp_cos flow_conrol FSK_demodulaor 3-63 FSK_demodulaor_n 3-62 FSK_modulaor 3-61 FSK_modulaor_n 3-60 gloal_srucure_n 2-39 H_regsers_n 2-45 n_char_uar n_sample_codec load_daa_handler_parameers 2-57 mcf5407_uar_n mcf5407_uar_nerrup_mask_se mcf5407_uar_parameers_se memcpy_mcf ou_char_uar ou_sample_codec prn_connec prn_resul_code prn_ex_response QAM_demodulaor 3-99 QAM_demodulaor_n 3-98 QAM_modulaor 3-97 QAM_modulaor_n 3-96 re_connecon_code Rx_channel_n 2-42 Rx_daa Rx_daa_handler 2-51 Rx_daa_pump 2-49 Rx_daa_read 2-32 Rx_daa_wre 2-31 Rx_dle 2-55 Rx_rese 2-47 Rx_rng_de_n Rx_rng_deec Rx_sample_read 2-28 Rx_sample_wre 2-27 Rx_one Rx_one_n Rx_uar Rx_uar_daa_read 2-36 Rx_uar_daa_wre 2-35 Rx_V14_DH_n Rx_V14_DH_roune Rx_V21_handshake_n 3-9 Rx_V21_handshake_roune 3-10 Rx_V21_n 3-6 MOTOROLA Alphaecal Ls of Funcons Funcons-1
326 nc. nc Rx_V22_handshake_n 3-29 Rx_V22_handshake_roune 3-30 Rx_V22_n 3-28 Rx_V22s_change_mode 3-51 Rx_V22s_handshake_n 3-46 Rx_V22s_handshake_roune 3-47 Rx_V22s_n 3-45 Rx_V23_handshake_n 3-18 Rx_V23_handshake_roune 3-19 Rx_V23_n 3-15 Rx_V8_DH_n Rx_V8_DH_roune S_regsers_n 2-44 sample_presen_codec save_daa_handler_parameers 2-56 sae_machne 2-23 sae_machne_n 2-22 ex_o_de ex_o_de_fxed Tx_channel_n 2-40 Tx_daa Tx_daa_handler 2-50 Tx_daa_pump 2-48 Tx_daa_read 2-30 Tx_daa_wre 2-29 Tx_DTMF Tx_DTMF_n Tx_pulse Tx_pulse_n Tx_rese 2-46 Tx_sample_read 2-26 Tx_sample_wre 2-25 Tx_slence_gen 2-54 Tx_one Tx_one_n Tx_uar Tx_uar_all Tx_uar_daa_read 2-34 Tx_uar_daa_wre 2-33 Tx_V14_DH_n Tx_V14_DH_roune Tx_V21_handshake_n 3-7 Tx_V21_handshake_roune 3-8 Tx_V21_n 3-5 Tx_V22_handshake_n 3-31 Tx_V22_handshake_roune 3-32 Tx_V22_n 3-27 Tx_V22s_change_mode 3-50 Tx_V22s_handshake_n 3-48 Tx_V22s_handshake_roune 3-49 Tx_V22s_n 3-44 Tx_V23_handshake_n 3-16 Tx_V23_handshake_roune 3-17 Tx_V23_n 3-14 Tx_V8_DH_n Tx_V8_DH_roune un8_o_sr_decmal un8_o_sr_hexadecmal v14_ge_s v14_pu_s V22_descramle_ 3-26 V22_scramle_ 3-25 V22s_descramle_ 3-43 V22s_scramle_ 3-42 v42_ges v42_n v42_pus v42_rx_daa v42_x_daa v42_vews v42s_decode v42s_encode v42s_flush v42s_in v8_ge_s v8_pu_s Funcons-2 MCF5407 LDR Sof Modem Sofware Developer s Reference Manual MOTOROLA
Spline. Computer Graphics. B-splines. B-Splines (for basis splines) Generating a curve. Basis Functions. Lecture 14 Curves and Surfaces II
Lecure 4 Curves and Surfaces II Splne A long flexble srps of meal used by drafspersons o lay ou he surfaces of arplanes, cars and shps Ducks weghs aached o he splnes were used o pull he splne n dfferen
Methodology of the CBOE S&P 500 PutWrite Index (PUT SM ) (with supplemental information regarding the CBOE S&P 500 PutWrite T-W Index (PWT SM ))
ehodology of he CBOE S&P 500 PuWre Index (PUT S ) (wh supplemenal nformaon regardng he CBOE S&P 500 PuWre T-W Index (PWT S )) The CBOE S&P 500 PuWre Index (cker symbol PUT ) racks he value of a passve
MORE ON TVM, "SIX FUNCTIONS OF A DOLLAR", FINANCIAL MECHANICS. Copyright 2004, S. Malpezzi
MORE ON VM, "SIX FUNCIONS OF A DOLLAR", FINANCIAL MECHANICS Copyrgh 2004, S. Malpezz I wan everyone o be very clear on boh he "rees" (our basc fnancal funcons) and he "fores" (he dea of he cash flow model).
The Rules of the Settlement Guarantee Fund. 1. These Rules, hereinafter referred to as "the Rules", define the procedures for the formation
Vald as of May 31, 2010 The Rules of he Selemen Guaranee Fund 1 1. These Rules, herenafer referred o as "he Rules", defne he procedures for he formaon and use of he Selemen Guaranee Fund, as defned n Arcle
Capacity Planning. Operations Planning
Operaons Plannng Capacy Plannng Sales and Operaons Plannng Forecasng Capacy plannng Invenory opmzaon How much capacy assgned o each producon un? Realsc capacy esmaes Sraegc level Moderaely long me horzon
Lecture 40 Induction. Review Inductors Self-induction RL circuits Energy stored in a Magnetic Field
ecure 4 nducon evew nducors Self-nducon crcus nergy sored n a Magnec Feld 1 evew nducon end nergy Transfers mf Bv Mechancal energy ransform n elecrc and hen n hermal energy P Fv B v evew eformulaon of
How To Calculate Backup From A Backup From An Oal To A Daa
6 IJCSNS Inernaonal Journal of Compuer Scence and Nework Secury, VOL.4 No.7, July 04 Mahemacal Model of Daa Backup and Recovery Karel Burda The Faculy of Elecrcal Engneerng and Communcaon Brno Unversy
The Virtual Machine Resource Allocation based on Service Features in Cloud Computing Environment
Send Orders for Reprns o [email protected] The Open Cybernecs & Sysemcs Journal, 2015, 9, 639-647 639 Open Access The Vrual Machne Resource Allocaon based on Servce Feaures n Cloud Compung Envronmen
Guidelines and Specification for the Construction and Maintenance of the. NASDAQ OMX Credit SEK Indexes
Gudelnes and Specfcaon for he Consrucon and Manenance of he NASDAQ OMX Cred SEK Indexes Verson as of Aprl 7h 2014 Conens Rules for he Consrucon and Manenance of he NASDAQ OMX Cred SEK Index seres... 3
Genetic Algorithm with Range Selection Mechanism for Dynamic Multiservice Load Balancing in Cloud-Based Multimedia System
ISSN : 2347-8446 (Onlne) Inernaonal Journal of Advanced Research n Genec Algorhm wh Range Selecon Mechansm for Dynamc Mulservce Load Balancng n Cloud-Based Mulmeda Sysem I Mchael Sadgun Rao Kona, II K.Purushoama
An Architecture to Support Distributed Data Mining Services in E-Commerce Environments
An Archecure o Suppor Dsrbued Daa Mnng Servces n E-Commerce Envronmens S. Krshnaswamy 1, A. Zaslavsky 1, S.W. Loke 2 School of Compuer Scence & Sofware Engneerng, Monash Unversy 1 900 Dandenong Road, Caulfeld
PerfCenter: A Methodology and Tool for Performance Analysis of Application Hosting Centers
PerfCener: A Mehodology and Tool for Performance Analyss of Applcaon Hosng Ceners Rukma P. Verlekar, Varsha Ape, Prakhar Goyal, Bhavsh Aggarwal Dep. of Compuer Scence and Engneerng Indan Insue of Technology
Auxiliary Module for Unbalanced Three Phase Loads with a Neutral Connection
CODEN:LUTEDX/TEIE-514/1-141/6 Indusral Elecrcal Engneerng and Auomaon Auxlary Module for Unbalanced Three Phase Loads wh a Neural Connecon Nls Lundsröm Rkard Sröman Dep. of Indusral Elecrcal Engneerng
HAND: Highly Available Dynamic Deployment Infrastructure for Globus Toolkit 4
HAND: Hghly Avalable Dynamc Deploymen Infrasrucure for Globus Toolk 4 L Q 1, Ha Jn 1, Ian Foser,3, Jarek Gawor 1 Huazhong Unversy of Scence and Technology, Wuhan, 430074, Chna [email protected]; [email protected]
GUIDANCE STATEMENT ON CALCULATION METHODOLOGY
GUIDANCE STATEMENT ON CALCULATION METHODOLOGY Adopon Dae: 9/28/0 Effecve Dae: //20 Reroacve Applcaon: No Requred www.gpssandards.org 204 CFA Insue Gudance Saemen on Calculaon Mehodology GIPS GUIDANCE STATEMENT
12/7/2011. Procedures to be Covered. Time Series Analysis Using Statgraphics Centurion. Time Series Analysis. Example #1 U.S.
Tme Seres Analyss Usng Sagraphcs Cenuron Nel W. Polhemus, CTO, SaPon Technologes, Inc. Procedures o be Covered Descrpve Mehods (me sequence plos, auocorrelaon funcons, perodograms) Smoohng Seasonal Decomposon
Index Mathematics Methodology
Index Mahemacs Mehodology S&P Dow Jones Indces: Index Mehodology Ocober 2015 Table of Conens Inroducon 4 Dfferen Varees of Indces 4 The Index Dvsor 5 Capalzaon Weghed Indces 6 Defnon 6 Adjusmens o Share
MODEL-BASED APPROACH TO CHARACTERIZATION OF DIFFUSION PROCESSES VIA DISTRIBUTED CONTROL OF ACTUATED SENSOR NETWORKS
MODEL-BASED APPROACH TO CHARACTERIZATION OF DIFFUSION PROCESSES IA DISTRIBUTED CONTROL OF ACTUATED SENSOR NETWORKS Kevn L. Moore and YangQuan Chen Cener for Self-Organzng and Inellgen Sysems Uah Sae Unversy
An Anti-spam Filter Combination Framework for Text-and-Image Emails through Incremental Learning
An An-spam Fler Combnaon Framework for Tex-and-Image Emals hrough Incremenal Learnng 1 Byungk Byun, 1 Chn-Hu Lee, 2 Seve Webb, 2 Danesh Iran, and 2 Calon Pu 1 School of Elecrcal & Compuer Engr. Georga
Baumer FWL120 NeuroCheck Edition Art. No: OD106434
High Sensiive Digial Monochrome (b/w) Line Scan Camera Sysem: IEEE1394a Baumer FWL120 NeuroCheck Ediion Ar. No: OD106434 IEEE1394a (FireWire TM ) Progressive Scan CCD Camera 2048 Pixels Ousanding Image
MULTI-WORKDAY ERGONOMIC WORKFORCE SCHEDULING WITH DAYS OFF
Proceedngs of he 4h Inernaonal Conference on Engneerng, Projec, and Producon Managemen (EPPM 203) MULTI-WORKDAY ERGONOMIC WORKFORCE SCHEDULING WITH DAYS OFF Tar Raanamanee and Suebsak Nanhavanj School
Network Effects on Standard Software Markets: A Simulation Model to examine Pricing Strategies
Nework Effecs on Sandard Sofware Markes Page Nework Effecs on Sandard Sofware Markes: A Smulaon Model o examne Prcng Sraeges Peer Buxmann Absrac Ths paper examnes sraeges of sandard sofware vendors, n
COASTAL CAROLINA COMMUNITY COLLEGE
Eme r ge nc ymanage me n BULLETI N20152016 Foradd onal nf or ma on,pl eas ev s h p: c oas al c ar ol na. edu ac adem c s webs es ep COASTAL CAROLINA COMMUNITY COLLEGE Equal Educaon Opporuny and Equal Employmen
Desktop 4th Generation Intel Core Processor Family, Desktop Intel Pentium Processor Family, and Desktop Intel Celeron Processor Family
Deskop 4h Generaon Inel Core, Deskop Inel Penum, and Deskop Inel Celeron Processor Famly Daashee Volume 1 of 2 March 2015 Order No.: 328897-010 You may no use or faclae he use of hs documen n connecon
TSG-RAN Working Group 1 (Radio Layer 1) meeting #3 Nynashamn, Sweden 22 nd 26 th March 1999
TSG-RAN Working Group 1 (Radio Layer 1) meeing #3 Nynashamn, Sweden 22 nd 26 h March 1999 RAN TSGW1#3(99)196 Agenda Iem: 9.1 Source: Tile: Documen for: Moorola Macro-diversiy for he PRACH Discussion/Decision
Linear Extension Cube Attack on Stream Ciphers Abstract: Keywords: 1. Introduction
Lnear Exenson Cube Aack on Sream Cphers Lren Dng Yongjuan Wang Zhufeng L (Language Engneerng Deparmen, Luo yang Unversy for Foregn Language, Luo yang cy, He nan Provnce, 47003, P. R. Chna) Absrac: Basng
STUDENT AFFAIRS TECHNOLOGY... WEBSTANDARDS
STUDNT AFFAIRS TCHNOLOGY WBSTANDARDS W BD V L OPM NTPROC SS F ORNW WBSI TSORMAJ ORADDI TI ONS/ UPDATS R S A R C H ga her ngcon ac s,goal s, pur pose,needs,con en &o her nf o P L A N NI NGreframes cr ea
A Background Layer Model for Object Tracking through Occlusion
A Background Layer Model for Obec Trackng hrough Occluson Yue Zhou and Ha Tao Deparmen of Compuer Engneerng Unversy of Calforna, Sana Cruz, CA 95064 {zhou,ao}@soe.ucsc.edu Absrac Moon layer esmaon has
Wilmar Deliverable D6.2 (b) Wilmar Joint Market Model Documentation. Peter Meibom, Helge V. Larsen, Risoe National Laboratory
Rsø-R-1552(EN) Wlmar Delverable D6.2 (b) Wlmar Jon Marke Model Documenaon Peer Mebom, Helge V. Larsen, Rsoe Naonal Laboraory Rüdger Barh, Heke Brand, IER, Unversy of Sugar Chrsoph Weber, Olver Voll, Unversy
Pedro M. Castro Iiro Harjunkoski Ignacio E. Grossmann. Lisbon, Portugal Ladenburg, Germany Pittsburgh, USA
Pedro M. Casro Iro Harjunkosk Ignaco E. Grossmann Lsbon Porugal Ladenburg Germany Psburgh USA 1 Process operaons are ofen subjec o energy consrans Heang and coolng ules elecrcal power Avalably Prce Challengng
Preface. Frederick D. Wolf Director, Accounting and Financial Management Division
f Preface The hallmark of a professonal audor s a commmen o connued self-developmen. As new and challengng problems and ssues confron us, we mus respond by sharpenng and expandng our echncal experse, analycal
Inventory Management MILP Modeling for Tank Farm Systems
2 h European Sympoum on Compuer Aded Proce Engneerng ESCAPE2 S. Perucc and G. Buzz Ferrar (Edor) 2 Elever B.V. All rgh reerved. Invenory Managemen MILP Modelng for Tank Farm Syem Suana Relva a Ana Paula
A Hybrid AANN-KPCA Approach to Sensor Data Validation
Proceedngs of he 7h WSEAS Inernaonal Conference on Appled Informacs and Communcaons, Ahens, Greece, Augus 4-6, 7 85 A Hybrd AANN-KPCA Approach o Sensor Daa Valdaon REZA SHARIFI, REZA LANGARI Deparmen of
Cost- and Energy-Aware Load Distribution Across Data Centers
- and Energy-Aware Load Dsrbuon Across Daa Ceners Ken Le, Rcardo Banchn, Margare Maronos, and Thu D. Nguyen Rugers Unversy Prnceon Unversy Inroducon Today, many large organzaons operae mulple daa ceners.
MODELLING DISTURBANCES IN SYSTEM TRACK RAIL VEHICLE
The 8 h Inernaonal Conference RELIABILITY an STATISTICS n TRANSPORTATION an COMMUNICATION - 008 MODELLING DISTURBANCES IN SYSTEM TRACK RAIL VEHICLE Taeus Csosk, Anrej Necas, Jóef Sokłosa Hgh School of
COASTAL CAROLINA COMMUNITY COLLEGE
20152016 BULLETI N Foradd onal nf or ma onpl easev s :h p: / / www. coas al car ol na. edu/ academ cs/ webs es/ f r e/ COASTAL CAROLINA COMMUNITY COLLEGE Equal Educaon Opporuny and Equal Employmen Opporuny
A Hybrid Wind-Solar Energy System: A New Rectifier Stage Topology
A Hybr n-solar Energy Sysem: A New Recfer Sage Topology Joanne Hu*, IEEE Suen Member, Alreza Bakhsha IEEE Senor Member, an Praveen K. Jan, IEEE Fellow Deparmen of Elecrcal an Compuer Engneerng Queen s
Ground rules. Guide to the calculation methods of the FTSE Actuaries UK Gilts Index Series v1.9
Ground rules Gude o he calculaon mehods of he FTSE Acuares UK Gls Index Seres v1.9 fserussell.com Ocober 2015 Conens 1.0 Inroducon... 4 1.1 Scope... 4 1.2 FTSE Russell... 5 1.3 Overvew of he calculaons...
Selected Financial Formulae. Basic Time Value Formulae PV A FV A. FV Ad
Basc Tme Value e Fuure Value of a Sngle Sum PV( + Presen Value of a Sngle Sum PV ------------------ ( + Solve for for a Sngle Sum ln ------ PV -------------------- ln( + Solve for for a Sngle Sum ------
Gestures for pointing devices in screen-based environments. Florian Weil, www.derhess.de
Gesures for ponng devces n screen-based envronmens Floran Wel, www.derhess.de December 4, 2010 Absrac Ths paper analyses gesure desgn for ponng devces n screen-based envronmens. By explorng desgn paerns
Market-Clearing Electricity Prices and Energy Uplift
Marke-Clearng Elecrcy Prces and Energy Uplf Paul R. Grbk, Wllam W. Hogan, and Susan L. Pope December 31, 2007 Elecrcy marke models requre energy prces for balancng, spo and shor-erm forward ransacons.
The Prediction Algorithm Based on Fuzzy Logic Using Time Series Data Mining Method
The Predcon Algorhm Based on Fuzzy Logc Usng Tme Seres Daa Mnng Mehod I Aydn, M Karakose, and E Akn Asrac Predcon of an even a a me seres s que mporan for engneerng and economy prolems Tme seres daa mnng
Anomaly Detection in Network Traffic Using Selected Methods of Time Series Analysis
I. J. Compuer Nework and Informaon Secury, 2015, 9, 10-18 Publshed Onlne Augus 2015 n MECS (hp://www.mecs-press.org/) DOI: 10.5815/jcns.2015.09.02 Anomaly Deecon n Nework Traffc Usng Seleced Mehods of
DEPARTMENT OF ECONOMETRICS AND BUSINESS STATISTICS. Exponential Smoothing for Inventory Control: Means and Variances of Lead-Time Demand
ISSN 440-77X ISBN 0 736 094 X AUSTRALIA DEPARTMENT OF ECONOMETRICS AND BUSINESS STATISTICS Exponenal Smoohng for Invenory Conrol: Means and Varances of Lead-Tme Demand Ralph D. Snyder, Anne B. Koehler,
Kalman filtering as a performance monitoring technique for a propensity scorecard
Kalman flerng as a performance monorng echnque for a propensy scorecard Kaarzyna Bjak * Unversy of Souhampon, Souhampon, UK, and Buro Informacj Kredyowej S.A., Warsaw, Poland Absrac Propensy scorecards
THOMSON REUTERS/CORECOMMODITY CRB INDEX CALCULATION SUPPLEMENT
THOMSON REUTERS/CORECOMMODITY CRB INDEX CALCULATION SUPPLEMENT SEPTEMBER 2013 Thomson Reuers/CoreCommody CRB Index Calculaon Supplemen Ths supplemen conans he rules for calculang he Thomson Reuers/CoreCommody
RESOLUTION OF THE LINEAR FRACTIONAL GOAL PROGRAMMING PROBLEM
Revsa Elecrónca de Comuncacones y Trabajos de ASEPUMA. Rec@ Volumen Págnas 7 a 40. RESOLUTION OF THE LINEAR FRACTIONAL GOAL PROGRAMMING PROBLEM RAFAEL CABALLERO [email protected] Unversdad de Málaga
Load Balancing in Internet Using Adaptive Packet Scheduling and Bursty Traffic Splitting
152 IJCSNS Inernaonal Journal of Compuer Scence and Nework Secury, VOL.8 No.1, Ocober 28 Load Balancng n Inerne Usng Adapve Packe Schedulng and Bursy Traffc Splng M. Azah Research Scholar, Anna Unversy,
Insurance. By Mark Dorfman, Alexander Kling, and Jochen Russ. Abstract
he Impac Of Deflaon On Insurance Companes Offerng Parcpang fe Insurance y Mar Dorfman, lexander Klng, and Jochen Russ bsrac We presen a smple model n whch he mpac of a deflaonary economy on lfe nsurers
Sensor Nework proposeations
008 Inernaoal Symposum on Telecommuncaons A cooperave sngle arge rackng algorhm usng bnary sensor neworks Danal Aghajaran, Reza Berang Compuer Engneerng Deparmen, Iran Unversy of Scence and Technology,
Analyzing Energy Use with Decomposition Methods
nalyzng nergy Use wh Decomposon Mehods eve HNN nergy Technology Polcy Dvson [email protected] nergy Tranng Week Pars 1 h prl 213 OCD/ 213 Dscusson nergy consumpon and energy effcency? How can energy consumpon
Cooperative Distributed Scheduling for Storage Devices in Microgrids using Dynamic KKT Multipliers and Consensus Networks
Cooperave Dsrbued Schedulng for Sorage Devces n Mcrogrds usng Dynamc KK Mulplers and Consensus Newors Navd Rahbar-Asr Yuan Zhang Mo-Yuen Chow Deparmen of Elecrcal and Compuer Engneerng Norh Carolna Sae
HEAT CONDUCTION PROBLEM IN A TWO-LAYERED HOLLOW CYLINDER BY USING THE GREEN S FUNCTION METHOD
Journal of Appled Mahemacs and Compuaonal Mechancs 3, (), 45-5 HEAT CONDUCTION PROBLEM IN A TWO-LAYERED HOLLOW CYLINDER BY USING THE GREEN S FUNCTION METHOD Sansław Kukla, Urszula Sedlecka Insue of Mahemacs,
FRAMEWORK OF MEETING SCHEDULING IN COMPUTER SYSTEMS
FRAMEWORK OF MEEING CEDULING IN COMPUER YEM Goran Marnovc, Faculy of Elecrcal Engneerng, J.J. rossmayer Unversy of Ose, [email protected] ABRAC Developmen of compuer echnologes s a necessary bu no
Towards a Trustworthy and Controllable Peer- Server-Peer Media Streaming: An Analytical Study and An Industrial Perspective
Towards a Trusworhy and Conrollable Peer- Server-Peer Meda Sreamn: An Analycal Sudy and An Indusral Perspecve Zhja Chen, Hao Yn, Chuan n, Xuenn u, Yan Chen* Deparmen of Compuer Scence & Technoloy, *Deparmen
INTERNATIONAL EDUCATION, QUALIFICATION AND CERTIFICATION SYSTEMS IN WELDING. IIW International Institute of Welding
INTERNATIONAL EDUCATION, QUALIFICATION AND CERTIFICATION SYSTEMS IN WELDING Qunno L. 1, Ferraz R. 2, Fernandes I. 3 IIW Inernaonal Insue of Weldng EWF European Federaon for Weldng Jonng and Cung ABSTRACT
Attribution Strategies and Return on Keyword Investment in Paid Search Advertising
Arbuon Sraeges and Reurn on Keyword Invesmen n Pad Search Adversng by Hongshuang (Alce) L, P. K. Kannan, Sva Vswanahan and Abhshek Pan * December 15, 2015 * Honshuang (Alce) L s Asssan Professor of Markeng,
PARTICLE FILTER BASED VEHICLE TRACKING APPROACH WITH IMPROVED RESAMPLING STAGE
ISS: 0976-910(OLIE) ICTACT JOURAL O IMAGE AD VIDEO PROCESSIG, FEBRUARY 014, VOLUME: 04, ISSUE: 03 PARTICLE FILTER BASED VEHICLE TRACKIG APPROACH WITH IMPROVED RESAMPLIG STAGE We Leong Khong 1, We Yeang
Task is a schedulable entity, i.e., a thread
Real-Time Scheduling Sysem Model Task is a schedulable eniy, i.e., a hread Time consrains of periodic ask T: - s: saring poin - e: processing ime of T - d: deadline of T - p: period of T Periodic ask T
A robust optimisation approach to project scheduling and resource allocation. Elodie Adida* and Pradnya Joshi
In. J. Servces Operaons and Informacs, Vol. 4, No. 2, 2009 169 A robus opmsaon approach o projec schedulng and resource allocaon Elode Adda* and Pradnya Josh Deparmen of Mechancal and Indusral Engneerng,
(Im)possibility of Safe Exchange Mechanism Design
(Im)possbly of Safe Exchange Mechansm Desgn Tuomas Sandholm Compuer Scence Deparmen Carnege Mellon Unversy 5 Forbes Avenue Psburgh, PA 15213 [email protected] XaoFeng Wang Deparmen of Elecrcal and Compuer
A Heuristic Solution Method to a Stochastic Vehicle Routing Problem
A Heursc Soluon Mehod o a Sochasc Vehcle Roung Problem Lars M. Hvaum Unversy of Bergen, Bergen, Norway. [email protected] Arne Løkkeangen Molde Unversy College, 6411 Molde, Norway. [email protected]
A New Approach For Modelling & Pricing Correlation Swaps in Equity Derivatives
9 A MAY ew 006 Approach For Modellng & Prcng Correlaon Swaps n Equy Dervaves A ew Approach For Modellng & Prcng Correlaon Swaps n Equy Dervaves GLOBAL DERIVATIVES TRADIG & RISK MAAGEMET 006 ICBI h Annual
HEURISTIC ALGORITHM FOR SINGLE RESOURCE CONSTRAINED PROJECT SCHEDULING PROBLEM BASED ON THE DYNAMIC PROGRAMMING
Yugoslav Journal o Operaons Research Volume 19 (2009) Number 2, 281-298 DOI:10.2298/YUJOR0902281S HEURISTIC ALGORITHM FOR SINGLE RESOURCE CONSTRAINED PROJECT SCHEDULING PROBLEM BASED ON THE DYNAMIC PROGRAMMING
Currency Exchange Rate Forecasting from News Headlines
Currency Exchange Rae Forecasng from News Headlnes Desh Peramunelleke Raymond K. Wong School of Compuer Scence & Engneerng Unversy of New Souh Wales Sydney, NSW 2052, Ausrala [email protected] [email protected]
Fixed Income Attribution. Remco van Eeuwijk, Managing Director Wilshire Associates Incorporated 15 February 2006
Fxed Incoe Arbuon eco van Eeuwk Managng Drecor Wlshre Assocaes Incorporaed 5 February 2006 Agenda Inroducon Goal of Perforance Arbuon Invesen Processes and Arbuon Mehodologes Facor-based Perforance Arbuon
The Sarbanes-Oxley Act and Small Public Companies
The Sarbanes-Oxley Ac and Small Publc Companes Smry Prakash Randhawa * June 5 h 2009 ABSTRACT Ths sudy consrucs measures of coss as well as benefs of mplemenng Secon 404 for small publc companes. In hs
Estimating intrinsic currency values
Cung edge Foregn exchange Esmang nrnsc currency values Forex marke praconers consanly alk abou he srenghenng or weakenng of ndvdual currences. In hs arcle, Jan Chen and Paul Dous presen a new mehodology
Pocket3D Designing a 3D Scanner by means of a PDA 3D DIGITIZATION
Pocke3D Desgnng a 3D Scanner by means of a PDA 3D DIGITIZATION Subjec: 3D Dgzaon Insrucor: Dr. Davd Fof Suden: AULINAS Josep GARCIA Frederc GIANCARDO Luca Posgraduae n: VIBOT MSc Table of conens 1. Inroducon...
Ground rules. FTSE Global Bonds Index Series v1.7
Ground rules FTSE Global Bonds Index Seres v.7 fserussell.com Ocober 205 Conens.0 Inroducon... 3 2.0 Managemen responsbles... 7 3.0 Elgble of secures... 9 4.0 rce sources... 5.0 erodc Change o he orfolos...
The Feedback from Stock Prices to Credit Spreads
Appled Fnance Projec Ka Fa Law (Keh) The Feedback from Sock Prces o Cred Spreads Maser n Fnancal Engneerng Program BA 3N Appled Fnance Projec Ka Fa Law (Keh) Appled Fnance Projec Ka Fa Law (Keh). Inroducon
Analysis of intelligent road network, paradigm shift and new applications
CONFERENCE ABOUT THE STATUS AND FUTURE OF THE EDUCATIONAL AND R&D SERVICES FOR THE VEHICLE INDUSTRY Analyss of nellgen road nework, paradgm shf and new applcaons Péer Tamás "Smarer Transpor" - IT for co-operave
THE IMPACT OF QUICK RESPONSE IN INVENTORY-BASED COMPETITION
Workng Paper WP no 722 November, 2007 THE IMPACT OF QUICK RESPONSE IN INVENTORY-BASED COMPETITION Felpe Caro Vícor Marínez de Albénz 2 Professor, UCLA Anderson School of Managemen 2 Professor, Operaons
A Hybrid Method for Forecasting Stock Market Trend Using Soft-Thresholding De-noise Model and SVM
A Hybrd Mehod for Forecasng Sock Marke Trend Usng Sof-Thresholdng De-nose Model and SVM Xueshen Su, Qnghua Hu, Daren Yu, Zongxa Xe, and Zhongyng Q Harbn Insue of Technology, Harbn 150001, Chna [email protected]
A Real-time Adaptive Traffic Monitoring Approach for Multimedia Content Delivery in Wireless Environment *
A Real-e Adapve Traffc Monorng Approach for Muleda Conen Delvery n Wreless Envronen * Boonl Adpa and DongSong Zhang Inforaon Syses Deparen Unversy of Maryland, Balore Couny Balore, MD, U.S.A. [email protected],
SHIPPING ECONOMIC ANALYSIS FOR ULTRA LARGE CONTAINERSHIP
Journal of he Easern Asa Socey for Transporaon Sudes, Vol. 6, pp. 936-951, 2005 SHIPPING ECONOMIC ANALYSIS FOR ULTRA LARGE CONTAINERSHIP Chaug-Ing HSU Professor Deparen of Transporaon Technology and Manageen
APPLICATION OF CHAOS THEORY TO ANALYSIS OF COMPUTER NETWORK TRAFFIC Liudvikas Kaklauskas, Leonidas Sakalauskas
The XIII Inernaonal Conference Appled Sochasc Models and Daa Analyss (ASMDA-2009) June 30-July 3 2009 Vlnus LITHUANIA ISBN 978-9955-28-463-5 L. Sakalauskas C. Skadas and E. K. Zavadskas (Eds.): ASMDA-2009
SPC-based Inventory Control Policy to Improve Supply Chain Dynamics
Francesco Cosanno e al. / Inernaonal Journal of Engneerng and Technology (IJET) SPC-based Invenory Conrol Polcy o Improve Supply Chan ynamcs Francesco Cosanno #, Gulo Gravo #, Ahmed Shaban #3,*, Massmo
TECNICHE DI DIAGNOSI AUTOMATICA DEI GUASTI. Silvio Simani [email protected]. References
TECNICHE DI DIAGNOSI AUTOMATICA DEI GUASTI Re Neural per l Idenfcazone d Ssem non Lnear e Paern Recognon slvo.sman@unfe. References Texbook suggesed: Neural Neworks for Idenfcaon, Predcon, and Conrol,
CLoud computing has recently emerged as a new
1 A Framework of Prce Bddng Confguraons for Resource Usage n Cloud Compung Kenl L, Member, IEEE, Chubo Lu, Keqn L, Fellow, IEEE, and Alber Y. Zomaya, Fellow, IEEE Absrac In hs paper, we focus on prce bddng
Proceedings of the 2008 Winter Simulation Conference S. J. Mason, R. R. Hill, L. Mönch, O. Rose, T. Jefferson, J. W. Fowler eds.
Proceedngs of he 008 Wner Smulaon Conference S. J. Mason, R. R. Hll, L. Mönch, O. Rose, T. Jefferson, J. W. Fowler eds. DEMAND FORECAST OF SEMICONDUCTOR PRODUCTS BASED ON TECHNOLOGY DIFFUSION Chen-Fu Chen,
Hosted Voice Self Service Installation Guide
Hosted Voce Self Servce Installaton Gude Contact us at 1-877-355-1501 [email protected] www.earthlnk.com 2015 EarthLnk. Trademarks are property of ther respectve owners. All rghts reserved. 1071-07629
INTERNATIONAL JOURNAL OF STRATEGIC MANAGEMENT
IJSM, Volume, Number, 0 ISSN: 555-4 INTERNATIONAL JOURNAL OF STRATEGIC MANAGEMENT SPONSORED BY: Angelo Sae Unversy San Angelo, Texas, USA www.angelo.edu Managng Edors: Professor Alan S. Khade, Ph.D. Calforna
Event Based Project Scheduling Using Optimized Ant Colony Algorithm Vidya Sagar Ponnam #1, Dr.N.Geethanjali #2
Inernaonal Journal of Compuer Trends and Technology (IJCTT) Volume 18 Number 6 Dec 2014 Even Based Projec Schedulng Usng Opmzed An Colony Algorhm Vdya Sagar Ponnam #1, Dr.N.Geehanjal #2 1 Research Scholar,
Model-Based Monitoring in Large-Scale Distributed Systems
Model-Based Monioring in Large-Scale Disribued Sysems Diploma Thesis Carsen Reimann Chemniz Universiy of Technology Faculy of Compuer Science Operaing Sysem Group Advisors: Prof. Dr. Winfried Kalfa Dr.
VRT012 User s guide V0.1. Address: Žirmūnų g. 27, Vilnius LT-09105, Phone: (370-5) 2127472, Fax: (370-5) 276 1380, Email: info@teltonika.
VRT012 User s gude V0.1 Thank you for purchasng our product. We hope ths user-frendly devce wll be helpful n realsng your deas and brngng comfort to your lfe. Please take few mnutes to read ths manual
GUIDE GOVERNING SMI RISK CONTROL INDICES
GUIDE GOVERNING SMI RISK CONTROL IND ICES SIX Swiss Exchange Ld 04/2012 i C O N T E N T S 1. Index srucure... 1 1.1 Concep... 1 1.2 General principles... 1 1.3 Index Commission... 1 1.4 Review of index
Optimization of Nurse Scheduling Problem with a Two-Stage Mathematical Programming Model
Asa Pacfc Managemen Revew 15(4) (2010) 503-516 Opmzaon of Nurse Schedulng Problem wh a Two-Sage Mahemacal Programmng Model Chang-Chun Tsa a,*, Cheng-Jung Lee b a Deparmen of Busness Admnsraon, Trans World
II. IMPACTS OF WIND POWER ON GRID OPERATIONS
IEEE Energy2030 Alana, Georga, USA 17-18 November 2008 Couplng Wnd Generaors wh eferrable Loads A. Papavaslou, and S. S. Oren UC Berkeley, eparmen of Indusral Engneerng and Operaons esearch, 4141 Echeverry
Distributed Load Balancing in a Multiple Server System by Shift-Invariant Protocol Sequences
03 IEEE Wreess Communcaons and Neorkng Conference (WCNC): NETWORS Dsrbued Load Baancng n a Mupe Server Sysem by Shf-Invaran rooco Sequences Yupeng Zhang and Wng Shng Wong Deparmen of Informaon Engneerng
Multiprocessor Systems-on-Chips
Par of: Muliprocessor Sysems-on-Chips Edied by: Ahmed Amine Jerraya and Wayne Wolf Morgan Kaufmann Publishers, 2005 2 Modeling Shared Resources Conex swiching implies overhead. On a processing elemen,
