Psoc Modem Design Package Documentation
Total Page:16
File Type:pdf, Size:1020Kb
The PSoC™ 300 Baud Modem Features Data LINE1 Software Access IIR FIR Zero 300 bits per second PGA BPF Arrange TXDIFF ∆Σ BPF LPF Cross -ment, -1 Full duplex operation n*Z UART "DAA" AGND Receiver Bell 103 and V.21 modulation Rx ATDT dialing commands Time Software High-level API provides a simple interface Base SEQUENCE Phone # Wave SIN DTMF mDAC SUM SCALE Stand-alone, embedded or co-processor operation TXOUT Gen Table Dialer Serializer For a quick start, see Using the Design IP, below. TXFILT BPF Timer (UART Tx) Dynamically Software Reconfigured TXLOG "Overlays" Overview PWM Transmitter The PSoC™ Modem uses dynamic reconfiguration to OFFHOOK implement a full duplex 300 baud modem. The RING schematics and parts list provide full details for a low- Figure 1. Modem Block Diagram cost Data Access Arrangement (DAA) that should conform readily to FCC Part 68 (IS-968) standards. Some additional work will be required before all Static Requirements regulatory requirements can be met. The modem Devices CY8C26443 and higher operates with a 5V supply and draws less than 30 mA RAM 0 bytes in full duplex operation. Flash 8 k bytes The modem uses Frequency Shift Keyed (FSK) Analog Inputs 3 pins modulation methods compliant with both the ITU V.21 Analog Outputs 2 pins and Bell 103 standards (selectable). The calling or “originating” modem transmits using a lower pair of GPIO 4 pins frequencies and the answering modem uses an upper pair. In demodulation, a combination of analog Operational Requirements switched capacitor and digital IIR band pass filters CPU Utilization at 12 MHz 75 % attenuate the relatively strong transmit signal and Shared RAM 100 bytes select the weaker receive signal. The demodulation algorithm uses autocorrelation and a digital FIR filter Stack Space 21 bytes to recover the data. A built-in software UART provides Global Inputs 0 bus lines serial/parallel conversion. Global Outputs 1 bus lines The PSoC™ 300 Baud Modem is provided in two Analog PSoC Blocks 9 blocks forms: an example project implementing a stand-alone Digital PSoC Blocks 6 blocks 300 baud modem, and a “Design IP” package of core functionality that can be imported into a new or existing projects with PSoC Designer’s Design Browser. Dynamic reconfiguration of PSoC system resources enables existing designs to add modem functionality at very low additional cost. Table of Contents Estimated Performance ...............................................2 Notes on Third-Party Modems .................................. 11 System Architecture.....................................................2 Application Programming Interface........................... 12 Hardware Architecture .............................................2 Global Variables .................................................... 12 Software Architecture...............................................6 Functions ............................................................... 12 Software Modules ....................................................7 Macros................................................................... 14 Using the Design IP.....................................................8 Design Details ........................................................... 16 PSoC Designer Configurations................................9 FSK Modulator....................................................... 16 Placement Requirements and Limitations ...............9 FSK Receiver and Demodulator............................ 18 Requirements for Global Parameters ....................10 Automatic Gain Control Design............................. 25 Using the Example Project ........................................11 Revision History ........................................................ 27 Revision 1.2 © Cypress MicroSystems, Inc. 2002-2003. Web Site: http://www.cypressmicro.com The PSoC™ 300 Baud Modem Estimated Performance Parameter Conditions Typical1 Limit1 Units Receive Dynamic Range -30 [-10, -48] dBm Carrier detection -43 -48 dBm Carrier detect hysteresis 2 dB Modulation Frequency Range V.21 Modulation [980, 1850] Hz Bell 103 Modulation [1070, 2225] Hz Transmit Carrier Bandwidth ±100 Hz Transmit Signal Power -10.5 -9 dBm Transmit Frequency Accuracy ±6 Hz Trans-Hybrid Loss (THL) 600Ω resistive termination -17 -10 dB Transmit Rejection -43 dB Out-of-band Noise -50 dBc BER, Bit Error Rate SNR ≥ 20 dB, 10-6 10-5 -10 dB ≤ Receive Level ≤ -43 dBm Notes 1. Performance is strongly dependent on the overall system implementation and construction and the values above cannot be guaranteed. Actual performance values must be determined by the user. Sample unit tests suggest these values represent reasonable expectations for actual performance, but they are not statistically valid measurements. framed with a leading start bit using the “Space” System Architecture frequency, the lower one of the pair. Following the The modem design consists of four principle blocks, Start bit, data transmission proceeds least significant the Data Access Arrangement (DAA), the receiver/ bit first and terminates with a “Stop” bit represented by demodulator, the transmitter/modulator and the DTMF the Mark Frequency. When transmitting data bits, the generator. The elements that comprise these blocks Mark frequency represents a “1” and Space are partitioned between hardware and software represents “0.” Transitions between the two functions as shown in Figure 1. frequencies must be phase continuous to limit spectral dispersion of the signal. Both the Bell 103 and International Telecommunication Union V.21 standards specify full Hardware Architecture duplex communication using frequency-shift keyed (FSK) modulation. The modem that dials out, DAA and Demodulator originating the connection by transmitting data on one pair of frequencies and receiving on another, as To be useful, the modem must be connected to the shown in the following table. Modulation is analog public switched telephone network (PSTN) by accomplished by toggling the output back and forth means of a protective “data access arrangement,” or between the two frequencies in a phase-continuous DAA. In this design, part of the DAA circuit has been manner. incorporated within the PSoC Device. From a regulatory point of view, the primary job of the DAA is FSK Transmit Bell 103 ITU V.21 to prevent damage to the telephone network. The Frequencies Space Mark Space Mark DAA design shown in modem schematic drawings accomplishes this by providing galvanic and optical Originate 1070 1270 980 1180 isolation, together with voltage-limiting diodes and a Answer 2025 2225 1650 1850 fuse to limit the maximum current. The DAA also serves to protect the modem from the telephone In the absence of data, the modem sends the higher system. frequency of its assigned transmit pair. This is referred From the modem designer’s point of view, however, to as the “Mark” frequency. A byte to be transmitted is there are additional requirements. These may be Cypress Microsystems, Inc. Page 2 The PSoC™ 300 Baud Modem classified as either control or signal conditioning Over most North American circuits today, the receive functions. The control functions are simple: The DAA signal on the line usually presents -20 to -30 dBm into drives the active low signal, RING*, as the line is 600 Ohms, but may be lower depending on network ringing. (Following the convention used in the conditions. The transmit level, on the other hand, is schematics, the asterisk denotes an “active low” set to deliver about -10 dBm into the line. As a result, signal.) In addition, the DAA responds to the active the transmit signal energy may easily dominate the high OFFHOOK signal by closing the circuit on the receive signal at the RcvAmp output. Signal-to-Noise primary side of the coupling transformer to obtain dial ratios of 10 dB and higher provide the best Bit Error tone. Rate performance. Residual transmit power contributes directly to the noise seen by the The DAA incorporates a “hybrid” circuit that converts demodulator, so receive signal should exceed the between the two-wire telephone interface and a “four- transmit signal by at least 10 dB at the demodulator wire” interface, separating the transmit and receive input. To achieve this, the modem employs a signals. (In practice, both transmit and receive signals combination of hardware and software filters. The are referred to the AGND reference supplied by the hardware 4-pole band pass filter is constructed from a PSoC microcontroller). In this context the term “hybrid” pair of BPF2 user modules, RcvBPFa and RcvBPFb, has no special significance beyond its apparent each providing a pair of poles. The transfer functions historical origin. The PSoC modem design helps to differ for each type of modulation; details are given lower the cost of the DAA by implementing the later. hybrid’s differential amplifier on-chip with a PSoC INSAMP user module named RcvAmp. This is illustrated in Figure 2 which depicts requirements of a Important Notice To legally connected a PSoC modem in full duplex operation. The transmit signal Modem to the PSTN, the modem and DAA, must present on P0.2 is a common-mode input to RcvAmp be certified to the requirements of FCC part 68 when the telephone line presents a 600 Ohm (EIA/TIA Interim Standard IS-968). Once certified, impedance, whereas the received signal is an most changes to the hardware or software require unbalanced differential input. Rejection of the transmit re-certification. Modem prototypes can be tested signal may exceed 40 dB; however, the line seldom