Home

NSAM266SP Compact SPEECH Digital Speech Processor with Full

image

Contents

1. 88 790894 ben 41 38 3 533003 0543 129 1 AN ZN 5 135302 83128 Leu 01 L E i sna s 854 80 a 03 L5 8527 I a 91 1 790541 41 3813 LOAGOD QN9V aNov dis iui 55 189 M 954 00 y yo 2 792 45 2 86 Seu Day 1175223003 aNov 1 d QN9V 122 LN 155 z N 01 237 09 089 AY 1 N 7 080 253 2 d 2 Day lona www nat http 53 96 89852 33 1 lt gt lt 1704 gt 0 Vv M08 303 SM lt gt Appendix Continued 101 92 92 42 12 02 3 8 4 1 adeg adeg i 1 7 10 6 6 8 949 re ra 5 8109 ff eq od 5 LIE 5 1594 5 099 13538 99 93888400 A x01 T 2 198 7 082 ord 2 d YOGLLANN N 13534 a zz 15 H3TIOHLNOOOUOIN z E 54 http www national com 9 89821 33 11 LN T z 0218 L X91 14514 asd 19211 t 7 ost 294 294 QY2A33 Appendix Continued
2. Example SE Microcontroller 24 Byte sequence CompactSPEECH 24 Description Skip to end of current message SETD Set Time and Day time_and_day Sets the system time and day as specified by bits 0 13 in the 2 byte time parameter The day parameter is encoded as follows Bits 0 2 Day of the week 1 through 7 Bits 3 7 Hour of the day 0 through 23 Bits 8 13 Minute of the hour 0 through 59 Bits 14 15 These bits must be set to 1 If time day value is not valid ERR PARAM is set in the error word Example SETD 0 09 Microcontroller CompactSPEECH oF 09 Description Set time and day to Monday 1 30 AM Byte sequence 43 http www national com 2 0 Software Continued SF Skip Forward _ Skips forward in the current message time ength units each of 0 2s duration and causes message playback to pause time length is a 2 byte parameter that can have any value up to 320 i e 64s The skip accuracy is 5 This command is meaningful only in the PLAY state The RES command must be issued to continue playback If the end of the message is detected during execution of SF execution of the command is terminated the EV NORMAL END bit in the status register is set the MWRQST signal is activated and the CompactSPEECH Switches to the IDLE state If time Jength is greater than 320 ERR PARAM is set i
3. 5 of 59 ail 3 v ear v LET 24 ToN 150 Y eni 157 054 AOL 101 AOL 01 598 198 054 2 2 2 2 X 23 gt 7102 3 871 3 871 7OSNW 2 148442411 lt gt 0 lt 1 gt 08 39V3U3 LNI 35 lt 175 gt 109 4 N3097 H Y2M08 http www national com 55 http www national com 56 Physical Dimensions inches millimeters unless otherwise noted 23 6 0 2 TYP 20 0 0 1 17 6 0 2 TYP 14 0 0 1 1 8 0 5 0 1 0 65 TYP a SEE DETAIL A 09 120 Pees EUM i UT Nowe 152 0 2 0 8 0 1 PLANE 0 05 MIN 0 15 0 03 DETAIL A TYPICAL VLJ100A REV B 100 Pin Molded Plastic Quad Flatpak EIAJ Order Number NSAM266SPA VLJ NS Package Number VLJ100A 57 http www national com 0 006 0 950 0 000 0 15 0 PIN 1 IDENT 3 168 61 4 o 60 26 27 HHUHUHUHUHUHUUU 0 050 1 27 TYP 0 800 p TYP 20 32 LIFE SUPPORT POLICY 0 029 0 005 0 74 0 08 0 017 0 004 0 43 0 10 0 045 5 1 14 AAA A 0 910 0 020 23 1140 51 0 020 0 51
4. Description Announce the first sentence in the sentence table of the currently selected vocabulary SSM Set Speakerphone Mode mode Sets the speakerphone to the mode mode of operation The command is valid when the CompactSPEECH is in IDLE state mode can be one of 0 OFF Deactivate the speakerphone and return the Compact SPEECH to normal operation mode 1 ON Put the CompactSPEECH in speakerphone mode and ac tivate speakerphone in full duplex mode i e with full can cellation of both the acoustic and the electrical echoes Tone detectors are not active Gains in the Send and Receive paths are set by the relevant tunable parame ters 2 TRANSPARENT Activate the speakerphone with no echo cancellation This mode is used for system tuning 3 MUTE Activate speakerphone while generating silence on the line Tone detectors are not active 4 LISTEN The line is audible on the speaker Tone detectors are active Reserved RESTART Restart the current speakerphone mode This mode dif fers from ON it does not require full initialization of the speakerphone It should be used to resume the speaker phone operation after HOLD mode or to adjust to an envi ronment change e g parallel pickup 7 HOLD Stop the codec interrupts Neither side can hear each other Example SSM 1 Microcontroller 2F 01 CompactSPEECH 2F 01 Byte sequence Description Put the CompactSPEECH into Speakerphone mo
5. Microcontroller 23 00 19 CompactSPEECH 23 00 19 Byte sequence Description Skip back five seconds from the current position in the message being played SDET Set Detectors Mask detectors mask Controls the reporting of detection for tones and VOX ac cording to the value of the detectors mask parameter bit set to 1 in the mask enables the reporting of the corre sponding detector A bit cleared to 0 disables the reporting Disabling reporting of a detector does not stop or reset the detector The 1 byte detectors mask is encoded as follows Bit 0 Report detection of a busy tone Bit 1 Report detection of a dial tone Bits 2 4 Reserved Must be cleared to 0 Bit 5 Report detection of no energy VOX on the line The VOX attributes are specified with the tunable parameters TIME COUNT and VOX ENERGY LEVEL Bit 6 Report the ending of a detected DTMF Bit 7 Report the start of a detected DTMF up to 40 ms after detection start Example SDET A3 Microcontroller 10 A3 Byte sequence CompactSPEECH 10 Description Set reporting of all CompactSPEECH detectors except for end of DTMF SE Skip to End of Message This command is valid only in the PLAY state When in voked playback is suspended as for the PA command and a jump to the end of the message is performed Play back remains suspended after the jump
6. CDIN COON on 0 70 053 02 X D X DO X X 07 X D6 X D5 D4 X D3 X 02 X D X DO aes EIEIO TL EE 12868 7 FIGURE 1 6 Codec Protocol Short Frame CDOUT anaman aa an GJ is aman TL EE 12868 8 FIGURE 1 7 Codec Protocol Long Frame http www national com 1 0 Hardware Continued 1 3 SPECIFICATIONS 1 3 1 Absolute Maximum Ratings If Military Aerospace specified devices are required please contact the National Semiconductor Sales Office Distributors for availability and specifications All Input or Output Voltages with Respect to GND 0 5V to 6 5V Note Absolute maximum ratings indicate limits beyond which permanent damage may occur Continuous operation at these limits is not intended operation should be limited to those conditions specified below Storage Temperature Temperature under Bias 1 3 2 Electrical Characteristics TA 0 C to 70 C Voc 5V 10 GND OV 65 C to 150 C 0 C to 70 C Symbol Parameter Conditions Min Typ Max Units TTL Input 20 Voc Logical 1 Input Voltage 0 5 VIL TTL Input Logical 0 Input Voltage 0 5 0 8 V VxH CLKIN Input High Voltage External Clock 2
7. 5 3 TL EE 12868 21 FIGURE 1 20 Master MICROWIRE Timing http www national com 1 0 Hardware continued Tl T1 T2W1 T2W T2 T3 T3H Note and MWRQST Output Signal PABCh TL EE 12868 22 Note This cycle may be either TI idle T2 T3 or T3H FIGURE 1 21 Output Signal Timing for Port PB and MWRQST Xp Xn txi CLKIN TL EE 12868 23 FIGURE 1 22 CTTL and CLKIN Timing CTTL RESET TL EE 12868 24 FIGURE 1 23 Reset Timing When Reset is not at Power Up 4 5V RESET TL EE 12868 25 FIGURE 1 24 Reset Timing When Reset is at Power Up http www national com 20 2 0 Software 2 1 OVERVIEW The CompactSPEECH software resides in the on chip ROM It includes DSP based algorithms system support functions and a software interface to hardware peripherals 2 1 1 DSP based Algorithms Speech compression and decompression Full duplex speakerphone detector with echo canceler Energy based busy and dial tone detector Digital volume control 2 1 2 System Support Command interface to an external microcontroller Memory and message manager IVS support Tone generator Real time clock handler Power down mode support 2 1 3 Peripherals Support Serial flash interface Master MICRO
8. SIL THRESHOLD STEP Defines the adaptive threshold changes step If this threshold is too low the threshold converges too slowly If it is too high silence detection is too sensitive to any noise Legal values 3 to 48 12 SIL BURST THRESHOLD The minimum time period for speech detection during silence As this threshold increases the time period interpreted as silence increases If this threshold is too low a burst of noise is detected as speech If it is too high words may be partially cut off Legal values 1 to 3 SIL HANG THRESHOLD The minimum time period for silence detection during speech As this threshold increases the time period interpreted as silence decreases If this threshold is too low words may be partially cut off If itis too high silence is detected Legal values 8 to 31 15 SIL_ENABLE Silence compression control 0 turns silence compression off ENERGY__FACTOR Determines the energy level used to synthesize silence For the default value the energy levels of the synthesized silence and the recorded silence are the same If you divide multiply the default value by two the synthesized silence is 6 dB less more than the level of the recorded silence Legal values 1024 to 16384 8192 10 VOX ENERGY THRESHOLD This constant determines the minimum energy level at which voice is detected Below this level it is interpre
9. LEVEL 4 WMSG Write Message data Writes 32 bytes of data from the current position of the mes sage pointer and advances the message pointer by 32 bytes If the CompactSPEECH is in the IDLE state the command opens the current message switches the CompactSPEECH to the MSG__OPEN state sets the message pointer to the beginning of the message data and writes the 32 bytes of data WMSG 32 bytes 32 bytes of Microcontroller 31 yes Byte sequence data to write ho 32 byt CompactSPEECH 210 v Pyles of data Description Create a message with tag 01 and write 32 bytes in the message memory WRAM Write Memory tag data This command exists for compatibility only Use WMSG in stead http www national com 50 Appendix A SCHEMATIC DIAGRAMS The following schematic diagrams are extracted from a CompactSPEECH demo unit based on the NSV AM266 SPAF board designed by National Semiconductor This demo includes three basic clusters COP888EEG Microcontroller CompactSPEECH cluster including two TP3054 codec and an NSAM266SP controlling a Serial Flash device lt 18 0 gt 0 lt 7 0 gt 16 17 18 14 0 lt 0 gt 15 D lt 1 gt 16 D lt 2 gt 18 D lt 3 gt 20 0 lt 4 gt 21 0 lt 5 gt 22 0 lt 6 gt 23 D lt 7 gt 32 lt 16 gt 51 50 D1 D2 D3 D4 DS D6 D7 PBO PB1 PB2 COMPACTSPEECH
10. SEATING PLANE MIN TYP 0 10540 015 Physical Dimensions inches millimeters unless otherwise noted Continued TYP 2 67 0 38 0 165 0 180 4 19 4 57 TYP o 004 0 10 68 Pin Plastic Leaded Chip Carrier V Order Number NSAM266SPA V NS Package Number V68A 0 990 0 005 25 15 0 13 0 045 45 X V68A REV J NATIONAL S PRODUCTS ARE NOT AUTHORIZED FOR USE AS CRITICAL COMPONENTS IN LIFE SUPPORT DEVICES OR SYSTEMS WITHOUT THE EXPRESS WRITTEN APPROVAL OF THE PRESIDENT OF NATIONAL NSAM266SP CompactSPEECH Digital Speech Processor with Full Duplex Speakerphone SEMICONDUCTOR CORPORATION As used herein 1 Life support devices or systems are devices or systems which a are intended for surgical implant into the body or b support or sustain life and whose failure to perform when properly used in accordance with instructions for use provided in the labeling can be reasonably expected to result in a significant injury to the user 2 A critical component is any component of a life support device or system whose failure to perform can be reasonably expected to cause the failure of the life support device or system or to affect its safety or effectiveness National Semiconductor Europe National Semiconductor Corporation 9 http www national com Arlington TX 76017 Tel 1 800 272 9959 Fax 1 800 737 7018 1111 West Bardin Road Fax 49 0 180 530 85 86 Emai
11. 1 5 gt gt gt gt gt gt gt gt gt gt gt W W u u a W The bits in the status word are used as follows EV_DTMF_DIGIT DTMF digit A value indicating a detected DTMF digit See the description of DTMF code in the GT command DTMF END 1 Ended detection of a DTMF tone The detected digit is held in EV_DTMF_DIGIT EV NORMAL END 1 Normal completion of operation e g end of message playback EV_MEMFULL 1 Memory is full 1 Error detected the last command You must issue the GEW command to return the error code and clear the error condition BUSY 1 Busy tone detected Use this indicator for call progress and line disconnection EV_MEMLOW 1 Not enough memory See CMSG command for futher detail 1 Dial tone detected Use this indicator for call progress and line disconnection 1 period of silence energy was detected on the telephone line during recording See VOX_TIME_ COUNT in Table 2 2 5 When the CompactSPEECH completes its power up se quence and enters the RESET state this bit is set to 1 and the MWRQST signal is activated cleared to 0 Normally this bit changes to O after performing the INIT command If this bit is set during normal operation of the CompactSPEECH it
12. 6 lt 6 gt 68 3 CDOUT 45 00 lt 4 1 gt MW lt 5 0 gt R12 R13 10k 10k 10k User interface that includes one 16 digit LCD and a 16 key 4 x 4 keypad For more details about the demo please refer to the NS Digital Answering Machine Demo Operating Instructions Note If IVS resides in serial flash and in ROM the address and data line connections are not required and the layout is much simpler TL EE 12868 32 MEMCTL lt 10 0 gt 11 MMDOUT 64 MMCLK 12 MMDIN NOT CONNECTED LEAVE IT OPEN T p 8 E E A 19 0319 43557 5 EENEN oa Le zz M Be rad 318 355 8 51 http www national com 8982 1 44 11 Appendix A Continued lt gt 0 81 9 lt 9 gt 0 lt 1 gt 0 16 OVOVEZAN 0701 TILININ OF0OZZ NN 078 SAI 5 14 935 52 http www national com v 8982L 33 1ll Appendix A Continued QN9 LN 9d Sd d 14 941415 3421 ay Oy 0341 0 LON 189 0 08 23000 16350 183 04 1 93000 AV v NOV A 94 Sd td d 54 941815 Day ay 01 823 ON9V TWNOILdO A depo euoudjexeeds 135813 8 38 80 854
13. QN vationat Semiconduc General Description The NSAM266SP is a member of National Semiconductor s CompactSPEECH Digital Speech Processor family This processor provides Digital Answering Machine DAM func tionality to embedded systems The CompactSPEECH interfaces with National Semicon ductor s NM29A040 and NM29A080 Serial Flash memory devices to provide a cost effective solution for DAM and Cordless DAM CDAM applications The CompactSPEECH processor integrates the functions of a traditional Digital Signal Processing DSP chip and the CR16A a 16 bit general purpose RISC core implementation of the CompactRISC architecture It contains system sup port functions such as Interrupt Control Unit Codec inter face MICROWIRE interfaces to a microcontroller and Serial Flash WATCHDOG timer and a Clock Generator The CompactSPEECH processor operates as a slave pe ripheral that is controlled by an external microcontroller via a serial MICROWIRE interface In a typical DAM environ ment the microcontroller controls the analog circuits but tons and display and activates the CompactSPEECH by sending it commands The CompactSPEECH processor ex ecutes the commands and returns status information to the microcontroller PRELIMINARY 107 October 1996 NSAM266SP CompactSPEECH Digital Speech Processor with Full Duplex Speakerphone The CompactSPEECH firmware implements voice compres sion and decompression tone detec
14. The MWRDY signal is activated cleared to 0 after reset and after a protocol time out See Section 2 13 2 The MWRQST signal is used as follows 1 The MWRGST signal is activated cleared to 0 when the status word is changed 2 The MWRQST signal remains active 0 until the CompactSPEECH receives a GSW command Figure 2 4 illustrates the sequence of activities during a MICROWIRE data transfer 2 13 2 Interface Protocol Error Handling Interface Protocol Time Outs Depending on the CompactSPEECH s state if more than 20 ms 30 ms elapse between two consecutive byte trans missions or two byte receptions within the same command or return value after the MWRDY signal is asserted a time out event occurs and the CompactSPEECH responds as follows Sets the error bit in the status word to 1 Sets the TIMEOUT bit in the error word to 1 Activates the MWRQST signal clears it to 0 Activates the MWRDY signal clears it to 0 Waits for a new command After a time out occurs the microcontroller must wait at least four milliseconds before issuing the next command E Echo Mechanism The CompactSPEECH echoes back to the microcontroller all the bits received by the CompactSPEECH Upon detec tion of an error in the echo the microcontroller should stop the protocol clock which eventually causes a time out error i e ERR__TIMEOUT bit is set in the error word Note When a command has a return value
15. 51 CDOUT TL EE 12868 16 FIGURE 1 15 Codec Short Frame Timing SXterp 5 CTTL CCLK CFS0 51 CDOUT CDIN TL EE 12868 17 FIGURE 1 16 Codec Long Frame Timing 17 http www national com 1 0 Hardware continued CTTL A0 15 EMCS D0 7 MWDIN MWDOUT MWCS MWRDY Note 1 Note 2 Note 1 This cycle may be either TI Idle T3 or T3H Note 2 Data can be driven by an external device at T2W1 T2W T2 and T3 Note 3 This cycle may be either TI Idle or T1 FIGURE 1 17 ROM Read Cycle Timing tuwckp gt tuweLkh gt Note 3 uwcsh gt 5 gt TL EE 12868 18 uWRDYa TL EE 12868 19 FIGURE 1 18 MICROWIRE Transaction Timing Data Transmitted to Output http www national com 18 1 0 Hardware continued MWCLK MWCLKs tuweLkh gt MWDIN MWDOUT gt MWRDY TL EE 12868 20 FIGURE 1 19 MICROWIRE Transaction Timing Data Echoed to Output tetp 3
16. Line Cedec TL EE 12868 1 CompactSPEECH CompactRISCTM COPSTM Microcontrollers HPCTM MICROWIRETM MICROWIRE PLUSTM and WATCHDOG are trademarks of National Semiconductor Corporation 1996 National Semiconductor Corporation TL EE12868 RRD B30M116 Printed in U S A http www national com euoudaexeeds 4905993044 u eeds 1 HOFAdSWedWOD dS99ZINVSN Features W Designed around the CR16A a 16 bit general purpose RISC core implementation of the CompactRISC archi tecture 16 bit architecture and implementation 20 48 MHz operation On chip DSP Module DSPM for high speed DSP operations On chip codec clock generation and interface Power down mode Digital full duplex speakerphone Acoustic echo cancellation Line echo cancellation Digital volume control for the speaker Microphone MUTE mode with smooth switching be tween normal and mute modes Continuous on the fly monitoring of external acoustic and line and internal conditions provides high quality hands free conversation in a changing environment W No microcontroller control needed for the speaker phone operation W No need for a special signal to train the echo cancelers W No need for special hardware circuits Selectable speech compression rate of 5 2 kbit s or 7 3 kbit s with silence compression W Up to 16 minutes recording on a 4 Mbit Serial Flash more than 1 hour total recording time on four devices W
17. OGMs mailboxes and the ability to distinguish between InComing Messages ICMs and OGMs 25 http www national com 2 0 Software continued A message is the basic unit on which most of the Compact SPEECH commands operate A CompactSPEECH mes sage stored on a flash device can be regarded as a com puter file stored on a mass storage device A message is created with either the R or the command When a message is created it is assigned a time and day stamp and a message tag which can be read by the micro controller The R command takes voice samples from the codec com presses them and stores them in the message memory When a message is created with the CMSG command the data to be recorded is provided by the microcontroller via the WMSG Write Message command and not via the co dec The data is transferred directly to the message memo ry It is not compressed by the CompactSPEECH voice compression algorithm WMSG RMSG Read Message and SMSG Seek Mes sage are a complete set of message data access com mands that can be used to store and read data to from any location in the message memory see Section 2 15 for more details about these commands Using these commands messages can be used by the microcontroller to implement such features as a Telephone Directory A message can be played back P command and deleted DM command Redundant data e g trailing tones or si lence can be removed
18. and Expansion Memory Chip Select EMCS controls The number of extended address pins to use may vary depending on the size and configuration of the ROM Reading from Expansion Memory An Expansion Memory read bus cycle starts at T1 when the data bus is in TRI STATES and the address is driven on the address bus EMCS is asserted cleared to 0 on a T2W1 cycle This cycle is followed by three T2W cycles and one T2 cycle The CompactSPEECH samples data at the end of the T2 cycle The transaction is terminated at T3 when EMCS becomes inactive set to 1 The address remains valid until T3 is complete A T3H cycle is added after the cycle The address remains valid until the end of T3H 1 2 6 Codec Interface The CompactSPEECH provides an on chip interface to two serial codecs This interface supports codec operation in long or short frame formats The format is selected with the CFG command The codec interface uses five signals CDIN CDOUT CCLK CFSO and CFS1 The CDIN input pin and the CDOUT CCLK and CFSO output pins are connected to the first codec The second codec is connected to CDIN CDOUT CCLK and the CFS1 output pin Data is transferred to the codec through the CDOUT pin Data is read from the codec through the CDIN pin Short Frame Protocol When short frame protocol is configured eight data bits are exchanged with each codec in each frame i e CFSO cycle Data transfer starts when CFSO is set to 1 for one CC
19. return value is meaningful only if one of the tone detec tors is enabled bits 0 1 of the detectors mask see the description of SDET command The return value is unpredictable for any other value of item Example 610 Microcontroller 25 00 AA AA Byte sequence CompactSPEECH 25 00 00 06 Description Get the duration of the last detected DTMF tone The CompactSPEECH responds 60 ms GL Get Length Returns the length of the current message in multiples of 32 bytes The returned value includes the message directory informa tion 64 bytes for the first block and 32 bytes for every other block message data and the entire last block of the mes sage even if the message occupies only a portion of the last block Since a flash block includes 4096 bytes the re turned length may be bigger than the actual message length by up to 4095 bytes The minimum length of a message is one block i e an empty message occupies 4 kbytes the message length is 4096 32 128 Example GL Microcontroller 19 Byte sequence CompactSPEECH 19 02 00 Description Get the length of the current message The CompactSPEECH responds 512 i e the message occupies 16384 512 32 bytes GMS Get Memory Status type Returns the estimated total remaining recording time in sec onds as a 16 bit unsigned integer This estimate assumes 5 2 kbit s with no silence
20. 0 V VXL CLKIN Input Low Voltage External Clock 0 8 V VENVh ENVO High Level Input Voltage 3 6 V Vuh CMOS Input with Hysteresis 3 6 V Logical 1 Input Voltage CMOS Input with Hysteresis 1 1 Logical 0 Input Voltage VHys Hysteresis Loop Width Note A 0 5 V Logical 1 TTL Output Voltage 0 4 mA 2 4 V VoHwC MMCLK MMDOUT and EMCS 0 4 mA 2 4 V Logical 1 Output Voltage 50 pA Note Voc 0 2 V VoL Logical 0 TTL Output Voltage lol 4 0 45 V lo 80 pA Note 0 2 V VoL wc MMCLK MMDOUT and EMCS loi 4 0 mA 0 45 V Logical 0 Output Voltage 01 50 pA Note B 0 2 V IL Input Load Current Note C OV lt Vin lt 5 0 5 0 pA lo Off Output Leakage Current OV lt Vout Voc 250 50 I O Pins in Input Mode Note Active Supply Current Normal Operation Mode Running Speech Applications Note D mA lcc2 Standby Supply Current Normal Operation Mode 40 0 mA DSPM Idle Note D lcca Power Down Mode Power Down Mode 15 PRA Supply Current Notes D and E 1 and X2 Capacitance Note A 17 0 pF Note A Guaranteed by design Note B Measured in power down mode The total current driven or sourced by all the CompactSPEECH s output signals is lt 50 uA Note C Maximum 20 pA for all pins together Note D lout 0 TA 25 C operating from 40 96 MHz crystal and running from internal memory with
21. 2 TONE GENERATION The CompactSPEECH can generate DTMF tones and sin gle frequency tones from 300 Hz to 3000 Hz in increments of 100 Hz CompactSPEECH tone generation conforms to the EIA 470 RS standard Note however that you may have to change the value of some tunable parameters in order to meet the standard specifications since the energy level of generated tones depends on the analog circuits being used Tone generation is possible in both normal and speaker phone modes to support dialing while in speakerphone mode 9 Tune the DTMF TWIST LEVEL parameter to control the twist level of the generated DTMF tones Use the VC command and tune the TONE GENERATION LEVEL parameter to control the energy level at which these tones are generated Use the GT command to specify the DTMF tones and the frequency at which single tones are generated 10 A 5 20 E 6 301 40 200 400 600 800 1000 1200 1400 1600 1800 2000 Frequency Hz TL EE 12868 26 FIGURE 2 1 Busy and Dial Tone Band Pass Filter Frequency Response 5 5 5 TL EE 12868 27 51 Eg lt 90 1 3 lt 90 90 lt Ej lt 1650 65 lt 8 lt 1250 ms FIGURE 2 2 Busy Tone Detector Cadence Specification 27 http www national com 2 0 Software continued 2 9 FULL DUPLEX SPEAKERPHONE The speakerphone feature enables the us
22. CompactSPEECH is busy reading the byte writing the next byte or executing the received command after the last pa rameter has been received MWRDY is cleared to 0 after reset For proper operation after a hardware reset this signal should be pulled up MWRQST MICROWIRE Request When active 0 this signal indicates that new status information is available MWRQST is deacti vated set to 1 after the CompactSPEECH receives a GSW Get Status Word command from the microcontroller After reset this signal is active 0 to indicate that a reset oc curred MWRQST unlike all the signals of the communica tion protocol is an asynchronous line that is controlled by the CompactSPEECH firmware 2 13 1 Signal Use in the Interface Protocol After reset both MWRQST and MWRDY are cleared to 0 The MWRQST signal is activated to indicate that a reset occurred The RESET bit in the status register is used to indicate a reset condition The GSW command should be issued after reset to verify that the EV RESET event occurred and to deactivate the MWRQGST signal While the MWCS signal is active 0 the CompactSPEECH reads data from MWDIN on every rising edge of MWCLK CompactSPEECH also writes every bit back to MWDOUT This bit is either the same bit which was read from MWDIN in this case it is written back as a synchronization echo after some propagation delay or it is a bit of a value the CompactSPEECH transmits to the microco
23. Day time_day__option Returns the time and day as a 2 byte value time__day__ option may be one of the following 0 Get the system time and day 1 Get the current message time and day stamp Any other time day option returns the time and day stamp of the current message Time of day is encoded as follows Bits 0 2 Day of the week 1 through 7 Bits 3 7 Hour of the day 0 through 23 Bits 8 13 Minute of the hour 0 through 59 Bits 14 15 00 The time was not set before the current message was recorded 11 The time was set i e the SETD Set Time of Day command was executed Note the current message is undefined and time day option is 1 an INVALID error is reported Example GTD 1 Microcontroller 01 AA AA CompactSPEECH 01 E8 29 Byte sequence Description Get the current message time and day stamp The CompactSPEECH responds that the message was created on the first day of the week at 5 40 AM The return value also indicates that the SETD command was used to set the system time and day before the message was recorded Note If the SAS command is used to announce the time and day stamp Monday is announced as the first day of the week For an external vocabulary the announcement depends on the vocabulary definition See the VS User s Manual for more details GTM Get Tagged Message fag tag mask dir Selects the current mess
24. For any load on the ENVO pin the voltage should not drop below VENvh If the load on the ENVO pin causes the current to exceed 10 uA use an external pull up resistor to keep the pin at 1 Figure 1 3 shows a recommended circuit for generating a reset signal when the power is turned on CompactSPEECH RESET TL EE 12868 4 FIGURE 1 3 Recommended Power On Reset Circuit 1 2 2 Clocking The CompactSPEECH provides an internal oscillator that interacts with an external clock source through the X1 and X2 CLKIN pins Either an external single phase clock sig nal or a crystal oscillator may be used as the clock source External Single Phase Clock Signal If an external single phase clock source is used it should be connected to the CLKIN signal as shown in Figure 1 4 and should conform to the voltage level requirements for CLKIN stated in Section 1 3 2 CompactSPEECH 1 X2 CLKIN Single Phase Clock Signal Clock Generator TL EE 12868 5 FIGURE 1 4 External Clock Source Crystal Oscillator A crystal oscillator is connected to the on chip oscillator circuit via the X1 and X2 signals as shown in Figure 1 5 CompactSPEECH C1 Crystal Oscillator i TL EE 12868 6 FIGURE 1 5 Connections for an External Crystal Oscillator Keep stray capacitance and inductance in the oscillator cir cuit as low as possible The crystal resonator and the ex ternal components should be as close t
25. ICMs in a DAM environment It is more pleasant to the human ear to hear them both in the same quality Sometimes compactness and high quality are not enough There should be a simple and flexible interface to access the vocabulary el ements Not only the vocabulary but also the code to access it should be compact When designing for a multi lingual environ ment there are more issues to consider Each vocabulary should be able to handle language specific structures and designed in a cooperative way with the other vocabularies so that the code to access each vocabulary is the same When you use the command to synthesize the sentence Monday 12 30 PM you should not care in what language it is go ing to be played back Vocabulary recording Vocabulary access 2 10 3 IVS Vocabulary Components This section describes the basic concept of an IVS vocabu lary its components and the relationships between them The basic An IVS vocabulary consists of words sen concepts tences and special codes that control the behavior of the algorithm which Compact SPEECH uses to synthesize sentences The words are the basic units in the vocab ulary You create synthesized sentences by combining words in the vocabulary Each word in the vocabulary is given an index which identifies it in the word table Note that depending on the language structures and sentences that you wish to synthesize you may need to record some words more th
26. If you divide multiply the value by 2 you get a 3 dB decrease increase in the threshold The mapping between energy level and the parameter value is as follows results were measured on the codec output when a 400 Hz tone was injected to the codec input Tunable value Energy threshold dB V 10 31 8 20 28 6 100 21 7 500 14 7 8000 2 5 Legal values 0 to 65535 160 20 TONE OFF ENERGY THRESHOLD Maximum energy level at which busy and dial tones are detected as OFF after 700 Hz filtering If you divide multiply the value by 2 you get a 3 dB decrease increase in the threshold The mapping between energy level and the parameter value is the same as for THRESHOLD Legal values 0 to 65535 110 21 VCD LEVEL Controls the energy during playback and external voice synthesis Each unit represents 3 dB The default level is the reference level For example if you set this parameter to 4 the energy level is 6 dB less than the default level The actual output level is the sum of VCD LEVEL and the VOL LEVEL variable controlled by the VC command Speech is distorted when the level is set too high Legal values 0 VCD LEVEL VOL LEVEL x 12 22 VOX TOLERANCE TIME Controls the maximum energy period in 10 ms units that does NOT reset the vox detector Legal values 0 to 255 23 MIN BUSY DETECT TIME Minimum time period for bus
27. all messages whose message tags match the fag ref parameter Only bits set in fag mask are compared i e a match is considered successful if message tag and fag fask fag ref and mask where and is a bitwise AND operation After the command completes execution the current mes sage is undefined Use the GTM command to select a mes sage to be the current message The memory space released by the deleted message is im mediately available for recording new messages Byte sequence http www national com 36 2 0 Software continued Example DMS FFC2 003F 0B 0B FF FF C2 00 C2 00 3F 3F Microcontroller CompactSPEECH Byte sequence Description Delete all old incoming messages from mailbox Number 2 in a system where the message tag is encoded as follows Bits 0 2 mailbox ID 8 mailboxes indexed 0 to 7 Bit 3 new old message indicator 0 Message is old 1 Message is new Bits 4 5 message type 00 ICM memo 01 OGM 10 Call transfer message Bits 6 15 not used Note The description of the tag is an example only All bits of the tag are user definable GCFG Get Configuration Value Returns a sequence of two bytes with the following informa tion Bits 0 7 Magic number which specifies the Compact SPEECH firmware version Bits 8 9 Memory type 00 Reserved 01 Reserved 10 Serial Flash 11 Reserved The command should
28. be used together with the CFG and INIT commands during CompactSPEECH initialization See the CFG command for more details and an example of a typical initialization sequence Example GCFG Microcontroller 02 AA CompactSPEECH 02 02 01 Byte sequence Description Get the CompactSPEECH magic number The CompactSPEECH responds that it is Version 1 with Serial Flash GEW Get Error Word Returns the 2 byte error word THE ERROR WORD The 16 bit error word indicates errors that occurred during execution of the last command If an error is detected the command is not processed the ERROR bit the status word is set to 1 and the MWRQST signal is activated set to low The GEW command reads the error word The error word is cleared during reset and after execution of the GEW com mand If errors ERR COMMAND or ERR__PARAM occur during the execution of a command that has a return value the return value is undefined The microcontroller must still read the return value to ensure proper synchronization 15 9 8 7 6 5 4 3 2 1 0 2 2 8 20518 2 9 41413 11111 o 6 a tr The bits of the error word are used as follows ERR Illegal opcode The command opcode is not recognized by the CompactSPEECH ERR COMMAND Ill
29. compression a real recording may be longer according to the amount of silence detected and compressed The return value is dependent on the value of the type pa rameter as follows 0 The remaining recording time is returned 1 Returns 0 For compatibility only 2 Same as 0 For compatibility only The return value is unpredictable for any other value of type Example GMS 0 Microcontroller 12 00 AA Byte sequence CompactSPEECH 12 00 01 40 Description Return the remaining recording time The CompactSPEECH responds 320 seconds GMT Get Message Tag Returns the 16 bit tag associated with the current message If the current message is undefined ERR VALID is report ed Example GMT Microcontroller 04 AA CompactSPEECH 04 00 AA Byte sequence Description Get the current message tag In system where the message tag is encoded as described in the DMS command the CompactSPEECH return value indicates that the message is a new ICM in mailbox Number 6 GNM Get Number of Messages fag tag mask Returns the number of messages whose message tags match the fag ref parameter Only bits set in fag mask are compared i e a match is considered successful if message tag and lag mask tag ref and tag mask where and is a bitwise AND operation The ref and tag mask parameters are each two byt
30. from the message tail with the CMT Cut Message Tail command The PA Pause and RES Resume commands respective ly temporarily suspend the P and R commands and then allow them to resume execution from where they were sus pended CURRENT MESSAGE Most message handling commands e g P DM RMSG op erate on the current message The GTM Get Tagged Mes sage command selects the current message Deleting the current message does not cause a different message to become current The current message is unde fined If however you issue the GTM command to skip to the next message the first message that is newer than the just deleted message is selected as the current message 2 6 1 Message Tag Each message has a 2 byte message tag which you can use to categorize messages and implement such features as OutGoing Messages mailboxes and different handling of old and new messages The most significant bit of the message tag bit 15 is used to indicate the speech compression rate The microcontrol ler should program it before recording 1 for 4 8 kbit s 0 for 6 6 kbit s The CompactSPEECH reads the bit be fore message playback to select the appropriate decom pression algorithm The GMT Get Message Tag and SMT commands may be used to handle message tags Note Message tag bits can only be cleared Message tag bits are set only when a message is first created This limitation is inherent in flash memories whi
31. gt lt lt gt gt yn Note Pins marked NC should not be connected FIGURE 1 2 100 PQFP Package Connection Diagram TL EE 12868 3 http www national com 6 1 0 Hardware Continued 1 2 FUNCTIONAL DESCRIPTION This section provides details of the functional characteris tics of the CompactSPEECH processor It is divided into the following sections Resetting Clocking Power down Mode Power and Grounding Memory Interface Codec Interface 1 2 1 Resetting The RESET pin is used to reset the CompactSPEECH proc essor On application of power RESET must be held low for at least tpwr after is stable This ensures that all on chip voltages are completely stable before operation Whenever RESET is applied it must also remain active for not less than trast During this period and for 100 us after the TST signal must be high This can be done with a pull up resistor on the TST pin The value of MWRDY is undefined during the reset period and for 100 us after The microcontroller should either wait before polling the signal for the first time or the signal should be pulled high during this period Upon reset the ENVO signal is sampled to determine the operating environment During reset the EMCS ENVO pin is used for the ENVO input signals An internal pull up resistor sets ENVO to 1 After reset the same pin is used for EMCS System Load on ENVO
32. indicates an internal CompactSPEECH error The microcontroller can recover from such an error by re initializing the system EV_DTMF 1 Started detection of a DTMF tone Example GSW Microcontroller 14 AA CompactSPEECH 14 00 40 Get the CompactSPEECH Status Word typically sent after the MMRQST signal is asserted by the CompactSPEECH which indicates a change in the status word The CompactSPEECH responds that the memory is full Byte sequence Description GT Generate Tone fone Generates the tone specified by the 1 byte fone parameter until an S command is received Specify the tone by setting the bits of tone as follows Bit 0 1 Bits 1 4 DTMF code Where the DTMF code is encoded as follows Value Hex Digit 0 to 9 0109 B D B E D 39 http www national com 2 0 Software continued Bits5 7 0 To generate a single frequency tone encode the bits as follows 8 0 0 Bits 1 5 3 30 The value in bits 1 5 is multiplied by 100 to generate the required frequency 300 Hz 3000 Hz Bits6 7 0 The CompactSPEECH does not check for the validity of the tone specification Invalid specifi cation yields unpredictable results Example GT 0D20 Microcontroller OD 20 Byte sequence CompactSPEECH 0D 20 Description Generate a single frequency 1600 Hz tone GTD Get Time and
33. indicates errors that occurred during execution of the last command If an error is detected the command is not processed the ERROR bit in the status word is set to 1 and the MWRQST signal is activat ed ERROR HANDLING When the microcontroller detects that the MWRQST signal is active it should issue the GSW Get Status Word com mand which deactivates the MWRQST signal Then it should test the ERROR bit in the status word if it is set send the GEW Get Error Word command to read the error word for details of the error For a detailed description of each of the CompactSPEECH commands see Section 2 15 2 5 TUNABLE PARAMETERS The CompactSPEECH processor can be adjusted to your system s requirements For this purpose the Compact SPEECH supports a set of tunable parameters which are set to their default values after reset and can be later modi fied with the TUNE command By tuning these parameters you can control various aspects of the CompactSPEECH s operation such as silence compression tone detection no energy detection etc Table 2 2 describes all the tunable parameters in detail Section 2 15 describes the TUNE command 2 6 MESSAGES The CompactSPEECH message manager supports a wide range of applications which require different levels of DAM functionality The message organization scheme and the message tag support advanced memory organization features such as multiple OutGoing Messages
34. mode 1 2 4 Power and Grounding The CompactSPEECH processor requires a single 5V pow er supply applied to the Vcc pins The grounding connections are made on the GND pins For optimal noise immunity the power and ground pins should be connected to Vcc and the ground planes respec tively on the printed circuit board If and the ground planes are not used single conductors should be run direct ly from each Vcc pin to a power point and from each GND pin to a ground point Avoid daisy chained connections Use decoupling capacitors to keep the noise level to a mini mum Attach standard 0 1 wF ceramic capacitors to the Vcc and GND pins as close as possible to the Compact SPEECH When you build a prototype using wire wrap or other meth ods solder the capacitors directly to the power pins of the CompactSPEECH socket or as close as possible with very short leads 1 2 5 Memory Interface Serial Flash Interface The CompactSPEECH supports up to four NM29A040 4 Mbit or up to two NM29A080 8 Mbit serial flash memory devices for storing messages NM29A040 The NM29A040 is organized as 128 blocks of 128 pages each containing 32 bytes A block is the smallest unit that can be erased and is 4 kbytes in size Not all 128 blocks are available for recording Up to 10 blocks may contain bad bits and one block is write once and holds the locations of these unusable blocks For further information about the NM29A
35. ported See the Quick Reference Tables in Section 2 2 The CompactSPEECH may be in one of the following states RESET The CompactSPEECH is initialized to this state after a full hardware reset by the RESET signal see Section 1 3 CompactSPEECH detectors VOX call progress tones and DTMF tones are not active In all other states the detec tors are active See the SDET and RDET commands for further details IDLE This is the state from which most commands are executed As soon as a command and all its parameters are received the CompactSPEECH starts executing the command PLAY In this state a message is decompressed and played back RECORD In this state a message is compressed and recorded into the message memory SYNTHESIS An individual word or a sentence is synthesized from an external vocabulary GENERATE The CompactSPEECH generates single or DTMF tones MSG The CompactSPEECH either reads or writes 32 bytes from or to the message memory or sets the message Read Write pointer on a 32 byte boundary After receiving an asynchronous command see Section 2 4 such as P Playback R Record SW Say Words or GT Generate Tone the CompactSPEECH switches to the appropriate state and executes the command until it is com pleted or an S Stop or PA Pause command is received from the microcontroller When an asynchronous command execution is completed the EV NORMAL END event is
36. speak erphone with one command The resolution is 3 dB The actual output level is composed of the tunable level variable plus the evel The valid range for the actual output level of each output generator is defined in Table 2 2 For example if the tunable variable LEVEL is 6 and vol is 2 then the output level equals VOD LEVEL vol level 4 Example 04 Microcontroller 28 04 CompactSPEECH 28 04 Byte sequence The command can lengthen a new message i e a message which was just created with the CMSG command but was not yet closed by the S command If this is the case and if the message pointer points to the end of the last block used by the message and WMSG command is issued the mes sage length increases by 4 kbytes If the memory becomes full EV MEMFULL is set in the status word and the Com pactSPEECH switches to the IDLE state Trying to lengthen an existing message i e a message that was already closed causes the CompactSPEECH to set the NORMAL END event in the status word and switch to the IDLE state The microcontroller must issue an S command to close the message and switch the CompactSPEECH to the IDLE state Notes When updating an existing message bits can only be cleared but not set If the current message is undefined ERR INVALID is reported Example Description Set the volume level to
37. the CompactSPEECH transmits bytes of the return value instead of the echo value MWCLK Bit 7 Out p 1 D V The CompactSPEECH transmits a byte as an echo when it receives the value OxAA from the microprocessor Upon de tection of an error the CompactSPEECH activates the MWRGST signal and sets the ERR COMM bit in the error word 2 14 THE MASTER MICROWIRE INTERFACE The CompactSPEECH s Master MICROWIRE controller im plements the MICROWIRE PLUS interface in master mode It enables the CompactSPEECH to control flash devices Several devices may share the Master MICROWIRE chan nel This can be implemented by connecting device selec tion signals to general purpose output ports 2 14 1 Master MICROWIRE Data Transfer The Signals The Master MICROWIRE controller s signals are the Master MICROWIRE serial CLocK MMCLK the Master MICRO WIRE serial Data OUT MMDOUT signal and the Master MICROWIRE serial Data In MMDIN signal The Master MICROWIRE controller can handle up to four flash devices The CompactSPEECH uses the signals CS0 CSS3 as required for the number of devices in use as device chip select signals The Clock for Master MICROWIRE Data Transfer Before data can be transferred the transfer rate must be determined and set The rate of data transfer on the Master MICROWIRE is determined by the Master MICROWIRE se rial CLocK MMCLK signal This rate is the same as the Codec CLocK CCLK sig
38. 0 abessow 195 S 5SNS 9uoN 64 diis S ds 9911 30 Aeq pue 9911 195 S 41385 9uoN J 101 ve abessey dbis S ds 1019918q qai 0 5 0199190 195 5 1385 2 eui ujbue ON 52 premyoeg diis S as SISSHLNAS 31 eouejueg pejueunfuy fes SYS qal 43938 104 551519 00 dois S S AHONW3W AYOWAW 81 5 31vH3N39 3NOL SISJHLNAS S 584 JASEN 19594 10 99 9q ON qal 510125494 19594 S 4308 4 quooad qal 20 eDesse N 59148 uonduosog 5518 uonduoseq 9 5 51516 1059 51996 597699 epoodo uonduos q puewwog http www national com 23 2 0 Software Continued 2 2 CompactSPEECH COMMANDS QUICK REFERENCE TABLE Continued Speakerphone Mode Commands 31VH3N39 3NOL SISSH
39. 0 Echo cancellation off default 1 Echo cancellation is on during playback Echo cancellation improves the performance of DTMF detection during playback Echo cancel lation can be turned on only with a system that can disable AGC during playback A system with AGC that cannot be controlled i e en abled disabled by the microcontroller must not turn on this bit Bit 3 Reserved must be cleared to 0 Bits 4 5 Reserved must be set to 10 Bits 6 7 Reserved must be cleared to 00 Bits 8 10 Number of installed flash devices Valid range 1 4 flash devices Default is 1 Bits 11 15 Reserved Must be cleared to 0 Note The CompactSPEECH automatically detects the type of flash device in use i e NM29A040 or NM29A080 http www national com 2 0 Software continued Example CFG 0324 Microcontroller 01 03 24 Byte sequence CompactSPEECH 01 03 24 Description Configure the CompactSPEECH to work with Codec that supports short frame format Three NM29A040 flash devices Echo cancellation on CMSG Creates a new message with a message tag fag allocates num blocks 4 kbytes blocks for it and sets the mes sage pointer to the beginning of the message data The command switches the CompactSPEECH to the MSG_ OPEN state The memory space available for the message data is com puted as follows 127 x num blocks 1 X 32 bytes Once a message is open i e t
40. 040 see the NM29A040 Datasheet NM29A080 The NM29A080 is organized as 256 blocks of 128 pages each containing 32 bytes A block is the smallest unit that can be erased and is 4 kbytes in size Not all 256 blocks are available for recording Up to 20 blocks may contain bad bits and two blocks are write once and hold the locations of these unusable blocks For further information about the NM29A080 see the NM29A080 Datasheet Message Organization and Recording Time A CompactSPEECH message uses at least one block The number of messages that can be stored on one NM29A040 device is 117 to 127 and on one NM29A080 device is 234 to 254 depending on the number of bad blocks The maximum recording time depends on four factors 1 The basic compression rate 5 2 kbit s or 7 3 kbit s 2 The amount of silence in the recorded speech 3 The number of bad blocks 4 The number of recorded messages The basic memory allocation unit for a message is a 4 kbyte block which means that half a block in average is wasted per record ed message Assuming a single message is recorded in all the available memory space of a 4 Mbit device with no bad blocks the maximum recording time using 5 2 kbit s compression is as follows TABLE 1 3 Recording Time on 4 Mbit Device Amount of Silence Total Recording Time 096 13 minutes 9 seconds 1096 14 minutes 25 seconds 1596 15 minutes 7 seconds 2096 15 minutes 47 seconds 2596 16 minu
41. 1 17 Data in Hold 00 7 After R E CTTL T1 T3 or TI 0 0 ipis 147 Data in Setup 00 7 Before R E CTTL T1 T3 or TI 15 0 tMMDINh 1 20 Master MICROWIRE Data In Hold After R E CTTL 0 0 tMMDINs 1 20 Master MICROWIRE Data In Setup Before R E CTTL 11 0 IMWCKh 1 18 MICROWIRE Clock High Slave At 2 0V Both Edges 100 0 IMWCKI 1 18 MICROWIRE Clock Low Slave At 0 8V Both Edges 100 0 MWCKp 1 18 MICROWIRE Clock Period Slave Note A R E MWCLK to next R E MWCLK 2 5 us 1 18 MWCLK Hold After MWCS becomes Inactive 50 0 tMWCLKs 1 18 MWCLK Setup Before MWCS becomes Active 100 0 tmwcsh 1 18 MWCS Hold After F E MWCLK 50 0 tmwcss 1 18 MWCS Setup Before R E MWCLK 100 0 MWDIh 1 18 MWDIN Hold After R E MWCLK 50 0 1 18 MWDIN Setup Before R E MWCLK 100 0 tPwR 1 24 Power Stable to RESET R E Note B After Vcc reaches 4 5V 30 0 ms tRsTw 1 23 RESET Pulse Width At 0 8V Both Edges 10 0 ms txh 1 22 CLKIN High At 2 0V Both Edges tx1p 2 5 tx 1 22 CLKIN Low At 0 8V Both Edges bap 2 5 1 22 CLKIN Clock Period R E CLKIN to next R E CLKIN 24 4 Note A Guaranteed by design but not fully tested in power down mode Note B Guaranteed by design but not fully tested http www national com 16 1 0 Hardware Continued 1 3 5 Timing Diagrams tetp Xterp CTTL CCLK CFS0
42. ERR INVALID is reported Note 3 Bit 15 of the message tag is used to select the voice compression algorithm and should not be modified after recording Example SMT FF F7 Microcontroller 05 FF F7 Byte sequence CompactSPEECH 05 FF F7 Description Mark the current message as old in a system where the message tag is encoded as described in the example of the DMS command Note that the CompactSPEECH ignores bits in the tag which are set to 1 only bit 3 is modified in the message tag SO Say Word word number Plays the word number word number in the current vocab The 1 byte word number may be any value from 0 through the index of the last word in the vocabulary When playback of the selected word has been completed the CompactSPEECH sets the NORMAL bit in the status word and activates the MWRQST signal If word number is not defined in the current vocabulary if itis an IVS control or option code ERR PARAM is set in the error word If the current vocabulary is undefined ERR INVALID is re ported Example SO 00 Microcontroller 07 00 CompactSPEECH 07 00 Byte sequence Description Announce the first word in the word table of the currently selected vocabulary SPS Set Playback Speed speed Sets the speed of message playback as specified by speed The new speed applies to all recorded messages an
43. Expansion Memory disabled Note E All input signals are tied to 1 or 0 above 0 5 or below Vss 0 5V 11 http www national com 1 0 Hardware continued 1 3 3 Switching Characteristics Maximum times assume capacitive loading of 50 pF Definitions CLKIN crystal frequency is 40 96 MHz ir 52 T 3 Note CTTL is an internal signal and is used as a reference to explain the All timing specifications in this section refer to 0 8V or 2 0V timing of other signals See Figure 1 22 on the rising or falling edges of the signals as illustrated in Figures 1 8 through 1 14 unless specifically stated other wise 2 0V CTTL or MWCLK 2 0V Signal 0 8V tsignal TL EE 12868 9 Signal valid active or inactive time after a rising edge of CTTL or MWCLK FIGURE 1 8 Synchronous Output Signals Valid Active and Inactive MWCLK Signal TL EE 12868 10 Signal valid time after a falling edge of MWCLK FIGURE 1 9 Synchronous Output Signals Valid Signal TL EE 12868 11 Signal hold time after a rising edge of CTTL FIGURE 1 10 Synchronous Output Signals Hold http www national com 12 1 0 Hardware continued MWCLK Signal TL EE 12868 12 Signal hold time after a falling edge of MWCLK FIGURE 1 11 Synchronous Output Signals Hold CTTL or MWCLK Signal TL EE 12868 13 Signal setup time before a rising edge
44. LCC 55 MWROST MWCLK MWDIN CCLK CDIN 0 CDOUT NC Top View 28 29 30 31 32 33 34 35 36 37 gt ON m 2 lt lt gt gt 2 la EMCS ENVO Note Pins marked NC should not be connected FIGURE 1 1 68 PLCC Package Connection Diagram TL EE 12868 2 http www national com 1 0 Hardware Continued 1 1 3 Pin Assignment in the 100 PQFP Package Vss Al MMCLK Vss X2 CLKIN NC NC NC A9 0 A2 4 5 A6 A7 AB 100 99 98 97 96 95 94 93 92 9190 89 88 87 86 85 84 83 82 81 NC d NC NC 2 79 NC 3 78 NC 4 77 NC NC 5 765 NC 6 75 7 74 NC 73 TST NC 9 72 A10 10 71 MMDOUT 11 70l MMDIN 12 69 MWRDY NC 3 68 MWDOUT 00414 vi 67 ENC 01 15 vss 02 16 65 Ves 117 4 03 418 63 MWCLK 19 62 MWDIN 04 120 61 05 421 0 06 22 59 f crso D7 23 58 CDOUT A11 24 57 NC A12 25 56 f RESET NC 26 55 NC NC 27 NC NC 28 53 NC 29 52 NC 30 51 NC 5132 33 34 55 56 37 38 39 40 41 42 43 44 45 46 47 48 49 50 ON x Zr gt 5 gt 2
45. LK cycle The data is then transmitted bit by bit via the CDOUT output pin Concurrently the received data is shift ed in via the CDIN input pin Data is shifted one bit in each CCLK cycle After the last bit has been shifted CFS1 is set to 1 for one CCLK cycle Then the data from the second codec is shift ed out via CDOUT concurrently with the inward shift of the data received via CDIN Figure 1 6 shows how the codec interface signals behave when short frame protocol is configured Long Frame Protocol When long frame protocol is configured eight data bits are exchanged with each codec as for the short frame protocol However for the long frame protocol data transfer starts by setting CFSO to 1 for eight CCLK cycles Simultaneously the data for the first codec is shifted out bit by bit via the CDOUT output pin as in short frame protocol Concurrently the received data is shifted in through the CDIN input The data is shifted one bit in each CCLK cycle One CCLK cycle after CFSO has become inactive 0 CFS1 is set to 1 for eight CCLK cycles Simultaneously the data for the second codec is shifted out MSB first via CDOUT concurrently with the received data shifted in from CDIN Figure 1 7 shows how the codec interface signals behave when long frame protocol is configured http www national com CCLK CFSO 51 CDOUT CCLK CFSO 51 1 0 Hardware continued 06 X 05
46. LNAS 82 6 SL eun S INAL 9UON ON 32 euougjexeeds 195 S NSS 01 51019919 195 5 1385 19599 Nq 561515 00 0018 9 9 euoN s1012e1eq oc 8401599190 19999 9 1308 31VH3N39 3NOL qal ao 19 31VvH3N39 3NOL 9 3 ON SISSHLNAS GHOOSY Sc 195 S ID 99148 uonduoseg 91 8 uonduoseg v s owen eels SSS 89005 epoodo 24 http www national com 2 0 Software continued 2 3 THE STATE MACHINE The CompactSPEECH operates in one of two modes nor mal mode and Speakerphone mode The SSM command is used to change the mode of operation In each mode the CompactSPEECH functions as a state machine It changes state either in response to a command sent by the microcontroller after execution of the command is completed or as a result of an internal event e g memo ry full or power failure The main difference between the operation modes is that in Speakerphone mode only a limited set of commands is sup
47. SPEECH in full duplex speakerphone mode digit_pressed if first digit SSM 4 Enter LISTEN mode first digit FALSE j GT dtmf of digit Dial the digit S Stop Note that after the S command the CompactSPEECH is still in speakerphone mode enable_digit_timeout_event To guess when dialing is completed digit timeout event SSM 1 Dialing is completed Go back to full duplex mode deactivate digit timeout event 2 9 2 Speakerphone Terminology AEC SEND PATH Acoustic Echo Controller The part in the speakerphone al i trols th ho in th th The signal path from the microphone near end speaker to the line far end listener The microphone is the input port EEC and line out is the output port of this signal path Electric Echo Controller The part in the speakerphone algo RECEIVE PATH rithm that controls the echo in the receive path The signal path from the line far end speaker to the loud speaker near end listener The line in is the input port and the speaker is the output port for this signal path 29 http www national com 2 0 Software continued 2 10 SPEECH SYNTHESIS Speech synthesis is the technology that is used to create messages out of predefined words and phrases stored in a vocabulary There are two kinds of predefined messages fixed mes sages e g voice menus in a voice mail system and pro grammable messages time and day stamp or the You
48. The number of messages that can be stored is limited only by memory size MICROWIRE slave interface to an external microcontroller MICROWIRE master interface to Serial Flash memory devices Storage and management of messages Programmable message tag for message categoriza tion e g Mailboxes InComing Messages ICM Out Going Messages OGM Skip forward or backward during message playback Variable speed playback Supports external vocabularies using Serial Flash or expansion ROM Multi lingual speech synthesis using International Vo cabulary Support IVS Vocabularies available in English Japanese Mandarin German French and Spanish DTMF generation and detection DTMF detection during OutGoing Message playback Single tone generation Telephone line functions including busy and dial tone detection Real time clock Direct access to message memory Supports long frame and short frame codecs Call screening input signal echoed to codec output Supports up to four 4 Mbit or two 8 Mbit Serial Flash devices Supports prerecorded vocabularies on Serial Flash Available in PLCC 68 pin and PQFP 100 pin packages http www national com Table of Contents 1 0 HARDWARE 1 1 Pin Assignment 1 1 1 Pin Signal Assignment 1 1 2 Pin Assignment in the 68 PLCC Package 1 1 3 Pin Assignment in the 100 PQFP Package 1 2 Functional Description 1 2 1 Resetting 1 2 2 Clocking 1 2 3 Power down Mode 1 2 4 Power and Groundi
49. WIRE handler Microcontroller interface Slave MICROWIRE handler Codec interface The following sections describe the CompactSPEECH soft ware in detail 21 http www national com 2 0 Software continued 2 2 CompactSPEECH COMMANDS QUICK REFERENCE TABLE Normal Mode Commands Vi 9105 31dl 31vH3N39 3NOL ON SIS3HLNAS THOO3H esned S Vd 9uoN andl 0 xoeqfeld v d euoN 5 HN euoN N ana 62 eea SA Pelu 5 1383 L uejs g 921801 LINI punoy 2 2 Asen 60 19 5 WLS 4 uondo 30 pue 199 19 9uoN 0 31 VH3N39 3NOL 9 01 ejgjeue 19 SNIS ON 99 18 vi 5 1815 199 MSD jo jequnN 2 2 ysew jer mai LE 9989959971 Jo JjequnN 195 2 abesse v0 19 8 641
50. age according to instructions in dir to be the first nth next or nth previous message which complies with the equation message tag and mask tag ref and tag mask where and is a bitwise AND operation dir is one of the following 0 Selects the first oldest message 128 Selects the last newest message n Selects the nth next message starting from the cur rent message n Selects the nth previous message starting from the current message Note To select the nth message with a given tag to be the current mes sage you must first select the first message that complies with the above equation and then issue another GTM command with n 1 as a parameter to skip to the nth message a message is found it becomes the current message and 1 TRUE is returned If no message is found the current message remains unchanged and 0 FALSE is returned If dir is not 0 and the current message is undefined the return value is unpredictable After the command execution the current message may either remain undefined or change to any existing message The only exception is when the GTM command is exe cuted just after the DM command See the DM command descrip tion for further detail To access the nth message when n gt 127 a sequence of GTM commands is required http www national com 40 2 0 Software continued Example GTM FFCE 003F 0 Microcon
51. akerphone generates silence to the line The near end speaker can hear the far end listener but not vice versa Tone detectors are not active HOLD Interrupts from both codecs are stopped Neither side can hear each other RESTART The speakerphone re initilizes itself to the last speaker phone mode Full duplex transparent or Mute This mode should be used to resume the speakerphone operation after Hold mode or when there is a significant change in the envi ronmental conditions e g parallel pickup that may affect the speakerphone quality TRANSPARENT The speakerphone works in full duplex mode but with no echo cancellation Samples from the microphone are transferred to the line and samples from the line are transferred to the speaker with no processing This mode should be used only for tun ing and testing the system LISTEN Line is audible on the speaker and the CompactSPEECH tone detectors are active In this mode dialing can be performed with the GT com mand and call progress can be implemented since the busy and dial tone detectors are active http www national com 28 2 0 Software continued The following pseudo code demonstrates how to make a call from speakerphone mode while EV wait_event case EV of Skpr button pressed if speakerphone_on SSM O Put CompactSPEECH in idle mode first_digit TRUE deactivate_digit_timeout_event else SSM 1 Put Compact
52. an once in the vocabulary For example if you synthesize the sen tences you have twenty messages and you have twenty five messages the word twenty is pronounced differently They should therefore be defined as two differ ent words The number tables allow you to treat num bers differently depending on the context Example 1 The number 1 can be an nounced as one as in mes sage number one or as first as in first message The word table The number tables http www national com 30 2 0 Software continued The sentence table Sentence 0 Example 2 The number 0 can be an day announcement It assumes that the nounced as no as in you have sentence is designed for system and mes no messages or as oh as in sage time and day announcement and has monday eight oh five am one argument which is interpreted as fol A separate number table is re lows quired for each particular type 0 System time will be announced of use The number table con 1 The time and day of the current mes tains the indices of the words sage will be announced that Example 1 When the microcontroller sends the com used to synthesize the num mand ber Up to nine number tables can be included in a vocabu SAS 0 lary The system time and day is announced The sentence table describes the prede Example 2 When the microcontroller sends the com fined sentences in the vocabulary The
53. ble i e sentence 0 in a special way to support time and Sentence Table OPT_NUNBER CONTROL_SING MESSAGES Word Table Prev rave messes Number Table FIGURE 2 3 Relationship of IVS Tables TL EE 12868 28 31 http www national com 2 0 Software continued 2 10 4 The IVS Tool The IVS tool includes two utilities The DOS based IVS Compiler IVSTOOL for Windows A Windows 3 1 based utility The tools allow you to create vocabularies for the CompactSPEECH processor They take you all the way from designing the vocabulary structure through defining the vocabulary sentences and recording the vocabulary words The IVS compiler runs on MS DOS ver sion 5 0 or later It allows you to insert your own vocabulary i e basic words and data used to create numbers and sen tences as directories and files in MS DOS The IVS compiler then outputs a binary file containing that vocabulary This informa tion can be burned into an EPROM or seri al flash for use by the CompactSPEECH software Each IVS vocabulary can be compiled us ing either 5 2 kbit s or 7 3 kbit s voice compression algorithm The user defines the compression rate before compilation The CompactSPEECH automatically se lects the required voice decompression al gorithm when the SV command is used to select the active vocabulary The IVS package includes a Windows utili ty that assists the vocabulary desi
54. ch only allow bits to be changed from 1 to 0 changing bits from 0 to 1 requires a special erasure procedure see Section 1 2 5 However the main reason for updating an existing tag is to mark a message as old and this can be done by using one of the bits as a new old indicator setting it to 1 when a message is first created and clearing it when necessary 2 7 SPEECH COMPRESSION The CompactSPEECH implements two speech compres sion algorithms One algorithm with 5 2 kbit s compression rate enables up to 14 16 minutes of recording on a 4 Mbit device while the other uses a 7 3 kbit s compression rate to support 10 12 minutes of recording Both compression rates assume 10 silence Before recording each message the microcontroller can se lect one of the two algorithms by programming bit 15 of the message tag During message playback the CompactSPEECH reads this bit and selects the appropriate speech decompression algo rithm IVS vocabularies can be prepared in either of the two com pression formats using the IVS tool All the messages in a single vocabulary must be recorded using the same algo rithm See the VS User s Manual for further details During speech synthesis the CompactSPEECH automatically se lects the appropriate speech decompression algorithm 2 8 TONE AND NO ENERGY DETECTION The CompactSPEECH detects DTMF busy and dial tones and no energy VOX This enables remote control opera tions and call progre
55. d syn thesized messages only if synthesized using external voice synthesis until changed by another SPS command If this command is issued while the CompactSPEECH is in the PLAY state the speed also changes for the message cur rently being played speed may be one of 13 values from 6 to 6 A value of 0 represents normal speed Note that a negative speed value represents an increase in speed a positive value represents a decrease in speed The change in speed is approximate and depends on the recorded data If speed is not in the 6 to 6 range ERR PARAM is set in the error word Example SPS FB Microcontroller 16 CompactSPEECH 16 FB Set playback speed to 5 Byte sequence Description ss Say Sentence sentence_n Say sentence number sentence of the currently selected vocabulary sentence is 1 byte long If the sentence has an argument 0 is passed as the value for this argument http www national com 44 2 0 Software continued When playing has been completed the CompactSPEECH sets the NORMAL bit in the status word and activates the MWRGST signal If sentence is not defined in the current vocabulary ERR PARAM is set in the error word If the current vocabulary is undefined ERR INVALID is re ported Example SS 00 Microcontroller 00 CompactSPEECH 1F 00 Byte sequence
56. dBV and the low tone is 12 4 dBV which gives a DTMF twist level of 1 9 dB The energy level of a single generated tone is the level of the low tone 66 28 Reserved 29 Reserved 31 SP PRIORITY BIAS Controls the bias in priority between the Send and Receive paths If send priority bias is preferred the value should be greater than zero For no priority bias the value should be zero For priority bias for the Receive path the value should be negative Steps are 3 dB each e g 3 is 9 dB bias for the Send path 2 is 6 dB bias for the Receive path Legal values 4 to 4 32 SP THRESHOLD The RMS level below which the speakerphone treats a dial tone as noise and not as a dial tone When the Speakerphone algorithm detects a dial tone above this threshold it does not attenuate the signal A value of 32767 disables the dial tone detector Example if the value is 512 then dial tones with energy below the following are not detected as dial tones 20 10g10 512 16017 29 9 4096 33 SP BLOCK LEVEL Controls the maximum attenuation level of the speakerphone suppressors It affects the speakerphone stability and its subjective quality The maximum attenuation is calculated according to SP BLOCK LEVEL 228 Legal values 0 to 32000 10922 33 SP AEC LR LEVEL Controls the speakerphone gain from the micropho
57. de and set the speakerphone to full duplex mode SV 02 03 SV Set Vocabulary Type type id Selects the vocabulary table to be used for voice synthesis The vocabulary type is set according to the 1 byte type pa rameter 0 For compatibility only 1 External vocabulary in ROM 2 External vocabulary in Serial Flash All others Reserved The host is responsible to select the current vocabulary with SV before using an SO SW SS or SAS command Each external vocabulary table has a unique d which is part of the vocabulary internal header see the VS User s Manu al for more details If type is 1 or 2 the CompactSPEECH searches for the one byte jd parameter in each vocabulary table header until a match is found If the d parameter does not point to a valid IVS vocabulary ERR is set in the error word Example Byte sequence Microcontroller 20 02 03 CompactSPEECH 20 02 03 SW 02 00 00 Description Select the vocabulary with vocabulary id 3 which resides on Serial Flash as the current vocabulary SW Say Words word wordn Plays n words indexed by word to On completion the EV NORMAL bit in the status word is set and the MWRQST signal goes low If one of the words is not defined in the current vocabulary or if it is an IVS control or option code or if n gt 8 ERR PARAM is reported If the current vocabulary is u
58. during com munication One bit of data is transferred on every clock cycle The input data is available on MWDIN and is latched on the clock rising edge The transmitted data is output on MWDOUT on the clock falling edge The signal should re main low when switching MWCS MWCS MICROWIRE Chip Select The MWCS signal is cleared to 0 to indicate that the CompactSPEECH is being accessed Setting MWCS to 1 causes the CompactSPEECH to start driving MWDOUT with bit 7 of the transmitted value Setting the MWCS signal resets the transfer bit counter of the pro tocol so the signal can be used to synchronize between the CompactSPEECH and the microcontroller To prevent false detection of access to the Compact SPEECH due to spikes on the MWCLK signal use this chip select signal and toggle the MWCLK input signal only when the CompactSPEECH is accessed OUTPUT SIGNALS MWDOUT MICROWIRE Data Out Used for output only for transferring data from the CompactSPEECH to the microcontroller When the CompactSPEECH receives data it is echoed back to the microcontroller on this signal unless the received data is OxAA In this case the CompactSPEECH echoes a command s return value MWRDY MICROWIRE Ready When active 0 this signal indicates that the CompactSPEECH is ready to transfer receive or transmit another byte of data This signal is set to 1 by the CompactSPEECH after each byte transfer has been completed It remains 1 while the
59. e data ERR PARAM is set in the error word and execution stops Flash blocks that include IVS data cannot be used for re cording even if only one byte of the block contains IVS data e g if the vocabulary size is 4k 100 bytes two blocks of the flash are not available for message recording Example INJ 128 Data Vocabular Byte Microcontroller 29100100100 80 Data sequence CompactSPEECH 29 00 00 00 80 Echo of Data Description Inject 128 bytes of vocabulary data MR Memory Reset Erases all good flash blocks and initializes the Compact SPEECH i e does exactly what the INIT command does INIT Bad blocks and blocks which are used for IVS vocabularies 7 are not erased Byte sequence Microcontroller 13 Note The command erases all messages and should be used with care CompactSPEECH 13 Example Description Initialize the CompactSPEECH MR INJ Inject IVS data n byten pen Injects vocabulary data of size n bytes to good flash blocks CompactSPEECH 2A This command programs flash devices on a production line Description Erase all Serial Flash blocks with IVS vocabulary data It is optimized for speed all CompactSPEECH detectors are suspended during execu P Playback tion of the command Use the CVOC command to check whether programming was successful Begins playback of the current messag
60. e message length is 0 but is not deleted Use the DM Delete Message or DMS Delete Messages command to delete the message Example CMT 02BC Microcontroller 26 02 BC Byte sequence CompactSPEECH 26 02 BC Description Cut the last seven seconds of the current message Check Vocabulary Checks checksum if the IVS data was correctly pro grammed to the ROM or flash device If the vocabulary data is correct the return value is 1 Other wise the return value is 0 If the current vocabulary is undefined ERR INVALID is re ported Example cvoc Microcontroller 2B AA CompactSPEECH 2B 01 Byte sequence Description Check the current vocabulary The CompactSPEECH responds that the vocabulary is OK DM Delete Message Deletes the current message Deleting a message clears its message tag Deleting the current message does not cause a different message to become current The current message is unde fined If for example you issue the GTM command to skip to the next message the first message that is newer than the just deleted message is selected as the current mes sage The memory space released by the deleted message is im mediately available for recording new messages Example DM Microcontroller 0A CompactSPEECH 0A Description Delete current message DMS Delete Messages lag ref tag mask Deletes
61. e The Compact SPEECH state changes to PLAY When playback is com plete the CompactSPEECH sets the NORMAL END bit in the status word and activates clears to 0 the MWRQGST signal Playback can be paused with the PA com mand and can be resumed later with the RES command If the current message is undefined ERR INVALID is re ported 41 http www national com 2 0 Software continued Example P Microcontroller 03 CompactSPEECH 03 Byte sequence Description Play the current message PA Pause Suspends the execution of the current R P GT SO SW SS or SAS command The PA command does not change the state of the CompactSPEECH execution can be re sumed with the RES command Note DTMF and tone detectors remain active during Pause Example PA Microcontroller 1C CompactSPEECH 1C Byte sequence Description Suspend playback of current message PDM Go To Power down Mode Switches the CompactSPEECH to power down mode see Section 1 2 3 for details Sending any command while in power down mode resets the CompactSPEECH detectors and returns the CompactSPEECH to normal operation mode Example PDM Microcontroller 1A CompactSPEECH 1A Byte sequence Description Put the CompactSPEECH in power down mode R Record fag Records a new message with message tag ag The CompactSPEECH state change
62. e 2 4 shows the vocabulary creation process for a sin gle table on a ROM or serial flash device 2 11 INITIALIZATION Use the following procedures to initialize the Compact SPEECH processor NORMAL INITIALIZATION 1 Reset the CompactSPEECH by activating the RESET sig nal See Section 1 2 1 2 Issue a CFG Configure CompactSPEECH command to change the configuration according to your environment 3 Issue an INIT Initialize System command to initialize the CompactSPEECH firmware 4 Issue a series of TUNE commands to adjust the CompactSPEECH to the requirements of your system 2 12 MICROWIRE SERIAL INTERFACE MICROWIRE PLUS is a synchronous serial communica tion protocol originally implemented in National Semicon ductor s COPSTM and HPC families of microcontrollers to minimize the number of connections and thus the cost of communicating with peripherals Compressed Files ved IVS Vocabulary Files nor Programmer for Windows INJ Command TL EE 12868 29 FIGURE 2 4 Creation of an IVS Vocabulary http www national com 32 2 0 Software Continued The CompactSPEECH MICROWIRE interface implements the MICROWIRE PLUS interface in slave mode with an ad ditional ready signal It enables a microcontroller to inter face efficiently with the CompactSPEECH application The microcontroller is the protocol master and provides the clock for the protocol T
63. e CompactSPEECH in IDLE state SAS Say Argumented Sentence sentence arg Announces sentence number sentence of the currently selected vocabulary and passes arg to it sentence and arg are each 1 byte long When playing is complete the CompactSPEECH sets the EV NORMAL bit in the status word and activates the MWRQST signal If the current vocabulary is undefined ERR INVALID is re ported Example SAS 00 03 Microcontroller 1E 00 03 Byte sequence CompactSPEECH 1E 00 03 Description Announce the first sentence in the sentence table of the currently selected vocabulary with 3 as the actual parameter SB Skip Backward Skips backward in the current message time__ ength units each of 0 2s duration and causes message playback to pause time length is 2 byte parameter that can have any value up to 320 i e 64s The skip accuracy is 5 This command is meaningful only in the PLAY state The RES command must be issued to continue playback If the beginning of the message is detected during execu tion of the SB command execution is terminated the EV NORMAL END bit in the status register is set the MWRQNST signal is activated and the CompactSPEECH Switches to the IDLE state If time Jength is greater than 320 ERR PARAM is set in the error word Playback speed does not affect the behavior of this com mand Example SB 19
64. egal command sequence The command is not legal in the current state ERR Illegal parameter The value of the parameter is out of range or is not appropriate for the command ERR Microcontroller MCROWIRE communication error ERR Time out error Depending on the CompactSPEECH s state more than 20 ms to 30 ms elapsed between the arrival of two consecutive bytes for commands that have parame ters ERR_INVALID Command cannot be performed in current context Example GEW Microcontroller 18 CompactSPEECH 1B 00 02 Byte sequence Description Get the CompactSPEECH error word typically sent after GSW when __ ERROR is reported in the status word The CompactSPEECH responds ERR_OPCODE Get Information Returns the 16 bit value specified by item from one of the internal registers of the CompactSPEECH item may be one of the following 0 The duration of the last detected DTMF tone in 10 ms units The return value is meaningful only if DTMF de tection is enabled and the status word shows that a DTMF tone was detected 37 http www national com 2 0 Software continued 1 The duration of the last detected busy tone in 10 ms units 2 The energy level of the samples in the last 10 ms 3 The energy level of the samples in the last 10 ms that are in the frequency range described in Figure 2 1 The
65. er to communi cate through a telephone line using the speaker and the microphone of the unit instead of the handset The speaker phone processes signals that are transferred from the line to the speaker and from the microphone to the line and performs the necessary switching attenuation and echo cancellation on the signals that are present on the line speaker The CompactSPEECH speakerphone is very simple to use It requires no special hardware and no training for the echo cancelers The gain control is fully digital which eliminates the need for analog gain control hardware Two types of echoes exist in a speakerphone One is an electrical echo which is a result of an imperfect impedance match between the 4 to 2 wire interface hybrid and the line impedance This echo is relatively short term and its transfer function varies quite slowly The second echo is an acoustic echo returning from the speaker to the micro phone This echo is relatively long term and its transfer function may vary quite quickly if anyone or anything moves in the room Both echoes must be canceled to achieve a high quality hands free system 2 9 1 Speakerphone Modes of Operation FULL DUPLEX The speakerphone works in full duplex mode i e both par ties can speak and hear each other at the same time In this mode both the acoustic and electric echo controllers are active The CompactSPEECH tone detectors are not active in this mode MUTE The spe
66. es sometimes conflicting which must be addressed when designing a vocabulary Vocabulary f memory space is not an issue the vocabu content lary could contain all the required sentences each recorded separately If memory space is a concern the vocabulary must be compact it should contain the mini mum set of words and phrases required to synthesize all the sentences The least mem ory is used when phrases and words that are common to more than one sentence are re corded only once and the IVS tool is used to synthesize sentences out of them A good combination of sentence quality and memory space is achieved if you take the compact approach and extend it to solve pronunciation problems For example the word twenty is pronounced differently when used in the sentences You have twenty mes sages and You have twenty two messages To solve this problem words that are pro nounced differently should be recorded more than once each in the correct pronunciation When recording vocabulary words there is a compromise between space and quality On one hand the words should be recorded and saved in a compressed form and you would like to use the best voice compression for that purpose On the other hand the higher the compression rate the worse the voice quality Another issue to consider is the difference in voice quality between synthesized and re corded messages e g between time and day stamp and incoming messages
67. es the return value is also 2 bytes long For example if fag ref 4216 and fag mask 1 the number of existing old messages whose user defined tag is 2 is returned See Section 2 6 1 for a description of message tag encoding fag mask 0 the total number of all existing messages is returned regardless of the tag ref value Example GNM FFFE 0003 Microcontroller _ 11 FF FE 00 O3 AA AA CompactSPEECH 11 FF FE 00 03 00 05 Byte sequence Description Get the number of messages which have bit O cleared and bit 1 set in their message tags CompactSPEECH responds that there are five messages which satisfy the request http www national com 38 2 0 Software continued GSW Returns the 2 byte status word THE STATUS WORD The CompactSPEECH processor has a 16 bit status word to indicate events that occur during normal operation The CompactSPEECH asserts the MWRQST signal clears to 0 to indicate a change in the status word This signal remains active until the CompactSPEECH receives a GSW com mand The status word is cleared during reset and by the GSW command Get Status Word 15 14 13 12111 1019 8 7 61 5 4130 2 a 2 6 gt gt lt 4 0 gt 5 5 2
68. ge being played http www national com 26 2 0 Software continued TABLE 2 1 DTMF Detector Performance PLAY RECORD IDLE Detection Sensitivity Note A Performance Depends on The Message 40 dBm Being Played Note B Accepted DTMF Length gt 50 ms gt 40 ms Frequency Tolerance 1 5 1 5 S N Ratio 12 08 12 dB Minimum Spacing Note C gt 50 ms gt 45ms Normal Twist 8dB 8dB Reverse Twist Note D 4 dB or 8 dB 4 dB or 8 dB Note A Performance depends on the DAA design Note B Performance with echo canceler is 10 dB better than without echo canceler For a silent message Detection Sensivitiy is 34 dBm with echo canceler Note C If the interval between two consecutive DTMF tones is lt 20 ms the two are detected as one long DTMF tone If the interval between two consecutive DTMF tones is between 20 ms and 45 ms separate detection is unpredictable Note D Determined by the DTMF REV TWIST tunable parameter value OTHER DETECTORS Detection of busy and dial tones and no energy is con trolled by tunable parameters You should tune these pa rameters to fit your hardware For more information see the TUNE command in Section 2 15 Dial and busy tone detectors work with a band pass filter that Ilmits the frequency range in which tones be de tected to 0 Hz 1100 Hz Its frequency response is illustrat ed in Figure 2 1 and the busy tone cadences in Figure 2
69. gner to synthesize sentences With this utility you can both compose sentences and listen to them 2 10 5 How to Use the IVS Tool With the CompactSPEECH The IVS tool creates IVS vocabularies and stores them as a binary file This file is burnt into a ROM device or pro grammed into a serial flash device using the INJ command The CompactSPEECH SV command is used to select the required vocabulary The SW SO SS and SAS commands File Editor wav Files TheIVS Compiler Voice Compression The Graphical User Interface GUI IYS Compiler are used to synthesize the required word or sentence The typical vocabulary creation process is as follows 1 Design the vocabulary 2 Create the vocabulary files as described in detail below Use IVSTOOL for Windows 3 1 to simplify this process 3 Record the words using any standard PC sound card and sound editing software that can create wav files 4 Run the IVS compiler to compress the wav files and compile them and the vocabulary tables into an IVS vo cabulary file 5 Repeat steps 1 to 4 to create a separate IVS vocabulary for each language that you want to use 6 Burn the IVS vocabulary files into a ROM or serial flash device Use the INJ Inject IVS command to program the data into a serial flash device 7 Once the vocabulary is in place the speech synthesis commands of the CompactSPEECH can be used to syn thesize sentences Figur
70. have n messages announcement in a DAM A vocabulary includes a set of predefined words and phras es needed to synthesize messages in any language Appli cations which support more than one language require a separate vocabulary for each language 2 10 1 International Vocabulary Support IVS IVS is a mechanism by which the CompactSPEECH proces Sor can use several vocabularies stored on an external stor age device IVS enables CompactSPEECH to synthesize messages with the same meaning but in different lan guages from separate vocabularies Among IVS features Multiple vocabularies are stored on a single storage de vice Plug and play The same microcontroller code is used for all languages Synthesized and recorded messages use the same voice compression algorithm to achieve equal quality Argumented sentences For example You have messages Auto synthesized time and day stamp driven by the CompactSPEECH s clock Support for various language and sentence structures One versus many for example You have one message vs You have two messages None versus many for example You have no mes sage vs You have two messages Number synthesis English Eighty vs French Quatre vingt Word order 915 Twenty one vs German Ein undzwanzig Days of the week Monday through Sunday vs Sunday through Saturday 2 10 2 Vocabulary Design There are several issu
71. he CompactSPEECH is in the MSG state the message pointer can be set to any position on a page 32 bytes boundary within the message with the SMSG command The message contents can be modified with the WMSG command and read with the RMSG command As long as the message is not closed by the S command its length can be extended with the WMSG command Once the message is closed its length can not be extended The microcontroller must issue an S command to close the message and switch the CompactSPEECH to the idle state If the memory is full MEMFULL is set in the status word and no message is created If the memory is not full but there is not enough memory and the CompactSPEECH can not allocate the required memory space for the message EV MEMLOW is set in the status word and no message is created Create Message fag num blocks Example CMSG 0101 01 Microcontroller 33101 01 00 01 Byte sequence CompactSPEECH 33 01 01 00 01 Description Create a new message and allocate 4 kbytes for its data CMT Cut Message Tail Cut time_Jength units each of 10 ms duration off the end of the current message The maximum value of time_ length is 6550 Cut time accuracy is 0 14 sec Note If time_Jength is longer than the total duration of the message the NORMAL event is set in the status word and the mes sage becomes empty i
72. he CompactSPEECH supports clock rates of up to 400 kHz This transfer rate refers to the bit transfer the actual throughput is slower due to byte pro cessing by the CompactSPEECH and the microcontroller Communication is handled in bursts of eight bits one byte In each burst the CompactSPEECH is able to receive and transmit eight bits of data After eight bits have been trans ferred an internal interrupt is issued for the Compact SPEECH to process the byte or to prepare another byte for sending In parallel the CompactSPEECH sets MWRDY to 1 to signal the microcontroller that it is busy with the byte processing Another byte can be transferred only when the MWRDY signal is cleared to 0 by the CompactSPEECH When the CompactSPEECH transmits data it expects to receive the value OxAA before each transmitted byte The CompactSPEECH reports any status change by clearing the MWRQST signal to 0 If a parameter of a CompactSPEECH command is bigger than one byte the microcontroller should transmit the Most Significant Byte MSB first If a return value is bigger than one byte the CompactSPEECH transmits the MSB first 2 13 SIGNAL DESCRIPTION The following signals are used for the interface protocol Input and output are relative to the CompactSPEECH INPUT SIGNALS MWDIN MICROWIRE Data In Used for input only for transferring data from the microcontroller to the CompactSPEECH MWCLK This signal serves as the synchronization clock
73. inued 2 2 CompactSPEECH COMMANDS QUICK REFERENCE TABLE Continued Normal Mode Commands Continued snouoJuou Sy snouoJuou g o HO33dSioeduioo suoisi e1 enin pue 10 sjsixe SIU Ls ou seu nq 0195 si pueWWOD SUON 26 2 be eDesse AHOIN3IN AYOWAW 24 5 9uoN DSW N3dO DSW Le eBesse N S 5 31VH3N39 SNOL 9uoN 1ueujeJoe 1ueujeJou SISSHLNAS 8c 5 9uoN 2 1 SL S INAL 9uoN UpJOM N SISSHLNAS Ic SpJoM Aes MS 02 195 5 AS epo ON 32 euoydieyeeds 195 5 NSS u eouejes SISAHLNAS 3 65 61 98 fes V SS SUON peeds 5153 5 91 peeds yoegheld 195 S SdS JequinN SISSHLNAS qal 10 euo 05 4 obesso qal qal 50 5 4718 euoN 10 uny Bs
74. l europe supporte nsc com Deutsch Tel 49 0 180 530 85 85 English Tel 49 0 180 532 78 32 Frangais Tel 49 0 180 532 93 58 Italiano Tel 49 0 180 534 16 80 National Semiconductor Hong Kong Ltd 13th Floor Straight Block Ocean Centre 5 Canton Rd Tsimshatsui Kowloon Hong Kong Tel 852 2737 1600 Fax 852 2736 9960 National Semiconductor Japan Ltd Tel 81 043 299 2308 Fax 81 043 299 2408 National does not assume any responsibility for use of any circuitry described no circuit patent licenses are implied and National reserves the right at any time without notice to change said circuitry and specifications
75. ll scale values after expansion The value of CLIP NEG is set as shown for CLIP POS above Legal values 32768 to 0 38 SP CLIP POS Specifies the positive peak value at which the analog circuit of the speaker saturates 16000 Codec analog full scale corresponds to full scale values after expansion The value of CLIP POS is set as shown for CLIP POS above Legal values 0 to 32767 39 58 EEC CLIP NEG Specifies the negative peak value at which the analog circuit of the line out saturates 16000 Codec analog full scale corresponds uLAW full scale values after expansion The value SP CLIP NEG is set as shown for CLIP POS above Legal values 32768 to 0 40 ENABLE Enables disables the acoustic echo controller 1 Legal values 0 disable 1 enable 41 SP__EEC__ENABLE Enables disables the electrical echo controller 1 Legal values 0 disable 1 enable 49 http www national com 2 0 Software continued Example TUNE 23 700 Microcontroller 15 17 02 BC Byte sequence CompactSPEECH 15 17 02 BC Description Set the minimum period for busy detection to seven seconds vc Volume Control _ Controls the energy level of all the output generators play back tone generation and voice synthesis and the
76. ma zl smes 8 SNO midi ei 1925 9 SNOL anjen L xepu ON SIS3HLNAS THOO3H Sc uogeuuoju 199 S 19 saris 8l 199 Mad 2 anjea 9 1383 50 195 S 52335 80 Mowe auoN 2 2 mia 80 5 SING vo ebesseW 8950 Wa 1591 9uoN az 8 9uoN 9c 1149 2 2 syoojg 10 wn 99 3 5 5882 enjex 19534 13534 0 930 1383 ve 5 inseu 159 Jequnu uonov 90 WYHY den 0 dVIAV 99148 uonduoseg 99148 uonduoseg XoH v S owen 5 epoodo 22 http www national com 2 0 Software cont
77. mand purpose of this table is to make the micro SAS O 7 controller that drives the Compact SPEECH independent of the language be ing synthesized For example if the serial flash and or ROM contain vocabularies in various lan guages and the first sentence in each vo cabulary means you have n messages the microcontroller switches languages by issuing the following command to Com The current message time and day stamp is announced Figure 2 3 shows the interrelationship be tween the three types of tables Control and The list of word indices alone cannot pro option codes vide the entire range of sentences that the CompactSPEECH synthesize IVS control and option codes are used as spe pactSPEECH cial instructions that control the behavior of SV storage media the speech synthesis algorithm in the 5 A CompactSPEECH lt vocabulary_id gt For example if the sentence should an Select a new vocabulary nounce the time of day the Compact The microcontroller software is thus inde SPEECH should be able to substitute the pendent of the grammar of the language current day and time in the sentence in use These control words do not represent re The sentences consist of words which corded words rather they instruct the are represented by their indices in the vo CompactSPEECH to take special actions cabulary All sentences but one are user defined The CompactSPEECH treats the first sen tence in the sentence ta
78. n the error word Playback speed does not affect the behavior of this com mand Example SF 19 22 00 19 22 00 19 Microcontroller CompactSPEECH Byte sequence Description Skip forward five seconds from the current position in the message being played SMSG Set Message Pointer num_of_pages Set the message pointer to num__of_pages x 32 bytes from the beginning of the current message data If of pages x 32 is greater than the message length EV NORMAL END is set in the status word the message pointer is set to the end of the message and the CompactSPEECH switches to the IDLE state Example SNSG 10 0A 0A Microcontroller 30 00 CompactSPEECH 30 00 Byte sequence Description Set the message pointer to 32 bytes from the beginning of the current message data SMT Set Message Tag message lag Sets the tag of the current message The 2 byte message tag can be used to implement mailbox functions by including the mailbox number in the tag or to handle old and new messages differently by using one bit in the tag to mark the message as old or new See Section 2 6 1 To change the tag of a message we recommend that you read the message tag modify it and write it back Note 1 Message tag bits can only be cleared Message tag bits are set only when a message is first created Note 2 If the current message is undefined
79. nal As long as the Master MICRO WIRE is transferring data the codec interface must be en abled and its sampling rate should not be changed ma X Shift Out i Sample Point TL EE 12868 30 FIGURE 2 4 Sequence of Activities during a MCROWIRE Byte Transfer http www national com 34 2 0 Software continued MMCLK End of Transfer Shift Out Sample Point TL EE 12868 31 FIGURE 2 5 Master MICROWIRE Data Transfer 2 15 COMMAND DESCRIPTION The commands are listed in alphabetical order The execution time for all commands when specified in cludes the time required for the microcontroller to retrieve the return value where appropriate The execution time does not include the protocol timing overhead i e the execution times are measured from the moment that the command is detected as valid until the command is fully executed Note Each command description includes an example application of the command The examples show the opcode issued by the microcon troller and the response returned by the CompactSPEECH For com mands which require a return value from the CompactSPEECH the start of the return value is indicated by a thick vertical line CCIO Configure Codec I O config value Configures the voice samples paths in various states It should be used to change the default CompactSPEECH configuration The config value parameter is encoded as follows Bit 0 Lo
80. nd CFS1 Active After R E CTTL 25 0 5 1 15 50 CFS1 Hold After R E CTTL 0 0 tFSia 1 15 50 and CFS1 Inactive After R E CTTL 25 0 MMCLKa 1 20 Master MICROWIRE Clock Active After R E CTTL 12 0 MMCLKh 1 20 Master MICROWIRE Clock Hold After R E CTTL 0 0 MMCLKia 1 20 Master MICROWIRE Clock Inactive After R E CTTL 12 0 MMDOh 1 20 Master MICROWIRE Data Out Hold After R E CTTL 0 0 MMDOv 1 20 Master MICROWIRE Data Out Valid After R E CTTL 12 0 MWDOf 1 18 MICROWIRE Data Float Note B After R E MWCS 70 0 MWDOh 1 18 MICROWIRE Data Out Hold Note B After F E MWCK 0 0 MWDOnt 1 18 MICROWIRE Data No Float Note B After F E MWCS 0 0 70 0 MWDOv 1 18 MICROWIRE Data Out Valid Note B After F E MWCK 70 0 tMWITOp 1 19 MWDIN to MWDOUT Propagation Time 70 0 1 18 MWRDY Active After R E of CTTL 0 0 35 0 tMwRDYia 1 18 MWRDY Inactive After F E MWCLK 0 0 70 0 tpaBch 1 21 PB MWRQST After R E CTTL 0 0 1 21 PB and MWRQST After R E CTTL T2W1 12 0 Note In normal operation mode must be 48 8 ns in power down mode must be 50 000 ns Note B Guaranteed by design but not fully tested 15 http www national com 1 0 Hardware continued INPUT SIGNALS Symbol Figure Description Reference Conditions Min ns tcpih 1 15 CDIN Hold After R E CTTL 0 0 tepis 1 15 CDIN Setup Before R E CTTL 11 0 tDih
81. ndefined ERR INVALID is re ported Example Byte sequence Microcontroller 21 02 00 00 CompactSPEECH 21 02 00 00 Description Announce the first word in the word table of the currently selected vocabulary twice TUNE Tune index Sets the value of the tunable parameter identified by index one byte to the 2 byte value parameter value This com mand may be used to tune the DSP algorithms to a specific Data Access Arrangement DAA interface or to change other parameters If you do not use TUNE the Compact SPEECH uses default values If index does not point to a valid tunable parameter ERR PARAM is set in the error word Note The tunable parameters are assigned with their default values on ap plication of power The INIT command does not affect these parame ters Table 2 2 describes the tunable parameters their index numbers and their default values 45 http www national com 2 0 Software continued TABLE 2 2 Tunable Parameters Index Parameter Name Description Default 0 3 Reserved 4 SIL THRESHOLD Prevents speech from being interpreted as silence The silence detection algorithm has an adaptive threshold which is changed according to the noise level This parameter is therefore only the initial threshold level Legal values 9216 to 13824 in 512 6 dB steps 11264
82. ne to the line out The total attenuation or gain depends on both of the analog gains and this value The gain is K signal where K SP AEC LR LEVEL 4096 Legal values 0 to 16000 14000 http www national com 48 2 0 Software continued TABLE 2 2 Tunable Parameters Continued Index Parameter Name Description Default 35 SP EEC LR LEVEL Controls the speakerphone gain from the line in to the speaker 281 The total attenuation or gain depends on both of the analog gains and this value The gain is K signal where SP EEC LR LEVEL 40996 2 6 VOL LEVEL 2 Legal values 0 to 400 36 SP AEC CLIP POS Specifies the positive peak value at which the analog circuit of the line out saturates 16000 Codec analog full scale corresponds full scale values after expansion Assume that positive saturation occurs at amplitudes higher than those of a sine wave at X The SP CLIP POS value is set as SP CLIP POS 32636 10 X 3 17 20 Note a sine wave with amplitude 4 8159 32636 corresponds to 3 17 Example For X 6 2761 the value is SP CLIP POS 32636 10 6 2761 3 17 20 0 3371 32636 11000 Legal values 0 to 32767 37 SP AEC CLIP NEG Specifies the negative peak value at which the analog circuit of the line out saturates 16000 Codec analog full scale corresponds to uLAW fu
83. ng 1 2 5 Memory Interface 1 2 6 Codec Interface 1 3 Specifications 1 3 1 Absolute Maximum Ratings 1 3 2 Electrical Characteristics 1 3 3 Switching Characteristics 1 3 4 Synchronous Timing Tables 1 3 5 Timing Diagrams 2 0 SOFTWARE 2 1 Overview 2 1 1 DSP based Algorithms 2 1 2 System Support 2 1 3 Peripherals Support 2 2 CompactSPEECH Commands Quick Reference Table 2 3 The State Machine 2 4 Command Execution 2 5 Tunable Parameters 2 6 Messages 2 6 1 Message Tag 2 7 Speech Compression 2 8 Tone and No Energy Detection 2 9 Full Duplex Speakerphone 2 9 1 Speakerphone Modes of Operation 2 9 2 Speakerphone Terminology 2 10 Speech Synthesis 2 10 1 International Vocabulary Support IVS 2 10 2 Vocabulary Design 2 10 3 IVS Vocabulary Components 2 10 4 The IVS Tool 2 10 5 How to Use the IVS Tool with the CompactSPEECH 2 11 Initialization 2 12 Microwire Serial Interface 2 13 Signal Description 2 13 1 Signal Use in the Interface Protocol 2 13 2 Interface Protocol Error Handling 2 14 The Master Microwire Interface 2 14 1 Master MICROWIRE Data Transfer 2 15 Command Description APPENDIX A SCHEMATIC DIAGRAMS http www national com 1 0 Hardware 1 2 PIN ASSIGNMENT 1 2 1 Pin Signal Assignment The following sections detail the pins of the NSAM266SP Table 1 1 shows all the pins and the signals that use them processor Slashes separate the names of signals that in different configurations It also show
84. ntroller in this case it is written on every falling edge of the clock When a command has more than one parameter return val ue the parameters return values are transmitted in the or der of appearance If a parameter return value is more than one byte long the bytes are transmitted from the most sig nificant to the least significant The MWRDY signal is used as follows 1 Active 0 MWRDY signals the microcontroller that the last eight bits of data transferred to from the voice mod ule were accepted and processed see below The MWRDY signal is deactivated set to 1 by the CompactSPEECH after 8 bits of data were transferred to from the CompactSPEECH The bit is set following the falling edge of the eighth MWCLK clock cycle The MWRDY signal is activated cleared to 0 by the CompactSPEECH when it is ready to receive the first pa rameter byte if there are any parameters and so on till the last byte of parameters is transferred An active MWRDY signal after the last byte of parameters indicates that the command was parsed and if possible executed If that command has a return value the microcontroller must read the value before issuing a new command m 33 http www national com 2 0 Software Continued 4 When a return value is transmitted the MWRDY signal is deactivated after every byte and activated again when the CompactSPEECH is ready to send another byte or to receive a new command
85. o the X1 and X2 CLKIN pins as possible to keep the trace lengths in the printed circuit to an absolute minimum You can use crystal resonators with maximum load capaci tance of 20 pF although the oscillation frequency may differ from the crystal s specified value Table 1 2 lists the components in the crystal oscillator cir cuit TABLE 1 2 Crystal Oscillator Component List Component Parameters Values Tolerance Resonance Frequency Third Overtone Parallel Type AT Cut Crystal Maximum Serial 500 Resistance N A Resonator Maximum Shunt 7 pF Capacitance Maximum Load 12 pF Capacitance P 10 MQ 5 1000 pF 20 3 9 http www national com 1 0 Hardware continued 1 2 3 Power Down Mode Power down mode is useful during a power failure when the power source for the CompactSPEECH is a backup battery or in battery powered devices while the CompactSPEECH is idle In power down mode the clock frequency of the Compact SPEECH is reduced and some of the processor modules are deactivated As a result the CompactSPEECH con sumes much less power than in normal power mode lt 1 5 mA Although the CompactSPEECH does not per form all its usual functions in power down mode it still keeps stored messages and maintains the time of day Note In power down mode all the chip select signals CSO to CS3 are set to 1 To guarantee that there is no current flow f
86. of CTTL or MWCLK and signal hold time after a rising edge of CTTL or MWCLK FIGURE 1 12 Synchronous Input Signals 13 http www national com 1 0 Hardware continued Signal A Signal B signal TL EE 12868 14 Signal B starts after rising or falling edge of signal A FIGURE 1 13 Asynchronous Signals The RESET signal has a Schmitt trigger input buffer Figure 1 14 shows the characteristics of the input buffer Vout Vuh TL EE 12868 15 FIGURE 1 14 Hysteresis Input Characteristics http www national com 14 1 0 Hardware continued 1 3 4 Synchronous Timing Tables In this section R E means Rising Edge and F E means Falling Edge OUTPUT SIGNALS Symbol Figure Description Reference Conditions Min ns Max ns tan 1 17 Address Hold After R E CTTL 0 0 tay 1 17 Address Valid After R E CTTL T1 12 0 tccLKa 1 15 CCLK Active After R E CTTL 12 0 1 15 CCLK Hold After R E CTTL 0 0 1 15 CCLK Inactive After R E CTTL 12 0 1 15 CDOUT Hold After R E CTTL 0 0 1 15 CDOUT Valid After R E CTTL 12 0 tcTp 1 22 CTTL Clock Period Note A R E CTTL to next R E CTTL 48 8 50 000 tEMCSa 1 17 EMCS Active After R E CTTL T2W1 12 0 1 5 1 17 EMCS Hold After R E CTTL 0 0 tEMCSia 1 17 EMCS Inactive After R E CTTL T3 12 0 tFSa 1 15 50 a
87. opback control 0 Loopback disable default 1 Loopback enabled During RECORD state the input samples are echoed back un changed i e no volume control to the co dec Bit 1 Codec input control 0 Input is received via the line codec i e the codec which is controlled via CFSO default 1 Input is received via the speakerphone codec i e the codec which is controlled via CFS1 Bit 2 3 Codec output control 00 In PLAY IDLE SYNTHESIS and TONE__ GENERATE output is to both codecs In RECORD mode output is to the non input codec Volume control is not supported in RECORD mode If the loopback control bit is set output is to both codecs default 01 Output in all states is to the line codec 10 Output in all states is to the speakerphone codec 11 Output in all states is to both codecs Bits 4 7 Reserved Example CCIO 01 Microcontroller 34 01 CompactSPEECH 34 01 Byte sequence Description loopback enable Input is from the line codec Output goes to both codecs CFG Configure CompactSPEECH config__value Configures the CompactSPEECH in various hardware envi ronments It should be used to change the default Compact SPEECH configuration The config__value parameter is encoded as follows 8 0 Codec configuration 0 short frame format default 1 long frame format Guaranteed by design but not tested Bit 1 Reserved Bit 2 Echo cancellation control
88. or SB command RMSG Read Message data Returns 32 bytes of data from the current position of the message pointer and advances the message pointer by 32 bytes If the CompactSPEECH was in the IDLE state the com mand opens the current message switches the Compact SPEECH to the MSG_OPEN state sets the message pointer to the beginning of the message data and returns the 32 bytes of data The microcontroller must issue an S command to close the message and switch the CompactSPEECH to the IDLE state If the current message is undefined ERR INVALID is re ported Trying to read beyond the end of the message will set the NORMAL END event and the CompactSPEECH will switch to the IDLE state In this case the return value is undefined and should be ignored Example RMSG Data Microcontroller 32 Byte sequence CompactSPEECH 32 32 bytes of data Description Read 32 bytes from the current message memory RRAM Read Memory Exists for compatibility only Use RMSG instead S Stop Stops execution of the current command and switches the CompactSpeech to the IDLE state S may be used to stop the execution of all asynchronous commands http www national com 42 2 0 Software continued Example S Microcontroller 00 CompactSPEECH 00 Byte sequence Description Stop current activity e g playback recording and put th
89. rom these signals to the Serial Flash devices the power supply to these devices must not be disconnected The CompactSPEECH stores messages and all memory management information in flash memory Thus there is no need to maintain the power to the processor to preserve stored messages If the microcontroller s real time clock and not the CompactSPEECH s real time clock is used to maintain the time and day neither the flash nor the CompactSPEECH require battery backup during power fail ure In this case when returning to normal mode the micro controller should perform the initialization sequence as de scribed in Section 2 11 and use the SETD command to set the time and day To keep power consumption low in power down mode the RESET MWCS MWCLK and MWDIN signals should be held above 0 5V or below Vss 0 5V The PDM Go To Power down Mode command switches the CompactSPEECH to power down mode For an expla nation of the CompactSPEECH commands see Section 2 15 It may only be issued when the CompactSPEECH is in the IDLE state For an explanation of the Compact SPEECH states see Section 2 3 If it is necessary to switch to power down mode from any other state the controller must first issue an S command to switch the Compact SPEECH to the IDLE state and then issue the PDM com mand Sending any command while in power down mode resets the CompactSPEECH detectors and returns the CompactSPEECH to normal operation
90. s the type and direc share the same pin tion of each signal TABLE 1 1 CompactSPEECH Pin Signal Assignment Type Signal Name 1 0 A 0 15 TTL A 0 15 Output CCLK TTL CCLK Output CDIN TTL CDIN Input CDOUT TTL CDOUT Output CFSO TTL CFSO Output CFS1 TTL CFS1 Output D 0 7 TTL D 0 7 1 0 MWCS TTL Note A MWCS Input TST TTL TST Input MWRDY TTL MWRDY 1 0 MWRQST MWRQST 1 0 MWDOUT TTL MWDOUT Output PB 0 2 TTL EA 16 18 Output Note B PB 3 6 TTL CS 0 3 Output Note C EMCS TTL1 Note D EMCS Output ENVO CMOS Note E ENVO Input MWCLK TTL MWCLK Input MWDIN TTL MWDIN Input MMCLK TTL1 Note D MMCLK Output MMDIN TTL MMDIN Input MMDOUT TTL1 Note D MMDOUT Output RESET Schmitt Note A RESET Input Voc Power Voc Vss Power Vss x1 XTAL x1 OSC X2 CLKIN XTAL OSC TTL CLKIN Input Note A Schmitt trigger input Note B Virtual address lines for 5 ROM Note C Chip select lines for Serial Flash devices Note D TTL1 output signals provide CMOS levels in the steady state for small loads Note E Input during reset CMOS level input http www national com 4 1 0 Hardware continued 1 1 2 Pin Assignment in the 68 PLCC Package 10 MMDOUT MMDIN NC 00 01 02 Vss D3 D4 05 D6 07 11 12 A13 MMCLK Vss X2 CLKIN xt TST NC NC NC MWRDY MWDOUT NSAM266SP NC 68 P
91. s to RECORD The R com mand continues execution until stopped by the S command Recording can be paused with the PA command and can be resumed later with the RES command If the memory becomes full recording stops and MEMFULL is set in the status word Example R 000E Microcontroller OC 00 OE Byte sequence CompactSPEECH 00 OE Description Record a new ICM in mailbox Number 6 in a system where the message tag is encoded as described in the example of the DMS command RDET Reset Detectors detectors_reset_mask Resets the CompactSPEECH tone and energy detectors according to the value of the detectors reset mask pa rameter A bit set to 1 in the mask resets the corresponding detector A bit cleared to 0 is ignored The 1 byte detectors reset mask is encoded as follows 8 0 Reset the busy and dial tone detectors Bits 1 4 Reserved Must be cleared to 0 Bit 5 Reset the no energy VOX detector Bit 6 Reset the DTMF detector Bit 7 Reserved Must be cleared to 0 Example RDET 20 Microcontroller 2C 20 CompactSPEECH 2C 20 Byte sequence Description Reset the VOX detector RES Resume Resumes the activity that was suspended by the PA SF or SB commands Example RES Microcontroller 1D CompactSPEECH 1D Byte sequence Description Resume playback which was suspended by either the PA SF
92. set and the Compact SPEECH switches to the IDLE state Section 2 2 provides a table which shows all the Compact SPEECH commands the source states in which these com mands are valid and the result states which the Compact SPEECH enters as a result of the command 2 4 COMMAND EXECUTION A CompactSPEECH command is represented by an 8 bit opcode Some commands have parameters and some have return values Commands are either synchronous or asynchronous SYNCHRONOUS COMMANDS A synchronous command must complete execution before the microcontroller can send a new command e g GMS GEW A command sequence starts when the microcontroller sends an 8 bit opcode to the CompactSPEECH followed by the command s parameters if any The CompactSPEECH executes the command and if re quired transmits a return value to the microcontroller Upon completion the CompactSPEECH notifies the microcontrol ler that it is ready to accept a new command ASYNCHRONOUS COMMANDS An asynchronous command starts execution in the back ground and notifies the microcontroller which can send more commands while the current command is still running e g R P STATUS WORD The 16 bit status word indicates events that occur during normal operation The CompactSPEECH activates the MWRGST signal to indicate a change in the status word This signal remains active until the CompactSPEECH re ceives a GSW command ERROR WORD The 16 bit error word
93. ss Detection is active throughout the operation of the CompactSPEECH Detection can be con figured using the SDET Set Detectors Mask command which controls the reporting of the occurrence of tones and the RDET Reset Detectors command which resets the de tectors DTMF DTMF detection may be reported at the starting point end ing point or both The report is made through the status word for further details see GSW command in Section 2 15 The DTMF detector performance as measured on the line input using an NSV AM265 DAA board is summarized on following page see Table 2 1 ECHO CANCELLATION Echo cancellation is a technique used to improve the per formance of DTMF tone detection during speech synthesis tone generation and OGM playback For echo cancellation to work properly AGC must not be active in parallel Thus to take advantage of echo cancellation the microcontroller must control the AGC i e disable the AGC during PLAY SYNTHESIS _ states and enable it again afterwards If AGC cannot be disabled do not use echo cancellation The microcontroller should use the CFG command to activate deactivate echo cancellation For fur ther details see Section 2 15 Echo cancellation applies only to DTMF tones Busy and dial tone detection is not affected by this technique This implies that the performance of the busy and dial tone de tector during message playback depends on the messa
94. ted as silence If you divide multiply the value by 2 you get 3 dB decrease increase in the threshold Legal values 0 to 65535 12 11 Reserved 12 VOX TIME COUNT This constant in units of 10 ms determines the period of silence before the CompactSPEECH reports silence The accuracy of the constant is 10 ms Legal values 0 to 65535 700 13 15 Reserved http www national com 46 2 0 Software continued TABLE 2 2 Tunable Parameters Continued Index Parameter Name Description Default 16 TONE GENERATION LEVEL Controls the energy level at which DTMF and other tones are generated Each unit represents 3 dB The default level is the reference level For example if you set this parameter to 4 the energy level is 6 dB less than the default level The actual output level is the sum of GENERATION LEVEL and the VOL LEVEL variable controlled by the VC command The tones are distorted when the level is set too high Legal values 0 lt GENERATION LEVEL VOL LEVEL lt 12 6 17 Reserved 18 TONE TIME COUNT Controls the duration of a tone before it is reported as a dial tone in 10 ms units The accuracy of the constantis 10 ms Legal values 0 to 65535 700 19 ENERGY THRESHOLD Minimum energy level at which busy and dial tones are detected as ON after 700 Hz filtering
95. tes 25 seconds Serial Flash Endurance The serial flash may be erased up to 100 000 times To reduce the effect of this limitation the memory manager utilizes the serial flash s blocks evenly i e each block is erased more or less the same number of times to ensure that all blocks have the same lifetime http www national com 1 0 Hardware continued Consider the following extensive usage of all the NM29A040 s blocks 1 Record 15 minutes of messages until the memory is full 2 Playback 15 minutes all the recorded messages 3 Delete all messages Assuming a NM29A040 device is used in this manner 24 times a day its expected lifetime is Flash Lifetime 100 000 24 365 11 4 years Thus the NM29A040 device will last for over ten years even when used for six hours of recording per day Note that if an NM29A080 device is used then under the same conditions it will last for more than 20 years ROM Interface IVS vocabularies can be stored in either serial flash and or ROM The CompactSPEECH supports IVS ROM devices through Expansion Memory Up to 64 kbytes 64k x 8 of Expansion Memory are supported directly Nevertheless the CompactSPEECH uses bits of the on chip port PB to further extend the 64 kbytes address space up to 0 5 Mbytes address space ROM is connected to the CompactSPEECH using the data bus D 0 7 the address bus A 0 15 the extended address signals EA 16 18
96. tion and generation message storage management speech synthesis for time and day stamp and supports user defined voice prompts in various languages The CompactSPEECH implements digital full duplex speakerphone which utilizes acoustic echo cancellation techniques to enable simultaneous talking and listening dur ing hands free conversation Minimum microcontroller inter vention launch and forget is required during speakerphone sessions The speakerphone monitors its performance in real time and continually updates its internal state and fil ters to enable high quality hands free conversation The CompactSPEECH implements echo cancellation tech niques to support high quality DTMF tone detection during message playback The CompactSPEECH can synthesize messages in various languages via the International Vocabulary Support IVS mechanism The NSAM266SP can store vocabularies on either Serial Flash or Expansion ROM memories DAM manufacturers can thus create machines that speak in different languages simply by using other vocabularies For more details about IVS refer to the VS User s Manual Block Diagram NSAM266SP Voice Processor Microcontroller MICROWIRE Serial Interface TRI STATE is a registered trademark of National Semiconductor Corporation NSAM 266SP Basic Configuration NM29A040 NM29A080 Serial Flash SPKR Analog Front End MIC TP3054 Codec CLK TP3054 Codec
97. troller 09 FF 00 00 Byte sequence CompactSPEECH 09 FF 00 00 01 Description Select the oldest of the new ICMs in mailbox number 6 to be the current message For a system where the message tag is encoded as described in the example for the DMS command The CompactSPEECH return value indicates that there is such a message The following pseudo code demonstrates how to play all new ICMs The messages are marked after being played In mailbox number 6 Return val GTM FFCE OOSF 1 While ReturnVal TRUE Begin P Play Message_tag GMT get message tag SMT FFF7 Mark the message as old GTM FFCE OOSF 1 Get next with same tag End INIT Initialize System If there is not enough memory space for the vocabulary Execute this command after the CompactSPEECH has been configured see CFG and GCFG commands Performs a soft reset of the CompactSPEECH as follows Initializes the message directory information Messages are not deleted To delete the messages use the DM and DMS commands Sets the detectors mask to O Sets the volume level that is controlled by the VC com mand to 0 Sets the playback speed to normal 0 Switches to the IDLE state Initializes the tone detectors The current message is undefined after INIT execution The tunable parameters are not affected by this command They are set to their default values only during RESET Exampl
98. y detection in 10 ms units The accuracy of the constant is 10 ms Legal values 0 to 65535 600 24 ECHO DELAY The near echo delay in samples The sampling rate is 8000 Hz i e 125 us per sample Legal values 0 to 16 25 Reserved 26 DTMF REV TWIST Controls the reverse twist level at which CompactSPEECH detects DTMF tones While the normal twist is set at 8 dB the reverse twist can be either 8 dB default or 4 dB If this parameter is set to 1 47 http www national com 2 0 Software continued TABLE 2 2 Tunable Parameters Continued Index Parameter Name Description Default 27 TWIST LEVEL A one byte value that controls the twist level of a DTMF tone generated by the GT command by controlling the energy level of each of the two tones low frequency and high frequency composing the DTMF tone The Least Significant Nibble LSN controls the low tone and the Most Significant Nibble MSN controls the high tone The energy level of each tone as measured at the output of a TP3054 codec before the DAA connected to the CompactSPEECH is summarized in the following table Nibble Value Tone Energy dBV 0 0 17 8 14 3 12 9 12 4 12 0 11 9 11 85 8 15 11 85 The volume of the generated tone during meaurements was 6 TONE__GENERATION__LEVEL VOL LEVEL 6 For the default level the high tone is 14 3

Download Pdf Manuals

image

Related Search

Related Contents

資材計画部資材計画課  ゲイトトレーニングシステム3 ショートハンドレール付 ロングハンドレール付  Técnicas Geomáticas en Ingeniería Civil  repair parts manual model no. we4qe22sha lawn mower manuel    取説 - キッコーマン バイオケミファ  Whirlpool LA6805XK User's Manual  article  T_CODALP_REV1 - Cook Medical  Dm PRAMAC - Scalemates  

Copyright © All rights reserved.
Failed to retrieve file