![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
APPLICATION NOTE ST7537 POWER LINE MODEM APPLICATION By Joel HULOUX and Laurent HANUS SUMMARY I I.1 I.2 II III III.1 III.2 III.3 III.4 IV V VI VI.1 VI.2 VI.2.1 VI.2.2 VI.2.3 VI.2.4 VI.2.4.1 VI.2.4.2 VI.2.4.3 VI.3 VI.4 VI.5 VI.6 VI.7 VI.8 VI.8.1 VI.8.2 VI.9 VI.9.1 VI.9.2 VI.9.3 VII FOREWORD : HOME AUTOMATION CONCEPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HOME AUTOMATION APPLIANCES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . THE GROWTH OF THE INDUSTRY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . INTRODUCTION. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . THE ELECTRICAL NETWORK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . IMPEDANCE OF POWER LINES . . . NOISE. . . . . . . . . . . . . . . . . . . . . . . . STANDING WAVES . . . . . . . . . . . . . TYPICAL CONNECTION LOSS . . . . .. . .. . .. . .. .. .. . .. . .. . . ... ... ... ... .. . . .... ... ... .. . .. . .... ... .. .. . .. . .. .. .. . . ..... . .. . .. .. .. . .. . .. .. .. .. . .. .. ... .. . . .. . .. . .. .. .... ... .. .. . . ... ... ... .... ... Page 2 2 2 3 4 4 4 5 5 6 7 7 7 7 8 9 9 9 9 10 12 15 15 17 17 17 18 19 20 22 22 23 23 23 1/32 ST7537 POWER LINE MODEM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DEMOBOARD FEATURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HARDWARE DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ABOUT CENELEC SPECIFICATIONS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . POWER LINE INTERFACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Line Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Line Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Power Line Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Performances of the Power Line Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Output impedance of the power line interface versus the frequency . . . . . . . . . . . . . BER test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Transmit signal spectrum analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CARRIER DETECT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . IMPROVING SENSITIVITY. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . COMMUNICATION WITH A RS232C INTERFACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . DEMOBOARD COMMUNICATING APPLICATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . OVERVIEW OF THE ST90E28 MCU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . IMPLEMENTATION OF THE ST90E28 MCU. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Applicative Pin Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Power Consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . POWER SUPPLY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Power Supply Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Power Supply Sizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using a 2x6 V Secondary Voltage Transformer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PC SOFTWARE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AN655/0994 ST7537 - POWER LINE MODEM APPLICATION VIII VIII.1 VIII.1.1 VIII.2 VIII.2.1 VIII.2.2 IX IX.1 IX.2 X TYPICAL APPLICATION : LOAD MANAGEMENT . . . . . . . . . . . . PROTOCOL DESIGN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Frame Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . USE OF THE ST90E28 RESOURCES . . . . . . . . . . . . . . . . . . . . . . Initialization of ST90E28 Core and On-chip Peripherals. . . . . . . . . Main Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... ... ... .. .. ... ................ .. .. . .. . .. .. .. . . .. .. . .. . .. .. .. . . .. .. . .. . .. .. .. . . .. .. . .. . .. .. .. . . 24 24 24 24 25 26 27 27 28 32 ANNEXES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ANNEXE A : DEMOBOARD OUTPUT IMPEDANCE . . . . . . . . . . . . . . . . . . . . . . . . . . . ANNEXE B : DEMOBOARD SCHEMATICS & LAY OUT . . . . . . . . . . . . . . . . . . . . . . . . REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I - FOREWORD : HOME AUTOMATION CONCEPT Kenneth P. Wacks, consultant to the home automation industry, has written an article clearly defining the concept of home automation. An extract is given below : "... Over the past six years a new industry called "home automation" has been developing. This industry will create the next generation of consumer appliances. The primary value added by home automation is the integration of products and services for household use. A few small companies are marketing home automation systems. Large companies and institutions are exploring this emerging industry to determine the market potential. A communication network in the house will provide the infra-structure for linking appliances, sensors, controllers, and control panels inside the house. This has become feasible by tailoring the communications technologies developed for office automation to the home environment. I.1 - Home Automation Appliances In home automation, the term "appliances" refers not only to the familiar kitchen, audio/video, and portable appliances, but also to the components of a heating and cooling system, a security system, and lighting features. Home automation covers a broad range of products and services intended for consumer use. These items are expected to share some common attributes, among which are : - Emphasis on Subsystems : Most appliances in houses today are self-contained in metal or plastic cabinets. Each appliance operates independentlyto the others. Each appliance has a different set of user control. Appliances in a home automation environment are able to exchange data. This allows appliances to be grouped into subsystems. Examples range from familiar subsystems, such as security and audio/video systems, to sophisticated lighting 2/32 controls with preset dimming levels for banks of lights. A future subsystem might permit a washing machine or a dish-washer to request that a water heater preheat water when needed or when the energy cost is lowest. - Incorporation of Communications Standard : Some of the subsystems mentioned already exist. However, the components of each are interconnected using custom-designed technologies and custom wiring. Home automation standards will relieve the manufacturer of the need to invent an ad hoc communications protocol and to provide wiring for data signals. - Diverse Locations : Once communications standards are developed, manufacturers will be able to locate components of appliances outside the cabinet. Control panels could be placed where convenient for the user, not necessarelymounted on the cabinet. Related appliances,such as clothes washer and a clothes dryer, could share a control panel so the knobs and dials are consistent and easier to operate. I.2 - The Growth of the Industry Communications technology and standards play important roles in forecasting the home automation industry. However, the development of applications to use these technologies will set the growth rate that simplify routine activities, spark a desire consumers, or save money. Thus, the growth rate of the home automation industry is ultimately determinated by the actions of appliance manufacturers. Key among these decisions are : - Adoption of an Emerging Communications Standard : The appliance manufacturers will greatly influence the establishment of a particular communications standard. They may even force an amalgamation of standards from among the current contenders. ST7537 - POWER LINE MODEM APPLICATION - Create New Appliances or Appliances Features : The development of standard communications methods can benefit manufacturersand consumers. The design staff would more likely be encouraged and financed to invent appliances that depend on the exchange of data if a communications infra-structure were already in the house..." nity "ESPRIT" project on domestic automation. A typical household scenario is shown in Figure 1, where various appliances, sensors, utility controls, a telephone interface and a TV screen display are all connected to the power line using power line modem. If this automated house catches fire the detector will send a warning message over the line. This will be picked up by the gas control which can cut off the gas supply, by an alarm system that can alert anyone in the house, and even by the telephone interface that can call the emergency services. The telephone interface also allows the householder to give instructions to appliances from outside. You might, for example, phone home and tell the air conditioner to precool certain rooms at a specified time. Where there is a limit on energy consumption, or where demand energy pricing is used (now that the technology is available this is likely to be applied extensively in future) various appliances can negociate power requirements through an energy control system. For example, a washing machine can agree with the heating system when it can start a cycle to avoid sudden and unnecessary peaks of demand. II - INTRODUCTION In the latest generation of home automation systems, appliances can exchange information by transmitting data over the domestic mains wiring. As a result there is no need to install extra control cables and appliances can be connected to the "network" simply by plugging them into the nearest wall socket. Apart from the obvious saving in installation cost, this virtual network also makes modification and enhancement very simple since new devices just have a wall socket to be instantly connected to the network. What makes these systems feasible is a new dedicated modem integrated circuit, the SGS-THOMSON ST7537 Home Automation Modem IC, developed specifically for this new high volume consumer market as part of a European CommuFigure 1 : Typical Household Scenario GAS CONTROL LIGHTING DIMMER PHONE REMOTE SYSTEM TELEVISION INFORMATION ON SCREEN GAS Phone line ALARM SYSTEM WATER CONTROL MAINS FIRE DETECTOR ALARM SENSOR ENERGY TEMPERATURE SENSOR WASHING MACHINE HOME AUTOMATION SYSTEM 7537-07.AI HEATER CONTROL SYSTEM 3/32 ST7537 - POWER LINE MODEM APPLICATION III - THE ELECTRICAL NETWORK Research has been done on the communication properties of the residential power circuit by J.B O'Neal Jr. An extract of his written work is presented below : "... The primary objective in most residential power line carrier systems is to communicate information from one power outlet in a residence to another. The communication medium, therefore, consists of everything connected on power outlets. This includes house wiring in the walls of the building, appliance wiring, the appliances themselves, the service panel, the triplex wire connecting the service panel to the distribution transformer and the distribution transformer itself. Since distribution transformers usually serve more than one residence, the loads and wiring of all residences connected to the same transformer must be included. III.1 - Impedance of Power Lines The most extensive data on this subject has been published by Malack and Engstrom of IBM (Electromagnetic Compatibility Laboratory), who measured the RF impedance of 86 commercial AC power distribution systems in six European countries (see Figure 2). These measurements show that the impedance of the residential power circuits increases with frequency and is in the range from about 1.5 to 80 at 100kHz. It appearsthat this impedance is determined by two parameters - the loads connected to the network and the impedance of the distribution transformer. The loads at a neighbor's residence can effect this impedance. Wiring seems to have a relatively small effect. The impedance is usually inductive. For typical resistive loads, signal attenuation is expected to be from 2 to 40dB at 150kHz depending on the distribution transformer used and the size of the loads. Moreover, it may be possible for capacitive loads to resonate with the inductance of the distribution transformer and cause the signal attenuation to vary wildly with frequency. III.2 - Noise The principal source of noise is caused by appliances connected to the same transformer secondary to which the power line carrier system is connected. The two primary sources of noise will be triacs used in light dimmers and universal motors. Triacs generate noise synchronous with the 50Hz power signal and this noise appears as harmonics of 50Hz. Universal motors found in mixers, sewing machines, and sanders also create noise, but it is not as strong as light dimmer noise, and not generally synchronous with 50Hz. Furthermore, light dimmers are often left on for long periods of time whereas universal motors are used intermittently. The Figure 3 shows noise sources as well as background noise in a typical residential environment. Figure 2 : Aggregate European Power Line Impedance(by Malack and Engstrom) IMPEDANCE MAGNITUDE (OHM) 1000 100 10 1 0,1 0,04 0,08 0,1 0,3 0,75 2,1 5 15 30 7537-08.AI FREQUENCY (MHz) MAXIMUM MEAN MINIMUM 4/32 ST7537 - POWER LINE MODEM APPLICATION Figure 3 : Voltage spectra for 3 universal motors compared to light dimmers operating into the 60Hz power circuit (by Vines, Trussel, Gale and O'Neal Jr.) 0 100 watt light dimmer reversible drill (dB) 50 sander seving machine background 0 20 40 (kHz) 60 80 100 III.3 - Standing Waves Standing wave effects will begin to occur when the physical dimensionsof the communication medium are similar to about one-eight of a wavelenght, which is about 375 and 250 meters at 100 and 150kHz respectively. The length of the communication path on the secondary side of the power distribution system will be determined primarily by the length of the triplex wire connecting the residences to the distribution transformer.Usually, several residences use the same distribut ion transformer. It would be rare that a linear run of this wiring would exceed 250 meters in length although the total length of branches might occasionally exceed 250 meters. Thus standing wave effects would be rare at frequencies below 150kHz for residential wiring..." III.4 - Typical Connection Loss (see Figure 4) We notice two classes of value at a transmit frequency of about 130kHz : - from 10dB to 15dB : in this case, the transmitter and the receiver are connected to the same branch circuit. - from 20dBto 30dB : in that case, the transmission path goes from one branch circuit to another through the service panel which induces an additional attenuation of 10dB to 20dB. Therefore, the transmit range of a home automation system depends on the physical topology of the electric power distribution network inside the building where the system is installed. 5/32 7537-09.AI 100 ST7537 - POWER LINE MODEM APPLICATION Figure 4 : Static Attenuation for Several Paths (by Daniel CHAFFANJON) TYPICAL CONNECTION LOSS POWER LINE MODEM 0 -10 -20 LOSS in dB -30 -40 -50 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 250 300 350 400 FREQUENCY ( KHz ) living room/kitchen living room/hall kitchen/bedroom kitchen/hall kitchen/bathroom 7537-10.AI IV - ST7537 POWER LINE MODEM Fabricated in analog CMOS technology, the ST7537 transmits and receives data up to 1200bps in half duplex mode using a carrier frequency of 132.45kHz, complying with Europe's CENELEC EN 50065 standard (which specifies the use of 125kHz to 140kHz carrier frequencies for home automation)and US FCC regulations (which specifies the use of carrier frequencies lower than 450kHz). Frequency-shift keying is used for transmission, a fundamental design choice that makes it possible to achieve rugged transmission in a very noisy electrical environment at an affordable cost for high volume consumer markets. Among the alternatives, amplitude-shift keying is too susceptible to noise and spread-spectrum, though theoretically more reliable, requires complex and costly circuits. Moreover, field trials in a critical remote utility meter reading application have proven the dependability of the SGS-THOMSON approach. Included on the chip are all of the functional blocks necessary for the transmission and reception of data over power lines. In addition to this IC the only external components needed are a line driver and a transformer, plus, of course, the microcontroller that prepares and interprets message data. Transmit data enters the FSK modulator asynchronously with a nominal intra-message data rate of 1200bps. Inside the modulator, the data is transformed into two frequencies (133.05kHz for a "0" 6/32 and 131.85kHz for a "1"), derived from an inexpensive 11.0592MHz crystal. The modulated signal from the FSK modulator is filtered by a switched-capacitor bandpass filter (TX bandpass) to limit the output spectrum and to reduce the level of harmonic components. The final stage of the transmit path consists of an operational amplifier which needs a feedback signal from the power amplifier. In the receive section, the incoming signal is applied at the RAI input (with a typical sensitivity of 1mVRMS) where it is first filtered by a switched-capacitor bandpass filter with a pass band of around 12kHz, centered on the carrier frequency. The output of the filter is amplified by a 20dB gain stage which provides symetrical limitation for overvoltages. The resulting signal is downconverted by a mixer which receives a local oscillator synthesized by the FSK modulator block. Finally, an intermediate frequency bandpass filter whose central frequency is 5.4kHz improves the signal-to-noise ratio before entering the FSK demodulator. The coupling of the intermediate frequency filter output to the FSK demodulator input is made by an external capacitor which cancels the receive path offset. In the ST7537 there are two important additional functions: the carrier detector and the watchdog. Carrier detection is needed because in practically all applications more than two appliances will be connected to the power line. Before attempting to ST7537 - POWER LINE MODEM APPLICATION transmit, an appliance must first check that there is no carrier present, and if there is, it must wait and retry later. The watchdog function is provided to ensure that the modem's control micro is functioning correctly. Software in the micro must include instructions that send a pulse to the watchdog input of the ST7537 at least once every 1.5s. If no negative transition is observed at this input for 1.5s a reset signal is generated to restart the micro. This watchdog monitor scheme ensures that any disruption caused by glitches are quickly corrected. V - DEMOBOARD FEATURES Power line interface The power line interface has been designed in order to follow the CENELEC EN 50065-1 and US FCC specification. It has to amplify and filter the output signal of the ST7537. Test pin It is possible to program the different test modes of the ST7537 with the switches SW1, SW2, SW3 and SW4 corresponding to TEST1, TEST2, TEST3 and TEST4. The most important test mode is TEST1 which allows continuous transmission. RS232C interface On the application board, there is an RS232C interface allowing you to debug your system. This interface is connected to the ST7537 by four switches SW5, SW6, SW7 and SW8. Remark : It is mandatory to provide the watchdog clock to the ST7537. Wrapping area You can wire your application and do its debug by Figure 5 : Power Line Interface Description connecting relevant digital signals to SW5, SW6, SW7 and SW8 (pin not used) and watchdog, master clock and RSTO. VI - HARDWARE DESCRIPTION VI.1 - About CENELEC Specifications The CENELEC specifications are given for an imaginary network (50/ 50H + 5) simulating the power line. This network looks like a 54 impedance at a transmit frequency of 132.45kHz. The transmitted signal is measured in relation to a reference of this network (see Annexe B). With this configuration, some of the specifications are : - maximum output level : 116dBV - harmonics level of less than 46dBV mean. In this chapter, the transmitted signal is measured between the phase and the neutral of the simulated power line. Then, the measured voltages are twice the ones measured with CENELEC test configuration. Thus, it is necessary to add 6dBV to the specifications given above : - maximum output level : 122dBV - harmonics level of less than 52dBV mean. Henceforth, these values will be used . VI.2 - Power Line Interface The power line interface connects the ST7537 to the power lines and meets the CENELEC and FCC specifications. It has the following functions : - in transmitmode : to amplify and filter the transmit signal (ATO) from the ST7537 - in receive mode : to provide received signal from powerlines to the receive input (RAI) of the ST7537 - protection against spikes and overvoltages. It is composed of a line driver and a line interface as it is shown in Figure 5. ST7537 ATO PAFB PABC PABC LINE DRIVER LINE INTERFACE MAINS 50 / 60 Hz 7/32 7537-11.AI RAI ST7537 - POWER LINE MODEM APPLICATION In transmit mode, the power line interface has to be able to drive, via the line interface, power lines with impedances from 1 to 100. Theline interface is not only used to put signals on the power line. It is also used as a bandpass filter, in order to reduce the harmonics of the transmit signal to a level of less than 52dBV . In receive mode, the line driver is switched off to avoid the low output impedance of the line driver attenuating the received signals and to save energy costs. VI.2.1 - The Line Driver The line driver has to amplify the output signal (ATO) of the ST7537 (see Figure 6). First, a normal Push-Pull amplifier has been set up with two bipolar transistors Q4 (2N2222) and Q3 (2N2907). These types of transistors (2N2222 and 2N2907) have been chosen as they are cheap and widely used. The resistors R4, R5, R10 and R12 degenerate the emitter of Q5, Q4, Q1, Q3 in order to definethe bias Figure 6 : Power Line Interface Schematics 10V Q6 current of the ouput branch independently of the mismatch of the transistors. The Push-Pull is polarized with two common collector amplifiers composed of Q1 (2N2222) and Q5 (2N2907). As far as resistors R7 and R11 are concerned, their value (180) has been defined to obtain the optimum performances of the amplifiers thus define the bias current of the system. The bipolar transistors Q2 (2N2222) and Q6 (2N2907) are used to switch off the power amplifier during the receive mode, thanks to the ST7537 output signals PABC and PABC which follow the Rx/Tx mode. In order to avoid thermal runaways, it is mandatory to connect thermically Q1/Q4 and Q3/Q5. This is possible since the collectors of the transistors used are connected to the metal package. Consequently, both transistors will have the same temperature. Main characteristics of the line driver : - voltage gain = 1 - high input impedance - low output impedance Q1, Q2, Q4 = 2N2222 Q3, Q5, Q6 = 2N2907 R11 180 Q4 LINE DRIVER R1 2 2.2 R9 47k PABC 8 R10 2.2 Q5 C5 L1 707VX-T1002N 1-2 : 20 turns 2-3 : 100 turns 4-6 : 20 turns 3 4 S T 7 5 3 7 R2 1k RAI 3 PAFB 6 ATO 7 R8 1k Q1 10H 1F (r = 0.8) 2 1 6 R6 47k PABC 9 R5 2.2 Q3 R4 2.2 LINE INTERFACE C4 3 Bottom View C1 TR1 4 6.8nF 1F 2 R7 180 D1 P6KE6V8CP C21 6 Mains 50/60Hz 0V 8/32 7537-12.EPS Q2 Toko 1F T1002N 1 ST7537 - POWER LINE MODEM APPLICATION VI.2.2 - The Line Interface In order to adapt the line driver to the power line, a transformer is used (see Figure 6). This transformer has : - to isolate the rest of the interface from the power line - to put the transmit signal on the power line - to extract the received signal from the power line - to filter 50Hz/60Hz signal coming from the power line - to filter the harmonics of the transmit signal. The used transformer is a TOKO T1002N. It has two primary windings and one secondary winding. The ratios of these windings are 4:1:1 (turns). Typical values of the transformer are : - L1t windings : 9.4H - L4t windings : 140H. The primary windings of the transformer are used to create a bandpass filter. The resonance frequency is set at the transmit frequency with C4. This capacitor is in parallel with the primary winding (1t/4t). The equivalent value for those two windings can be calculated according to : Leq = L1t + L4t + 2M destroyed, or worse, danger might occur for persons working with the interface and the ST7537. Moreover, since the TOKO transformer cannot overcome higher than 800V spikes, the safety norms are not met and the capacitor C1 is required to comply with them. An additional capacitor C21 is used as the phase location is unknown. As a final protection against any possible spikes, a transil (TRL 1) is used. It is a 6.8V bidirectional type. If a voltage greater than 6.8V appears, voltage between pins of the system will be set to 6.8V, protectingthe other parts of the power line interface from damage. R1 is added to discharge C1 after disconnecting the interface from the powerline. Without this resistor, C1 will not be discharged and schock hazard might occur if someone touches the powerline connector. This resistor is only useful in evaluation systems. In all other cases where disconnection from the power line never takes place, R1 can be removed, saving undesired energy loss. VI.2.3 - The Power Line Interface The complete power line interface has been described in the two preceding parts. The interface has to be connected to the ST7537 as described in Figure 7. The ATO and RAI are the analog output and input from/to the ST7537. The control of the transmit/receive mode is made with PABC and PABC signals from the ST7537. A high output (+10V) on PABC line selects the transmit mode, whereas a low output (0V) selects the receive mode. The "pwr" outputs are the power line connections. On the application board, these connections are located close to C1 and the transformer in order to avoid long tracks carrying high voltage. VI.2.4 - Performances of the power line interface The following tests have been done on the power line interface : - output impedance of the powerline interface versus the frequency - Bit Error Rate (BER) test - spectrum analysis of the transmit signal. VI.2.4.1 - OUTPUT IMPEDANCE OF THE POWER LINE INTERFACE VERSUS THE FREQUENCY The output impedance of the power line interface is measured with an impedance analyzer as it is shown in Figure 8. The board is set in receive mode. The results are given in annexe B. Test equipment : 41924 LF Impedance Analyzer 5Hz-13MHz (Hewlett Packard) Test conditions : T = +25C 9/32 M = k L1t L4t With the given values : k = 1/21/2 M = (9.4H 140H / 2) 1/2= 25.7H Leq = L1t + L4t + 2 M = 200.7H The resonance frequency of this LC network is dependant of C4 and Leq according to : Fres = 2 Leq C4 1 Leq (2 Fres)2 1 C4 = For Fres = 132.45kHz C4 = 7.2nF (6.8nF is chosen since it is the nearest capacitor value available). The capacitor C4 must be very linear in order avoid harmonic distortion. That's why a KS (styroflex or NPO ceramic capacitor) capacitor has been used. In order to filter the 50Hz/60Hz signal from the powerlines, C1 is used. The capacitor filters the low frequencies (50Hz/60Hz) and lets the high (Transmit) frequencies pass. It is a class X2 capacitor. These capacitors have a short circuit protection, which is absolutely necessary. Indeed if a short circuit in the capacitor occurs, the 50Hz/60Hz filtering is lost, and the powerline interface will be ST7537 - POWER LINE MODEM APPLICATION Figure 7 : Power Line Interface Inputs and Outputs +10V +10V PWR POWER LINE INTERFACE 0V 0V RAI ATO PABC PABC PWR POWER LINE RECEIVE OUTPUT TRANSMIT INPUT MODE SELECTION Figure 8 : Output Impedance Measurement Configuration ATO ST7537 POWER LINE IMPEDANCE ANALYZER 7537-14.AI RAI INTERFACE VI.2.4.2 - BER TEST Two boards are required : one for the transmission, the other one for the reception. White noise is added to the ATO transmit output of the ST7537 thanks to a mixer. The aim is to measure the BER under different Signal/Noise ratio conditions. The mixed signal is transmitted to the RAI receive input of the modem. The digital signal injected in TxD is a 215-1 pseudo-random pattern long, generated by a bit error rate analyzer (with internal 1.2kHz asynchronous clock). In the reception board, a 1.2kHz clock (CRX) is built thanks to the ST7537 MCLK clock. The received digital signal RxD is amplified (RxDL) and synchronized with the CRX clock. Both of them (CRX and RxDL) are analyzed by the BER analyzer. The measurements are made with different RAI input level. The Figures 10 and 11 gives respec- tively the B.E.R with a RAI input level of 10.023mVRMS and 1.14mVRMS . Conclusion Under the test conditions of the ST7537 specification (RAI = 10mVRMS and S/N = 15dB) the BER is 4.10-7. With an RAI input level of 1.14mVRMS the BER is around 10-4 with the same S/N ratio. Therefore, the ST7537 is able to communicate with low input signal level of about 1mVRMS. This test illustrates the high sensitivity of the power line modem. In Figure 10, the measured BER (with an RAI input level of 10mVRMS) is compared with the theorical BER of a conventional BFSK modulator/demodulator. Test equipment : SI7703B BER analyzer Rhode and Schwartz noise generator Test condition : T = +25C 10/32 7537-13.AI ST7537 - POWER LINE MODEM APPLICATION Figure 9 : BER Test Configuration B.E.R ANALYZER NOISE GENERATOR Rx CLK IN Rx DATA Tx DATA SI7703B noise TxD ST7537 RAI ATO MIXER ST7537 RxD MCLK transmission board RxDL CRX 7537-15.AI Reception board Figure 10 : BER Test for an RAI Input Amplitude of 10.023mVRMS ST7537 B.E.R T-26c Baud rate = 1200 V RAI = 10.023 mVrms B.E.R 0,1 0,01 1,000E-03 1,000E-04 1,000E-05 1,000E-06 1,000E-07 8 9 10 11 12 B/N (dB) V RAI = 10.023 mVrms Theorical B.E.R 13 14 15 16 7537-16.AI 11/32 ST7537 - POWER LINE MODEM APPLICATION Figure 11 : BER Test for an RAI Input Level of 1.14mVRMS ST7537 B.E.R T-26c Baud rate = 1200 V RAI = 1.14 mVrms B.E.R 0,01 1,00E-03 1,000E-04 1,000E-05 10 11 12 13 B/N (dB) V RAI = 1.14mVrms 14 15 16 7537-17.AI VI.2.4.3 - TRANSMIT SIGNAL SPECTRUM ANALYSIS The transmit output signal of the power line interface is measured with the power line simulated by resistors : R = 1, 5, 10, 50, 100. A spectrum analyzer is used to display the output signal frequency spectrum of the power line interface (see Figure 12). In a first design of the board, a 2.2 resistor was used instead of the inductance L1. In this configuration, whatever the power line impedance, the output level was at least 106dBV up to 119dBV (see Figure 13). Thus no communication problems had been noticed during the test session. To improve the frequency spectrum of the transmit signal, the resistor has been replaced by an inductance L1 of 68H, 1.6 (see Figures 14 and 15). Figure 12 : Spectrum Analysis Configuration Test 1 ATO However, tests on a real site showed that the transmit level was very low with this inductance in case of low power line impedance : with an impedance of 1, the output level is 87dBV, so that communication difficulties occur. At the transmit frequency (132.45kHz), the inductance looks like an impedance of about 56, which introduces significant attenuationson the transmit signal compared to those induced by the 2.2 resistor. To improve the output signal amplitude, the inductance value must be modified. A compromise has to be found between filtering the pertubation voltages and lowering the impedance of the inductance at the transmit frequency. An inductance of 10 H (0.8) has been chosen which looks like an impedance of 8 at 132.45kHz frequency (see Figures 16 and 17). POWER LINE POWER LINE SPECTRUM ST7537 Rx/Tx PAFB INTERFACE R ANALYZER TXD R : 1/5/10/50/100 ohm TXD : "0" / "1" (0V / +5V) 7537-18.AI 12/32 ST7537 - POWER LINE MODEM APPLICATION Figure 13 : Output Transmit Level (dBV) with 2.2 Resistor ST7537 APPLICATION BOARD WITH A 2.2 ohm RESISTOR TXD = "O" 125 125 120 120 115 115 110 105 110 100 95 105 90 100 1 5 VOUT (dBV) 10 R power line (ohm) CENELEC : 122 dB V) 50 100 7537-19.AI Figure 14 : Output Transmit Level (dBV) with 68H Inductance ST7537 APPLICATION BOARD WITH A 68 H INDUCTANCE TXD = "O" 85 1 5 VOUT (dBV) 10 R power line (ohm) CENELEC : 122 dB V) 50 100 7537-20.AI 7537-22.AI Figure 15 : Second and Third Harmonics Level (dBV) with 68H Inductance ST7537 APPLICATION BOARD WITH A 68 H INDUCTANCE TXD = "O" 60 Figure 16 : Output Transmit Level (dBV) with 10H Inductance ST7537 APPLICATION BOARD WITH A 10 H INDUCTANCE TXD = "O" 125 55 50 45 40 35 110 30 25 20 1 5 10 R power line (ohm) CENELEC : 52 dB V) HS (dBV) HS (dBV) 7537-21.AI 120 115 105 50 100 100 1 5 10 R power line (ohm) VOUT (dBV) CENELEC : 122 dB V) 50 100 13/32 ST7537 - POWER LINE MODEM APPLICATION Figure 17 : Second and Third Harmonics Level ST7537 APPLICATION BOARD WITH A 10 H INDUCTANCE TXD = "O" 55 dB 90 Figure 18 : Demoboard Transmit Performances ST7537 APPLICATION BOARD WITH A 10 H INDUCTANCE TxD = "O" 50 85 45 80 40 75 35 70 30 1 5 10 R power line (ohm) H2 (dBV) CENELEC : 52 dB V) H3 (dBV) 7537-23.AI 50 100 65 60 1 5 10 R power line (ohm) VOUT/H2 (dB) VOUT/H3 (dB) 50 100 7537-60.AI VOUT/H2 and VOUT/H3 variations with the 10H inductance versus the power line impedance are given in Figure 18. Test results CENELEC specifications FCC specifications (with L1 = 10H) VOUT < 122 dBV VOUT < 122 dBV, H2 < 39 dBV H2 < 56 dBV mean H2 < 48 dBV (extended to 60 dBV) H3 < 49 dBV H3 < 52 dBV mean H3 < 48 dBV (extended to 60 dBV) VOUT/H2 > 70 dB VOUT/H3 > 65 dB Conclusion With L1 = 10 H, the required harmonics level is reached and the output voltage is smaller than 122 dBV. Therefore, the power line interface is fully operating according to the CENELEC and FCC specifications. Moreover, for very low power line impedances, the output transmit level is high enough to ensure a good communication quality. Test equipment : Test conditions : 3585A Spectrum Analyzer 20Hz-40MHz (Hewlett Packard) T = +25C 14/32 ST7537 - POWER LINE MODEM APPLICATION VI.3 - Carrier Detect The carrier detect output (CD) is driven low when the input signal amplitude on RAI is greater than VCD typically 5mVRMS for at least TCD (typically 4ms). When the input signal disappears or becomes lower than VCD, CD is held low for at least TCD before returning to a high level. VCD input is the carrier detection threshold voltage which is set internally. The graph, given in Figure 19, represents the minimum amplitude of the received signal which can be detected (which corresponds to CD = 0) according to the frequency. Thus input signals at a frequency of 133.05kHz(high logic level) and 131.85kHz (low logic level) can de detected at a very low level. For frequencies smaller than 129kHz or greater than 150kHz, the detection is made at a very high level of input signal. Therefore, only significant frequencies received signals are detected. Figure 19 : RAI Input Minimum Detection Level Minimum received signal(Vin) amplitude for CD="0" ( Vcd = 5.098V ) Vin at transformer input 140 In the ST7537, the clamping of CD on RxD is programmable thanks to TxD pin. Figure 21 CD TxD CARRIER DETECTION GATE Clamping Prog 7537-41.EPS RxD GATE FSK DEMODULATOR So we are able to receive data even if the incoming analog receive signal is less than 5mV. When removing the clamping of RxD by CD we are able to get RxD data without error with a receive level of 400 micro Volt. Figure 22 RAI CD TxD RxD Rand VALID DATA "1" 7537-42.EPS 130 120 110 Vin (dBV) 100 90 80 As you can see on previous Figure even when RAI is lower than the carrier detect level we get the datas because TxD = "0". When TxD = "0" and the receive signal is not one of the 7537 (e.gNoise), the RxD is random (in most configuration the RxD is at "0"). 125 129 131 133 134.5 138.5 142.6 145 70 Frequency (KHz) VI.4 - Improving Sensitivity In all modem, the carrier detector clamps the outgoing digital data RxD when the incoming analog receive signal is below a defined level (carrier detector level 7537 typ = 5mVRMS). That means we are loosing the data when the signal is less than CD level. Figure 20 RAI 7537-40.EPS CD RxD DATA DATA Example of Implementation We have seen that by programming the TxD to "0" in receive mode we increase the sensitivity of the ST7537 because there is no more clamping by CD. You will be able to have good communication with a receive signal of around 50dBV which means a dynamic of around 70dB. Because we want to get the benefit of the very good sensitivity of the ST7537, we will program TxD to "0" in receive mode and create by soft a frame detector. We will use the CD signal as mentionned by CENELEC only when we want to transmit a frame. Different software frame detector can be implemented depending of the ressources of your microcontroller. You can program your microcontroller to go in receive frame when it received the expected byte. 7537-61.AI 15/32 ST7537 - POWER LINE MODEM APPLICATION Figure 23 RxD RANDOM DATAS PREAMBLE EXPECTED BYTE 7537-43.EPS 7537-44.EPS +5V FRAME So the preamble is for demodulator training (when you start a communication the 3 first bits are lost by the receiver) and when you will match with expected byte the microcontroller will go in receive frame routine. On the ST6 microcontroller we have implemented the following frame detector. Figure 24 RxD RANDOM DATAS "1" FFh FRAME DATA We put TxD = "1" on the transmitter for around 4ms (for demodulator training) and after we send in asynchronous mode FFh following by the complete frame. On the receiver, we check that we have RxD equal to "1" for at least 7ms (we are looking for FFh), then we go in receive and we will have frame synchronization on the first start bit of the data. We did a trial in our lab with this system during 2 hours without having the ST6 going in frame receive routine on bad datas dued to noise signal. VI.5 - Communication with a RS232C Interface The application board can be connected to a Personal Computer (PC) thanks to the RS232C inter- face. As the electrical levels of the RS232 port (12V) do not match the electrical levels of the ST7537 (TTL levels 0/+5V), a MAX232 is used to make communication possible. This device has two RS232 receivers to convert RS232 levels into TTL levels and two RS232 transmitters to convert TTL levels into RS232 levels. The connectionsbetween the ST7537 and the RS232 interface are given in Figure 25. Not all the pins from the RS232 port are used. The RXD, TXD and Carrier Detect (CD) signals are directly converted. The Request To Send (RTS) line is used to set the ST7537 in receive or transmit mode, but also to give the PC a Clear To Send (CTS) signal. The Data Set Ready (DSR) line is connectedto the Data Terminal Ready (DTR) line. This simulates the transmission of the DSR signal by the power line modem when the PC is ready. The RI output of the PC is only used for telephone network modems, and therefore it is not connected. If the RS232 port of the PC is used, it is necessary to provide the board with a watchdog clock (e.g : 1kHz) in order to get the PC communication working. A suggested clock generator is given Figure 26. It uses a NE555 timer working in astable mode. The output HIGH time of the clock is : tH = 0.693*(R1 + R2)*C1 The output LOW time of the clock is : tL = 0.693*(R2)*C1 Thus the total period T is : T = tH + tL The frequency of oscillation is : f = 1/T = 1/(tH + tL) Calculations provides the following results : R1 = 1k, R2 = 100k, C1 = 7nF. Figure 25 : Connections between ST7537 and RS232 Interface + 1 10F 16 + 10F + 10F + 10F C1+ 2 VCC 15 + 10F V+ 3 GND 14 C14 T1out 13 C2+ 5 R1in 12 TXD RXD CD RX/TX C26 R1out 11 ST7537 V7 T1in 10 T2out 8 T2in 9 R2in R2out MAX 232 1 2 3 4 5 6 7 8 9 16/32 7537-25.AI (nc) 1. 2. 3. 4. 5. DCD RXD TXD DTR GND 6. 7. 8. 9. DSR RTS CTS RI ST7537 - POWER LINE MODEM APPLICATION Figure 26 : Watchdog Clock 5V R1 4 Reset Discharge 3 8 7 1 K Ohm WD OUT NE555 R2 100 K Ohm Threshold Trigger 2 6 5 Control Voltage C 0.01 microF 1 C1 7537-26.AI 7 nF 0V RS232C Communication Problem We have discovered that with some computer the communication program does not work correctly. In some new PC generation the UART is sensitive to the RxD jitter and then shows characters errors on PLM communication. The following hardware avoid the jitter on RxD for the UART of the PC. Figure 27 Reset VCC 16 6 33nF 7 10k 11 16.4k 12 5 8 1.2k 1 9 3 4 14 RxD 2 BCLKR 3 100nF 14 7 7537-45.EPS VI.6 - Demoboard Communicating Application The ST7537 power line modem enables you to design "communicating" appliances, which meet your specific requirements and comply with the CENELEC specifications. Equipped with a single low-cost ST90E28 microcontroller, it makes it possible to build a "smart" home network, where each device is able to use any information required either if it is local (sensors) or remote (inside any other communicating appliance). This paragraph is intended to provide design basics for the implementation of the ST90E28 on the ST7537 demoboard. VI.7 - Overview of the ST90E28 MCU The ST90E28 microcontroller chosen to equip the ST7537 demoboard is a 16Kbyte program memory EPROM version with 256 bytes of RAM and 256 bytes of register file. Within this file, 224 general purpose registers are available as RAM, accumulators or index pointers, allowing code efficiency. This MCU has an internal clock generator, a 16-bit watchdog timer for system integrity, a powerful serial communications interface (SCI) with included baud rate generator and outstanding character search capability, and a 16-bit multifunction timer for complex user applications; it provides a reset input and up to 36 input/output pins, including 7 external interrupts and a non-maskable interrupt. Most of the instructions take 14 clock cycles: with a clock frequency of 11.0592MHz, one instruction lasts about 90ns. Connected to the ST7537, the microcontroller has to deliver a maximum bit rate of 1200 bauds: one bit is at least 833s long. 17/32 C D 4 0 4 6 B C N 7 4 H C 7 4 B 5 RxDs to RS232C From ST7537 Figure 28 RxD BCLKR RxDs After power-up the 7537 demoboard, you have to reset the receive recovery block. Before doing this extra hardware we recommend you to test your PC with the new program and if there are time to time some errors the hardware has to be adapted as shown above (you can use BCLKR for the watchdog clock). 7537-46.EPS ST7537 - POWER LINE MODEM APPLICATION VI.8 - Implementation of the ST90E28 MCU Two configurations have been set up, one for the slave appliances, and one for the master system. Both versions will have their address initialized in the software in this first release. Besides, they use one data output to display information about the main program execution by means of a led: you know that the main program is running well, when this led is blinking as the appliance is powered on. The main differences between the two controllers are the input/ouput facilities. The slave configuration provides an ouput that switches a load. This load will be simulated by a LED (see Figure 29). The master configuration provides a 3-bit command input to control the slaves. This command will be simulated by a KEYBOARD : one key is available for each slave, and one specific key enables the user to supervise all the slaves inside a room at once. This configuration also uses a 3-bit data output to let you know whether a particular slave is on, or whether the room is lit up. This information will be displayed by one led attached to the key dedicated to a particular device (see Figure 30). All the slaves addresses will be stored in the master version of the software. Furthermore, both configurations need a 7 bit data exchange with the ST7537 : clock, transmit data, receive data, reset, Rx/Tx control lines (see Figure 31). No external component is needed to interface the microcontroller with the power line modem, allowing cost savings. - OSCIN (Pin 2) : The MCU oscillator is driven with the PLM master clock, so that no additional crystal is needed.In this case, the oscillator output pin Figure 29 : Slave Configuration AC POWER LINE 50/60 Hz PLI must stay unconnected. - Port 5 bit 1 (Pin 42) : This output bit provides the PLM watchdog input with negative transitions, before the timeout end is reached. The watchdog pulses must be at least 500ns wide with a period of at least 800s and up to 1.5s. - Port 5 bit 0 (Pin 43) : This output controls the Rx/Tx mode. When this bit is 0, the transmit mode is set, otherwise the receive mode is selected. Remember that the ST7537 switches automatically in the receive mode, when this bit is held at 0 longer than 1s. - INT1 (Pin 26) : The PLM carrier detect signal channels through this external interrupt input pin, which is triggered on falling edge. On signal detection, the carrier detect output is driven low and generates an interrupt request. - SOUT (Pin 30) : The microcontroller provides the ST7537 with Tx data by means of the SCI output. - SIN (Pin 31) : The ST7537 providesthe microcontroller with Rx data through the SCI input. - NMI (Pin 18) : The PLM reset output signal acts as an MCU external watchdog, in order to detect hardware or software failures. This signal channels through the MCU external non maskable interrupt input pin, which is triggered on rising edge. When the power supply is too low or when no negative transition occurs on the PLM watchdog input for more than 1.5s, the reset ouput is driven high and generates a top level interrupt request, which resets the microcontroller. As for the MCU internal watchdog timer, the watchdog mode is disabled, so that a second 16-bit programmable timer is available for customer applications. ST7537 PLM 7 ST9 MCU LOAD MAIN PROGRAM 18/32 7537-28.AI ST7537 - POWER LINE MODEM APPLICATION Figure 30 : Master Configuration AC POWER LINE 50/60 Hz PLI Command LOAD_1 ST7537 PLM 7 ST9 MCU LOAD_2 ROOM Status MAIN PROGRAM LOAD_1 LOAD_2 ROOM Figure 31 : Interface between ST7537 and ST90E28 ST7537 MCLK WD Rx/Tx CD TxD RxD RSTO 24 18 18 19 20 21 22 23 2 42 43 26 30 31 ST9 OSCIN P51 P50 INT1 SOUT SIN NMI 7537-30.AI 19/32 7537-31.AI VI.8.1 - Applicative Pin Configuration - VSS (Pin 1) : Digital Circuit Ground - VDD (Pin 21) : Main Power Supply Voltage +5V. A decoupling capacitor of 47F is connected between VDD and VSS pins. The VDD of the microcontroller should be connected also to the DVCC of the ST7537 in order to reference the digital level of the ST7537. - RESET (Pin 3) : This input is active low. To restart the microcontroller, the reset key has to be pressed (see Figure 32). A capacitor (2.2F) will keep the input low for a minimum startup period, whereas a pull-up resistor (100k) will keep it high for normal operation. Figure 32 : Reset Command +5V 100K ST9 RESET + RESET KEY 2.2F 7537-29.AI ST7537 - POWER LINE MODEM APPLICATION - Display Output : Light emitting diodes are used to display data. The maximum current provided by each output pin is 0.8mA. Therefore the serial resistor R has a minimum value of 4.7k (see Figure 33 : current = (4.2-0.6)/4.7e3 = 0.77mA). The slave configuration uses 2 display output pins. Port 2 bit 3 (Pin 25) : blinking led Port 2 bit 5 (Pin 27) : load (slave led) The master configuration uses 4 display output pins. Port 2 bit 3 (Pin 25) : blinking led Port 2 bit 5 (Pin 27) : load 1 status Port 2 bit 6 (Pin 28) : load 2 status Port 5 bit 5 (Pin 38) : room status Figure 33 : Display Output VI.8.2 - Power Consumption The power consumption of each configuration has been measured. Both master and slave boards were connected to the AC power mains : the slave led and all master status leds are switched ON by pressing the master room key (worst case simulation). The current consumption is measured with a digitizing oscilloscope (channel 2) by means of a serial resistor, which value is small enough to avoid big supply voltage drops (about 1 typically). A dual tracking power supply provides each board with the same power voltage, which value is displayed on a multimeter. Test equipment : Fluke 45 Multimeter, Tektronix TDS460 Digitizing Oscilloscope Test conditions : R = 1.04 , Valim = +10.006 V o T = +25 C - Slave board : the oscilloscope is triggered on the falling edge of the Carrier Detect (CD) signal displayed on channel 1 (see Figure 35). Therefore, the current consumption is displayed on channel 2 in receive mode on stand-by (CD = 1) and active (CD = 0) states. Current consumption (Rx mode) :+146mARMS Power consumption : (+10.006V - 1.04 146mA) 146mA = +1.44W Slave board current consumption test results (see Figure 36) Channel 1 : Carrier Detect signal Channel 2 : Supply current - Master board : the oscilloscope is triggered on the falling edge of the Rx/Tx signal on channel 1 (see Figure 37). The current consumption is displayed on channel 2 in both receive and transmit modes. Current consumption : Rx mode +160mARMS Tx mode +230mARMS Power consumption : Rx mode (+10.006V - 1.04 160mA) 160mA = +1.57W Tx mode (+10.006V - 1.04 230mA) 230mA = +2.25W Master board current consumption test results (see Figure 38) Channel 1 : Rx/Tx signal Channel 2 : Supply current 7537-33.AI ST9 R Pxx - Keyboard Input : Switch keys are used to enter commands. The keyboard pin is active high (see Figure 34). Apull-down resistor of 10k keepsthe input low, whereas a key press holds it high for active operation. The master configuration uses 3 keyboard input pins. Port 5 bit 2 (Pin 41) : load 1 command Port 5 bit 3 (Pin 40) : load 2 command Port 5 bit 4 (Pin 39) : room command Figure 34 : Keyboard Input +5V KEY ST9 Pxx 10K 20/32 7537-32.AI ST7537 - POWER LINE MODEM APPLICATION Figure 35 : Slave Board Current Consumption Test MULTIMETER +V -V ALIM +10V 0V R OSCILLOSCOPE SLAVE +10V MASTER Tx mode 3 shots CH2 CH1 0V CD VAC VAC 7537-34.AI AC POWER LINE 50/60 Hz Figure 36 : Slave Board Current Consumption Test Results Tek stopped 33 Acquisitions [ T ] T Ch2 RMS 145.68 mv 1 Ch2 Max 172.4 mv Ch2 Mean 145.44 mv Ch2 Min 119.6 mv 2 7537-35.AI Ch1 5.00 V Ch2 20.00 mV M 100 ms Ch1 3.2 V 21/32 ST7537 - POWER LINE MODEM APPLICATION Figure 37 : Master Board Current Consumption Test MULTIMETER +V -V ALIM +10V 0V R OSCILLOSCOPE MASTER +10V SLAVE CH2 CH1 0V Rx/Tx VAC Rx mode VAC 7537-36.AI AC POWER LINE 50/60 Hz Figure 38 : Master Board Current Consumption Test Results Tek stopped 33 Acquisitions [ T ] T Ch2 RMS 183.78 mv 1 Ch2 Max 268.2 mv Ch2 Mean 180.84 mv Ch2 Min 119.4 mv 2 7537-37.AI Ch1 5.00 V Ch2 30.0 mV M 100 ms Ch1 3.1 V V.9 - Power Supply V.9.1 - Power supply features The power supply features are : - one reference voltage of 10 VDC - output current of 400 mA The 5 VDC voltage needed for the numeric part of the application is provided by a voltage regulator LM 7805, which already exists on the board. The power supply schematic is given in Figure 39 : The LM317T regulator is ajustable between 1.2V and 37V thanks to the R1 & R2 resistors. It could be replaced by a +10V regulator. 22/32 ST7537 - POWER LINE MODEM APPLICATION Figure 39 : Power Supply Schematics Uca + 220V C1 4700F C2 100nF R2 R1 220 C3 1F LM 317T +10 V OV V.9.2 - Power supply sizing The rectified voltage between pins of the capacitor C1 is shown in Figure 40 : Uca = transformer secondary voltage (VRMS) Ucc = voltage between pins of the capacitor C1 Urtt = ripple voltage U = minimum voltage which has to exist between input and output of the voltage regulator Us = output power supply voltage Ud = rectifier diodes voltage drop I = output power supply current Hypothesis : - I = 400mA - Umin = 3V - Ud = 1V The minimum voltage the transformer has to provide is : Uca = (Us + Umin + Urtt + 2Ud) / 2 The ripple voltage is : Urtt = 10 * I / C1 (with I in mA and C1 in F) Figure 40 : Rectified Voltage Parameters V C1 min = 10*I / Urtt max C1 min = 2000F We choose a C1 capacitor value of : 4700F The maximum voltage Vmax which can be applied between C1 pins has to be higher than the maximum secondary voltage of the transformer. Therefore, with a safety margin of 25% : Vmax = (2 * Uca) * 1.25 = 21.2V The maximum power dissipated by the voltage regulator is : Pd = U * I U = 2*Uca - Us - Urtt - 2*Ud Urtt = (10 * 400) / 4700 = 0.85V Pd = 1.6W In short, the power supply sizing is : - secondary voltage of the transformer : 2x6V - 5 VA transformer - C1 = 4700F with a maximum voltage of 25V between its pins. VII - PC SOFTWARE With the application board, we provide you a communication program written in Turbo C language which allows : - to drive the RS232 interface - to transmit data via power lines thanks to the ST7537 - to receive data from power lines thanks to the ST7537 - to process data - to run character error test. It is possible to transmit : - characters - text ( maximum 80 characters ) - hexadecimal data ( maximum 64 bytes ) - file. The communication program allows you to run different types of communication : - communication between 2 computers. - communication between 2 ports COM on the same computer. 23/32 Urtt Umin 10 V 1.414*Ucarms - 2*Ud Uoutput t V.9.3 - Using a 2x6 V secondary voltage transformer The transformer must be able to supply I = 400mA, so that a 5 VA transformer is required. The maximum value of Urtt is : Urtt max = 2*Uca - Us - Umin - 2*Ud = 2V 7537-39.AI 7537-38.AI 5K ST7537 - POWER LINE MODEM APPLICATION VIII - TYPICAL APPLICATION VIII.1 - Protocol Design The software described in the following parts provides you with a simple efficient protocol kernel, which is fully interrupt handled and uses almost no CPU time. Therefore it enables you to develop friendly interactive applications with a short response time. This protocol uses a packet encapsulation mechanism with two level error detection capability, both for the packet level and for the byte level. During reception, burst noise can affect the communication channel, so that a frame check sum is used to detect excessive errors. In many cases, impulsive noise may cause unpredictable data loss without modifying the frame check sum. Therefore, each byte is transmitted and received in an asynchronous mode inside a 11-bit type word including a start bit, onestop bit, and an odd parity bit to ensure byte integrity. VIII.1.1 - Frame Format (see Figure 41) Each frame consists of a preamble, a header, a house address, a link control, a source address, a destination address, a data block, and a frame check sum. The preambule is 8-bit field with a fixed value FFh: it trains the FSK demodulator, allows a good uart synchronisation for next character. The header consists of a 8-bit pattern AAh chosen with a low probability of wrongly detecting noise or preamble as the header. On a message reception, a matching test is run on the house address field to overcome perturbations coming from a neighbouring Figure 40 : Frame Fields home network. VIII.2 - Use of the ST90E28 resources - The Watchdog/Timer : The watchdog mode is disabled and the timer is operated in continuous mode. On each timer interrupt request, network access parameters, keyboard delay time, common system clock parameters are updated. Besides, the ST7537 watchdog input is reset. - The Serial Communication Interface (SCI) : The SCI is configured in asynchronous mode to exchange data between the power line modem and the microcontroller. Every character sent (or received) by the SCI has the following format: 1 start bit, 8 data bits, 1 parity bit (odd parity selected), 1 stop bit. The transmit rate is 1200 bauds. To start transmitting a frame, the transmitter buffer register is loaded with the preambule value FFh in order to run the SCI. Each data byte end of transmission results in the generation of an TXHEM (transmitter buffer empty) interrupt request to load the next transmit data byte. An outstandingcharacter search is performed to detect the header of an incoming frame (see Figure 42). This is achieved by comparing each received data byte to the content of the data compare register. If the incoming character matches, an RXA (receiver address match) interrupt is requestedto enablethe analysisof the next data frame fields. Every time the reception of a data byte is completed, a RxD (receive data) interrupt request is generated to store the received data byte. HOUSE PREAMBULE HEADER ADDRESS LINK SOURCE DESTINATION DATA FRAME CONTROL ADDRESS ADDRESS CHECK SUM 7537-54.AI 24/32 ST7537 - POWER LINE MODEM APPLICATION Figure 42 : Character Search Function DATA DATA MATCH DATA DATA INTERRUPT INTERRUPT MATCH INTERRUPT INTERRUPT INTERRUPT - The Register File (see Figure 43) : Among the 224 available global purpose registers, 16 registers are reserved as a transmit frame buffer, another group of 16 registers is reserved as a receive frame buffer, 48 registers are dedicated to the protocol kernel, and another group of 48 registers is allocated to the system & user stacks, which leaves 96 registers for storage of applicative values. - The Input/OutputPorts : Two of the port pins must be used for the Rx/Tx (P5.0) and WD (P5.1) output signals. Four must be initialized as alternate function for the RSTO (P2.0), CD (P2.4), RxD (P3.6) and TxD (P3.7) signals. Details concerning the initialization of these ports are given in next section. Figure 43 : Register File Map FFh F0h EFh E0h DFh PAGE SYSTEM SYSTEM STACK C0h BFh B0h AFh USER STACK APPLICATION 50h 4Fh PROTOCOL KERNEL 20h 1Fh 10h 0Fh 00h RECV BUFFER XMIT BUFFER 7537-56.AI VIII.2.1 - Initialization of ST90E28 core and onchip peripherals - Core initialization : The user and system stacks are set up in the internal register file. The internal clock frequencyis set to 11.0592MHz.The priority level of the main program is set to 7 (lowest), whereas the non-maskable interrupt (RSTO signal) has the top level priority. - Initialization of the Input/Output ports : Only six input/outputs are required to exchange data between the ST7537 and the ST90E28. The corresponding pins are initialized as follows : NMI (Port 2 bit 0) A lte rn a t e f u n ct io n, open drain, TTL CD (Port 2 bit 4) AF, OP, TTL RxD (Port 3 bit 6) AF, OP, TTL TxD (Port 3 bit 7) A lte rn a t e f u n ct io n, Push pull, TTL Rx/Tx (Port 5 bit 0) Output, Push pull, TTL WD (Port 5 bit 1) OUT, PP, TTL The NMI pin is programmed rising edge sensitive, whereas the CD/ input signal triggers an external interrupt request on a falling edge (INT1 pin) with a priority level set to 1. As for the applicative features, each port pin is initialized as follows : display pin Output, push pull, TTL keyboard pin Input, tristate, TTL - Timer : The watchdog mode is disabled. Continuous mode is selectedwith count down from a fixed value of 767, each underflow resulting in an interrupt request and reload of the fixed initial counter value. The internal clock rate, prescaler and initial count value are chosen to give an interrupt request every 555.56s (1.8kHz = 36*50Hz = 30*60Hz). The timer counter is loaded with the value 767 to complete an end of count every 555.56s. On each counter underflow an interrupt request (INT0) is generated with a priority level set to 0 (high). - Serial Communication Interface : The asynchronous mode is selected. The serial interface programmed characteristics are : 8-bit word length, 25/32 7537-55.AI DATA DATA CHAR DATA DATA ST7537 - POWER LINE MODEM APPLICATION odd parity generation and detection, 1 stop bit generation, AAh header search. In this mode, each data bit is sampled 16 times, so that each data bit period will be 16 SCI clock periods long. The counter of the baud rate generator is loaded with the fixed value 576 to set the SCI clock rate to 16*1200 = 19200 bauds. The priority level of all SCI interrupts (RXA, RxD, TXHEM) is set to 1. VIII.2.2 - Main Program The main is automatically entered on system reset, and first initializes the internal clock, stacks, ports, register file, serial communication interface, and timer. Then the timer starts counting down towards zero from an initial value of 767. Each time the counter clears to zero, an high priority interrupt request will be generated, which will initiate an update of the network access parameters. The main program loops around the main modules. TIME BASE Figure 44 : Main Program Flow Chart Entered on MAIN System RESET MCU INITIALIZATION ENABLE INTERRUPTS KEYBOARD TX_APPLICATION BACKGROUND 26/32 7537-57.AI ST7537 - POWER LINE MODEM APPLICATION ANNEXE A : DEMOBOARD OUTPUT IMPEDANCE Figure 45 ST7 537 1 60 140 DEMO B OARD IMPEDA NCE 1 20 modu le (O HM) 1 00 80 60 40 20 0 50 freq uency ( kHz) 10 0 150 Figure 46 100 80 60 I m a g i n a r y - 20 150 KHz - 40 0 20 40 - 60 - 80 0 20 40 60 80 Re al 100 120 140 160 27/32 7537-59.AI 7537-58.AI IFO AVDD 3 SW5 2 1 4 19 WD ATO 7 1k Q1 TP1 TP2 TP3 TP4 SW1 1 2 3 SW2 1 2 +5V +5V TP5 2 18 MCLK R8 2N2907 C5 1 F PAFB VCM RAI 3 1k 6 Q5 R4 2.2 DEMI 1 DVDD R16 10k TXFI R2 AVSS DVSS XTAL1 C19 10F 28 15 16 XT1 3 11.0592MHz SW3 1 2 3 C20 10F 2 3 C6 100nF C2 22pF C3 22pF SW4 1 R6 47k R7 180 17 0V C16 IC2 XTAL2 28/32 +10V P2A R14 619 Q6 2N2907 C12 C13 10F IC3 2 100nF 16V C14 16V 0V +5V (1%) C8 100nF C9 (1%) 0V 1 L7805 3 C15 10F C11 2.2F R15 9.09 R3 10k (1%) 26 R10 2.2 5 R12 2.2 Q4 2N2222 R11 180 100nF C10 2.2F 100nF 2 14 27 R9 47k 0V C7 100nF LD1 R19 10k LD2 LD3 LD4 R17 10k R18 10k 3 SW6 1 2 1 3 21 CD TEST1 TEST2 TEST3 TEST4 PABC PABC 8 20 Rx/Tx 9 10 11 12 13 2N2222 Figure 47 : Application Board 7537 DEMO1 P3 SUBD9 (FEMALE) ST7537 L1 10H (r = 1.6) 3 SW7 2 1 23 RxD 7 3 SW8 2 1 8 25 DVCC 6 24 RSTO 5 22 TxD ST7537 - POWER LINE MODEM APPLICATION 1 6 2 7 3 8 4 9 5 1 C1+ VCC 16 R5 2.2 Q3 2N2907 C4 6.8nF 3 TR1 4 2 C1 P3A 10F 2 V+ GND 15 3 C1- T10 14 470nF 6 1 4 C2+ R1I 13 R1 1M P3B C17 10F 5 C2- R10 12 D1 P2B 6 V- T1I 11 Q2 2N2222 C18 10F 0V 7 T20 T2I 10 707VX-T1002N 1-2 : 20 turns 2-3 : 100 turns 4-6 : 20 turns 3 4 0V 8 R2I R20 9 MAX232CPE 2 ANNEXE B : DEMOBOARD SCHEMATICS & LAY OUT 1 6 BottomView 7537-74.EPS ST7537 - POWER LINE MODEM APPLICATION Figure 48 : Layout F3 F4 R SW1 SW2 SW3 SW4 TP1 TP2 TP3 TP4 C1 R1 TR1 R14 R15 R3 C4 R2 Q2 IC1 R7 R6 R8 R9 R11 C8 C11 Q6 C12 P2 F7 7537-75.EPS XT1 P1 C19 5 P3 9 1 C16 C20 SW5 C2 C3 R19 R18 LD4 6 C5 Q5 Q3 L1 C21 SW6 LD3 LD2 IC2 SW8 C18 R16 LD1 R4 R10 R17 TP5 C17 SW7 R5 R12 Q1 Q4 D1 IC3 C14 C6 C13 C15 C9 C7 C10 F6 Bill Of Materials Item 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Qty. 2 6 4 1 8 1 2 2 3 3 1 1 1 4 2 1 1 Reference C11,C10 C7,C6,C8,C9,C12,C14 LD4,LD1,LD2,LD3 IC1 SW8, SW1, SW2, SW3, SW4, SW5, SW6, SW7 XT1 R8, R2 R6, R9 Q2, Q1, Q4 Q3, Q5, Q6 C4 C1 R1 R4, R5, R10, R12 R11, R7 IC2 IC3 Part 2.2F 100nF LED ST7537 Item 18 19 20 21 22 CRYSTAL 1k 47k 2N2222 2N2907 6.8nF 470nF 1M 2.2 180 MAX232CPE LM7805 23 24 25 26 27 28 29 30 31 32 33 34 Qty. Reference 1 R14 4 R19, R16, R17, R18 5 C16, C17, C18, C19, C20 1 C21 2 2 1 1 5 1 1 1 1 1 1 2 1 PICO1, PICO2 C13, C15 L1 D1 TP2, TP1, TP3, TP4, TP5 P3 P2 P1 TR1 R15 R3 C2, C3 C5 Part 619 (1%) 10k 10F 15nF PICO 10nF/16V 10H (r=0.8) DIODE POINT SUBD9 (FEMALE) ALIM ALIM+ TOKO 9.09k (1%) 10k (1%) 22pF 1F 29/32 ST7537 - POWER LINE MODEM APPLICATION Figure 49 : Master Configuration Board +5V SW10 LOAD_1 SW11 LOAD_2 R24 SW12 ROOM 0V LD8 R22 4.7k R24 R24 10k 0V WD Rx/Tx 10k 10k +5V 0V C22 47F 43 42 41 40 39 38 P50 P51 P52 P53 P54 P55 10 P00 11 P01 12 P02 13 P03 14 P04 15 P05 16 P06 17 P07 4 5 6 7 8 9 +5V R19 100k P10 P11 P12 P13 XTALIN P14 P15 RESET XTALOUT 21 VCC 1 GND P30 30 P31 31 P32 32 P33 33 P34 34 P35 35 RxD TxD ST90E28 U1 P36 36 P37 37 AS 22 DS 23 RW 24 P20 P21 P22 P23 P24 P25 P26 3 2 44 18 19 20 25 26 27 28 29 R23 4.7k R20 4.7k LD7 LD6 SW9 RESET 0V MCLK C23 2.2F P27 0V CD R21 RSTO 4.7k LD5 0V 7537-77.EPS 30/32 ST7537 - POWER LINE MODEM APPLICATION Figure 50 : Slave Configuration Board WD Rx/Tx 43 42 41 40 39 38 P50 P51 P52 P53 P54 P55 10 P00 11 P01 12 P02 13 P03 14 P04 15 P05 16 P06 17 P07 4 5 6 7 8 9 +5V R19 100k P10 P11 P12 P13 XTALIN P14 P15 RESET XTALOUT AS 22 DS 23 RW 24 21 VCC 1 GND P30 30 P31 31 P32 32 P33 33 P34 34 P35 35 RxD TxD +5V 0V C22 47F ST90E28 P36 36 P37 37 U1 P20 P21 P22 P23 P24 P25 P26 3 2 44 18 19 20 25 26 27 28 29 LOAD R20 0V 4.7k LD6 LOAD R21 0V 4.7k LD5 7537-78.EPS SW9 RESET 0V MCLK RSTO C23 2.2F P27 CD 31/32 ST7537 - POWER LINE MODEM APPLICATION REFERENCES 1. WACKS (Kenneth P.) Utility load management using home automation, IEEE Transactions on Consumer Electronics, Vol 37, N2, pp 168-174, May 1991. 2. O'NEAL (J.B, Jr.), The residential power circuit as a communication medium, IEEE Transactions on Consumer Electronics, Vol CE-36, N3, pp 567-577, August 1986. 3. VINES (Roger M.), TRUSSEL (Jel), GALE (Louis J.), Noise on Residential power distribution circuits, IEEE Transactions on ElectromagneticCompatibility, Vol EMC-26, N24, pp 161-168, November 1984. 4. LEWART (Cass), Modem handbook for the communications professional, Elsevier Science Publishing Co., 1987. 5. SGS-THOMSON Microelectronics, ST9 family 8/16 bit MCU programming manual, 1991, ST9 serie. 6. SGS-THOMSON Microelectronics, ST9 family 8/16 bit MCU technical manual, 1991, ST9 serie. 7. BORLAND, TURBO C : User's manual, 1988. 8. CHAFFANJON D., Courants porteurs sur installation electrique d'un logement (aspects physiques). Information furnished is believed to be accurate and reliable. However, SGS-THOMSON Microelectronics assumes no responsibility for the consequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. No licence is granted by implication or otherwise under any patent or patent rights of SGS-THOMSON Microelectronics. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all information previously supplied. SGS-THOMSON Microelectronics products are not authorized for use as critical components in life support devices or systems without express written approval of SGS-THOMSON Microelectronics. (c) 1995 SGS-THOMSON Microelectronics - All Rights Reserved Purchase of I2C Components of SGS-THOMSON Microelectronics, conveys a license under the Philips I2C Patent. Rights to use these components in a I2C system, is granted provided that the system conforms to the I2C Standard Specifications as defined by Philips. SGS-THOMSON Microelectronics GROUP OF COMPANIES Australia - Brazil - China - France - Germany - Hong Kong - Italy - Japan - Korea - Malaysia - Malta - Morocco The Netherlands - Singapore - Spain - Sweden - Switzerland - Taiwan - Thailand - United Kingdom - U.S.A. 32/32 |
Price & Availability of 1124
![]() |
|
|
All Rights Reserved © IC-ON-LINE 2003 - 2022 |
[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy] |
Mirror Sites : [www.datasheet.hk]
[www.maxim4u.com] [www.ic-on-line.cn]
[www.ic-on-line.com] [www.ic-on-line.net]
[www.alldatasheet.com.cn]
[www.gdcy.com]
[www.gdcy.net] |