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 NSAM266SA CompactSPEECH Digital Speech Processor with Serial Flash Interface March 1996 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 http://www.national.com Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y 2 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 Table of Contents 2.2 CompactSPEECH CommandsÐQuick Reference Table 1.0 HARDWARE 1.1 Block Diagrams 2.3 The State Machine 1.2 Pin Assignment 2.4 Command Execution 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 2.5 Tunable Parameters 2.6 Messages 2.6.1 Message Tag 1.3 Functional Description 2.7 Speech Compression 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 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 1.4 Specifications 2.9.4 The IVS Tool 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.9.5 How to Use the IVS Tool With the CompactSPEECH 2.10 Initialization 2.11 Microwire Serial Interface 2.12 Signal Description 2.0 SOFTWARE 2.12.1 Signal Use in the Interface Protocol 2.12.2 Interface Protocol Error Handling 2.1 Overview 2.1.1 DSP-based Algorithms 2.1.2 System Support 2.1.3 Peripherals Support 2.13 The Master Microwire Interface 2.13.1 Master MICROWIRE Data Transfer 2.14 Command Description APPENDIX A SCHEMATIC DIAGRAMS 3 http://www.national.com 1.0 Hardware (Continued) 1.2.1 PinÐSignal Assignment 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. 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. TABLE 1-1. CompactSPEECH PinÐSignal Assignment Pin Name Type Signal Name I/O A(0:15) TTL A(0:15) Output CCLK TTL CCLK Output CDIN TTL CDIN Input CDOUT TTL CDOUT Output CFS0 TTL CFS0 Output D(0:7) TTL D(0:7) I/O MWCS TTL (Note A) MWCS Input TST TTL TST Input MWRDY TTL MWRDY I/O MWRQST TTL MWRQST I/O MWDOUT TTL MWDOUT Output PB(0:2) (Note B) TTL EA(16:18) Output PB(3:6) (Note C) TTL CS(0:3) Output EMCS/ ENV0 TTL1 (Note D) CMOS (Note E) EMCS ENV0 Output Input MWCLK TTL MWCLK Input MWDIN TTL MWDIN Input MMCLK TTL1 (Note D) MMCLK Output MMDIN TTL MMDIN Input MMDOUT TTL1 (Note D) MMDOUT Output CFS0 CMOS CFS0 Output RESET Schmitt (Note A) RESET Input VCC Power VCC VSS Power VSS X1 XTAL X1 OSC X2/CLKIN XTAL TTL X2 CLKIN OSC Input 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. 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) External Single-Phase Clock Signal 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 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. 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. 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-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. 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. Figure 1-3 shows a recommended circuit for generating a reset signal when the power is turned on. TABLE 1-2. Crystal Oscillator Component List Component Parameters Values Tolerance Resonance Frequency 40.96 MHz AT-Cut 50X Maximum Shunt Capacitance 7 pF Maximum Load Capacitance 12 pF FIGURE 1-3. Recommended Power-On Reset Circuit N/A Resistor R1 10 MX 5% Capacitor C1 1000 pF 20% 3.9 mH 10% Inductor L 7 Parallel Type Maximum Serial Crystal Resistance Resonator TL/EE/12584 – 5 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. Third Overtone http://www.national.com 1.0 Hardware (Continued) 1.3.5 Memory Interface 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. 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 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. 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. http://www.national.com Amount of Silence Total Record Time 0 10 15 20 25 13 min 9 sec 14 min 25 sec 15 min 7 sec 15 min 47 sec 16 min 25 sec 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. 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 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. 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. 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. 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. 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) All Input or Output Voltages, with Respect to GND 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 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. 0§ C to a 70§ C 1.4.2 Electrical Characteristics TA e 0§ C to a 70§ C, VCC e 5V g 10%, GND e 0V Symbol Parameter Conditions Min Typ Max Units 2.0 VCC a 0.5 V b 0.5 0.8 V VIH TTL Input, Logical 1 Input Voltage VIL TTL Input, Logical 0 Input Voltage VXH CLKIN Input, High Voltage External Clock VXL CLKIN Input, Low Voltage External Clock VENVh ENV0 High Level, Input Voltage 3.6 V VHh CMOS Input with Hysteresis, Logical 1 Input Voltage 3.6 V VHI CMOS Input with Hysteresis, Logical 0 Input Voltage VHys Hysteresis Loop Width (Note A) 0.5 V VOH Logical 1 TTL, Output Voltage IOH e b0.4 mA 2.4 V VOHWC MMCLK, MMDOUT and EMCS Logical 1, Output Voltage IOH e b0.4 mA 2.4 V Logical 0, TTL Output Voltage IOL e 4 mA 0.45 V IOL e 50 mA (Note B) 0.2 V MMCLK, MMDOUT and EMCS Logical 0, Output Voltage IOL e 4.0 mA 0.45 V IL Input Load Current (Note C) 0V s VIN s VCC IO (Off) Output Leakage Current (I/O Pins in Input Mode) (Note C) 0V s VOUT s VCC ICC1 Active Supply Current Normal Operation Mode, Running Speech Applications (Note D) 65 ICC2 Standby Supply Current Normal Operation Mode, DSPM Idle (Note D) 40 ICC3 Power-Down Mode Supply Current Power-Down Mode (Notes D and E) CX X1 and X2 Capacitance (Note A) VOL VOLWC 2.0 V 0.8 1.1 IOH e b50 mA (Note B) VCC b 0.2 V V V IOL e 50 mA (Note B) 0.2 V b 5.0 5.0 mA b 5.0 5.0 mA 80 mA mA 1.5 17 mA pF Note A: Guaranteed by design. Note B: Measured in power-down mode. The total current driven, or sourced, by all the CompactSPEECH’s output signals is 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) Maximum times assume capacitive loading of 50 pF. CLKIN crystal frequency is 40.96 MHz. 1.4.3 Switching Characteristics Definitions Note: CTTL is an internal signal and is used as a reference to explain the timing of other signals. See Figure 1-22 . 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. 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 Figure Description Reference Conditions Min (ns) Max (ns) tAh 1-17 Address Hold After R.E. CTTL 0.0 tAv 1-17 Address Valid After R.E. CTTL, T1 tCCLKa 1-15 CCLK Active After R.E. CTTL tCCLKh 1-15 CCLK Hold After R.E. CTTL tCCLKia 1-15 CCLK Inactive After R.E. CTTL tCDOh 1-15 CDOUT Hold After R.E. CTTL tCDOv 1-15 CDOUT Valid After R.E. CTTL tCTp 1-22 CTTL Clock Period (Note A) R.E. CTTL to next R.E. CTTL tEMCSa 1-17 EMCS Active After R.E. CTTL, T2W1 tEMCSh 1-17 EMCS Hold After R.E. CTTL tEMCSia 1-17 EMCS Inactive After R.E. CTTL, T3 tFSa 1-15 CFS0 Active After R.E. CTTL tFSh 1-15 CFS0 Hold After R.E. CTTL tFSia 1-15 CFS0 Inactive After R.E. CTTL tMMCLKa 1-20 Master MICROWIRE Clock Active After R.E. CTTL tMMCLKh 1-20 Master MICROWIRE Clock Hold After R.E. CTTL tMMCLKia 1-20 Master MICROWIRE Clock Inactive After R.E. CTTL tMMDOh 1-20 Master MICROWIRE Data Out Hold After R.E. CTTL tMMDOv 1-20 Master MICROWIRE Data Out Valid After R.E. CTTL 12.0 tMWDOf 1-18 MICROWIRE Data Float (Note B) After R.E. MWCS 70.0 tMWDOh 1-18 MICROWIRE Data Out Hold (Note B) After F.E. MWCK 0.0 tMWDOnf 1-18 MICROWIRE Data No Float (Note B) After F.E. MWCS 0.0 tMWDOv 1-18 MICROWIRE Data Out Valid (Note B) After F.E. MWCK 70.0 tMWITOp 1-19 MWDIN to MWDOUT Propagation Time 70.0 tMWRDYa 1-18 MWRDY Active After R.E. of CTTL 0.0 35.0 tMWRDYia 1-18 MWRDY Inactive After F.E. MWCLK 0.0 70.0 tPABCh 1-21 PB and MWRQST After R.E. CTTL 0.0 tPABCv 1-21 PB and MWRQST After R.E. CTTL, T2W1 12.0 12.0 0.0 12.0 0.0 12.0 48.8 50,000 12.0 0.0 12.0 25.0 0.0 25.0 12.0 0.0 12.0 0.0 70.0 12.0 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 Figure tCDIh 1-15 CDIN Hold Description After R.E. CTTL Reference Conditions 0.0 tCDIs 1-15 CDIN Setup Before R.E. CTTL 11.0 tDIh 1-17 Data in Hold (D0:7) After R.E. CTTL T1, T3 or TI 0.0 tDIs 1-17 Data in Setup (D0:7) Before R.E. CTTL T1, T3 or TI 15.0 tMMDINh 1-20 Master MICROWIRE Data In Hold After R.E. CTTL 0.0 tMMDINs 1-20 Master MICROWIRE Data In Setup Before R.E. CTTL 11.0 tMWCKh 1-18 MICROWIRE Clock High (Slave) At 2.0V (Both Edges) 100.0 tMWCKI 1-18 MICROWIRE Clock Low (Slave) At 0.8V (Both Edges) 100.0 tMWCKp 1-18 MICROWIRE Clock Period (Slave) (Note A) R.E. MWCLK to next R.E. MWCLK 2.5 ms tMWCLKh 1-18 MWCLK Hold After MWCS becomes Inactive 50.0 tMWCLKs 1-18 MWCLK Setup Before MWCS becomes Active 100.0 tMWCSh 1-18 MWCS Hold After F.E. MWCLK 50.0 tMWCSs 1-18 MWCS Setup Before R.E. MWCLK 100.0 tMWDIh 1-18 MWDIN Hold After R.E. MWCLK 50.0 tMWDIs 1-18 MWDIN Setup Before R.E. MWCLK 100.0 tPWR 1-24 Power Stable to RESET R.E. (Note B) After VCC reaches 4.5V 30.0 ms tRSTw 1-23 RESET Pulse Width At 0.8V (Both Edges) 10.0 ms tXh 1-22 CLKIN High At 2.0V (Both Edges) tX1p/2 b 5 tXI 1-22 CLKIN Low At 0.8V (Both Edges) tX1p/2 b 5 tXp 1-22 CLKIN Clock Period R.E. CLKIN to next R.E. CLKIN 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 Min (ns) 24.4 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 2.1.2 System Support # # # # # # Command interface to an external microcontroller Memory and message manager IVS support Tone generator Real-time clock handler Power-down mode support 2.1.3 Peripherals Support # Serial flash interface (Master MICROWIRE handler) # Microcontroller interface (Slave MICROWIRE handler) # Codec interface The following sections describe the CompactSPEECH software in detail. 21 http://www.national.com http://www.national.com S S S S A S S GTM INIT INJ MR P PA PDM S GL S S GI A S GEW GTD S GCFG GT A FR** S S DMS GSW S DM S S CVOC GNM S CMT S S CFG GMT S CCIO S S GMS S/A Name AMAP** Command 22 Go to Power-Down Mode Pause Playback Memory Reset Inject IVS Data Initialize System Get Tagged Message Get Time and Day Generate Tone Get Status Word Get Number of Messages Get Message Tag Get Memory Status Get Length Get Information Item Get Error Word Get Configuration Value Free Memory Delete Messages Delete Message Check Vocabulary Cut Message Tail Configure CompactSPEECH Configure Codec I/O Check and Map ARAM Description 1A 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 No Change No Change IDLE IDLE IDLE IDLE RESET No Change Result State IDLE None TagÐref, TagÐmask None Type None Index None None None TagÐref, TagÐmask None None Length of Time ConfigÐvalue ConfigÐvalue ActionÐnumber Description PLAY IDLE No Change IDLE IDLE IDLE IDLE 1 1 Time/Day None Status Word Number of Messages Message Tag Recording Time Left Message Length Value Error Word Version, ConfigÐvalue None None None Test Result None None None Test Result Description Return Value None None None None N, byte1 . . . byten None 4an None None None None None None TagÐref, TagÐMask, Dir 2 a 2 a 1 Message Found Time/Day Option 2a2 1 1 2a2 2 2 1 1 Bytes Command Parameters TONEÐGENERATE Tone or DTMF No Change IDLE IDLE IDLE IDLE PLAY, RECORD, SYNTHESIS, No Change TONEÐGENERATE, IDLE* IDLE IDLE RESET, IDLE RESET, IDLE IDLE IDLE IDLE All States IDLE IDLE IDLE IDLE PLAY, RECORD, SYNTHESIS, No Change TONEÐGENERATE, IDLE All States RESET, IDLE IDLE IDLE IDLE IDLE RESET RESET, IDLE Source State 1 2 2 2 2 2 2 2 2 2 1 1 Bytes 2.0 Software (Continued) 2.2 CompactSPEECH COMMANDSÐQUICK REFERENCE TABLE 23 S S VC WRAM Write RAM Volume Control Tune Say Words Set Vocabulary Type Say Sentence Set Playback Speed Say One Word Set Message Tag Skip Forward Set Time and Day Skip to End of Message Set Detectors Mask Skip Backward Say Argumented Sentence Stop Read RAM Resume Reset Detectors Record Message Description 17 28 15 21 20 1F 16 07 05 22 0F 24 10 23 1E 00 18 1D 2C 0C Opcode Hex IDLE, MEMORYÐWRITE PLAY, SYNTHESIS, IDLE, TONEÐGENERATE IDLE IDLE IDLE IDLE PLAY, SYNTHESIS, IDLE IDLE IDLE PLAY, IDLE* IDLE PLAY, IDLE* IDLE PLAY, IDLE* IDLE All States but RESET IDLE, MEMORYÐREAD PLAY, RECORD, SYNTHESIS, TONEÐGENERATE, IDLE* IDLE IDLE Source State A Asynchronous command. S Synchronous command. **This command exists for compatibility reasons only, and will be obsoleted in future revisions of CompactSPEECH. *Command is valid in IDLE state; but has no effect. S S SMT A S SF TUNE S SETD SW S SE S S SDET A S SB SV A SAS SS S S S S RRAM A S RES SPS S RDET SO A S/A R Name Command MEMORYÐWRITE No Change IDLE SYNTHESIS IDLE SYNTHESIS No Change SYNTHESIS IDLE No Change No Change No Change No Change No Change SYNTHESIS IDLE MEMORYÐREAD No Change No Change RECORD Result State Message Tag, Data Increment/Decrement Index, Value N, word1 . . . wordn Mode, Id SentenceÐn Speed Value Word Number Message Tag Length of Time Time/Day None Detectors Mask Length of Time SentenceÐn arg1 None None None Detectors Reset Mask Message Tag Description 2 a 32 1 1a2 1an 1a1 1 1 1 2 2 2 1 2 1a1 1 2 Bytes Command Parameters None None None None None None None None None None None None None None None None Data None None None Description 32 Bytes Return Value 2.0 Software (Continued) 2.2 CompactSPEECH COMMANDSÐQUICK REFERENCE TABLE (Continued) http://www.national.com 2.0 Software (Continued) SYNCHRONOUS COMMANDS 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: 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. 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). 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). 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. 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. 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. 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. SYNTHESIS An individual word or a sentence is synthesized from an external vocabulary. 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. 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.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. 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. 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. 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). 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. 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. 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. 25 http://www.national.com 2.0 Software (Continued) TABLE 2-1. DTMF Detector Performance PLAY RECORD/IDLE Detection Sensitivity (Note A) Performance Depends on Message Being Played (Note B) b 40 dBm Accepted DTMF Length l 50 ms l 40 ms Frequency Tolerance g 1.5% g 1.5% S/N Ratio 12 dB 12 dB Minimum Spacing (Note C) l 50 ms l 45 ms Normal Twist 8 dB 8 dB Reverse Twist (Note D) 4 dB or 8 dB 4 dB or 8 dB Note A: Performance depends on the DAA design. Note B: Performance with echo canceler is 10 dB better than without echo canceler. For a silent message, Detection Sensivitiy is 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. 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. 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 . # 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. 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 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) 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 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: # 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.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 . 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 27 http://www.national.com 2.0 Software (Continued) The sentence table 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 Example 1: The system time & day is announced. When the microcontroller sends the command: SAS O, 1 Example 2: The current message time & day stamp is announced. 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) are used to synthesize the required word or sentence. The typical vocabulary-creation process is as follows: 2.9.4 The IVS Tool The IVS tool includes two utilities: 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. Ð 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. 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. 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 TL/EE/12584 – 38 FIGURE 2-4. Creation of an IVS Vocabulary 29 http://www.national.com 2.0 Software (Continued) MWRDY 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. 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: 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. 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. 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. 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: 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. 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. 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. Figure 2-5 illustrates the sequence of activities during a MICROWIRE data transfer. 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.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). 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. 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 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 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 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. Configure Codec I/O config-value CCIO 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 Note: The CompactSPEECH automatically detects the type of flash device in use, i.e., NM29A040 or NM29A080. Example CFG 0324 Byte sequence: Description: CCIO 3401 Byte sequence: Microcontroller 34 01 CompactSPEECH 34 01 Description: Bit 1 Configure the CompactSPEECH to work with: Codec that supports short-frame format. Three, NM29A040, flash devices. Echo cancellation on. 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 Codec configuration. 0: short-frame format (default) 1: long-frame format. (Guaranteed by design, but not tested.) Reserved. http://www.national.com 01 03 24 CompactSPEECH 01 03 24 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. 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 Microcontroller CMT 02BC Byte sequence: Description: 32 Microcontroller 26 02 BC CompactSPEECH 26 02 BC Cut the last seven seconds of the current message. 2.0 Software (Continued) Example 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 DMS FFC2 003F Byte sequence: Description: CVOC Byte sequence: Microcontroller 2B AA CompactSPEECH 2B 01 Description: Check the current vocabulary. The CompactSPEECH responds that the vocabulary is OK. DM Delete Message Deletes the current message. Deleting a message clears its message tag. Deleting the current message does not cause a different message to become current. The current message is 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 Microcontroller 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 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 0A CompactSPEECH 0A Description: 0B FF C2 00 3F Note: The description of the tag is an example only. All bits of the tag are user-definable. DM Byte sequence: Microcontroller CompactSPEECH 0B FF C2 00 3F 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 GCFG Byte sequence: Microcontroller 02 AA AA CompactSPEECH 02 02 01 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. Description: 33 Get the CompactSPEECH magic number. The CompactSPEECH responds that it is Version 1, with Serial Flash. http://www.national.com 2.0 Software (Continued) GEW Returns the 2-byte error word. ERRÐINVALID Get Error Word Command cannot be performed in current context. Example 15 – 9 8 7 6 5 4 3 2 1 0 Res Res ERRÐINVALID ERRÐTIMEOUT ERRÐCOMM Res ERRÐPARAM ERRÐCOMMAND ERRÐOPCODE Res 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. GEW Byte sequence: 1B AA AA CompactSPEECH 1B 00 02 Description: 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. 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 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). http://www.national.com Microcontroller GI 0 Byte sequence: Microcontroller 25 00 AA AA CompactSPEECH 25 00 00 06 Description: 34 Get the duration of the last detected DTMF tone. The CompactSPEECH responds: 60 ms 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 GMT GMT Byte sequence: Microcontroller Description: 19 AA AA 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 . Byte sequence: Description: 12 00 AA AA CompactSPEECH 12 00 01 40 Description: Microcontroller 11 FF FE 00 03 AA AA CompactSPEECH 11 FF FE 00 03 00 05 GMS 0 Microcontroller 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. GNM FFFE 0003 Example Byte sequence: 04 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 CompactSPEECH 19 02 00 Description: Microcontroller CompactSPEECH 04 00 0E GL Byte sequence: Get Message Tag Returns the 16-bit tag associated with the current message. If the current message is undefined, ERRÐVALID is reported. Example 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. 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. EVÐVOX Get Status Word 1 e a period of silence (no energy) was detected on the telephone line during recording. (See VOXÐTIMEÐ COUNT in Table 2-2.) 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. 30 EVÐDTMF 1 e Started detection of a DTMF tone. Example EVÐDTMFÐDIGIT 4 EVÐDTMFÐEND 5 EVÐNORMALÐEND 6 EVÐMEMFULL 7 EVÐERROR 8 EVÐBUSY 9 EVÐDIALTONE 10 Res 1211 Res 13 EVÐVOX 14 EVÐRESET EVÐDTMF 15 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. GSW Byte sequence: 14 AA AA CompactSPEECH 14 00 40 Description: 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. 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. 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: EVÐNORMALÐEND 1 e Normal completion of operation, e.g., end of message playback. Bit 0 Bits 1 – 4 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. 1 DTMF code. Where the DTMF code is encoded as follows: Value (Hex) 0 to 9 A B C D E F 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. http://www.national.com Microcontroller 36 DTMF Digit 0 to 9 A * Ý B C D 2.0 Software (Continued) Bits 5 – 7 Bit 0 Bits 1 – 5 Bits 6, 7 0 Get Tagged Message tagÐref tagÐmask dir 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. GTM 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. Example GT 0D20 Byte sequence: Microcontroller 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. 0D 20 CompactSPEECH 0D 20 Description: 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. Generate a single-frequency 1600 Hz tone. 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.) 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. To access the nth message, when n l 127, a sequence of GTM commands is required. Note: If the current message is undefined, and timeÐdayÐoption is 1, an ERRÐINVALID error is reported. Example GTD 1 Byte sequence: Microcontroller 0E 01 AA AA CompactSPEECH 0E 01 E8 29 Description: Get the current message time-and-day stamp. The CompactSPEECH responds that the message was created on the first day of the week at 5:40 AM. The return value also indicates that the SETD command was used to set the system time and day before the message was recorded. Note: If the SAS command is used to announce the time-and-day stamp, ‘‘Monday’’ is announced as the first day of the week. For an external vocabulary, the announcement depends on the vocabulary definition. (See the IVS User’s Manual for more details.) 37 http://www.national.com 2.0 Software (Continued) Example GTM FFCE 003F 0 Byte sequence: Microcontroller 09 FF CE 00 3F 00 AA CompactSPEECH 09 FF CE 00 3F 00 01 Description: Select the oldest of the new ICMs, in mailbox number 6, to be the current message. For a system where the message tag is encoded as described in the example for the DMS command. The CompactSPEECH return value indicates that there is such a message. The following pseudo-code demonstrates how to play all new ICMs. The messages are marked after being played. In mailbox number 6: Return val 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 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 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: # 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 com- INJ 128 Data mand, to 0. Byte sequence: # # # # 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 Inject 128 bytes of vocabulary data. Note: The command erases all messages and should be used with care. Microcontroller 13 Example MR Initialize the CompactSPEECH. Byte sequence: Microcontroller 2A CompactSPEECH 2A 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. http://www.national.com 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. CompactSPEECH 13 Description: 29 00 00 00 80 CompactSPEECH 29 00 00 00 80 Echo of Data Description: INIT Byte sequence: Microcontroller 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. 38 2.0 Software (Continued) Example Reset Detectors detectorsÐresetÐmask 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: RDET P Byte sequence: Microcontroller 03 CompactSPEECH 03 Description: Play the current message. Bit 0 Bits 1 – 4 Bit 5 Bit 6 Bit 7 Example 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 Reset the busy and dial tone detectors. Reserved. Must be cleared to 0. Reset the no energy (VOX) detector. Reset the DTMF detector. Reserved. Must be cleared to 0. RDET 20 PA Byte sequence: Microcontroller Byte sequence: 1C Description: Suspend playback of current message. RES Byte sequence: Description: 1A CompactSPEECH 1A Description: Resume playback which was suspended by either the PA, SF or SB 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). 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. 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 Example RMEM Data R 000E Microcontroller 0C 00 0E Byte sequence: CompactSPEECH 0C 00 0E Description: 1D 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. 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. Byte sequence: Microcontroller CompactSPEECH 1D PDM Byte sequence: Reset the VOX detector. RES Resume Resumes the activity that was suspended by the PA, SF or SB commands. Example 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 Microcontroller 2C 20 CompactSPEECH 2C 20 CompactSPEECH 1C Description: Microcontroller Microcontroller 18 AA AA CompactSPEECH 18 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. Description: ... 32 bytes of data 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 Set Detectors Mask detectorsÐmask 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: SDET S Byte sequence: Microcontroller 00 CompactSPEECH 00 Description: Stop current activity (e.g., playback, recording) and put the CompactSPEECH in IDLE state. 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 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: Microcontroller SDET A3 1E 00 03 CompactSPEECH 1E 00 03 Description: Byte sequence: Announce the first sentence in the sentence table of the currently selected vocabulary with ‘‘3’’ as the actual parameter. Description: SE Byte sequence: Microcontroller 24 CompactSPEECH 24 Description: Skip to end of current message. SETD Set Time and Day timeÐandÐday Sets the system time and day as specified by bits 0 – 13 in the 2-byte timeÐ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 23 00 19 CompactSPEECH 23 00 19 Description: Set reporting of all CompactSPEECH detectors, except for end-of-DTMF. SE Skip to End of Message This command is valid only in the PLAY state. When 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 SB 19 Microcontroller 10 A3 CompactSPEECH 10 A3 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 Byte sequence: Microcontroller Skip back five seconds from the current position in the message being played. SETD 0E09 Byte sequence: Microcontroller 0F 0E 09 CompactSPEECH 0F 0E 09 Description: http://www.national.com 40 Set time and day to Monday 1:30 AM. 2.0 Software (Continued) SF 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. Skip Forward timeÐ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 If the current vocabulary is undefined, ERRÐINVALID is reported. Example SO 00 Byte sequence: Microcontroller 22 00 19 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 Skip forward five seconds from the current position in the message 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. SPS FB Byte sequence: Note 1: Message tag bits can only be cleared. Message tag bits are set only when a message is first created. SMT FF F7 05 FF F7 CompactSPEECH 05 FF F7 Description: 16 FB Set playback speed to b5. 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 Example Microcontroller Microcontroller CompactSPEECH 16 FB Description: 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. Byte sequence: Announce the first word in the word table of the currently selected vocabulary. SPS Set Playback Speed speed Sets the speed of message playback as specified by speed. The new speed applies to all recorded messages 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. CompactSPEECH 22 00 19 Description: 07 00 CompactSPEECH 07 00 Description: SF 19 Byte sequence: Microcontroller 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 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. Byte sequence: Microcontroller 1F 00 CompactSPEECH 1F 00 Description: 41 Announce the first sentence in the sentence table of the currently selected vocabulary. http://www.national.com 2.0 Software (Continued) SV Set Vocabulary Type type id SW SW 02 00 00 Byte sequence: Microcontroller Description: 21 02 00 00 Announce the first word, in the word table of the currently selected vocabulary, twice. 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. 20 02 03 CompactSPEECH 20 02 03 Description: Microcontroller CompactSPEECH 21 02 00 00 SV 02 03 Byte sequence: Say Words n word1 . . . wordn 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 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 Select the vocabulary with vocabulary-id 3, which resides on Serial Flash, as the current vocabulary. 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 Description Default 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. 11264 Reserved ÐSILÐTHRESHOLD Ð Legal values: 9216 to 13824 in 512 (6 dB) steps. 5 ÐSILÐTHRESHOLDÐSTEP Defines the adaptive threshold changes step. 12 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. 2 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. 15 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 ÐSILÐENABLE Silence compression control. 0 turns silence compression off. 1 9 ÐENERGYÐFACTOR Determines the energy level used to synthesize silence. For the default value, the energy levels of the synthesized silence and the recorded silence are the same. If you divide (multiply) the default value by two, the synthesized silence is 6 dB less (more) than the level of the recorded silence. 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. 8192 Legal values: 1024 to 16384. 12 Legal values: 0 to 65535. 11 Reserved 12 VOXÐTIMEÐCOUNT This constant, in units of 10 ms, determines the period of silence before the CompactSPEECH reports silence. The accuracy of the constant is g 10 ms. 700 Legal values: 0 to 65535. 13 – 15 Reserved 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. Default 6 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ÐGENERATIONÐLEVEL a VOLÐLEVEL s 12. 17 Reserved 18 TONEÐTIMEÐCOUNT 19 TONEÐONÐENERGYÐTHRESHOLD 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. 700 Legal values: 0 to 65535. 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. 160 Legal values: 0 to 65535. 20 TONEÐOFFÐENERGYÐTHRESHOLD 21 VCDÐLEVEL 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. 110 Legal values: 0 to 65535. 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: 6 0 s VCDÐLEVEL a VOLÐLEVEL s 12. 22 VOXÐTOLERANCEÐTIME Controls the maximum energy period, in 10 ms units, that does NOT reset the vox detector. 23 MINÐBUSYÐDETECTÐTIME Minimum time period for busy detection, in 10 ms units. The accuracy of the constant is g 10 ms. 24 ECHOÐDELAY 25 Reserved 26 DTMFÐREVÐTWIST 3 Legal values: 0 to 255. 600 Legal values: 0 to 65535. The near-echo delay in samples. The sampling rate is 8000 Hz (i.e., 125 ms per sample). 4 Legal values: 0 to 16. http://www.national.com 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). 44 0 2.0 Software (Continued) TABLE 2-2. Tunable Parameters (Continued) Index Parameter Name Description Default 27 DTMFÐTWISTÐLEVEL A one-byte value that controls the twist level of a DTMF tone, generated by the GT command, by controlling the energy level of each of the two tones (low frequency and high frequency) composing the DTMF tone. The Least Significant Nibble (LSN) controls the low tone and the Most Significant Nibble (MSN) controls the high tone. The energy level of each tone, as measured at the output of a TP3054 codec (before the DAA) connected to the CompactSPEECH is summarized in the following table: 66 Nibble Value 0 1 2 3 4 5 6 7 8 – 15 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 Reserved 29 Reserved Example TUNE 23 700 Byte sequence: Microcontroller 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 15 17 02 BC CompactSPEECH 15 17 02 BC Description: 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 WMEM 1 32 bytes Byte sequence: VC 04 Byte sequence: 17 01 CompactSPEECH 17 01 Microcontroller 28 04 Description: CompactSPEECH 28 04 Description: Microcontroller 32 bytes of data to write echo 32 bytes of data Create a message with tag e 01, and write 32 bytes in the message memory. Set the volume level to VCDÐLEVEL a 4. 45 http://www.national.com Appendix A # User interface that includes one 16-digit LCD, and a SCHEMATIC DIAGRAMS 16-key (4 x 4) keypad. For more details about the demo please refer to the NS Digital Answering Machine Demo Operating Instructions. 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: 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 TL/EE/12584 – 31 an NSAM266SA controlling a Serial Flash device. http://www.national.com 46 TL/EE/12584 – 32 Appendix A (Continued) 47 http://www.national.com http://www.national.com 48 AV (CODEC) e 1 (R30 e 0; R31 e NOT MOUNTED) NATIONAL DEMO USES: AV (CODEC) e 1 a R30/31 TL/EE/12584 – 33 Appendix A (Continued) TL/EE/12584 – 34 Appendix A (Continued) 49 http://www.national.com http://www.national.com TL/EE/12584 – 35 Appendix A (Continued) 50 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 http://www.national.com 2. A critical component is any component of a life support device or system whose failure to perform can be reasonably expected to cause the failure of the life support device or system, or to affect its safety or effectiveness. National Semiconductor Europe 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 Fran3ais 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.