Application Note CM L M icrocircuits COMMUNICATION SEMICONDUCTORS CMX866 Operation with Low-Level Commands AN/Telecom/866/Commands/1 January 2003 1 Introduction The CMX866 is a V.22bis modem IC that was designed to connect to off-the-shelf V.22bis-capable modems using industry standard “AT” commands. Special AT commands must be used to allow the CMX866 to perform low-level functions such as DTMF generation and programmable dual tone detection. The purpose of this application note is to describe how the CMX866 can be made to perform these types of functions. 1.1 Contents 1 Introduction ......................................................................................................... 1 1.1 Contents ...................................................................................................... 1 2 Examples ............................................................................................................ 1 2.1 DTMF Generation ........................................................................................ 2 2.2 DTMF Detection........................................................................................... 2 2.3 Programmable Tone Generation ................................................................. 3 2.4 Programmable Tone Detection .................................................................... 5 2.5 Use Of Hook Switch “AT” Command and the Effect On Impedance Presented To Telephone Line ................................................................................ 6 3 Conclusion .......................................................................................................... 6 2 Examples The CMX866 can be made to perform a variety of low-level functions with the use of special AT commands combined with user-defined register values. Once the desired function(s) has been resolved, the required CMX866 register contents can be determined. In general, these register contents are loaded into the CMX866 with special AT commands, and these commands will cause the desired operating mode to occur. The CMX866 shares internal register addresses and structure with the CMX868 (V.22bis modem IC without AT command set). Consequently, to determine the appropriate CMX866 register and setting for a particular operating condition, the CMX868 data sheet should be consulted. Data sheets for all CML products can be found at the following internet address: http://www.cmlmicro.com/products/datasheets/download.htm CMX866 Operation with Low-Level Commands Page 1 of 7 The following examples are intended to demonstrate how the CMX866 can be made to perform actions not associated with normal modem call establishment. Please consult the CMX866 and CMX868 data sheets while reviewing these examples. 2.1 DTMF Generation After the CMX866 has been successfully powered up, the CMX866 Transmit Mode register (address $E1) must be written to in order to generate a DTMF tone. This register is fully described in Section 1.5.10.3 of the CMX868 data sheet. The AT command “AT@Rxx=yy<CR>” should be used to write a value to a CMX866 register. The format for this command is: “xx” is the hexadecimal address of the desired register “yy” is the decimal equivalent of the desired register contents “<CR>” is a carriage return The following AT command demonstrates how the CMX866 can be configured to transmit a DTMF “2” character: AT@RE1=4114<CR> “E1” is the hexadecimal address for the CMX866 Transmit Mode register, and 4114d ($1012) represents the contents to be loaded into this register. Mapping the 4114d value to the description of the CMX868 Transmit Mode register indicates that the following actions will occur: DTMF/Tones generation mode selected (b15-12=0001) Tx gain of –10.5dB (b11-9=000) DTMF mode selected (b8-5=0000, b4=1) DTMF character “2” selected (b3-0=0010) The DTMF tone can then be observed on either the TXA or the TXAN pins of the CMX866. 2.2 DTMF Detection After the CMX866 has been successfully powered up, the CMX866 Receive Mode register (address $E2) must be written to in order to detect DTMF tones. This register is fully described in Section 1.5.10.4 of the CMX868 data sheet. The following AT command demonstrates how the CMX866 can be configured to detect DTMF tones: AT@RE2=8185<CR> “E2” is the hexadecimal address for the CMX866 Receive Mode register, and 8185d ($1FF9) represents the contents to be loaded into this register. Mapping the 8185d CMX866 Operation with Low-Level Commands Page 2 of 7 value to the description of the CMX868 Receive Mode register indicates that the following actions will occur: DTMF/Programmable Tone Pair/Answer Tone/Call Progress detection mode selected (b15-12=0001) 0dB internally provided Rx gain (b11-9=111) DTMF Tones detection mode (b2-0=001) (Note that b8-3 of the Receive Mode register are “don’t cares” for DTMF detection mode.) 2.3 Programmable Tone Generation After the CMX866 has been successfully powered up, both the CMX866 Transmit Mode register (address $E1) and the CMX866 Programming Register (address $E8) must be written to in order to generate user-defined tones. These registers are fully described in Sections 1.5.10.3 and 1.5.10.8 of the CMX868 data sheet. The CMX866 has the capability to generate single or dual user-defined tones. Four transmit “tone pairs” are provided in the CMX866 for programmable tone generation; TA, TB, TC, and TD. Information corresponding to the desired frequency and amplitude must be supplied for each tone of each desired tone pair, so frequency and amplitude information for eight different tones can be loaded into the CMX866. Formulas for calculation of register contents for various frequencies and amplitudes are provided in Section 1.5.10.8 of the CMX868 data sheet. The CMX866 Programming Register should only be written to when the Programming Flag bit of the CMX866 Status Register (address $E6) is 1. The act of writing to the Programming Register clears the Programming Flag bit. When the programming action is completed (normally within 150µs after writing to the Programming Register), the Programming Flag bit is set back to 1. Please review Section 1.5.10.8 of the CMX868 data sheet for more details concerning the loading of values into the CMX866 programming register. The CMX866 Status Register must be read to check the status of the Programming Flag bit, and this can be done with the following AT command: AT@RE6?<CR> A numeric result will be provided that represents the Status Register contents. The format of this response (decimal or hex) is determined by bit 4 of the S14 “S-register” in the CMX866. The selected tone pair (determined by the CMX866 Transmit Mode register) determines which tones are transmitted. When only one tone is to be generated, the frequency and amplitude values for the other tone of the pair should be set to 0. To summarize, the general approach is to: Determine the amplitude and frequency of the tone(s) you want to generate. Calculate the required coefficients to generate the tone(s) using the formulas in Section 1.5.10.8 of the CMX868 data sheet. Load those coefficients into the CMX866 Programming Register. CMX866 Operation with Low-Level Commands Page 3 of 7 Once this is done, the CMX866 Transmit Mode register should be loaded with a value that will select the Programmable Tone Generation mode and the desired “Tone Pair” to be generated. The following AT commands demonstrate how the CMX866 can be configured to transmit: a 400Hz tone @ 1Vrms. a 900Hz tone at 0.75Vrms. tone pair TA location selected. This example presumes the Programming Flag bit in the Status Register is set to 1 before writes are made to the Programming Register. AT@RE8=32768<CR> Resets the Programming Register increment pointer. AT@RE8=1366<CR> Selects 400Hz frequency for TA Tone 1. AT@RE8=18756<CR> Selects 1Vrms amplitude (at Vdd=5.0V) for TA Tone 1. AT@RE8=3073<CR> Selects 900Hz frequency for TA Tone 2. AT@RE8=14067<CR> Selects 0.75Vrms amplitude (at Vdd=5.0V) for TA Tone 2. (If no other tones are to be programmed, no further writes to the Programming Register are required.) Next, to configure the CMX866 transmit circuitry for Programmable Tone Generation mode: AT@RE1=4108<CR> “E1” is the hexadecimal address for the CMX866 Transmit Mode register, and 4108d ($100C) represents the contents to be loaded into this register. Mapping the 4108d value to the description of the CMX868 Transmit Mode register indicates that the following actions will occur: • DTMF/Tones mode (b15-12=0001) • -10.5dB internally provided Tx gain (b11-9=000) • Programmed Tone Pair mode (b8-5=0000, b4=0) • Tone Pair TA selected (b3-0=1100) The desired tone pair should now be observed on the TXA or TXAN output pins of the CMX866. CMX866 Operation with Low-Level Commands Page 4 of 7 2.4 Programmable Tone Detection After the CMX866 has been successfully powered up, both the CMX866 Receive Mode register (address $E2) and the CMX866 Programming Register (address $E8) must be written to in order to detect user-defined tones. These registers are fully described in Sections 1.5.10.4 and 1.5.10.8 of the CMX868 data sheet. The CMX866 has the capability to detect single or dual user-defined tones. The frequencies of these tones are derived by filter coefficients that are loaded into the CMX866 Programming Register. A Microsoft ExcelTM spreadsheet is available from the CML website that allows quick determination of the required filter coefficients for a variety of tone parameters. This spreadsheet can be obtained at the following internet address: http://www.cmlmicro.com/products/applications/868FL_1.htm There are two pairs of “biquads” in the programmable tone detectors, so under normal circumstances, the pole frequencies in the ExcelTM coefficient generating spreadsheet will be the same for Biquad A & B. For example, to determine coefficients for a 400Hz tone and a 1kHz tone, first load 400Hz into the “Pole Frequency” window for both Biquad A and Biquad B and record all of the coefficients. Next, load 1000Hz into both “Pole Frequency” windows and record those coefficients. Finally, load all of the coefficients for both the 400Hz and 1kHz tones into the CMX866 Programming Register in accordance with Section 1.5.10.8 of the CMX868 data sheet. The CMX866 Programming Register should only be written to when the Programming Flag bit of the CMX866 Status Register (address $E6) is 1. The act of writing to the Programming Register clears the Programming Flag bit. When the programming action is completed (normally within 150µs after writing to the Programming Register), the Programming Flag bit is set back to 1. Please review Section 1.5.10.8 of the CMX868 data sheet for more details concerning the loading of values into the CMX866 programming register. The CMX866 Status Register must be read to check the status of the Programming Flag bit, and this can be done with the following AT command: AT@RE6?<CR> A numeric result will be provided that represents the Status Register contents. The format of this response (decimal or hex) is determined by bit 4 of the CMX866 S14 “S-register”. To summarize, the general approach is to: Determine the tone(s) you want to detect. Calculate the required coefficients to generate the tone(s) using the Excel spreadsheet from the CML website (web location provided above). Load those coefficients into the CMX866 Programming Register. Once this is done, the CMX866 Receive Mode register should be loaded with a value that will select the Programmable Tone Detection mode. CMX866 Operation with Low-Level Commands Page 5 of 7 (NOTE: details concerning register writes for programmable tone detection are not provided due to the large number of writes (27) required for proper register configuration. The information provided in the “PROGRAMMABLE TONE GENERATION” section of this application note, coupled with the information in the CMX866 & CMX868 data sheets, should be sufficient to allow successful completion of this operation.) 2.5 Use Of Hook Switch “AT” Command and the Effect On Impedance Presented To Telephone Line The use of the “ATHx” hook switch command, when used on its own, does not allow the correct impedance to be presented to the telephone line because the CMX866 transmit amplifiers are not powered up with this command. Therefore, the following AT command should be used for going off-hook without automatically establishing a data connection with another modem: AT@RE0=4864<CR> “E0” is the hexadecimal address for the CMX866 General Control register, and 4864d ($1300) represents the contents to be loaded into this register. This command will establish: b15-13 reserved and set to 0 11.0592MHz crystal operation (b12=1) No loopback operation (b11=0) Equalizers enabled (b10=0) Relay drive pin pulled down to Vss (b9=1, this causes the off-hook condition) Device powered up normally (b8=1) Normal power operation (b7=0) IRQ pin disabled (b6=0) IRQ mask bits are all masked (b5-0=0) In normal operation where higher level commands are used (e.g. ATDTxyz…), the correct impedance is presented to the telephone line. 3 Conclusion The CMX866 is an AT-command-driven modem that was designed to easily connect to off-the-shelf V.22bis-capable modems. Special AT commands are required to enable the CMX866 to perform functions outside of those associated with normal modem call establishment. This document presented several examples that illustrate how the CMX866 can be made to perform these types of functions. CMX866 Operation with Low-Level Commands Page 6 of 7 CML does not assume any responsibility for the use of any circuitry described. No IPR or circuit patent licences are implied. CML reserves the right at any time without notice to change the said circuitry and this product specification. CML has a policy of testing every product shipped using calibrated test equipment to ensure compliance with this product specification. Specific testing of all circuit parameters is not necessarily performed. www.cmlmicro.com For FAQs see: http://www.cmlmicro.com/products/faqs/index.htm For a full data sheet listing see: http://www.cmlmicro.com/products/datasheets/download.htm For detailed application notes: http://www.cmlmicro.com/products/applications/index.htm Oval Park, Langford, Maldon, Essex, CM9 6WG - England. 4800 Bethania Station Road, Winston-Salem, NC 27105 - USA. No 2 Kallang Pudding Road, #09 to 05/06 Mactech Industrial Building, Singapore 349307 No. 218, Tian Mu Road West, Tower 1, Unit 1008, Shanghai Kerry Everbright City, Zhabei, Shanghai 200070, China. Tel: +44 (0)1621 875500 Tel: +65 67450426 Fax: +44 (0)1621 875600 Tel: +1 336 744 5050, 800 638 5577 Fax: +1 336 744 5054 Fax: +65 67452917 Tel: +86 21 63174107 +86 21 63178916 Fax: +86 21 63170243 Sales: [email protected] Sales: [email protected] Sales: [email protected] Sales: [email protected] Technical Support: [email protected] Technical Support: [email protected] Technical Support: [email protected] Technical Support: [email protected] CMX866 Operation with Low-Level Commands Page 7 of 7