0
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
会员中心
创作中心
发布
  • 发文章

  • 发资料

  • 发帖

  • 提问

  • 发视频

创作活动
NSAM266SA

NSAM266SA

  • 厂商:

    NSC

  • 封装:

  • 描述:

    NSAM266SA - NSAM266SA CompactSPEECHTM Digital Speech Processor with Serial Flash Interface - Nationa...

  • 数据手册
  • 价格&库存
NSAM266SA 数据手册
NSAM266SA CompactSPEECH Digital Speech Processor with Serial Flash Interface March 1996 NSAM266SA CompactSPEECH TM Digital Speech Processor with Serial Flash Interface General Description The NSAM266SA is a member of National Semiconductor’s CompactSPEECH Digital Speech Processor family This processor provides Digital Answering Machine (DAM) functionality to embedded systems The CompactSPEECH interfaces with National Semiconductor’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 CompactRISCTM architecture It contains system support functions such as Interrupt Control Units Codec interface MICROWIRETM interfaces to a microcontroller and Serial Flash WATCHDOGTM timer and a Clock Generator The CompactSPEECH processor operates as a slave peripheral that is controlled by an external microcontroller via a serial MICROWIRE interface In a typical DAM environment the microcontroller controls the analog circuits buttons and display and activates the CompactSPEECH by sending it commands The CompactSPEECH processor executes the commands and returns status information to the microcontroller The CompactSPEECH firmware implements voice compression and decompression tone detection and generation message storage management speech synthesis for timeand-day stamp and supports user-defined voice prompts in various languages The CompactSPEECH implements echo-cancellation techniques 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 NSAM266SA 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 IVS User’s Manual 1 0 Hardware 1 1 BLOCK DIAGRAMS NSAM266SA Basic Configuration TL EE 12584 – 1 TRI-STATE is a registered trademark of National Semiconductor Corporation CompactSPEECHTM CompactRISCTM COPSTM Microcontrollers HPCTM MICROWIRETM MICROWIRE PLUSTM and WATCHDOGTM are trademarks of National Semiconductor Corporation C1996 National Semiconductor Corporation TL EE12584 RRD-B30M46 Printed in U S A http www national com Features Y Y Y Y Y Y Y Y Y Y Y Y Y Designed around the CR16A a 16-bit general-purpose RISC core implementation of the CompactRISC architecture 20 48 MHz operation On-chip DSP Module (DSPM) for high-speed DSP operations On-chip codec clock generation and interface Power-down mode Selectable speech compression rate of 5 2 kbit s or 7 3 kbit s with silence compression Up to 16 minutes recording on a 4-Mbit Serial Flash (more than 1 hour total recording time on four devices) 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 categorization e g Mailboxes InComing Messages (ICM) OutGoing Messages (OGM) Skip forward or backward during message playback Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Digital volume control Variable speed playback Supports external vocabularies using Serial Flash or expansion ROM Multi-lingual speech synthesis using International Vocabulary 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 Call screening (input signal echoed to codec output) Real-time clock Direct access to message memory Supports long-frame and short-frame codecs Supports up to four 4-Mbit or two 8-Mbit Serial Flash devices Supports prerecorded IVS and OGM on Serial Flash Available in 68-pin PLCC and 100-pin PQFP packages http www national com 2 Table of Contents 1 0 HARDWARE 1 1 Block Diagrams 1 2 Pin Assignment 1 2 1 Pin Signal Assignment 1 2 2 Pin Assignment in the 68-PLCC Package 1 2 3 Pin Assignment in the 100-PQFP Package 1 3 Functional Description 1 3 1 Resetting 1 3 2 Clocking 1 3 3 Power-down Mode 1 3 4 Power and Grounding 1 3 5 Memory Interface 1 3 6 Codec Interface 1 4 Specifications 1 4 1 Absolute Maximum Ratings 1 4 2 Electrical Characteristics 1 4 3 Switching Characteristics 1 4 4 Synchronous Timing Tables 1 4 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 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 Speech Synthesis 2 9 1 Explanation of Terms 2 9 2 Vocabulary Design 2 9 3 IVS Vocabulary Components 2 9 4 The IVS Tool 2 9 5 How to Use the IVS Tool With the CompactSPEECH 2 10 Initialization 2 11 Microwire Serial Interface 2 12 Signal Description 2 12 1 Signal Use in the Interface Protocol 2 12 2 Interface Protocol Error Handling 2 13 The Master Microwire Interface 2 13 1 Master MICROWIRE Data Transfer 2 14 Command Description APPENDIX A SCHEMATIC DIAGRAMS Quick Reference 3 http www national com 1 0 Hardware (Continued) 1 2 PIN ASSIGNMENT The following sections detail the pins of the NSAM266SA processor Slashes separate the names of signals that share the same pin 1 2 1 Pin Signal Assignment Table 1-1 shows all the pins and the signals that use them in different configurations It also shows the type and direction of each signal Signal Assignment Signal Name A(0 15) CCLK CDIN CDOUT CFS0 D(0 7) MWCS TST MWRDY MWRQST MWDOUT EA(16 18) CS(0 3) EMCS ENV0 MWCLK MWDIN MMCLK MMDIN MMDOUT CFS0 RESET VCC VSS X1 X2 CLKIN OSC OSC Input IO Output Output Input Output Output IO Input Input IO IO Output Output Output Output Input Input Input Output Input Output Output Input TABLE 1-1 CompactSPEECH Pin Pin Name A(0 15) CCLK CDIN CDOUT CFS0 D(0 7) MWCS TST MWRDY MWRQST MWDOUT PB(0 2) (Note B) PB(3 6) (Note C) EMCS ENV0 MWCLK MWDIN MMCLK MMDIN MMDOUT CFS0 RESET VCC VSS X1 X2 CLKIN Note A Schmitt trigger input Note B Virtual address lines for IVS 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 Type TTL TTL TTL TTL TTL TTL TTL (Note A) TTL TTL TTL TTL TTL TTL TTL1 (Note D) CMOS (Note E) TTL TTL TTL1 (Note D) TTL TTL1 (Note D) CMOS Schmitt (Note A) Power Power XTAL XTAL TTL http www national com 4 1 0 Hardware (Continued) 1 2 2 Pin Assignment in the 68-PLCC Package TL EE 12584 – 3 Note Pins marked NC should not be connected FIGURE 1-1 68-PLCC Package Connection Diagram 5 http www national com 1 0 Hardware (Continued) 1 2 3 Pin Assignment in the 100-PQFP Package TL EE 12584 – 4 Note Pins marked NC should not be connected FIGURE 1-2 100-PQFP Package Connection Diagram http www national com 6 1 0 Hardware (Continued) 1 3 FUNCTIONAL DESCRIPTION This section provides details of the functional characteristics of the CompactSPEECH processor It is divided into the following sections Resetting Clocking Power-down Mode Power and Grounding Memory Interface Codec Interface 1 3 1 Resetting The RESET pin is used to reset the CompactSPEECH processor On application of power RESET must be held low for at least tpwr after VCC 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 tRST During this period and for 100 ms 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 ms 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 ENV0 signal is sampled to determine the operating environment During reset the EMCS ENV0 pin is used for the ENV0 input signals An internal pull-up resistor sets ENV0 to 1 After reset the same pin is used for EMCS System Load on ENV0 For any load on the ENV0 pin the voltage should not drop below VENVh If the load on the ENV0 pin causes the current to exceed 10 mA use an external pull-up resistor to keep the pin at 1 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 4 2 TL EE 12584 – 6 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 TL EE 12584 – 7 Figure 1-3 shows a recommended circuit for generating a reset signal when the power is turned on FIGURE 1-5 Connections for an External Crystal Oscillator Keep stray capacitance and inductance in the oscillator circuit as low as possible The crystal resonator and the external components should be as close to 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 capacitance 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 circuit TABLE 1-2 Crystal Oscillator Component List Component Parameters Values Tolerance Resonance Frequency 40 96 MHz Third Overtone Type Maximum Serial Crystal Resistance Resonator TL EE 12584 – 5 Parallel AT-Cut 50X 7 pF 12 pF 10 MX 1000 pF 3 9 mH 5% 20% 10% NA Maximum Shunt Capacitance Maximum Load Capacitance Resistor R1 Capacitor C1 Inductor L 7 FIGURE 1-3 Recommended Power-On Reset Circuit 1 3 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 signal or a crystal oscillator may be used as the clock source http www national com 1 0 Hardware (Continued) 1 3 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 CompactSPEECH is reduced and some of the processor modules are deactivated As a result the CompactSPEECH consumes much less power than in normal-power mode (k 1 5 mA) Although the CompactSPEECH does not perform 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 CS0 to CS3 are set to 1 To guarantee that there is no current flow from these signals to the Serial Flash devices the power supply to these devices must not be disconnected 1 3 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 NM29A040 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 – 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 The basic compression rate (5 2 kbit s or 7 3 kbit s) The amount of silence in the recorded speech The number of unusable blocks 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 not used per recorded message) Assuming a single message is recorded in all the available memory space of a 4 Mbit device with all blocks usable 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 0 10 15 20 25 Total Record Time 13 min 9 sec 14 min 25 sec 15 min 7 sec 15 min 47 sec 16 min 25 sec 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 failure In this case when returning to normal mode the microcontroller should perform the initialization sequence as described in Section 2 10 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 VCC b 0 5V or below VSS a 0 5V The PDM (Go To Power-down Mode) command switches the CompactSPEECH to power-down mode (For an explanation of the CompactSPEECH commands see Section 2 14 ) It may only be issued when the CompactSPEECH is in the IDLE state (For an explanation of the CompactSPEECH 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 CompactSPEECH to the IDLE state and then issue the PDM command Sending any command while in power-down mode resets the CompactSPEECH detectors and returns the CompactSPEECH to normal operation mode 1 3 4 Power and Grounding The CompactSPEECH processor requires a single 5V power 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 respectively on the printed circuit board If VCC and the ground planes are not used single conductors should be run directly 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 minimum Attach standard 0 1 mF ceramic capacitors to the VCC and GND pins as close as possible to the CompactSPEECH When you build a prototype using wire-wrap or other methods solder the capacitors directly to the power pins of the CompactSPEECH socket or as close as possible with very short leads 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 8 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 e 100 000 (24 365) e 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) 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-STATE 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 T3 cycle The address remains valid until the end of T3H 1 3 6 Codec Interface The CompactSPEECH provides an on-chip interface to a serial codec This interface supports codec operation in long- or short-frame formats The format is selected with the CFG command The codec interface uses four signals CDIN CDOUT CCLK and CFS0 Data is transferred to the codec through the CDOUT pin Data is read from the codec through the CDIN pin Data transfer between the CompactSPEECH and the serial codec starts by the CompactSPEECH asserting (setting to 1) the CFS0 frame synchronization signal After one clock cycle the CompactSPEECH de-asserts (clears to 0) CFS0 data from the CompactSPEECH is sent to the codec through CDOUT and simultaneously data from the codec is sent to the CompactSPEECH through CDIN Short Frame Protocol When short frame protocol is configured eight data bits are exchanged with each codec in each frame i e CFS0 cycle Data transfer starts when CFS0 is set to 1 for one CCLK cycle The data is then transmitted bit-by-bit via the CDOUT output pin Concurrently the received data is shifted in via the CDIN input pin Data is shifted one bit in each CCLK cycle 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 exhanged with each codec as with the short frame protocol However for the long frame protocol data transfer starts by setting CFS0 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 Figure 1-7 shows how the codec interface signals behave when long frame protocol is configured 9 http www national com 1 0 Hardware (Continued) TL EE 12584 – 8 FIGURE 1-6 Codec Protocol Short Frame TL EE 12584 – 9 FIGURE 1-7 Codec Protocol Long Frame http www national com 10 1 0 Hardware (Continued) 1 4 SPECIFICATIONS 1 4 1 Absolute Maximum Ratings If Military Aerospace specified devices are required please contact the National Semiconductor Sales Office Distributors for availability and specifications b 65 C to a 150 C Storage Temperature Temperature under Bias 0 C to a 70 C All Input or Output Voltages with Respect to GND b 0 5V to a 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 1 4 2 Electrical Characteristics TA e 0 C to a 70 C VCC e 5V g 10% GND e 0V Symbol VIH VIL VXH VXL VENVh VHh VHI VHys VOH VOHWC Parameter TTL Input Logical 1 Input Voltage TTL Input Logical 0 Input Voltage CLKIN Input High Voltage CLKIN Input Low Voltage ENV0 High Level Input Voltage CMOS Input with Hysteresis Logical 1 Input Voltage CMOS Input with Hysteresis Logical 0 Input Voltage Hysteresis Loop Width (Note A) Logical 1 TTL Output Voltage MMCLK MMDOUT and EMCS Logical 1 Output Voltage Logical 0 TTL Output Voltage IOH e b0 4 mA IOH e b0 4 mA IOH e b50 mA (Note B) IOL e 4 mA IOL e 50 mA (Note B) VOLWC MMCLK MMDOUT and EMCS Logical 0 Output Voltage Input Load Current (Note C) Output Leakage Current (I O Pins in Input Mode) (Note C) Active Supply Current Standby Supply Current Power-Down Mode Supply Current X1 and X2 Capacitance (Note A) IOL e 4 0 mA IOL e 50 mA (Note B) 0V s VIN s VCC 0V s VOUT s VCC Normal Operation Mode Running Speech Applications (Note D) Normal Operation Mode DSPM Idle (Note D) Power-Down Mode (Notes D and E) 17 b5 0 b5 0 Conditions Min 20 b0 5 Typ Max VCC a 05 08 Units V V V External Clock External Clock 20 08 36 36 11 05 24 24 VCC b 0 2 0 45 02 0 45 02 50 50 65 40 15 80 V V V V V V V V V V V V mA mA mA mA mA pF VOL IL IO (Off) ICC1 ICC2 ICC3 CX 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 k 50 mA Note C Maximum 20 mA for all pins together Note D IOUT e 0 TA e 25 C VCC e 5V operating from a 40 96 MHz crystal and running from internal memory with Expansion Memory disabled Note E All input signals are tied to 1 or 0 (above VCC b 0 5 or below VSS a 0 5V) 11 http www national com 1 0 Hardware (Continued) 1 4 3 Switching Characteristics Definitions All timing specifications in this section refer to 0 8V or 2 0V on the rising or falling edges of the signals as illustrated in Figures 1-8 through 1-14 unless specifically stated otherwise Maximum times assume capacitive loading of 50 pF CLKIN crystal frequency is 40 96 MHz Note CTTL is an internal signal and is used as a reference to explain the timing of other signals See Figure 1-22 TL EE 12584 – 10 Signal valid active or inactive time after a rising edge of CTTL or MWCLK FIGURE 1-8 Synchronous Output Signals (Valid Active and Inactive) TL EE 12584 – 11 Signal valid time after a falling edge of MWCLK FIGURE 1-9 Synchronous Output Signals (Valid) TL EE 12584 – 12 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) TL EE 12584 – 13 Signal hold time after a falling edge of MWCLK FIGURE 1-11 Synchronous Output Signals (Hold) TL EE 12584 – 14 Signal setup time before a rising edge 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) TL EE 12584 – 15 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 TL EE 12584 – 16 FIGURE 1-14 Hysteresis Input Characteristics http www national com 14 1 0 Hardware (Continued) 1 4 4 Synchronous Timing Tables In this section R E means Rising Edge and F E means Falling Edge OUTPUT SIGNALS Symbol tAh tAv tCCLKa tCCLKh tCCLKia tCDOh tCDOv tCTp tEMCSa tEMCSh tEMCSia tFSa tFSh tFSia tMMCLKa tMMCLKh tMMCLKia tMMDOh tMMDOv tMWDOf tMWDOh tMWDOnf tMWDOv tMWITOp tMWRDYa tMWRDYia tPABCh tPABCv Figure 1-17 1-17 1-15 1-15 1-15 1-15 1-15 1-22 1-17 1-17 1-17 1-15 1-15 1-15 1-20 1-20 1-20 1-20 1-20 1-18 1-18 1-18 1-18 1-19 1-18 1-18 1-21 1-21 Description Address Hold Address Valid CCLK Active CCLK Hold CCLK Inactive CDOUT Hold CDOUT Valid CTTL Clock Period (Note A) EMCS Active EMCS Hold EMCS Inactive CFS0 Active CFS0 Hold CFS0 Inactive Master MICROWIRE Clock Active Master MICROWIRE Clock Hold Master MICROWIRE Clock Inactive Master MICROWIRE Data Out Hold Master MICROWIRE Data Out Valid MICROWIRE Data Float (Note B) MICROWIRE Data Out Hold (Note B) MICROWIRE Data No Float (Note B) MICROWIRE Data Out Valid (Note B) MWDIN to MWDOUT MWRDY Active MWRDY Inactive PB and MWRQST PB and MWRQST Reference Conditions After R E CTTL After R E CTTL T1 After R E CTTL After R E CTTL After R E CTTL After R E CTTL After R E CTTL R E CTTL to next R E CTTL After R E CTTL T2W1 After R E CTTL After R E CTTL T3 After R E CTTL After R E CTTL After R E CTTL After R E CTTL After R E CTTL After R E CTTL After R E CTTL After R E CTTL After R E MWCS After F E MWCK After F E MWCS After F E MWCK Propagation Time After R E of CTTL After F E MWCLK After R E CTTL After R E CTTL T2W1 00 00 00 12 0 00 00 70 0 70 0 70 0 35 0 70 0 00 12 0 70 0 00 12 0 00 25 0 12 0 00 12 0 25 0 48 8 00 12 0 50 000 12 0 00 12 0 Min (ns) 00 12 0 12 0 Max (ns) Note A In normal operation mode tCTp must be 48 8 ns in power-down mode tCTp 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 tCDIh tCDIs tDIh tDIs tMMDINh tMMDINs tMWCKh tMWCKI tMWCKp tMWCLKh tMWCLKs tMWCSh tMWCSs tMWDIh tMWDIs tPWR tRSTw tXh tXI tXp Figure 1-15 1-15 1-17 1-17 1-20 1-20 1-18 1-18 1-18 1-18 1-18 1-18 1-18 1-18 1-18 1-24 1-23 1-22 1-22 1-22 CDIN Hold CDIN Setup Data in Hold (D0 7) Data in Setup (D0 7) Master MICROWIRE Data In Hold Master MICROWIRE Data In Setup MICROWIRE Clock High (Slave) MICROWIRE Clock Low (Slave) MICROWIRE Clock Period (Slave) (Note A) MWCLK Hold MWCLK Setup MWCS Hold MWCS Setup MWDIN Hold MWDIN Setup Power Stable to RESET R E (Note B) RESET Pulse Width CLKIN High CLKIN Low CLKIN Clock Period Description Reference Conditions After R E CTTL Before R E CTTL After R E CTTL T1 T3 or TI Before R E CTTL T1 T3 or TI After R E CTTL Before R E CTTL At 2 0V (Both Edges) At 0 8V (Both Edges) R E MWCLK to next R E MWCLK After MWCS becomes Inactive Before MWCS becomes Active After F E MWCLK Before R E MWCLK After R E MWCLK Before R E MWCLK After VCC reaches 4 5V At 0 8V (Both Edges) At 2 0V (Both Edges) At 0 8V (Both Edges) R E CLKIN to next R E CLKIN Min (ns) 00 11 0 00 15 0 00 11 0 100 0 100 0 2 5 ms 50 0 100 0 50 0 100 0 50 0 100 0 30 0 ms 10 0 ms tX1p 2 b 5 tX1p 2 b 5 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 4 5 Timing Diagrams TL EE 12584 – 17 FIGURE 1-15 Codec Short Frame Timing TL EE 12584 – 18 FIGURE 1-16 Codec Long Frame Timing 17 http www national com 1 0 Hardware (Continued) TL EE 12584 – 19 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 Tl (Idle) or T1 FIGURE 1-17 ROM Read Cycle Timing TL EE 12584 – 20 FIGURE 1-18 MICROWIRE Transaction Timing Data Transmitted to Output http www national com 18 1 0 Hardware (Continued) TL EE 12584 – 21 FIGURE 1-19 MICROWIRE Transaction Timing Data Echoed to Output TL EE 12584 – 22 FIGURE 1-20 Master MICROWIRE Timing 19 http www national com 1 0 Hardware (Continued) TL EE 12584 – 23 Note This cycle may be either Tl (idle) T2 T3 or T3H FIGURE 1-21 Output Signal Timing for Port PB and MWRQST TL EE 12584 – 24 FIGURE 1-22 CTTL and CLKIN Timing TL EE 12584 – 25 FIGURE 1-23 Reset Timing When Reset is not at Power-Up TL EE 12584 – 26 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 DTMF detector with echo canceler Energy-based busy and dial-tone detector Digital volume control Command interface to an external microcontroller Memory and message manager IVS support Tone generator Real-time clock handler Power-down mode support 2 1 2 System Support 2 1 3 Peripherals Support  Serial flash interface (Master MICROWIRE handler)  Microcontroller interface (Slave MICROWIRE handler)  Codec interface The following sections describe the CompactSPEECH software in detail 21 http www national com http Command Description Description Action number RESET IDLE RESET IDLE IDLE IDLE IDLE None RESET IDLE All States PLAY RECORD SYNTHESIS No Change TONE GENERATE IDLE IDLE IDLE IDLE IDLE All States IDLE IDLE IDLE RESET IDLE RESET IDLE IDLE IDLE IDLE No Change IDLE PLAY IDLE IDLE No Change None 1 Time Day Option Tag None N byte1 None None None IDLE None byten 4an ref Tag 1 IDLE IDLE None Tag ref Tag mask 2a2 IDLE Type IDLE None 1 Index No Change None 1 No Change None None Version Config Error Word Value Message Length Recording Time Left Message Tag Number of Messages Status Word None Time Day Mask Dir 2 a 2 a 1 Message Found None None None None None None 2 1 value 2 2 2 2 2 2 2 2 IDLE Tag ref Tag mask 2a2 None IDLE None None IDLE None Test Result IDLE Length of Time 2 None 1 RESET Config value 2 None No Change Config value 1 None 1 Test Result 1 Bytes Description Bytes Check and Map ARAM Configure Codec I O Configure CompactSPEECH Cut Message Tail Check Vocabulary Delete Message Delete Messages Free Memory Get Configuration Value Get Error Word Get Information Item Get Length Get Memory Status Get Message Tag Get Number of Messages Get Status Word Generate Tone Get Time and Day Get Tagged Message Initialize System Inject IVS Data Memory Reset Playback Pause Go to Power-Down Mode 1A IDLE 1C 03 2A 29 13 09 0E 0D 14 11 04 12 19 25 1B 02 08 0B 0A 2B 26 01 34 06 Opcode Hex Source State Result State Command Parameters Return Value Name SA AMAP S 2 0 Software (Continued) 2 2 CompactSPEECH COMMANDS www national com CCIO S CFG S CMT S CVOC S DM S DMS S FR A GCFG S GEW S GI S GL S QUICK REFERENCE TABLE 22 TONE GENERATE Tone or DTMF PLAY RECORD SYNTHESIS No Change TONE GENERATE IDLE GMS S GMT S GNM S GSW S GT A GTD S GTM S INIT S INJ S MR S P A PA S PDM S Command Description Description IDLE IDLE PLAY RECORD SYNTHESIS TONE GENERATE IDLE IDLE MEMORY All States but RESET IDLE PLAY IDLE IDLE PLAY IDLE IDLE PLAY IDLE IDLE IDLE PLAY SYNTHESIS IDLE IDLE IDLE IDLE IDLE PLAY SYNTHESIS IDLE TONE GENERATE IDLE MEMORY WRITE IDLE SYNTHESIS IDLE No Change MEMORY WRITE SYNTHESIS No Change SYNTHESIS IDLE No Change No Change Time Day Length of Time Message Tag Word Number Speed Value Sentence n Mode Id N word1 Index Value Increment Decrement Message Tag Data wordn No Change None 2 2 2 1 1 1 1a1 1an 1a2 1 2 a 32 No Change Detectors Mask No Change Length of Time SYNTHESIS Sentence n arg1 IDLE None 1a1 2 1 READ MEMORY READ None Data None None None None None None None None None None None None None None None None No Change None None 32 No Change Detectors Reset Mask 1 None RECORD Message Tag 2 None Bytes Description Bytes Record Message Reset Detectors Resume Read RAM Stop Say Argumented Sentence Skip Backward Set Detectors Mask Skip to End of Message Set Time and Day Skip Forward Set Message Tag Say One Word Set Playback Speed Say Sentence Set Vocabulary Type Say Words Tune Volume Control Write RAM 17 28 15 21 20 1F 16 07 05 22 0F 24 10 23 1E 00 18 1D 2C 0C Opcode Hex Source State Result State Command Parameters Return Value Name A S S S S A S S S S S S A S A S A S S S SA R RDET RES RRAM 2 0 Software (Continued) 2 2 CompactSPEECH COMMANDS S SAS SB SDET SE SETD SF SMT QUICK REFERENCE TABLE (Continued) 23 SO SPS SS SV SW TUNE VC WRAM Command is valid in IDLE state but has no effect This command exists for compatibility reasons only and will be obsoleted in future revisions of CompactSPEECH S Synchronous command http A Asynchronous command www national com 2 0 Software (Continued) 2 3 THE STATE MACHINE 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 memory full or power failure) 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-6) CompactSPEECH detectors (VOX call progress tones and DTMF tones) are not active In all other states the detectors 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 TONE GENERATE The CompactSPEECH generates single or DTMF tones MEMORY READ The CompactSPEECH reads a 32-byte block from the message memory and sends it to the external microcontroller MEMORY WRITE The CompactSPEECH accepts a 32-byte block from the external microcontroller and writes it to the message memory 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 completed 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 set and the CompactSPEECH switches to the IDLE state Section 2 2 provides a table which shows all the CompactSPEECH commands the source states in which these commands are valid and the result states which the CompactSPEECH 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 required transmits a return value to the microcontroller Upon completion the CompactSPEECH notifies the microcontroller that it is ready to accept a new command ASYNCHRONOUS COMMANDS An asynchronous command starts execution in the background 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 MWRQST signal to indicate a change in the status word This signal remains active until the CompactSPEECH receives a GSW command 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 EV ERROR bit in the status word is set to 1 and the MWRQST signal is activated ERROR HANDLING When the microcontroller detects that the MWRQST signal is active it should issue the GSW (Get Status Word) command which deactivates the MWRQST signal Then it should test the EV ERROR bit in the status word and 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 14 2 5 TUNABLE PARAMETERS The CompactSPEECH processor can be adjusted to your system’s requirements For this purpose the CompactSPEECH supports a set of tunable parameters which are set to their default values after reset and can be later modified with the TUNE command By tuning these parameters you can control various aspects of the CompactSPEECH’s operation such as silence compression tone detection noenergy detection etc Table 2-2 describes all the tunable parameters in detail Section 2 14 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 (OGMs) mailboxes and the ability to distinguish between InComing Messages (ICMs) and OGMs http www national com 24 2 0 Software (Continued) A message is the basic unit on which most of the CompactSPEECH commands operate A CompactSPEECH message stored on a flash device can be regarded as a computer file stored on a mass-storage device A message is created with either the R or the WRAM (Write Memory) command When a message is created it is assigned a time-and-day stamp and a message tag which can be read by the microcontroller The R command takes voice samples from the codec compresses them and stores them in the message memory When a message is created with the WRAM command the data to be recorded is provided by the microcontroller and not via the codec The data is transferred directly to the message memory It is not compressed by the CompactSPEECH voice compression algorithm The WRAM command together with the RRAM (Read Memory) command which enables the microcontroller to read data from the CompactSPEECH can be used to store data other than compressed voice in the message memory e g a telephone directory A message can be played back (P command) and deleted (DM command) Redundant data (e g trailing tones or silence) can be removed from the message tail with the CMT (Cut Message Tail) command The PA (Pause) and RES (Resume) commands respectively temporarily suspend the P and R commands and then allow them to resume execution from where they were suspended CURRENT MESSAGE Most message handling commands e g P DM RRAM operate on the current message The GTM (Get Tagged Message) command selects the current message Deleting the current message does not cause a different message to become current The current message is undefined 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 (bit 15) of the message tag is used to indicate the speech compression rate The microcontroller should program it before recording (‘‘1’’ for 4 8 kbit s ‘‘0’’ for 6 6 kbit s) The CompactSPEECH reads the bit before message playback to select the appropriate decompression 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 which only allow bits to be changed from 1 to 0 (changing bits from 0 to 1 requires a special erasure procedure see Section 1 3 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 compression 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 select 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 algorithm IVS vocabularies can be prepared in either of the two compression formats using the IVS tool All the messages in a single vocabulary must be recorded using the same algorithm (See the IVS User’s Manual for further details) During speech synthesis the CompactSPEECH automatically selects 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 operations and call progress Detection is active throughout the operation of the CompactSPEECH Detection can be configured 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 detectors DTMF DTMF detection may be reported at the starting point ending point or both The report is made through the status word (for further details see GSW command in Section 2 14) The DTMF detector performance as measured on the line input using an NSV-AM265-DAA board is summarized below (see Table 2-1) ECHO CANCELLATION Echo cancellation is a technique used to improve the performance 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 and TONE GENERATE 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 further details see Section 2 14 ) 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 detector during message playback depends on the message being played 25 http www national com 2 0 Software (Continued) TABLE 2-1 DTMF Detector Performance PLAY Detection Sensitivity (Note A) Accepted DTMF Length Frequency Tolerance S N Ratio Minimum Spacing (Note C) Normal Twist Reverse Twist (Note D) 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 b 34 dBm with echo canceler Note C If the interval between two consecutive DTMF tones is s 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 RECORD IDLE b 40 dBm l 40 ms g 1 5% Performance Depends on Message Being Played (Note B) l 50 ms g 1 5% 12 dB l 50 ms 12 dB l 45 ms 8 dB 4 dB or 8 dB 8 dB 4 dB or 8 dB OTHER DETECTORS Detection of busy and dial tones and no-energy is controlled by tunable parameters You should tune these parameters to fit your hardware For more information see the TUNE command in Section 2 14 Dial and busy tone detectors work with a band-pass filter that llmits the frequency range in which tones can be detected to 0 Hz – 1100 Hz Its frequency response is illustrated in Figure 2-1 and the busy tone cadences in Figure 2-2 TONE GENERATION The CompactSPEECH can generate DTMF tones and single-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  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 TL EE 12584 – 27 FIGURE 2-1 Busy and Dial-Tone Band-Pass Filter Frequency Response TL EE 12584 – 28 E1 b E3 k 90 ms S1 b S3 k 90 ms 90 k Ei k 1650 ms 65 k Si k 1250 ms FIGURE 2-2 Busy-Tone Detector Cadence Specification http www national com 26 2 0 Software (Continued) 2 9 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 messages (e g voice menus in a voice-mail system) and programmable messages (e g time and day stamp or the You have n messages announcement in a DAM) A vocabulary includes a set of predefined words and phrases needed to synthesize messages in any language Applications which support more than one language require a separate vocabulary for each language 2 9 1 International Vocabulary Support (IVS) IVS is a mechanism by which the CompactSPEECH processor can use several vocabularies stored on an external storage device IVS enables CompactSPEECH to synthesize messages with the same meaning but in different languages from separate vocabularies Among IVS features used in the sentences You have twenty messages and You have twenty two messages To solve this problem words that are pronounced differently should be recorded more than once each in the correct pronunciation Vocabulary When recording vocabulary words there is a recording 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 recorded messages (e g between time-andday stamp and incoming messages (ICMs) in a DAM environment) It is more pleasant to the human ear to hear them both in the same quality Vocabulary Sometimes compactness and high quality are access not enough There should be a simple and flexible interface to access the vocabulary elements Not only the vocabulary but also the code to access it should be compact When designing for a multi-lingual environment 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 going to be played back 2 9 3 IVS Vocabulary Components This section describes the basic concept of an IVS vocabulary its components and the relationships between them The basic An IVS vocabulary consists of words senconcepts tences and special codes that control the behavior of the algorithm which CompactSPEECH uses to synthesize sentences The word The words are the basic units in the vocabtable 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 than once in the vocabulary For example if you synthesize the sentences you have twenty messages and you have twenty five messages the word twenty is pronounced differently They should therefore be defined as two different words The number The number tables allow you to treat numtables bers differently depending on the context Example 1 The number 1 can be announced as one as in message number one or as first as in first message 27  Multiple vocabularies are stored on a single storage device  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 kn l 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 messages vs You have two messages) Number synthesis (English–Eighty vs French – Quatre-vingt ) Word order (English–Twenty one vs German –Einundzwanzig ) Days of the week (Monday through Sunday vs Sunday through Saturday) 2 9 2 Vocabulary Design There are several issues sometimes conflicting which must be addressed when designing a vocabulary Vocabulary If memory space is not an issue the vocabucontent 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 minimum set of words and phrases required to synthesize all the sentences The least memory is used when phrases and words that are common to more than one sentence are recorded 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 http www national com 2 0 Software (Continued) Example 2 The number 0 can be announced as no as in you have no messages or as oh as in monday eight oh five am A separate number table is required for each particular type of use The number table contains the indices of the words in the vocabulary that are used to synthesize the number Up to nine number tables can be included in a vocabulary The sentence table describes the predefined sentences in the vocabulary The purpose of this table is to make the microcontroller that drives the CompactSPEECH independent of the language being synthesized For example if the serial flash and or ROM contain vocabularies in various languages and the first sentence in each vocabulary means you have n messages the microcontroller switches languages by issuing the following command to CompactSPEECH announcement It assumes that the sentence is designed for system and message time day announcement and has one argument which is interpreted as follows 0 - System time will be announced 1 - The time day of the current message will be announced When the microcontroller sends the command SAS O 0 The system time day is announced When the microcontroller sends the command SAS O 1 The current message time announced day stamp is Example 1 Example 2 The sentence table Control and option codes SV kstorage media l kvocabulary id l Select a new vocabulary The microcontroller software is thus independent of the grammar of the language in use The sentences consist of words which are represented by their indices in the vocabulary Sentence 0 All sentences but one are user defined The CompactSPEECH treats the first sentence in the sentence table i e sentence 0 in a special way to support time day Figure 2-3 shows the interrelationship between the three types of tables The list of word indices alone cannot provide the entire range of sentences that the CompactSPEECH can synthesize IVS control and option codes are used as special instructions that control the behavior of the speech synthesis algorithm in the CompactSPEECH For example if the sentence should announce the time of day the CompactSPEECH should be able to substitute the current day and time in the sentence These control words do not represent recorded words rather they instruct the CompactSPEECH to take special actions TL EE 12584 – 37 FIGURE 2-3 Relationship of IVS Tables http www national com 28 2 0 Software (Continued) 2 9 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 The IVS compiler runs on MS-DOS (verCompiler sion 5 0 or later) It allows you to insert your own vocabulary i e basic words and data used to create numbers and sentences as directories and files in MS-DOS The IVS compiler then outputs a binary file containing that vocabulary This information can be burned into an EPROM or serial flash for use by the CompactSPEECH software Voice Each IVS vocabulary can be compiled usCompression 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 selects the required voice decompression algorithm when the SV command is used to select the active vocabulary The Graphical The IVS package includes a Windows utiliUser Interface ty that assists the vocabulary designer to (GUI) synthesize sentences With this utility you can both compose sentences and listen to them 2 9 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 programmed 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 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 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 vocabulary 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 synthesize sentences Figure 2-4 shows the vocabulary-creation process for a single table on a ROM or serial flash device 2 10 INITIALIZATION Use the following procedures to initialize the CompactSPEECH processor NORMAL INITIALIZATION 1 Reset the CompactSPEECH by activating the RESET signal (See Section 1 3 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 11 MICROWIRE SERIAL INTERFACE MICROWIRE PLUSTM is a synchronous serial communication protocol originally implemented in National Semiconductor’s COPSTM microcontrollers and HPCTM families of microcontrollers to minimize the number of connections and thus the cost of communicating with peripherals TL EE 12584 – 38 FIGURE 2-4 Creation of an IVS Vocabulary 29 http www national com 2 0 Software (Continued) The CompactSPEECH MICROWIRE interface implements the MICROWIRE PLUS interface in slave mode with an additional ready signal It enables a microcontroller to interface efficiently with the CompactSPEECH application The microcontroller is the protocol master and provides the clock for the protocol The 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 processing 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 transferred an internal interrupt is issued for the CompactSPEECH 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 0xAA 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 12 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 during communication 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 remain 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 protocol so the signal can be used to synchronize between the CompactSPEECH and the microcontroller To prevent false detection of access to the CompactSPEECH 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 0xAA 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 CompactSPEECH is busy reading the byte writing the next byte or executing the received command (after the last parameter 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 deactivated (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 occurred MWRQST unlike all the signals of the communication protocol is an asynchronous line that is controlled by the CompactSPEECH firmware 2 12 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 EV 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 MWRQST 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 microcontroller (in this case it is written on every falling edge of the clock) When a command has more than one parameter return-value the parameters return-values are transmitted in the order of appearance If a parameter return-value is more than one byte long the bytes are transmitted from the most significant 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 module were accepted and processed (see below) 2 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 3 The MWRDY signal is activated (cleared to 0) by the CompactSPEECH when it is ready to receive the first parameter 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 http www national com 30 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 The MWRDY signal is activated (cleared to 0) after reset and after a protocol time-out (See Section 2 12 2 ) The MWRQST signal is used as follows 1 The MWRQST 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 Echo Mechanism The CompactSPEECH echoes back to the microcontroller all the bits received by the CompactSPEECH Upon detection 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 the CompactSPEECH transmits bytes of the return value instead of the echo value Figure 2-5 illustrates the sequence of activities during a MICROWIRE data transfer 2 12 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 transmissions or two byte receptions within the same command or return value after the MWRDY signal is asserted a timeout event occurs and the CompactSPEECH responds as follows 1 Sets the error bit in the status word to 1 2 Sets the EV TIMEOUT bit in the error word to 1 3 Activates the MWRQST signal (clears it to 0) 4 Activates the MWRDY signal (clears it to 0) 5 Waits for a new command (After a time-out occurs the microcontroller must wait at least four milliseconds before issuing the next command ) The CompactSPEECH transmits a byte as an echo when it receives the value 0xAA from the microprocessor Upon detection of an error the CompactSPEECH activates the MWRQST signal and sets the ERR COMM bit in the error word 2 13 THE MASTER MICROWIRE INTERFACE The CompactSPEECH’s Master MICROWIRE controller implements the MICROWIRE PLUS interface in master mode It enables the CompactSPEECH to control flash devices Several devices may share the Master MICROWIRE channel This can be implemented by connecting device selection signals to general purpose output ports 2 13 1 Master MICROWIRE Data Transfer The Signals The Master MICROWIRE controller’s signals are the Master MICROWIRE serial CLocK (MMCLK) the Master MICROWIRE 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 – CS3 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 serial CLocK (MMCLK) signal This rate is the same as the Codec CLocK (CCLK) signal As long as the Master MICROWIRE is transferring data the codec interface must be enabled and its sampling rate should not be changed TL EE 12584 – 29 FIGURE 2-5 Sequence of Activities during a MICROWIRE Byte Transfer 31 http www national com 2 0 Software (Continued) TL EE 12584 – 30 FIGURE 2-6 Master MICROWIRE Data Transfer 2 14 COMMAND DESCRIPTION The commands are listed in alphabetical order The execution time for all commands when specified includes 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 microcontroller and the response returned by the CompactSPEECH For commands 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 Loopback control 0 Loopback disable (default) 1 Loopback enabled During RECORD state the input samples are echoed back unchanged (i e no volume control) to the codec Bits 1 – 7 Reserved Example CCIO 3401 Byte sequence Description Microcontroller 34 01 Echo cancellation control 0 Echo cancellation off (default) 1 Echo cancellation is on during playback Echo cancellation improves the performance of DTMF detection during playback Echo cancellation can be turned on only with a system that can disable AGC during playback A system with AGC that cannot be controlled (i e enabled 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 Bit 2 Note The CompactSPEECH automatically detects the type of flash device in use i e NM29A040 or NM29A080 Example CFG 0324 Byte sequence Description Microcontroller 01 03 24 CompactSPEECH 01 03 24 Configure the CompactSPEECH to work with Codec that supports short-frame format Three NM29A040 flash devices Echo cancellation on CompactSPEECH 34 01 Enable Loopback CFG Configure CompactSPEECH config value Configures the CompactSPEECH in various hardware environments It should be used to change the default CompactSPEECH configuration The config value parameter is encoded as follows Bit 0 Codec configuration 0 short-frame format (default) 1 long-frame format (Guaranteed by design but not tested ) Reserved CMT Cut Message Tail time length Cut time length 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 g 0 14 sec Note If time length is longer than the total duration of the message the EV NORMAL END event is set in the status word and the message becomes empty (i 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 Byte sequence Description Microcontroller 26 02 BC CompactSPEECH 26 02 BC Cut the last seven seconds of the current message Bit 1 http www national com 32 2 0 Software (Continued) CVOC Check Vocabulary Checks (checksum) if the IVS data was correctly programmed to the ROM or flash device If the vocabulary data is correct the return value is 1 Otherwise the return value is 0 If the current vocabulary is undefined ERR INVALID is reported Example CVOC Byte sequence Description Microcontroller 2B AA Example DMS FFC2 003F Byte sequence Description Microcontroller 0B FF C2 00 3F CompactSPEECH 0B FF C2 00 3F 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 CompactSPEECH 2B 01 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 undefined 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 message The memory space released by the deleted message is immediately available for recording new messages Example DM Byte sequence Description Microcontroller 0A CompactSPEECH 0A Delete current message DMS Delete Messages tag ref tag mask Deletes all messages whose message tags match the tag ref parameter Only bits set in tag mask are compared i e a match is considered successful if message tag and tag task e tag ref and tag mask where and is a bitwise AND operation After the command completes execution the current message is undefined Use the GTM command to select a message to be the current message The memory space released by the deleted message is immediately available for recording new messages GCFG Get Configuration Value Returns a sequence of two bytes with the following information Bits 0 – 7 Magic number which specifies the CompactSPEECH firmware version Bits 8 – 9 Memory type 00 Reserved 01 Reserved 10 Serial Flash 11 Reserved The command should 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 Byte sequence Description Microcontroller 02 AA AA CompactSPEECH 02 02 01 Get the CompactSPEECH magic number The CompactSPEECH responds that it is Version 1 with Serial Flash 33 http www national com 2 0 Software (Continued) GEW Returns the 2-byte error word Get Error Word ERR INVALID Command cannot be performed in current context Example GEW Byte sequence Description Microcontroller 1B AA AA 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 EV ERROR bit in 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 command 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 INVALID 6 TIMEOUT 5 4 3 2 COMMAND 1 OPCODE 0 CompactSPEECH 1B 00 02 Get the CompactSPEECH error word (typically sent after GSW when EV ERROR is reported in the status word) The CompactSPEECH responds ERR OPCODE GI Get Information item Returns the 16-bit value specified by item from one of the internal registers of the CompactSPEECH The bits of the error word are used as follows ERR OPCODE Illegal opcode The command opcode is not recognized by the CompactSPEECH ERR COMMAND Illegal command sequence The command is not legal in the current state ERR PARAM Illegal parameter The value of the parameter is out of range or is not appropriate for the command ERR COMM Microcontroller MICROWIRE communication error ERR TIMEOUT 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 parameters) 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 detection is enabled and the status word shows that a DTMF tone was detected 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 return value is meaningful only if one of the tone detectors 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 GI 0 Byte sequence Description Microcontroller 25 00 AA AA ERR ERR ERR ERR PARAM COMM ERR ERR Res Res Res Res CompactSPEECH 25 00 00 06 Get the duration of the last detected DTMF tone The CompactSPEECH responds 60 ms http www national com 34 2 0 Software (Continued) GL Get Length Returns the length of the current message in multiples of 32 bytes The returned value includes the message directory information (64 bytes for the first block and 32 bytes for every other block) message data and the entire last block of the message even if the message occupies only a portion of the last block Since a flash block includes 4096 bytes the returned 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 e 128) Example GL Byte sequence Description Microcontroller 19 AA AA GMT Get Message Tag Returns the 16-bit tag associated with the current message If the current message is undefined ERR VALID is reported Example GMT Byte sequence Description Microcontroller 04 AA AA CompactSPEECH 04 00 0E Get the current message tag In a 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 CompactSPEECH 19 02 00 Get the length of the current message The CompactSPEECH responds 512 i e the message occupies 16384 (512 32) bytes Get Memory Status type GMS Returns the estimated total remaining recording time in seconds as a 16-bit unsigned integer This estimate assumes 5 2 kbit s with no silence 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 parameter 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 Byte sequence Description Microcontroller 12 00 AA AA GNM Get Number of Messages tag ref tag mask Returns the number of messages whose message tags match the tag ref parameter Only bits set in tag mask are compared i e a match is considered successful if message tag and tag mask e tag ref and tag mask where and is a bitwise AND operation The tag ref and tag mask parameters are each two bytes the return value is also 2-bytes long For example if tag ref e 4216 and tag mask e 3F16 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 If tag mask e 0 the total number of all existing messages is returned regardless of the tag ref value Example GNM FFFE 0003 Byte sequence Description Microcontroller 11 FF FE 00 03 AA AA CompactSPEECH 11 FF FE 00 03 00 05 Get the number of messages which have bit 0 cleared and bit 1 set in their message tags CompactSPEECH responds that there are five messages which satisfy the request CompactSPEECH 12 00 01 40 Return the remaining recording time The CompactSPEECH responds 320 seconds 35 http www national com 2 0 Software (Continued) GSW Returns the 2-byte status word Get Status Word EV VOX 1 e a period of silence (no energy) was detected on the telephone line during recording (See VOX TIME COUNT in Table 2-2 ) EV RESET When the CompactSPEECH completes its power-up sequence 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 0 after performing the INIT command If this bit is set during normal operation of the CompactSPEECH it indicates an internal CompactSPEECH error The microcontroIler can recover from such an error by re-initializing the system EV DTMF 1 e Started detection of a DTMF tone Example GSW Byte sequence Description Microcontroller 14 AA AA 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 command The status word is cleared during reset and by the GSW command 15 14 13 1211 10 9 8 7 6 5 NORMAL END 4 30 DTMF DIGIT Res Res DTMF END DIALTONE MEMFULL ERROR RESET DTMF BUSY VOX EV EV EV EV EV EV EV EV EV EV 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 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 ) EV DTMF END 1 e Ended detection of a DTMF tone The detected digit is held in EV DTMF DIGIT EV NORMAL END 1 e Normal completion of operation e g end of message playback EV MEMFULL 1 e Memory is full EV ERROR 1 e Error detected in the last command You must issue the GEW command to return the error code and clear the error condition EV BUSY 1 e Busy tone detected Use this indicator for call progress and line disconnection EV DIALTONE 1 e Dial tone detected Use this indicator for call progress and line disconnection GT Generate Tone tone Generates the tone specified by the 1-byte tone parameter until an S command is received Specify the tone by setting the bits of tone as follows Bit 0 Bits 1 – 4 1 DTMF code Where the DTMF code is encoded as follows Value (Hex) 0 to 9 A B C D E F DTMF Digit 0 to 9 A B C D http www national com 36 2 0 Software (Continued) Bits 5 – 7 0 To generate a single-frequency tone encode the bits as follows 0 3– 30 The value in bits 1–5 is multiplied by 100 to generate the required frequency (300 Hz–3000 Hz) 0 The CompactSPEECH does not check for the validity of the tone specification Invalid specification yields unpredictable results GTM Get Tagged Message tag ref tag mask dir Bit 0 Bits 1 – 5 Selects the current message according to instructions in dir to be the first nth next or nth previous message which complies with the equation message tag and tag mask e 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 current 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 message you must first select the first message that complies with the above equation and then issue another GTM command with n b 1 as a parameter to skip to the nth message If 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 executed just after the DM command (See the DM command description for further detail ) To access the nth message when n l 127 a sequence of GTM commands is required Bits 6 7 Example GT 0D20 Byte sequence Description Microcontroller 0D 20 CompactSPEECH 0D 20 Generate a single-frequency 1600 Hz tone GTD Get Time and 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 If the current message is undefined and time ERR INVALID error is reported day option is 1 an Example GTD 1 Byte sequence Description Microcontroller 0E 01 AA AA CompactSPEECH 0E 01 E8 29 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 IVS User’s Manual for more details ) 37 http www national com 2 0 Software (Continued) Example GTM FFCE 003F 0 Byte sequence Description Microcontroller 09 FF CE 00 3F 00 AA CompactSPEECH 09 FF CE 00 3F 00 01 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 e GTM (FFCE 003F 1) While (ReturnVal 44 TRUE) Begin P( ) * Play * Message tag 4 GMT( ) * get message tag * SMT(FFF7) * Mark the message as ‘old’ * GTM(FFCE 003F 1) * get next with same tag * End INIT Initialize System Execute this command after the CompactSPEECH has been configured (see CFG and GCFG commands) Performs a soft reset of the CompactSPEECH as follows If there is not enough memory space for the vocabulary data ERR PARAM is set in the error word and execution stops Flash blocks that include IVS data cannot be used for recording even if only one byte of the block contains IVS data (e g if the vocabulary size is 4k a 100 bytes two blocks of the flash are not available for message recording) Example INJ 128 Data Byte sequence Description Microcontroller 29 00 00 00 80 Vocabulary Data  Initializes the message directory information Messages are not deleted To delete the messages use the DM and DMS commands  Sets the detectors mask to 0  Sets the volume level that is controlled by the VC command to 0 Sets the playback speed to normal (0) Switches to the IDLE state Activates (clears to 0) the MWRDY signal 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 Example INIT Byte sequence Description Microcontroller 13     CompactSPEECH 29 00 00 00 80 Echo of Data Inject 128 bytes of vocabulary data MR Memory Reset Erases all good flash blocks and initializes the CompactSPEECH (i e does exactly what the INIT command does) Bad blocks and blocks which are used for IVS vocabularies are not erased Note The command erases all messages and should be used with care Example MR Byte sequence Microcontroller 2A CompactSPEECH 13 Initialize the CompactSPEECH INJ Inject IVS data n byte1 byten Injects vocabulary data of size n bytes to good flash blocks This command programs flash devices on a production line with IVS vocabulary data It is optimized for speed all CompactSPEECH detectors are suspended during execution of the command Use the CVOC command to check whether programming was successful CompactSPEECH 2A Description Erase all Serial Flash blocks P Playback Begins playback of the current message The CompactSPEECH state changes to PLAY When playback is complete the CompactSPEECH sets the EV NORMAL END bit in the status word and activates (clears to 0) the MWRQST signal Playback can be paused with the PA command and can be resumed later with the RES command If the current message is undefined ERR INVALID is reported http www national com 38 2 0 Software (Continued) Example P Byte sequence Description Microcontroller 03 RDET Reset Detectors detectors reset mask CompactSPEECH 03 Play the current message Resets the CompactSPEECH tone and energy detectors according to the value of the detectors reset mask parameter 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 Bit 0 Bits 1 – 4 Bit 5 Bit 6 Bit 7 Example RDET 20 Byte sequence Description Microcontroller 2C 20 Reset the Reserved Reset the Reset the Reserved busy and dial tone detectors Must be cleared to 0 no energy (VOX) detector DTMF detector Must be cleared to 0 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 resumed with the RES command Note DTMF and tone detectors remain active during Pause Example PA Byte sequence Description Microcontroller 1C CompactSPEECH 2C 20 Reset the VOX detector CompactSPEECH 1C Suspend playback of current message PDM Go To Power-down Mode Switches the CompactSPEECH to power-down mode (see Section 1 3 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 Byte sequence Description Microcontroller 1A RES Resume Resumes the activity that was suspended by the PA SF or SB commands Example RES Byte sequence Description Microcontroller 1D CompactSPEECH 1D Resume playback which was suspended by either the PA SF or SB command CompactSPEECH 1A Put the CompactSPEECH in power-down mode R Record tag Records a new message with message tag tag The CompactSPEECH state changes to RECORD The R command 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 EV MEMFULL is set in the status word Note A time-and-day stamp is automatically attached to each message Before using the R command for the first time use the SETD command Failure to do so results in undefined values for the time-andday stamp RRAM Read Memory Returns 32 bytes from the current message The first RRAM command returns the first 32 bytes of the current message Subsequent RRAM commands return the next following 32 bytes from the message until the end of the message The command sequence can be stopped by the S command Note 1 Trying to read beyond the end of the message sets the EV NORMAL END event and the CompactSPEECH switches to the IDLE state In this case the return value is undefined and should be ignored Note 2 When using WRAM and RRAM to write and read messages of arbitrary length the microcontroller is responsible for marking the actual end of the message (e g with a delimiter string) The next RRAM command after the end of the message is reached starts again from the beginning of the current message Note 3 If the current message is undefined ERR INVALID is reported Example R 000E Byte sequence Description Microcontroller 0C 00 0E Example RMEM Data Byte sequence Description Microcontroller 18 AA AA 32 bytes of data CompactSPEECH 0C 00 0E 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 CompactSPEECH 18 Read 32 bytes from the current message memory 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 WRAM RRAM and all asynchronous commands 39 http www national com 2 0 Software (Continued) Example S Byte sequence Description Microcontroller 00 SDET Set Detectors Mask detectors mask CompactSPEECH 00 Stop current activity (e g playback recording) and put the CompactSPEECH in IDLE state Controls the reporting of detection for tones and VOX according to the value of the detectors mask parameter A bit set to 1 in the mask enables the reporting of the corresponding 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 VOX 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 Byte sequence Description Microcontroller 10 A3 SAS Say Argumented Sentence sentence n arg Announces sentence number sentence n of the currently selected vocabulary and passes arg to it sentence n and arg are each 1-byte long When playing is complete the CompactSPEECH sets the EV NORMAL END bit in the status word and activates the MWRQST signal If the current vocabulary is undetermined ERR INVALID is reported Example SAS 00 03 Byte sequence Description Microcontroller 1E 00 03 CompactSPEECH 1E 00 03 Announce the first sentence in the sentence table of the currently selected vocabulary with ‘‘3’’ as the actual parameter CompactSPEECH 10 A3 Set reporting of all CompactSPEECH detectors except for end-of-DTMF SB Skip Backward time length Skips backward in the current message time length 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 beginning of the message is detected during execution of the SB command execution 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 length is greater than 320 ERR PARAM is set in the error word Playback speed does not affect the behavior of this command Example SB 19 Byte sequence Description Microcontroller 23 00 19 SE Skip to End of Message This command is valid only in the PLAY state When invoked playback is suspended (as for the PA command) and a jump to the end of the message is performed Playback remains suspended after the jump Example SE Byte sequence Description Microcontroller 24 CompactSPEECH 24 Skip to end of current message CompactSPEECH 23 00 19 Skip back five seconds from the current position in the message being played 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 and day parameter The time and 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 and day value is not valid ERR PARAM is set in the error word Example SETD 0E09 Byte sequence Description Microcontroller 0F 0E 09 CompactSPEECH 0F 0E 09 Set time and day to Monday 1 30 AM http www national com 40 2 0 Software (Continued) length Skips forward in the current message time length 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 length is greater than 320 ERR PARAM is set in the error word Playback speed does not affect the behavior of this command Example SF SF 19 Byte sequence Description Microcontroller 22 00 19 Skip Forward time If word number is not defined in the current vocabulary or if it is an IVS control or option code ERR PARAM is set in the error word If the current vocabulary is undefined ERR ported Example SO 00 Byte sequence Description Microcontroller 07 00 INVALID is re- CompactSPEECH 07 00 Announce the first word in the word table of the currently selected vocabulary CompactSPEECH 22 00 19 Skip forward five seconds from the current position in the message being played SPS Set Playback Speed speed Sets the speed of message playback as specified by speed The new speed applies to all recorded messages and synthesized 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 currently being played SMT Set Message Tag message tag 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 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 speed may be one of 13 values from b6 to a 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 b6 to a 6 range ERR PARAM is set in the error word Example SPS FB Byte sequence Description Microcontroller 16 FB CompactSPEECH 16 FB Set playback speed to b5 Example SMT FF F7 Byte sequence Description Microcontroller 05 FF F7 CompactSPEECH 05 FF F7 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 SS Say Sentence sentence n Say sentence number sentence n of the currently selected vocabulary sentence n is 1-byte long If the sentence has an argument 0 is passed as the value for this argument When playing has been completed the CompactSPEECH sets the EV NORMAL END bit in the status word and activates the MWRQST signal If sentence n is not defined in the current vocabulary ERR PARAM is set in the error word If the current vocabulary is undefined ERR INVALID is reported Example SS 00 Byte sequence Description Microcontroller 1F 00 SO Say One Word word number Plays the word number word number in the current vocabulary 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 EV NORMAL END bit in the status word and activates the MWRQST signal CompactSPEECH 1F 00 Announce the first sentence in the sentence table of the currently selected vocabulary 41 http www national com 2 0 Software (Continued) SV Set Vocabulary Type type id SW Say Words n word1 wordn Selects the vocabulary table to be used for voice synthesis The vocabulary type is set according to the 1-byte type parameter 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 id which is part of the vocabulary internal header (See the IVS User’s Manual for more details) If type is 1 or 2 the CompactSPEECH searches for the one byte id parameter in each vocabulary table header until a match is found If the id parameter does not point to a valid IVS vocabulary ERR PARAM is set in the error word Example SV 02 03 Byte sequence Description Microcontroller 20 02 03 Plays n words indexed by word1 to wordn On completion the EV NORMAL END 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 ERR PARAM is set in the error word If the current vocabulary is undefined ERR INVALID is reported Example SW 02 00 00 Byte sequence Description Microcontroller 21 02 00 00 CompactSPEECH 21 02 00 00 Announce the first word in the word table of the currently selected vocabulary twice CompactSPEECH 20 02 03 Select the vocabulary with vocabulary-id 3 which resides on Serial Flash as the current vocabulary TUNE Tune index parameter value Sets the value of the tunable parameter identified by index (one byte) to the 2-byte value parameter value This command 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 CompactSPEECH 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 application of power The INIT command does not affect these parameters Table 2-2 describes the tunable parameters their index numbers and their default values http www national com 42 2 0 Software (Continued) TABLE 2-2 Tunable Parameters Index 0–3 4 Parameter Name Reserved 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 5 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 6 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 7 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 it is too high silence is detected Legal values 8 to 31 8 9 SIL ENABLE FACTOR Silence compression control 0 turns silence compression off 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 10 VOX ENERGY THRESHOLD This constant determines the minimum energy level at which voice is detected Below this level it is interpreted as silence If you divide (multiply) the value by 2 you get 3 dB decrease (increase) in the threshold Legal values 0 to 65535 11 12 Reserved 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 g 10 ms Legal values 0 to 65535 13 – 15 Reserved 700 12 1 8192 15 2 12 11264 Description Default ENERGY 43 http www national com 2 0 Software (Continued) TABLE 2-2 Tunable Parameters (Continued) Index 16 Parameter Name TONE GENERATION LEVEL Description 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 TONE GENERATION LEVEL and the VOL LEVEL variable controlled by the VC command The tones are distorted when the level is set too high The valid range is 0 s TONE 17 18 Reserved 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 constant is g 10 ms Legal values 0 to 65535 19 TONE ON ENERGY THRESHOLD Minimum energy level at which busy and dial tones are detected as ON (after 700 Hz filtering) If you divide (multiply) the value by 2 you get a 3 dB decrease (increase) in the threshold Legal values 0 to 65535 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 Legal values 0 to 65535 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 The valid range is 0 s VCD 22 VOX TOLERANCE TIME LEVEL a VOL LEVEL s 12 3 6 110 160 700 GENERATION LEVEL a VOL LEVEL s 12 Default 6 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 busy detection in 10 ms units The accuracy of the constant is g 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 ms per sample) Legal values 0 to 16 4 25 26 Reserved 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) 0 http www national com 44 2 0 Software (Continued) TABLE 2-2 Tunable Parameters (Continued) Index 27 Parameter Name DTMF TWIST LEVEL Description 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 Tone energy (dB-Volts) 0 b 17 8 b 14 3 b 12 9 b 12 4 b 12 0 b 11 9 b 11 85 b 11 85 The volume of the generated DTMF tone during meaurements was 6 (TONE GENERATION LEVEL a VOL LEVEL e 6) For the default level the high tone is b14 3 dBV and the low tone is b12 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 28 29 Reserved Reserved Nibble Value 0 1 2 3 4 5 6 7 8 – 15 Default 66 Example TUNE 23 700 Byte sequence Description Microcontroller 15 17 02 BC WRAM Write Memory tag data This command creates a new message with a message tag tag The following 32 bytes of data data are stored as the new message data in the message memory The WRAM command switches the CompactSPEECH to the MEMORY WRITE state As long as it remains in this state each subsequent WMEM command appends new message data to the end of the previous data The CompactSPEECH remains in the MEMORY WRITE state until an S command is issued Note that while the CompactSPEECH is in the MEMORY WRITE state tag is ignored If the memory becomes full recording stops and EV MEMFULL is set in the status word Example WMEM 1 32 bytes Microcontroller 17 01 32 bytes of data to write echo 32 bytes of data CompactSPEECH 15 17 02 BC Set the minimum period for busy detection to seven seconds VC Volume Control vol level Controls the energy level of all the output generators (playback tone generation and voice synthesis) with one command The resolution is g 3 dB The actual output level is composed of the tunable level variable plus the vol level The valid range for the actual output level of each output generator is defined in Table 2-2 For example if the tunable variable VCD LEVEL is 6 and vol level is b2 then the output level equals VCD LEVEL a vol level e 4 Example VC 04 Byte sequence Description Microcontroller 28 04 Byte sequence CompactSPEECH 17 01 CompactSPEECH 28 04 Set the volume level to VCD 4 LEVEL a Description Create a message with tag e 01 and write 32 bytes in the message memory 45 http www national com Appendix A SCHEMATIC DIAGRAMS The following schematic diagrams are extracted from a CompactSPEECH demo unit based on the NSV-AM266SPAF board designed by National Semiconductor This demo includes three basic clusters  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 not in ROM the address- and dataline connections are not required and the layout is much simpler  COP888EEG Microcontroller  CompactSPEECH cluster including a TP3054 codec and an NSAM266SA controlling a Serial Flash device http www national com 46 TL EE 12584 – 31 47 TL EE 12584 – 32 Appendix A (Continued) http www national com http Appendix A (Continued) www national com TL EE 12584 – 33 48 AV (CODEC) e 1 a R30 31 NATIONAL DEMO USES AV (CODEC) e 1 (R30 e 0 R31 e NOT MOUNTED) 49 http www national com TL EE 12584 – 34 Appendix A (Continued) http www national com 50 TL EE 12584 – 35 Appendix A (Continued) Physical Dimensions inches (millimeters) 100-Pin Molded Plastic Quad Flatpak (EIAJ) Order Number NSAM266SAA VLJ NS Package Number VLJ100A 51 http www national com NSAM266SA CompactSPEECH Digital Speech Processor with Serial Flash Interface Physical Dimensions inches (millimeters) (Continued) 68-Pin Plastic Leaded Chip Carrier (V) Order Number NSAM266SAA V NS Package Number V68A LIFE SUPPORT POLICY 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 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 National Semiconductor Corporation 1111 West Bardin Road Arlington TX 76017 Tel 1(800) 272-9959 Fax 1(800) 737-7018 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 http www national com National Semiconductor Europe Fax a49 (0) 180-530 85 86 Email europe support nsc com Deutsch Tel a49 (0) 180-530 85 85 English Tel a49 (0) 180-532 78 32 Fran ais Tel a49 (0) 180-532 93 58 Italiano Tel a49 (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
NSAM266SA 价格&库存

很抱歉,暂时无法提供与“NSAM266SA”相匹配的价格&库存,您可以联系我们找货

免费人工找货