home *** CD-ROM | disk | FTP | other *** search
/ Hacker 2 / HACKER2.mdf / phreak / sp.txt < prev    next >
Text File  |  1995-01-03  |  58KB  |  2,127 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                                  TITLE PAGE
  7.  
  8.  
  9.                            IBM PC Voice Mail Card
  10.  
  11.                                      By
  12.  
  13.                               Daniel A. Durbin
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.                                Senior Project
  29.  
  30.               ELECTRONIC AND ELECTRICAL ENGINEERING DEPARTMENT
  31.  
  32.                   California Polytechnic State University
  33.  
  34.                             San Luis Obispo, CA
  35.  
  36.                                     1989
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.                                APPROVAL PAGE
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.               Title:                  IBM PC Voice Mail Card 
  57.               Author:                 Daniel Durbin
  58.               Date Submitted:         March 15, 1989
  59.  
  60.  
  61.  
  62.  
  63.  
  64.                     Copyright (C) 1989 by Daniel Durbin
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.               ______________________ ________________________
  72.               Prof. Arthur Dickerson         Signature
  73.               Senior Project Advisor
  74.  
  75.  
  76.               ______________________ _________________________
  77.                 Dr. James D. Harris          Signature
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.                                      i
  92.  
  93.  
  94.  
  95.  
  96.  
  97.                              TABLE OF CONTENTS
  98.  
  99.               Section                                  Page
  100.  
  101.                    ABSTRACT............................ iv
  102.               I.   INTRODUCTION........................  1
  103.                       A.  Purpose......................  1
  104.                       B.  Problem......................  1
  105.                       C.  Solution.....................  2
  106.               II.  BACKGROUND..........................  3
  107.                       A.  IBM PC Bus Interface.........  3
  108.                       B.  Telephone Line Interface.....  5
  109.                       C.  A/D and D/A Conversion.......  6
  110.               III. REQUIREMENTS........................  7
  111.               IV.  DESIGN..............................  8
  112.                       A.  Address Decode............... 10
  113.                       B.  Data Bus..................... 13
  114.                       C.  Voice Digitizer.............. 15
  115.                       D.  Voice Reproduction........... 18
  116.                       E.  Audio Input Amplifier........ 18
  117.                       F.  Audio Output Amplifier....... 21
  118.                       G.  Telephone Interface.......... 22
  119.                       H.  DTMF Decoder/Ring Detector... 24
  120.                       I.  Software Program............. 27
  121.               V.   DEVELOPMENT AND CONSTRUCTION........ 28
  122.               VI.  TEST RESULTS........................ 29
  123.                       A.  ADC Test..................... 29
  124.                       B.  Audio End-around Test........ 30
  125.                       C.  DAC Test..................... 32
  126.                       D.  Telephone Interface.......... 32
  127.                       E.  Answering Mode Test.......... 32
  128.                       F.  Integrated test.............. 33
  129.               VII.  CONCLUSION......................... 34
  130.               VIII. BIBLIOGRAPHY....................... 35
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.                                      ii
  146.  
  147.  
  148.  
  149.  
  150.  
  151.                                 APPENDICES                                    
  152.  
  153.               Section                                  Page
  154.  
  155.               A.  Specifications....................... 35
  156.               B.  Parts List and Costs................. 36
  157.               C.  Wire List............................ 39
  158.               D.  IC Location Diagram.................. 41
  159.               E.  PC Board Layout...................... 42
  160.               F.  Program Listing...................... 44
  161.               G.  Hardware Configuration/Layout........ 49
  162.  
  163.  
  164.  
  165.                                    TABLES
  166.  
  167.               II-1  IBM PC Bus Pin-out.................  4
  168.               IV-1  Address Assignment................. 12
  169.               IV-2  Control/Status Register Bit Asgmnt. 15    
  170.               V-1   Frequency Response Data............ 31
  171.               D-1   Wire List.......................... 39
  172.  
  173.  
  174.  
  175.                                   FIGURES
  176.  
  177.               IV-1  General Block Diagram..............  9
  178.               IV-2  Address Decode Schematic Diagram... 11 
  179.               IV-3  Data Bus Schematic Diagram......... 14 
  180.               IV-4  Audio Input/Output Schematic Diagm. 19 
  181.               IV-5  Telephone Interface Schematic Diagm 23 
  182.               IV-6  DTMF Decoder Schematic Diagram..... 25 
  183.               IV-7  Ring Detector Schematic Diagram.... 26    
  184.               V-1   Frequency Response Plot............ 30    
  185.               D-1   Wiring Diagram..................... 40
  186.               E-1   IC Location / PC Board Silkscreen.. 41
  187.               F-1   PC Board Layout - Component Side... 42  
  188.               F-2   PC Board Layout - Solder Side...... 43
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.                                     iii
  200.                                   ABSTRACT 
  201.  
  202.               
  203.  
  204.               The Voice Mail Card (VMC) functions as an 
  205.  
  206.               enhanced telephone answering machine and is 
  207.  
  208.               designed as a plug in card for the IBM PC and 
  209.  
  210.               compatibles. In addition to regular answering 
  211.  
  212.               machine functions, the VMC features programmable 
  213.  
  214.               outgoing message selection, response to caller's 
  215.  
  216.               touch tone signals, and remote programming 
  217.  
  218.               ability. 
  219.  
  220.               The function of the Voice Mail Card is to answer 
  221.  
  222.               incoming telephone calls, deliver outgoing 
  223.  
  224.               messages which are programmably selectable from 
  225.  
  226.               16 digitized audio messages which are stored on 
  227.  
  228.               the PC's hard disk, to record incoming messages 
  229.  
  230.               to the hard disk or optionally to an external 
  231.  
  232.               cassette tape recorder, to respond to a caller's 
  233.  
  234.               touch tone signals, and to enter a remote 
  235.  
  236.               programming mode as a result of a special code 
  237.  
  238.               sent by the caller. 
  239.  
  240.               Audio messages are processed digitally via A/D 
  241.  
  242.               and D/A converters which receive and send 8 bit 
  243.  
  244.               data to and from the IBM PC through a selectable 
  245.  
  246.               port address.  A/D conversion is implemented 
  247.  
  248.               with the ADC0802 which is operated at a clock 
  249.  
  250.               rate of 512 Mhz. 
  251.  
  252.  
  253.                                      iv 
  254.  
  255.               At this frequency, the conversion rate of the 
  256.  
  257.               ADC will be 8 khz yielding a bandwidth of 4 khz 
  258.  
  259.               which is the limit of the telephone line.  This 
  260.  
  261.               same clock is used for D/A conversion which is 
  262.  
  263.               implemented with the DAC0830.  8 bit data is 
  264.  
  265.               read/written to/from the card via software and 
  266.  
  267.               stored on the hard disk or optionally to an 
  268.  
  269.               external cassette tape recorder. 
  270.  
  271.               Data is transferred to and from the card through 
  272.  
  273.               I/O port address 0278h which may be changed as 
  274.  
  275.               necessary by dip switch selection.  A software 
  276.  
  277.               program controls data read and write operations.  
  278.  
  279.               A full featured pull-down windowing program is 
  280.  
  281.               provided which controls all features of the VMC 
  282.  
  283.               and operates in answer mode, program mode, 
  284.  
  285.               message record, and message playback modes. 
  286.  
  287.               A/D and D/A conversion, telephone line speech 
  288.  
  289.               interface, ring detection, and DTMF decoding are 
  290.  
  291.               performed by pre-packaged monolithic devices. 
  292.  
  293.               The entire circuitry resides on a 4-1/2" x 7" 
  294.  
  295.               printed circuit board which plugs into an 
  296.  
  297.               expansion slot in the IBM PC. 
  298.  
  299.               
  300.  
  301.               
  302.  
  303.               
  304.  
  305.               
  306.  
  307.  
  308.                                      v 
  309.  
  310.  
  311.               
  312.  
  313.                             I.      INTRODUCTION 
  314.  
  315.  
  316.               A.  Purpose  
  317.  
  318.               This project proposes an alternative to the 
  319.  
  320.               standard telephone answering machine and will 
  321.  
  322.               offer superior performance as a result of 
  323.  
  324.               versatile programmability through the use of the 
  325.  
  326.               IBM Personal Computer (IBM PC).  The primary 
  327.  
  328.               purpose of this project is to provide the 
  329.  
  330.               designer with design experience interfacing to 
  331.  
  332.               the IBM PC, interfacing to the telephone line, 
  333.  
  334.               and digital-to-analog (D/A) and (A/D) analog-to-
  335.  
  336.               digital conversion techniques. 
  337.  
  338.               B.  Problem  
  339.  
  340.               To implement this design, a method of recording 
  341.  
  342.               outgoing messages (OGM), incoming messages 
  343.  
  344.               (ICM), detecting phone rings, and audio coupling 
  345.  
  346.               to the telephone line must be devised and 
  347.  
  348.               implemented. 
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.               
  365.  
  366.               C.  Solution  
  367.  
  368.  
  369.               Messages will be digitized using an A/D 
  370.  
  371.               converter and stored as 8 bit data on a hard 
  372.  
  373.               disk. The bandwidth of the telephone line, 4 
  374.  
  375.               khz, will be adopted for the bandwidth of 
  376.  
  377.               recorded messages. This requires a sample rate 
  378.  
  379.               of 8 khz (by the Nyquist criteria). Therefore, 
  380.  
  381.               the data rate will be 8 kbytes per second or 480 
  382.  
  383.               kbytes per minute.  Since incoming messages can 
  384.  
  385.               be long and numerous, provision will be made for 
  386.  
  387.               optionally storing incoming messages to an 
  388.  
  389.               external cassette tape recorder.  Audio will be 
  390.  
  391.               reproduced using a D/A converter and played back 
  392.  
  393.               to the telephone line and an external speaker.  
  394.  
  395.               The digitized data will be read/written by the 
  396.  
  397.               IBM PC through data buffers on the answering 
  398.  
  399.               card. Audio will be recorded from a microphone 
  400.  
  401.               and played back to a speaker.  All circuitry to 
  402.  
  403.               implement this will reside on a 4-1/2" by 7" pc 
  404.  
  405.               board which will plug into an expansion slot in 
  406.  
  407.               the IBM PC. 
  408.  
  409.               Wherever possible, circuit functions on pre-
  410.  
  411.               packaged monolithic devices are used to minimize 
  412.  
  413.               power consumption, pc board space, cost, and 
  414.  
  415.               scope of this project. 
  416.  
  417.               
  418.  
  419.                              II.     BACKGROUND 
  420.  
  421.  
  422.               A.  IBM PC Bus Interface  
  423.  
  424.               The type of IBM PC bus interface of interest in 
  425.  
  426.               this project is 8 bit parallel data read and 
  427.  
  428.               write operations.  The simplest approach is to 
  429.  
  430.               use port addresses and the port read/write 
  431.  
  432.               instructions of the 8088 microprocessor.  On the 
  433.  
  434.               IBM PC, port addresses are numbered from 0200h 
  435.  
  436.               to 03FFh of which some are assigned by IBM to 
  437.  
  438.               specific devices.  Many of these addresses are 
  439.  
  440.               unassigned and are available for purposes such 
  441.  
  442.               as add-ons and expansion.  The choice of address 
  443.  
  444.               to use then depends only on which addresses are 
  445.  
  446.               free in the particular system being considered.  
  447.  
  448.               The second parallel printer port is chosen as 
  449.  
  450.               the default port address, but for adaptability, 
  451.  
  452.               may be changed by the appropriate selection of 
  453.  
  454.               dip switch positions. The dip switch may be set 
  455.  
  456.               to select any of the port addresses allowed by 
  457.  
  458.               the IBM PC. With this configuration, 8 bit 
  459.  
  460.               parallel data I/O may be accomplished with 
  461.  
  462.               software's use of the 8088's IN and OUT 
  463.  
  464.               instructions.  In TurboC, these instructions are 
  465.  
  466.               referenced with inportb() and outportb() 
  467.  
  468.               functions. 
  469.  
  470.  
  471.               Port addresses are determined by decoding 
  472.  
  473.               address bits (A0 - A9, where bit A9 indicates a 
  474.  
  475.               port is being addressed).  A port address on the 
  476.  
  477.               address bus is valid when address enable (AEN~) 
  478.  
  479.               is lowered. 8 bit data is then transferred using 
  480.  
  481.               the port read (IOR~) and port write (IOW~) 
  482.  
  483.               signals. The IBM PC bus signals are tabulated 
  484.  
  485.               below in Table II-1. 
  486.  
  487.                       GND         |  B1   A1  |   I/O CH CK~
  488.                       RESET DRV   |  B2   A2  |   D7
  489.                       +5V DC      |  B3   A3  |   D6
  490.                       IRQ2        |  B4   A4  |   D5
  491.                       -5V DC      |  B5   A5  |   D4
  492.                       DRQ2        |  B6   A6  |   D3
  493.                       -12V DC     |  B7   A7  |   D2
  494.                       NOT USED    |  B8   A8  |   D1
  495.                       +12V DC     |  B9   A9  |   D0
  496.                       GND         | B10   A10 |   I/O CH RDY
  497.                       MEMW        | B11   A11 |   AEN~
  498.                       MEMW        | B12   A12 |   A19
  499.                       IOW~        | B13   A13 |   A18
  500.                       IOR~        | B14   A14 |   A17
  501.                       DACK3~      | B15   A15 |   A16
  502.                       DRQ3        | B16   A16 |   A15
  503.                       DACK1~      | B17   A17 |   A14
  504.                       DRQ1        | B18   A18 |   A13
  505.                       DACK0~      | B19   A19 |   A12
  506.                       CLK         | B20   A20 |   A11
  507.                       IRQ7        | B21   A21 |   A10
  508.                       IRQ6        | B22   A22 |   A9
  509.                       IRQ5        | B23   A23 |   A8
  510.                       IRQ4        | B24   A24 |   A7
  511.                       IRQ3        | B25   A25 |   A6
  512.                       DACK2~      | B26   A26 |   A5
  513.                       T/C         | B27   A27 |   A4
  514.                       ALE         | B28   A28 |   A3
  515.                       +5V DC      | B29   A29 |   A2
  516.                       OSC         | B30   A30 |   A1
  517.                       GND         | B31   A31 |   A0
  518.                                   -------------
  519.  
  520.                                 Table II-1.
  521.  
  522.  
  523.               
  524.  
  525.               B.  Telephone Line Interface  
  526.  
  527.  
  528.                        1.  Speech 
  529.  
  530.               The telephone company equipment registers an 
  531.  
  532.               off-hook condition when a load which draws 20 ma 
  533.  
  534.               is placed across the two phone lines, TIP and 
  535.  
  536.               RING. The current is modulated and demodulated 
  537.  
  538.               to send and receive speech signals through the 
  539.  
  540.               lines.  Factors involved in this process include 
  541.  
  542.               line impedance balancing, gain control, and 
  543.  
  544.               amplification.  There are many manufacturers who 
  545.  
  546.               produce telephone speech circuits in monolithic 
  547.  
  548.               packages which perform these functions.  To 
  549.  
  550.               simplify the design, a choice of one of these 
  551.  
  552.               circuits is made for the telephone speech 
  553.  
  554.               interface. 
  555.  
  556.                        2.  DTMF 
  557.  
  558.               Dual Tone Multi-Frequency (DTMF) tones are used 
  559.  
  560.               to represent Touch Tone digits.  To decode these 
  561.  
  562.               tones, a series of band pass filters must be 
  563.  
  564.               used.  Most practical are switched capacitor 
  565.  
  566.               filters.  This method and frequency measuring 
  567.  
  568.               techniques are used by the M-957-01 DTMF 
  569.  
  570.               Receiver from Teltone.  This is the chip used 
  571.  
  572.               for the purpose of DTMF decoding. 
  573.  
  574.  
  575.               
  576.  
  577.  
  578.                        3.  Ring 
  579.  
  580.  
  581.               A ring signal consists of an 86 Vac signal which 
  582.  
  583.               is on for 2 seconds and off for 4 seconds. The 
  584.  
  585.               ring detector should present a high impedance to 
  586.  
  587.               the line.  Inexpensive monolithic packages are 
  588.  
  589.               available to perform the function of ring detect 
  590.  
  591.               and provide a signal which may be conditioned to 
  592.  
  593.               deliver a TTL ring detect signal to the IBM PC. 
  594.  
  595.               C.  Analog/Digital and Digital/Analog Conversion 
  596.  
  597.               National Semiconductor offers a wide variety of 
  598.  
  599.               ADC's and DAC's.  The choice of which depends on 
  600.  
  601.               3 criteria: bit resolution, conversion rate and 
  602.  
  603.               interface.  In this application, 8 bit data is 
  604.  
  605.               required at a conversion rate of 8 khz.  The 
  606.  
  607.               data should be easily interfaced to a 
  608.  
  609.               microprocessor. The ADC0802 and DAC0830 satisfy 
  610.  
  611.               these requirements with flying colors. 
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.               
  629.  
  630.  
  631.                             III.   REQUIREMENTS 
  632.  
  633.  
  634.               In addition to the IBM PC Voice Mail Card, the 
  635.  
  636.               following equipment is necessary for full 
  637.  
  638.               operation: 
  639.  
  640.               * IBM PC XT or AT Compatible (10 Mhz max) 
  641.               * MS DOS v3.0 or above 
  642.               * 128k memory 
  643.               * Hard disk (20 meg suggested) 
  644.               * Telephone line 
  645.               * External 8 Ohm speaker 
  646.               * 600 Ohm dynamic microphone 
  647.               * External tape recorder (optional)
  648.               
  649.  
  650.               The term "IBM Compatible" has been found to be 
  651.  
  652.               misleading.  Some PC systems claim to be able to 
  653.  
  654.               run all software written for the IBM PC, but in 
  655.  
  656.               actuality don't.  The Voice Mail Card was 
  657.  
  658.               designed to operate on an IBM PC XT and was 
  659.  
  660.               tested on an IBM AT 10 Mhz Compatible using MS 
  661.  
  662.               DOS 3.2. 
  663.  
  664.               The data hold time on the DAC determines the 
  665.  
  666.               maximum CPU clock frequency of 10 Mhz.  The size 
  667.  
  668.               of the hard disk will determine the amount of 
  669.  
  670.               digitized data that can be stored.  Voice 
  671.  
  672.               messages may be optionally saved in analog form 
  673.  
  674.               to an external tape drive which has a remote 
  675.  
  676.               start/stop control input. 
  677.  
  678.  
  679.  
  680.  
  681.  
  682.               
  683.  
  684.                                IV.     DESIGN 
  685.  
  686.  
  687.               The VMC consists of the following components: 
  688.  
  689.               A.  Address Decode 
  690.               B.  Control/Status Registers 
  691.               C.  Data Bus
  692.               D.  Voice Digitizer 
  693.               E.  Voice Reproduction 
  694.               F.  Audio Input Amplifier
  695.               G.  Audio Output Amplifier 
  696.               H.  Telephone Interface 
  697.               I.  DTMF Decoder / Ring Detector 
  698.               J.  Software Program
  699.  
  700.  
  701.               A general block diagram showing the inter- 
  702.  
  703.               connection of the above is shown in Figure IV-1. 
  704.  
  705.               Audio may be digitized from two sources - from 
  706.  
  707.               an external microphone, and from the telephone 
  708.  
  709.               line.  When DATA READY is asserted, the ADC has 
  710.  
  711.               completed a conversion and the data will be 
  712.  
  713.               placed on the data lines when the address decode 
  714.  
  715.               circuit detects address 0278h on the address 
  716.  
  717.               lines.  The CPU must read the data within the 
  718.  
  719.               sample period to avoid losing the next 
  720.  
  721.               conversion.  Digitized audio may be written to 
  722.  
  723.               the DAC by placing 0278h on the address lines 
  724.  
  725.               and the desired data on the data lines.  The CPU 
  726.  
  727.               should time writes with DATA READY (8 khz).  The 
  728.  
  729.               DAC outputs to the AUDIO OUT amplifier which 
  730.  
  731.               drives an external speaker and the telephone 
  732.  
  733.               line. 
  734.  
  735.               
  736.  
  737.               A.  Address Decode  
  738.  
  739.  
  740.               The IBM PC system bus has 20 address lines (A0 - 
  741.  
  742.               A19) of which only the lower 10 are used to 
  743.  
  744.               decode I/O port or device addresses.  The 
  745.  
  746.               signals may be interpreted as shown below. 
  747.  
  748.               | AEN  A9 | A8  A7  A6  A5  A4  A3  | A2 A1 A0| 
  749.               | port    |   port select           |  chip   | 
  750.               | Address |                         | select  | 
  751.               | Valid   |                         |         | 
  752.  
  753.  
  754.               Valid port address range is from 0200h to 03FFh.  
  755.  
  756.               Some of these are used and others are not. The 
  757.  
  758.               best approach for address selection is a built 
  759.  
  760.               in dip switch allow to assignment different 
  761.  
  762.               addresses depending on the particular PC 
  763.  
  764.               configuration.  The author choose the default to 
  765.  
  766.               be the second printer port (LPT2) addresses 
  767.  
  768.               0278h - 027Fh. 
  769.  
  770.               The address decode circuitry monitors the IBM PC 
  771.  
  772.               address lines (A0 - A9), address enable (AEN~) 
  773.  
  774.               and port read/write (IOR~ and IOW~) and produces 
  775.  
  776.               control signals which select operation of the 
  777.  
  778.               card.  This method is shown shown in Figure IV-2 
  779.  
  780.               and is described in detail. 
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.               Address lines (A3 - A8) and address enable 
  788.  
  789.               (AEN~) are compared with the card address value 
  790.  
  791.               in S1 (whose default is 0278h) by an 8 bit 
  792.  
  793.               magnitude comparator which is enabled by the a                
  794.  
  795.               port I/O read (IOR~) or port I/O write (IOW~) 
  796.  
  797.               operation.  This condition (XIOR + XIOW)~ is 
  798.  
  799.               decoded by discrete gates and applied to the 
  800.  
  801.               enable input of the comparator. The comparator 
  802.  
  803.               then produces card select (CS~) which is used to 
  804.  
  805.               enable two 1-of-8 decoders.  The 1-of-8 decoders 
  806.  
  807.               further decode address bits (A2 - A0) and are 
  808.  
  809.               enabled by card I/O read and card I/O write 
  810.  
  811.               (XIOR~ and XIOW~).  The outputs then become                
  812.  
  813.               register read (RA~ - RH~) and register write 
  814.  
  815.               (WA~ - WH~) control signals which enable the 
  816.  
  817.               various 3-state data registers on the card.  The 
  818.  
  819.               assignment of the registers A - H is 
  820.  
  821.               tabulated in Table IV-1. 
  822.  
  823.               Address |    Register   |       Read    |  Write
  824.               --------|---------------|---------------|-------
  825.               0278h   |       A       |       ADC     |  DAC 
  826.               0279h   |       B       |       -       |   -
  827.               027Ah   |       C       |       -       |   -
  828.               027Bh   |       D       |       -       |   -
  829.               027Ch   |       E       |       -       |   -
  830.               027Dh   |       F       |       -       |   -
  831.               027Eh   |       G       |       DTMF    |   -
  832.               027Fh   |       H       |       STAT    |  CTRL
  833.  
  834.                                 Table IV-1.
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.               
  842.  
  843.               B.  Data Bus  
  844.  
  845.  
  846.               The Voice Mail Card data bus consists of 8 bit 
  847.  
  848.               data connected to the IBM PC data bus through a 
  849.  
  850.               three-state buffer which is enabled by card 
  851.  
  852.               select (CS~) and card I/O read (XIOR~).  There 
  853.  
  854.               are five 3-state devices connected to the Voice 
  855.  
  856.               Mail Card data bus, the DAC, ADC, Status 
  857.  
  858.               Register, Control Register, and the DTMF 
  859.  
  860.               decoder.  The status register monitors the state 
  861.  
  862.               of the ADC clock (DATA READY), DTMF signal 
  863.  
  864.               decode detect (DTMF), voice signal present 
  865.  
  866.               (VOICE), ring detect (RING), and phone off hook 
  867.  
  868.               (HOOK) signals.  The control register holds 
  869.  
  870.               control signals for the tape drive and phone 
  871.  
  872.               hook relay. 
  873.  
  874.               The Data Bus Schematic diagram is shown in 
  875.  
  876.               Figure IV-3. 
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.               The status and control registers are assigned as 
  894.  
  895.               register H.  From the view of the computer, the 
  896.  
  897.               status register is a read-only register and is 
  898.  
  899.               enabled by read register H (RH~). The control 
  900.  
  901.               register is a write-only register and is enabled 
  902.  
  903.               by write register H (WH~).  These are data 
  904.  
  905.               registers which hold 8 bit card status and card 
  906.  
  907.               control signals whose assignment is tabulated 
  908.  
  909.               below in Table IV-2. 
  910.  
  911.                       |  Control Register | Status Register
  912.               --------|-------------------|------------------
  913.               BIT     |    Function       |    Function
  914.               --------|-------------------|------------------
  915.               MSB 7   |       -           |    -
  916.                   6   |       -           |    -
  917.                   5   |       -           |    -
  918.                   4   |       -           |    -
  919.                   3   |       -           |    DTMF-Detect
  920.                   2   |       Mic-On      |    Voice-Detect
  921.                   1   |       Tape-On     |    Ring-Detect
  922.               LSB 0   |       Off-Hook    |    Hook-Status
  923.  
  924.                                 Table IV-2.
  925.               C.  Voice Digitizer  
  926.  
  927.               The selection of an A/D converter is a 
  928.  
  929.               compromise between price and availability.  The 
  930.  
  931.               ADC0802 was available and chosen.  The ADC is 
  932.  
  933.               clocked at 512 khz which is set by RC 
  934.  
  935.               components. The conversion rate is then 512 khz 
  936.  
  937.               / 64 clks/conversion = 8 khz.  This will allow a 
  938.  
  939.               frequency response of up to 4 khz which will 
  940.  
  941.               cover the telephones bandwidth of 3.5 khz.  The 
  942.  
  943.               ADC is shown in Figure IV-3. 
  944.  
  945.  
  946.               The bandwidth of the telephone line is 3.5 khz.  
  947.  
  948.               For good results, the card will be designed for 
  949.  
  950.               a 4 khz bandwidth.  According to Nyquist, a 
  951.  
  952.               sample rate of twice the highest frequency is 
  953.  
  954.               required to reproduce the original signal. 
  955.  
  956.               Therefore a sample rate of 8 khz is required.  
  957.  
  958.               The National Semiconductor ADC0802 digital to 
  959.  
  960.               analog converter is an 8 bit ADC with a maximum 
  961.  
  962.               conversion rate of 10 khz.  It requires 64 clock 
  963.  
  964.               cycles per conversion.  Therefore, for an 8 khz 
  965.  
  966.               conversion rate, a clock of 512 khz is required.  
  967.  
  968.               This is obtained with RC components connected to 
  969.  
  970.               the clock inputs of the ADC.  The frequency can 
  971.  
  972.               be given by: 
  973.  
  974.                       1
  975.               f = ---------   Let R = 10 kohms,
  976.                    1.1 RC
  977.  
  978.                          1
  979.               C = --------------    =  177.6 pF
  980.                   1.1(10k)(512k)
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.               The ADC is set to operate in the free running 
  1000.  
  1001.               mode by tying interrupt (INTR~) to write (WR~) 
  1002.  
  1003.               which has the effect of initiating another 
  1004.  
  1005.               conversion once the last conversion process is 
  1006.  
  1007.               completed.  The ADC is therefore always 
  1008.  
  1009.               performing conversions.  The (INTR~) output will 
  1010.  
  1011.               then be the clock frequency divided by the 
  1012.  
  1013.               conversion rate and thus will be 8 khz. The 
  1014.  
  1015.               state of the INTR~ output of the ADC is 
  1016.  
  1017.               monitored by a D FF which is cleared when a read 
  1018.  
  1019.               register A (RA~) or write register A (WA~) 
  1020.  
  1021.               operation occurs.  The output of the D FF is 
  1022.  
  1023.               then a DATA READY signal which is monitored by 
  1024.  
  1025.               the status register for the CPU to examine.  In 
  1026.  
  1027.               this manner, the CPU can time read and write 
  1028.  
  1029.               operations to the 8 khz clock on the card.  The 
  1030.  
  1031.               ADC output data will appear on the card data bus 
  1032.  
  1033.               when read register A (RA~) is lowered which is 
  1034.  
  1035.               tied to read (RD~) on the ADC.  This corresponds 
  1036.  
  1037.               to address 0278h appearing on the IBM PC bus.  
  1038.  
  1039.               The audio input should be a voltage from 0 to 5 
  1040.  
  1041.               Vdc and is produced by the Audio Input Amplifier 
  1042.  
  1043.               circuit. 
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.               
  1054.  
  1055.               D.  Voice Reproduction 
  1056.  
  1057.  
  1058.               The DAC chip to be used is the DAC0830.  The 
  1059.  
  1060.               hookup for this chip is straight forward.  The 
  1061.  
  1062.               chip is double buffered but in this 
  1063.  
  1064.               configuration, this feature is not used.  The 
  1065.  
  1066.               feedback resistor is used in a current-to-
  1067.  
  1068.               voltage converter in the audio-out circuit. XFER 
  1069.  
  1070.               and WR2 are held low while WA~ is used as chip 
  1071.  
  1072.               select and XIOW~ clocks the data.  Vref = +5 
  1073.  
  1074.               Vdc.  The hold time of the data decreases as Vcc 
  1075.  
  1076.               increases.  For a 10 Mhz CPU, Vcc should be +12 
  1077.  
  1078.               Vdc. +5 Vdc is sufficient for 6 Mhz operation. 
  1079.  
  1080.               The DAC is shown in Figure IV-3. 
  1081.  
  1082.               E.  Audio Input Amplifier  
  1083.  
  1084.               The audio input amplifier consists of a high 
  1085.  
  1086.               gain inverting amplifier, low pass filter, level 
  1087.  
  1088.               shifter and activity detector.  The sources of 
  1089.  
  1090.               audio input signals are from an opto-isolator 
  1091.  
  1092.               connected to the telephone interface circuit and 
  1093.  
  1094.               a microphone whose impedance is 600 ohms and 
  1095.  
  1096.               output signal is about 5 mV at a normal speaking 
  1097.  
  1098.               volume and a speaking distance of 3" from the 
  1099.  
  1100.               microphone.  The input to the ADC0802 should be 
  1101.  
  1102.               from 0 to 5 Vdc centered at 2.5 Vdc.  An 
  1103.  
  1104.               inverting amplifier is used to provide a gain of 
  1105.  
  1106.               5 V / 5 mV = 1000. 
  1107.  
  1108.               The audio signal should also be filtered to 
  1109.  
  1110.               contain minimum frequency components above 4 
  1111.  
  1112.               khz.  A Sallen and Key two pole low pass filter 
  1113.  
  1114.               to provide low pass filtering.  The gain and 
  1115.  
  1116.               poles are given by: 
  1117.  
  1118.  
  1119.               Av = 1 + R2/R1          f = 1 / 2 pi R C 
  1120.  
  1121.  
  1122.  
  1123.               The gain is set to slightly above one and the 
  1124.  
  1125.               poles to 4 khz by selecting R1 = 10 kohms and R2 
  1126.  
  1127.               = 27 kohms.  Thus R2 = 12 kohms and C = 1500 pF.  
  1128.  
  1129.               The signal is then capacitively coupled to a 
  1130.  
  1131.               level shifter whose center is 2.5 Vdc and 
  1132.  
  1133.               limited by protection diodes to prevent values 
  1134.  
  1135.               greater than 5 Vdc and less than 0 Vdc. 
  1136.  
  1137.               A single-shot retriggerable multivibrator is 
  1138.  
  1139.               used as the activity detector and is set to 3 
  1140.  
  1141.               seconds by the timing components.  The high time 
  1142.  
  1143.               is given by 
  1144.  
  1145.                    tw = k Rext Cext,   where k ~= 0.45. 
  1146.  
  1147.               Choosing the highest value of Rext yields Cext = 
  1148.  
  1149.               22 uF.   The one-shot is connected to trigger on 
  1150.  
  1151.               the falling edge of the input signal.  Since the 
  1152.  
  1153.               zero or "quiet" value of the audio out signal is 
  1154.  
  1155.               2.5V, the one-shot will trigger when the input 
  1156.  
  1157.               falls below 0.8V. 
  1158.  
  1159.               
  1160.  
  1161.               F.  Audio Output Amplifier  
  1162.  
  1163.  
  1164.               The Audio Output Circuit is shown in Figure IV-4 
  1165.  
  1166.               and consists of a current-to-voltage converter 
  1167.  
  1168.               (since the output of the DAC is a current), a 
  1169.  
  1170.               Sallen and Key low pass filter, and an off-the-
  1171.  
  1172.               shelf audio amplifier. 
  1173.  
  1174.               The digitized audio output of the DAC is 
  1175.  
  1176.               converted to a voltage by the DAC's internal 15 
  1177.  
  1178.               kohm resistor and the inverting OP-AMP U16.  The 
  1179.  
  1180.               signal is then low pass filtered by a low pass 
  1181.  
  1182.               Sallen and Key filter whose high frequency is 
  1183.  
  1184.               set to 4 khz.  This removes the discrete digital 
  1185.  
  1186.               steps produced by the DAC by smoothing them into 
  1187.  
  1188.               an audio signal. 
  1189.  
  1190.               The output of this low pass filter, along with a 
  1191.  
  1192.               sample of the audio input low pass filter, is 
  1193.  
  1194.               sent to an audio power amp (U17) through a gain 
  1195.  
  1196.               control (R32) which acts as a volume control.  
  1197.  
  1198.               The output of the power amp is then sent to an 
  1199.  
  1200.               external 8 ohm speaker and to an external 
  1201.  
  1202.               cassette tape recorder if available. 
  1203.  
  1204.               Samples of both the audio output and audio 
  1205.  
  1206.               inputs circuits are send to the Telephone 
  1207.  
  1208.               Interface circuit for coupling to the telephone 
  1209.  
  1210.               line. 
  1211.  
  1212.               
  1213.  
  1214.               G.  Telephone Interface  
  1215.  
  1216.  
  1217.               The TCM-5700 monolithic speech circuit is used 
  1218.  
  1219.               to interface voice audio to the phone line.  
  1220.  
  1221.               Optosolators are used to isolate the IBM PC 
  1222.  
  1223.               power from the telephone line.  The Telephone 
  1224.  
  1225.               Interface Schematic Diagram is shown in Figure 
  1226.  
  1227.               IV-5. 
  1228.  
  1229.               The phone line is taken off hook when the 
  1230.  
  1231.               software address the OFF HOOK bit in the control 
  1232.  
  1233.               register.  The bridge rectifier BR1 converts the 
  1234.  
  1235.               telephone line's AC signal to DC for power and 
  1236.  
  1237.               use by the TP5700 speech circuit which is biased 
  1238.  
  1239.               and balanced with reference to its data sheet.  
  1240.  
  1241.               Since the telephone line must be isolated from 
  1242.  
  1243.               the IBM PC power and ground, opto-isolators are 
  1244.  
  1245.               used to couple the audio signals to and from the 
  1246.  
  1247.               audio circuits. Power from the TP5700 is used to 
  1248.  
  1249.               bias the receive LED and transmit transistor and 
  1250.  
  1251.               IBM PC +5 Vdc to bias the transmit LED and 
  1252.  
  1253.               receive transistor in the dual opto-isolator. 
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.               
  1266.  
  1267.               H.  DTMF Decoder / Ring Detector  
  1268.  
  1269.  
  1270.               The DTMF decoder schematic is shown in Figure 
  1271.  
  1272.               IV-6 and the Ring Detector in Figure IV-7. The 
  1273.  
  1274.               DTMF decoder monitors the received audio from 
  1275.  
  1276.               the telephone interface circuit.  When the DTMF 
  1277.  
  1278.               decoder detects a DTMF signal on the telephone 
  1279.  
  1280.               line, it will assert DTMF DETECT which may be 
  1281.  
  1282.               monitored by software by reading the status 
  1283.  
  1284.               register.  If the computer responds by 
  1285.  
  1286.               addressing the DTMF decoder, the DTMF decoder 
  1287.  
  1288.               will place onto the data bus (XD0-XD3) a 4 bit 
  1289.  
  1290.               binary number equivalent to the touch tone 
  1291.  
  1292.               signal present on the audio line. 
  1293.  
  1294.               The ring detector is connected directly to the 
  1295.  
  1296.               phone line through a high impedance RC circuit. 
  1297.  
  1298.               Since the ring detector is powered by the 
  1299.  
  1300.               telephone line power, its output must be 
  1301.  
  1302.               isolated from the IBM PC.  Opto-isolator U23 
  1303.  
  1304.               provides this isolation and produces RING which 
  1305.  
  1306.               is then sent to the status register. 
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.               
  1318.  
  1319.  
  1320.               I.  Software Program  
  1321.  
  1322.  
  1323.               The software program used to operate the voice 
  1324.  
  1325.               mail card is written in TurboC v1.5 and controls 
  1326.  
  1327.               the reading and writing of digitized speech to 
  1328.  
  1329.               and from the card.  It also monitors the voice 
  1330.  
  1331.               mail card status and takes appropriate action 
  1332.  
  1333.               such and picking up the phone in response to a 
  1334.  
  1335.               ring, and other control functions.  The source 
  1336.  
  1337.               code for the program is many thousand of lines 
  1338.  
  1339.               long so will not be listed here, however, a 
  1340.  
  1341.               partial listing of of the program containing the 
  1342.  
  1343.               readADC() and writeDAC() functions is provided 
  1344.  
  1345.               as Appendix G. 
  1346.  
  1347.               The program (called ANSWER.EXE) is a window 
  1348.  
  1349.               driven program which provides interface to all 
  1350.  
  1351.               the features of the voice mail card.  The user 
  1352.  
  1353.               may record outgoing messages, play back incoming 
  1354.  
  1355.               messages, manually dial a number, program the 
  1356.  
  1357.               out going message timer and anything else. 
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.               
  1371.  
  1372.  
  1373.                     V.      DEVELOPMENT AND CONSTRUCTION 
  1374.  
  1375.  
  1376.               The prototype for the VMC was built on a 
  1377.  
  1378.               prototype board during design and test.  A 
  1379.  
  1380.               layout of the proposed circuit board is provided 
  1381.  
  1382.               in the appendices.  The layout does not include 
  1383.  
  1384.               switching capacitors for the logic IC's which 
  1385.  
  1386.               should be added.  Time did not permit 
  1387.  
  1388.               fabrication of the pc board, however, it is the 
  1389.  
  1390.               author's intent to construct the pc board 
  1391.  
  1392.               version of this project. 
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.               
  1424.  
  1425.  
  1426.                             VI.     TEST RESULTS 
  1427.  
  1428.  
  1429.               A.  ADC Test  
  1430.  
  1431.               The first stage to be tested was the ADC. The 
  1432.  
  1433.               readADC() function was written to read and store 
  1434.  
  1435.               digitized audio from the ADC.  A graphing 
  1436.  
  1437.               function was written to display the digitized 
  1438.  
  1439.               audio on the computer's monitor in high 
  1440.  
  1441.               resolution graphics mode. 
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.               
  1478.  
  1479.               B.  Audio End-around Test  
  1480.  
  1481.  
  1482.               The audio input circuit was connected directly 
  1483.  
  1484.               to the audio output circuit and a frequency 
  1485.  
  1486.               response plot was made of the two circuits 
  1487.  
  1488.               combined. The combined circuits make up a four 
  1489.  
  1490.               pole band-pass filter with band of 100 hz to 
  1491.  
  1492.               4000 hz.  The resultant frequency response data 
  1493.  
  1494.               is tabulated in Table V-1 and the corresponding 
  1495.  
  1496.               frequency plot is shown in Figure V-1. 
  1497.  
  1498.                R =   12k / (150k + 12k) 
  1499.  
  1500.  
  1501.                Hz   |  Vi x R|   Vo  |   Vi   |  dB 
  1502.                -----|--------|-------|--------|------
  1503.                 70  |  52.31 |  0.22 |  3.875 |  35.0 
  1504.                100  |  52.40 |  0.40 |  3.881 |  40.3 
  1505.                200  |  52.42 |  0.65 |  3.883 |  44.5 
  1506.                400  |  52.03 |  0.82 |  3.854 |  47.0 
  1507.                700  |  51.86 |  0.91 |  3.841 |  47.5 
  1508.                1.5k |  51.68 |  1.05 |  3.828 |  48.8 
  1509.                1k   |  51.74 |  0.96 |  3.833 |  48.0 
  1510.                2k   |  51.72 |  1.20 |  3.831 |  49.9 
  1511.                3k   |  52.42 |  1.20 |  3.883 |  49.8 
  1512.                3.5k |  52.78 |  0.99 |  3.910 |  48.1 
  1513.                4k   |  52.84 |  0.78 |  3.910 |  46.0 
  1514.                5k   |  52.51 |  0.41 |  3.890 |  40.5 
  1515.                6k   |  52.28 |  0.20 |  3.873 |  34.3 
  1516.                7k   |  52.21 |  0.10 |  3.867 |  28.3
  1517.  
  1518.                Frequency response raw and calculated data
  1519.  
  1520.                                 Table V-1.
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.               
  1530.  
  1531.  
  1532.               C.  DAC Test  
  1533.  
  1534.  
  1535.               The second stage to be tested was the DAC. The 
  1536.  
  1537.               writeDAC() function was written to send stored 
  1538.  
  1539.               digitized audio to the DAC.  A speaker was 
  1540.  
  1541.               connected to the audio output circuit and the 
  1542.  
  1543.               resulting reproduction of audio was monitored 
  1544.  
  1545.               audibly. 
  1546.  
  1547.               D.  Telephone Interface  
  1548.  
  1549.               The third stage to be tested was the Telephone 
  1550.  
  1551.               interface.  A second phone line was used to dial 
  1552.  
  1553.               the phone to which the interface was connected.  
  1554.  
  1555.               The readADC() function was used to store the 
  1556.  
  1557.               digitized audio received from the phone line. 
  1558.  
  1559.               The writeDAC() was used to replay the digitized 
  1560.  
  1561.               audio. 
  1562.  
  1563.               E.  Answering Mode Test  
  1564.  
  1565.               The fourth stage to be tested was the integrated 
  1566.  
  1567.               answering mode.  For this test, the program was 
  1568.  
  1569.               used to monitor the ring signal and respond with 
  1570.  
  1571.               an OFF_HOOK command.  An outgoing message was 
  1572.  
  1573.               then played to the caller.  Once finished, the 
  1574.  
  1575.               incoming message was recorded until the VOICE 
  1576.  
  1577.               signal was no longer asserted.  The resultant 
  1578.  
  1579.               recorded incoming message was played back 
  1580.  
  1581.               through the external speaker. 
  1582.  
  1583.               
  1584.  
  1585.               F.  Integrated Test  
  1586.  
  1587.  
  1588.               The bulk of the user interface of the software 
  1589.  
  1590.               program was developed during this phase of 
  1591.  
  1592.               testing.  The readADC() and writeDAC functions 
  1593.  
  1594.               were integrated into a pull-down windowing 
  1595.  
  1596.               program and support functions were written to 
  1597.  
  1598.               provide the programmability of the VMC. 
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.               
  1636.  
  1637.  
  1638.                              VII.    CONCLUSION 
  1639.  
  1640.  
  1641.               This project was successful.  It was ahead of 
  1642.  
  1643.               schedule, under budget, exceeded specifications, 
  1644.  
  1645.               and performed outstandingly. 
  1646.  
  1647.               A.  Bugs and Suggestions  
  1648.  
  1649.               The readADC() functions writes data to the hard 
  1650.  
  1651.               disk in 1 second blocks (4 kbytes) which takes 
  1652.  
  1653.               different amounts of disk access times with 
  1654.  
  1655.               different types of hard disks.  With a 10 Mhz AT 
  1656.  
  1657.               and a 35 ms access time ST-251 hard disk, the 
  1658.  
  1659.               data write time takes more than the 1/4000th of 
  1660.  
  1661.               a second and results in data lost.  A solution 
  1662.  
  1663.               would be to provide a data buffering RAM on the 
  1664.  
  1665.               card. 
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.               
  1689.  
  1690.  
  1691.                             VII.    BIBLIOGRAPHY 
  1692.  
  1693.  
  1694.               A.  Interfacing to the IBM PC
  1695.                   by Lewis C. Eggebrecht.  Howard W. Sams.
  1696.  
  1697.               B.  Introduction to Electronic Speech Synthesis
  1698.                   by Neil Sclater Blacksburg  Howard W. Sams
  1699.  
  1700.               C.  Understanding Telephone Electronics
  1701.                   by John L. Fike.  Howard W. Sams 
  1702.  
  1703.  
  1704.  
  1705.               REFERENCES 
  1706.  
  1707.               A.  Motorola Schottky TTL Data Book
  1708.  
  1709.               B.  National Semiconductor Linear Databook
  1710.  
  1711.               C.  TelTone Corporation DTMF Receiver
  1712.                   M-957-01 Data Sheet 
  1713.  
  1714.  
  1715.               APPENDICES 
  1716.  
  1717.               Appendix A.  Specifications 
  1718.  
  1719.               Conversion rate          8       Kbytes/sec
  1720.               A/D Converter clock rate 512     Hz
  1721.               Data Rate                480     Kbytes/minute
  1722.  
  1723.               External Speaker
  1724.                impedence               8       ohms
  1725.                power                   2       watts max
  1726.  
  1727.               Microphone               600     ohms
  1728.               Audio Gain               48      dB @ 1 Khz
  1729.               Bandwidth                4       Khz
  1730.  
  1731.               Phone line               RJ-11
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746. Appendix B.  Parts List
  1747.  
  1748. Ref Des Description                       Part #      Spec     Tol  U/I  Price
  1749.  
  1750. BR1     Full-Wave Bridge Rectifier        BR84D-ND    2a, 400v      EA   0.77
  1751.  
  1752. C1      Capacitor, Electrolytic           2.2u        50V      20%  EA   0.13
  1753. C2      Capacitor, Polypropylene          1500p                2%   EA   0.39
  1754. C3      Capacitor, Polypropylene          1500p                2%   EA   0.39
  1755. C4      Capacitor, Electrolytic           2.2u        50V      20%  EA   0.13
  1756. C5      Capacitor, Polyprobylene          4700p                2%   EA   0.39
  1757. C6      Capacitor, Polyprobylene          4700p                2%   EA   0.39
  1758. C7      Capacitor, Electolytic            2.2u        50V      20%  EA   0.13
  1759. C8      Capacitor, Mylar                  0.047u      100V     10%  EA   0.09
  1760. C9      Capacitor, Electrolytic           22u         20V      20%  EA   0.13
  1761. C10     Capacitor, Metallized Polyester   0.01u       400V     10%  EA   0.16
  1762. C11     Capacitor, Mylar                  0.01u       100V     10%  >10  0.09
  1763. C12     Capacitor, Mylar                  0.047u      100V     10%  >10  0.09
  1764. C13     Capacitor, Electrolytic, Radial   100u        16V      20%  EA   0.45
  1765. C14     Capacitor, Mylar                  0.22u       100V     20%  >10  0.19
  1766. C15     Capacitor, Electrolytic, Tantalu  4.7u        50V      20%  EA   0.14
  1767. C16     Capacitor, Mylar                  0.1u        100V     20%  >10  0.11
  1768. C17     Capacitor, Tantalum               10u         16V      20%  EA   0.13
  1769. C18     Capacitor, Metallized Polyester   0.47u       250V     10%  EA   0.36
  1770. C19     Capacitor, Electrolytic, Tantalu  10u         50V      20%  EA   0.16
  1771. C20     Capacitor, Mica                   180p                 5%   EA   0.15
  1772. C21     Capacitor, Electrolytic           470u        16V      20%  EA   0.38
  1773. C22     Capacitor, Electrolytic           2.2u        50V      20%  EA   0.13
  1774. C23-C33 Capacitor, Mylar                  0.1u        100V     10%  >10  0.11
  1775.  
  1776. D1      Switching Diode                   1N4148 or eqLow I, Vf<.8v >10  0.05
  1777. D2      Switching Diode                   1N4148 or eqLow I, Vf<.8v >10  0.05
  1778. Ref Des Description                       Part #      Spec     Tol  U/I  Price
  1779.  
  1780. J1, J2  Connector, Phone                  RJ-11 DIP                 EA   3.72
  1781. J3      Connector, Miniature              SJ-441      1/8", 2 cond, EA   0.53
  1782. J4      Connector, Miniature              SJ-441      1/8", 2 cond, EA   0.53
  1783. J5      Connector, Miniature              SJ-441      1/8", 2 cond, EA   0.53
  1784. J6      Connector Subminiture             SJ-M24      1/10          EA   0.39
  1785.  
  1786. Q1      Transistor, General Purpose Swit  2N3904      NPN           EA   0.23
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794. Ref Des Description                       Part #      Spec     Tol  U/I  Price
  1795.  
  1796. R1      Resistor, Carbon                  560         1/4 WATT 5%    200 0.02
  1797. R2      Resistor, Carbon                  560K        1/4 WATT 5%    200 0.02
  1798. R3      Resistor, Carbon                  27K         1/4 WATT 5%    200 0.02
  1799. R4      Resistor, Carbon                  27K         1/4 WATT 5%    200 0.02
  1800. R5      Resistor, Carbon                  12K         1/4 WATT 5%    200 0.02
  1801. R6      Resistor, Carbon                  10K         1/4 WATT 5%    200 0.02
  1802. R7      Resistor, Carbon                  10K         1/4 WATT 5%    200 0.02
  1803. R8      Resistor, Carbon                  10K         1/4 WATT 5%    200 0.02
  1804. R9      Resistor, Carbon                  8.2K CF25   1/4 WATT 5%    200 0.02
  1805. R10     Resistor, Carbon                  8.2K        1/4 WATT 5%    200 0.02
  1806. R11     Resistor, Carbon                  12K         1/4 WATT 5%    200 0.02
  1807. R12     Resistor, Carbon                  18K         1/4 WATT 5%    200 0.02
  1808. R13     Resistor, Carbon                  10          1/4 WATT 5%    200 0.02
  1809. R14     Resistor, Carbon                  220K        1/4 WATT 5%    200 0.02
  1810. R15     Resistor, Carbon                  18K         1/4 WATT 5%    200 0.02
  1811. R16     Resistor, Carbon                  10          1/4 WATT 5%    200 0.02
  1812. R17     Resistor, Carbon                  620         1/4 WATT 5%    200 0.02
  1813. R18     Resistor, Carbon                  1.5K        1/4 WATT 5%    200 0.02
  1814. R19     Resistor, Carbon                  4.7K        1/4 WATT 5%    200 0.02
  1815. R20     Resistor, Carbon                  56 RSF1A    1   WATT 5%    100 0.12
  1816. R21     Resistor, Carbon                  1K          1/4 WATT 5%    200 0.02
  1817. R22     Resistor, Carbon                  8.2K        1/4 WATT 5%    200 0.02
  1818. R23     Resistor, Carbon                  5.6K        1/4 WATT 5%    200 0.02
  1819. R24     Resistor, Carbon                  150         1/4 WATT 5%    200 0.02
  1820. R25     Resistor, Carbon                  15K         1/4 WATT 5%    200 0.02
  1821. R26     Resistor, Carbon                  820         1/4 WATT 5%    200 0.02
  1822. R27     Resistor, Carbon                  2.2K        1/4 WATT 5%    200 0.02
  1823. R28     Resistor, Carbon                  470         1/4 WATT 5%    200 0.02
  1824. R29     Resistor, Carbon                  4.7K        1/4 WATT 5%    200 0.02
  1825. R30     Resistor, Carbon                  1M          1/4 WATT 5%    200 0.02
  1826. R31     Resistor, Carbon                  10K         1/4 WATT 5%    200 0.02
  1827. R32     Potentiometer, 15 turn            3006P       10K      10%  EA   1.35
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842. Ref Des Description                       Part #      Spec     Tol  U/I  Price
  1843.  
  1844. U1      Octal Bus Transceiver, Non-inver  74LS245                   >10  0.69
  1845. U2      A/D Converter, uP compatible      ADC0803LCN           1/2 LEA   4.95
  1846. U3      Octal Transparent Latch, 3-state  74LS373                   >10  0.79
  1847. U4      Octal Transparent Latch, 3-state  74LS373                   >10  0.79
  1848. U5      D/A Converter, uP compatible      DAC0830LCN                EA   4.75
  1849. U6      Quad 2-in NAND                    74S00                     EA   0.25
  1850. U7      Quad Buffer, Low enable, 3-state  74LS125A                  >10  0.39
  1851. U8      Dual D Flip-Flop                  74LS74A                   >10  0.25
  1852. U9      8 Bit Magnitude Comparator        74LS688N                  EA   1.93
  1853. U10     8.2 Kohm Resistor Pack DIP        4116R-001-RC1/4 WATT 10%  EA   0.59
  1854. U11     8 Switch DIP Switch               16 pin DIP                >10  1.05
  1855. U12     1 of 8 Decoder                    74LS138                   >10  0.39
  1856. U13     1 of 8 Decoder                    74LS138                   >10  0.39
  1857. U14     DTMF Receiver                     M-957-01 Teltone          dummy4.00
  1858. U15     Quad 2-in NAND                    74S00                     EA   0.25
  1859. U16     Wide Band Input JFET Op-Amp       LF347N                    EA   1.49
  1860. U17     Low Voltage Audio Power Amplifie  LM386N-1                  EA   0.79
  1861. U18     DPST Relay                        PRMA2A05    5V            EA   4.65
  1862. U19     Retriggerable Monostable Multivi  74LS123                   >10  0.39
  1863. U20     Opto-Isolator, Dual               MCT61GI     If = 50%      EA   2.50
  1864. U21     Telephone Speech Circuit          TP5700AN Nat Semi         dummy2.00
  1865. U22     Ring Detector                     TCM1520APTI               dummy0.75
  1866. U23     Opto-Isolator                     H11A2       If = 20       EA   0.75
  1867. U24     Quad Bilateral Switch             CD4016AE                  EA   0.29
  1868.  
  1869. X1      3.58 MHz Crystal Series           CY3.57      AP18          >10  0.89
  1870.  
  1871. ZD1     Zener Diode                       1N4746A     18V 100PR5%   EA   0.25
  1872.                                                                        ------
  1873.                                                                        $52.00
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885. Appendix F.  Program listing
  1886. -----------BEGIN ANSWER.H ------------
  1887. /*************************************************
  1888.  * File: Answer.h
  1889.  * Desc: Include file for the Answering card
  1890.  * Date: 12/03/88
  1891.  ************************************************/
  1892. /* FILE ADCDAC.C: */
  1893.  
  1894. /*  DOS interrupt vectors */
  1895.  
  1896. #define Keyboard        0x09            /* keyboard interrupt vector */
  1897. #define Timer           0x21
  1898. #define D8259           0x20
  1899. #define EOI             0x20
  1900.  
  1901. /*  Answering card addresses and codes */
  1902.  
  1903. #define AnsDAC          0x0278          /* Digital to Analog conv address */
  1904. #define AnsADC          0x0278          /* Analog to Digital conv address */
  1905.  
  1906. #define AnsStatReg      0x027f          /* Answering Card Status Register */
  1907. #define DataReady       0x01            /* Data Ready bit */
  1908. #define TouchTone       0x08            /* Strobe from DTMF decoder */
  1909. #define Audio           0x20            /* voice present */
  1910. #define NotRing         0x40            /* ring */
  1911. #define Clock           0x80            /* Clock bit */
  1912.  
  1913. #define AnsCtrlReg      0x027f          /* Answering Card Control Register */
  1914.  
  1915. #define OffHook         0x01            /* Takes phone off hook */
  1916. #define OnHook          0x00            /* Places phone on hook */
  1917. #define Mute            0x02            /* Halves receive gain */
  1918.  
  1919. #define AnsDTMF         0x027e          /* DTMF decoder */
  1920. #define DTMF            0xf0            /* */
  1921.  
  1922. #define Fclock          8000.0          /* 8 Khz conversion rate */
  1923.  
  1924. void interrupt keyboard_handler(void);
  1925. void read_adc(char *filename, unsigned char limit); /* limit in seconds */
  1926. char write_dac(char *filename);
  1927. void mask_timer(void);
  1928. void unmask_timer(void);
  1929. int read_dtmf(void);
  1930.  
  1931. -----------END ANSWER.H --------------
  1932.  
  1933. ---------- BEGIN ADCDAC.C ------------
  1934.  
  1935. /*************************************************
  1936.  * File: AdcDac.c
  1937.  * Desc: Read and write drivers for the ADC and
  1938.  *       the DAC at address 0278
  1939.  * Date: 12/03/88
  1940.  ************************************************/
  1941.  
  1942. #define MENU 1
  1943.  
  1944. #include <dos.h>
  1945. #include <stdlib.h>
  1946. #include <conio.h>
  1947. #include <string.h>
  1948. #include <io.h>
  1949. #include <stdio.h>
  1950.  
  1951. #include "answer.h"
  1952.  
  1953. #undef  BUFSIZ    /* increase the disk io buffer */
  1954. #define BUFSIZ  4096
  1955.  
  1956. void fopenerr(char *filename);
  1957. void interrupt (*old_keyboard)(void);
  1958. char _kbhit;
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981. /*************************************************
  1982.  * Function: Read_ADC()
  1983.  * Desc: Reads bytes from the A/D conv at 0x0278h
  1984.  ************************************************/
  1985.  
  1986. void read_adc(char *filename, unsigned char limit)
  1987. {
  1988.     FILE *stream;
  1989.     unsigned long size, i;
  1990.     char buf[BUFSIZ];
  1991.     char ch;
  1992.  
  1993.     size = (long)limit * 8000;  /* 8,000 bps */
  1994.     if (!(stream = fopen(filename, "wb"))) {
  1995.         fopenerr(filename);
  1996.         return;
  1997.     }
  1998.     setvbuf(stream,buf,_IOFBF,4096);
  1999.     old_keyboard = getvect(Keyboard);
  2000.     setvect(Keyboard, keyboard_handler);
  2001.     delay(100);
  2002.     if (kbhit())
  2003.         getch();
  2004.     _kbhit = 0;
  2005.     i = 0;
  2006.     mask_timer();
  2007.     ch = inportb(AnsStatReg);
  2008.     while ( !(ch & Audio) && !_kbhit)
  2009.         ch = inportb(AnsStatReg);
  2010.     while ( (ch & Audio) && !_kbhit) {
  2011.         ch = inportb(AnsStatReg);
  2012.         if (ch & Clock) {
  2013.             fputc(inportb(AnsADC), stream);
  2014.             if (i++ > size)
  2015.                 _kbhit++;
  2016.         }
  2017.         if (ch & TouchTone) {
  2018.             read_dtmf();
  2019.             _kbhit++;
  2020.         }
  2021.     }
  2022.     fclose(stream);
  2023.     unmask_timer();
  2024.     setvect(Keyboard, old_keyboard);
  2025.     if (kbhit())
  2026.         getch();
  2027.     return;
  2028. }
  2029. /*************************************************
  2030.  * Function: Write_DAC()
  2031.  * Desc: Writes bytes to the D/A converter 0x0278h
  2032.  *************************************************/
  2033.  
  2034. char write_dac(char *filename)
  2035. {
  2036.     char buf[BUFSIZ];
  2037.     long j;
  2038.     long size;
  2039.     FILE *stream;
  2040.     char dtmf;
  2041.     char ch;
  2042.  
  2043.     if (!(stream = fopen(filename, "rb"))) {
  2044.         fopenerr(filename);
  2045.         return(0);
  2046.     }
  2047.     setvbuf(stream,buf,_IOFBF,4096);
  2048.     old_keyboard = getvect(Keyboard);
  2049.     setvect(Keyboard, keyboard_handler);
  2050.     delay(100);
  2051.     if (kbhit())
  2052.         getch();
  2053.     size = filelength(fileno(stream));
  2054.     j = 0;
  2055.     _kbhit = 0;
  2056.     dtmf = 0;
  2057.     mask_timer();
  2058.     while (!_kbhit && (j < size)) {
  2059.         ch = inportb(AnsStatReg);
  2060.         if (ch & Clock) {
  2061.             outportb(AnsDAC, fgetc(stream));
  2062.             j++;
  2063.         }
  2064.         if (ch & TouchTone) {
  2065.             dtmf = read_dtmf();
  2066.             _kbhit++;
  2067.         }
  2068.     }
  2069.     fclose(stream);
  2070.     unmask_timer();
  2071.     setvect(Keyboard, old_keyboard);
  2072.     if (kbhit())
  2073.         getch();
  2074.     return(dtmf);
  2075. }
  2076.  
  2077. /*-------------------*/
  2078. /*  F O P E N E R R  */
  2079. /*-------------------*/
  2080.  
  2081. #ifndef MENU
  2082. void fopenerr(char *filename)
  2083. {
  2084.     printf("Cannot open %s\n", filename);
  2085. }
  2086. #endif
  2087.  
  2088. /*---------------------*/
  2089. /*  R E A D _ D T M F  */
  2090. /*---------------------*/
  2091.  
  2092. int read_dtmf(void)
  2093. {
  2094.     char dtmf;
  2095.  
  2096.     dtmf = 0;
  2097.     if (kbhit()) getch();
  2098.     while (!dtmf && !kbhit())
  2099.         dtmf = (inportb(AnsDTMF) & DTMF) >> 4;
  2100.     return(dtmf);
  2101. }
  2102. /*
  2103.  *    Check for keyboard press
  2104.  */
  2105. void interrupt keyboard_handler(void)
  2106. {
  2107.     (*old_keyboard)();
  2108.     _kbhit++;
  2109. }
  2110. /*
  2111.  *  Mask Timer
  2112.  */
  2113. void mask_timer(void)
  2114. {
  2115.     outportb(Timer, inportb(Timer) | 0x01);
  2116. }
  2117. void unmask_timer(void)
  2118. {
  2119.     outportb(Timer, inportb(Timer) & 0xfe);
  2120.     outportb(D8259, EOI);
  2121. }
  2122. #undef     BUFSIZ
  2123. #define    BUFSIZ 512    /* set back to normal */
  2124. ----------------- END OF ADCDAC.C -----------------
  2125.  
  2126. Downloaded From P-80 International Information Systems 304-744-2253
  2127.