Rs. 7.50 electronics OSCILLOSCOPES DIGITAL L©i METER ' r\ ®i t : Unique 3 Terminal Component Tester lmV/div. Sensitivity, Z-Modulation X-Y Operation, X-Y Magnifiers, X-Y Variable Controls TV Line & TV Frame, Trigger Indicator * For direct measurement of Inductance Capacitance & Resistance with the highest possible ranges and Simultaneous display of Tan Delta VLCRl is the only instrument in India covering the Widest ranges of 0.1 pf/uH/m ohm (i.e. 0.0001 ohm.) to 20,000 uf/2000H/20 M ohm. V A S A V I VASAVI ELECTRONICS 630, Alkarim, Ranigunj, Secunderabad-500 003 Phone: (0842) 70995 Grams: VELSCOPE Telex: 0425-6834 VELIN Publisher: C.R. Chandarana Editor: Surendra Iyer Technical Editor : Ashok Dongre Circulation: J. Dhas Advertising: B.M Mehta Production: C.N. Mithagari Address: ELEKTOR ELECTRONICS PVT LTD. 52, C Proctor Road. Bombay-400 007 INDIA Telex: (Oil) 76661 ELEK IN Overseas editions: Elektor Electronics 1. Harlequin Avenue. Great West Road. Brentford TW8. 9EW U K Editor:Len Seymour Pulitron Publicacoes Tecnicas Ltda Avlpiranga 1 100, 9°andar CEPOl040Sao Paulo — Brazil Editor: Juliano Barsali Elektor sari Route Nalionale; Le Seau. B P 53 592270 Bailleul — France Editors: D R S Moyer: G C P Raedersdorf Elektor Verlag GmbH Susterfeld-StraBc 25 100 Aachen — West Germany Editor: E J A Krempelsauer Elektor EPE Karaiskaki 14 16673 Voula — Athens - Greece Editor: E Xanthoulis Elektor B.V Peter Treckpoelstraat 2 4 6191 VK Beek — the Netherlands Editor: P E L Kersemakers Ferreira & Bento Lda R.D. Estefama, 32 1" 1000 Lisboa — Portugal Editor: Jorge Goncalves Ingelek S A Plaza Republica Ecuador 2-2B016 Madrid-Spain Editor: A M Ferrer In Part: Kedhorn Holdings PTY Ltd Cnr Fo* Valley Road & Kiogle Street Wahroonga NSW 2076 — Australia Editor: Roger Harrison Electronic Press AB Box 63 182 11 Danderyd - Sweeden Editor: Bill Cedrum The Circuits are for domestic use only The submission of designs of articles of Elektor India implies permission lo the publisher 10 alter and translate the icxi and designed and to use ihe contenis in other Elektor publications and activities The publishers cannot guarantee to return any material submitted to Ihem All drawings, photographs, printed circuit boards and articles published in Elektor India are copyright and may not be reproduced or imitated in whole or pari without prior written permission of the publishers Patent protection may exist in repect of circuits, devices, components etc described in this magazine The publishers do not accept resonsibility for failing to identify such paient or other protection MEMBER Printed at : Trupti Offset: Bombay - 400 013 Ph. 4923261. 4921354 Copyright © 1987 Elektuur B.V. The Netherlands The birth of satellite communications The digital audio taperecorder The UNIX operating system The INMOS transputer and OCCAM Computer Science's holy grail Projects BASIC computer Automatic car aerial Dimmer for inductive loads LED logic flasher Precise motor speed regulator chip Information Electronics News Telecommunication News Computer News New Products Readers Services Corrections- Guide lines Switchboard Index of advertisers Info/Data sheets Selex-29 Thermometer 12.22 12.34 12.38 12.41 12.48 12.26 12.40 12.43 12.45 12.46 12.18 12.20 12.21 12.56 12.70 12.72 12.65 12.72 12.73 12.51 Front cover Allhough the Digital Audio Taperecording system, introduced injapan earlier this year,has,run into difficulties with the combined might of the western world's records producers and composers' and music writers' organizations, it appears that it is here to slay. But. in the absence of prerecorded tapes. Ihe impossibility of recording from CD players, and a relatively high price, it is probable that it will lake a long time before it will make its presence felt on the market. elektor india december 1987 12.05 THE BIRTH OF SATELLITE COMMUNICATIONS Twenty-five years ago worldwide communications entered a new era. Telstar, the world’s first commercial communications satellite, was launched on July lO, 1962, and the first live television signals via satellite were received by British Telecom’s Goonhilly earth station in the early hours of the following morning. Fig. 1. The Olympus satellite is one of the largest and most powerful in the world. Photograph courtesey of British Aerospace. In October 1945, the magazine Wireless World published an article by Artur C. Clarke, today probably better known as the autor of 2001— A space Odyssey. entitled Extra-terrestrial re- lays— can rocket stations give worldwide radio coverage? Arthur C. Clarke commented in his article: "Many may consider the solution proposed in this discussion too farfetched to be taken very seriously." Yet his idea was to prove the blue-print for today's satellite communi- cations network. He accurately predicted the or- bital velocity that a rocket would need to become an ar- tificial satellite, or second moon, circling the world with no expenditure of power. He also predicted that a satellite circling the earth above the equator at a certain height would appear to be stationary to the earth and that three such satellites could give global radio coverage. He further predicted that devel- opment of rocket technology, started by the Germans during the second world war, would soon make it possible to place a satellite in orbit. Today, reality has caught up with science fiction as British Telecom International-BTI- handles more than three million minutes of telephone calls, tele- vision pictures, data, facsimile, and telex, every day through Goonhilly and its other inter- continental links. About 90 per cent of the world's telephones— some 600 million of them— in 173 countries can be dialled direct from the UK. Telephone services are provided to more than 200 countries and each day more than 500,000 calls are connec- ted from the UK to the other countries. 12.22 elektor mdia December 1987 The early Telstar demonstrations and tests In the Spring of 1961 it was jointly announced in the United Kingdom, the USA and France that the US National Aeronautics and Space Administration (NASA), the French Centre for Telecommunications Studies and British Telecom, as its predecessor Post Office Tele- communications, would co- operate in a programme for transatlantic testing of com- munications satellites. At the same time it was an- nounced that satellite earth sta- tions would be built in England and France "for the reception and transmission of telephone, telegraph and television signals across the Atlantic using satellites to be launched by NASA during 1962 and 1963." Work began shortly afterwards to build the UK's first satellite station at Goonhilly Downs in Cornwall. The site was chosen because it was as far west as possible to obtain the maximum period of visibility to the United States via the satellite, to be remote from sources of elec- trical interference, and to pro- vide an onobscured view to the horizon for the longest possible contact with the satellite. In less than a year from gaining access to the site the station was ready. A massive, steerable dish antenna, weighing 870 tonnes with a 25.9m dish had been built. All of the equipment on the station was of British design and manufacture, with the exception of one American transmitting klystron valve. The British design was the odd- man-out among the three earth stations to be used for the tests. Both the American station at An- dover, Maine, and the French station at Pleumeur Bodou in Britanny were equipped with horn antennas housed in radomes. The British station had cost around £800,000 to com- plete, about a quarter of the cost of the American and the French stations. In early July 1962 it was an- nounced that Telstar would be launched from Cape Canaveral on either July 10 or 11. The successful launch took place at 8.35 GMT on Tuesday, July 10, and the desired orbit was achieved. With Telstar circling the earth at heights varying between 590 and- 3500 miles, it was possible to achieve three or four periods during each 24 hours when mutual visibility between Goonhilly and Andover lasted for 30 to 40 minutes. During these periods the anten- na at Goonhilly had to be ac- curately manoeuvred to follow the satellite from the moment it rose above the horizon until it again disappeared from view. The signal transmitted from the antenna to the satellite was con- Fig. 2. A small section of Goonhilly Downs Earth Station: in the foreground Aerial No. 7. Photograph courtesy of British Telecom. centrated into a narrow beam, one-fifth of a degree in wid'h, so absolute precision was necessary. To maintain this ac- curacy in high wind meant that the antenna had to be massive and sturdy. In order to move the antenna so accurately it was equipped with electric motors of some 100 horse power. How- ever, the engineering design resulted in such good balance and smooth movement of the antenna that normaly less than two horse power was required under reasonable weather con- ditions. The primary purpose of the Telstar satellite tests was to ac- quire data on which to base the future design of satellite systems for commercial oper- ation. However, during the period from July 10 to July 27 a number of demonstrations were carried out which il- lustrated the potentialities of satellite systems for world-wide telecommunications. In the early hours of July 11 the first usable orbits were the sixth and seventh and the first at- tempt at television reception was made. Reception was decidedly poor. Some experts were quick to blame Goon- hilly's unique antenna design, and The Times described the experiment as "an almost total failure”. Some experts said the antenna was too heavy and cumbersome to accurately track the satellite, others blamed the driving mechanism. The problem proved to be that one component had been fitted the wrong way round and it was a twenty-minute job to correct it. The effect of the incorrect fit- ting had been to reverse the direction of the wave polariz- ation of the antenna, relative to that of the satellite, introducing a serious weakening of the strength of signals received. The problem arose because of an ambiguity in the accepted definition of the sense of ro- tation of radio waves; a difficulty which had been encountered both in the USA and the UK in the period just before the tests. With the correction made, ex- cellent pictures were received on orbit 15 during the evening of July 11, and during orbit 16 the first live television trans- mission between Europe and the USA was made from Goonhilly to Andover. The pic- tures and sound received at An- dover were reported to be of Fig. 3. The first of the dish antennas to be installed at Goonhilly Downs. Photograph courtesy of British Telecom. Fig. 4. Aerial 6 is Goonhrly's largest dish with a diamter of 32 m. It was also the first "dual frequency” antenna, able to transmit and receive on two different frequencies simultaneously. Photograph courtesy of British Telecom. Fig. 5. The latest of the antennas (No. 10) to be installed at Goonhilly Downs. Photograph courtesey of British Telecom. excellent quality and were broadcast as received through- out the USA. On July 12 the first two-way transatlantic telephony tests were made, showing that good- quality, stable telephone cir- cuits with low noise levels had been achieved. These tests were to be followed two days later by the first transatlantic telephone call and photo-tel- egraphy (facsimile) trans- mission via satellite. On July 14 during orbit 34, the director general of the Post Of- fice, Sir Ronald German, spoke from his home in London to the president of American Tele- phone and Telegraph Co (AT&T), Mr. Eugene McNeeiy, in New York. Simultaneously, one pair of channels was used to send facsimile pictures be- tween London and New York. On July IS tests to assess the ability of a communications sat- ellite to carry large numbers of telephone circuits were carried out during orbit 43. These demonstrated that at least 600 first-grade international circuits should be possible by satellite. The first transmissions of colour television signals by satellite were made from Goonhilly dur- ing orbits 60 and 61 on July 16. With the co-operation of the BBC’s research and designs department, who provided a colour slide scanner and moni- tor equipment, the signals, on 525-line NTSC standards, com- prised captions, test cards and still pictures to assess colour quality. The transmissions were initially made from Goonhilly to the satellite and back to Goonhilly but were also re- ceived in Andover. Andover reported: "Colour— good; pic- ture quality— excellent". During orbit 87 on July 19 satel- lite communications were opened up to the press. Twenty-four calls were made by the British press from Fleet Building in London, to the American press in New York. On July 23 during orbit 125 an 18-minute long programme from the European Broad- casting Union was transmitted from Goonhilly to Andover. The programme consisted of scenes from many European countries and was transmitted by the Eurovision link to Goonhilly, from Goonhilly to the satellite, and was received at Andover and broadcast throughout the USA. elektor india december 1987 12.23 During orbit 151 on July 26, the Telstar link between Goonhilly and Andover was used to pro- vide telephone circuits for the US Information Agency involv- ing conversations between "notable persons” in 20 pairs of cities in the USA and Europe for the Agency’s ”People-to- People” programme. The cir- cuits were reported as ex- cellent. The Telstar tests confirmed that communications satellites could provide high-quality, stable circuits for television and multi-channel telephony. The performance of Goonhilly earth station was reported as ex- cellent in every respect, and the equipment, almost all of which was of a unique new design, had worked well. In fact, Goonhilly’s antenna design was to prove, as had Arthur C. Clarke's idea, to be the blue-print for the future. A brief history of Goonhilly satellite earth station The choice of Goonhilly Downs, on the Lizard Peninsula in Cornwall, as the site of the United Kingdom’s first satellite earth station, was made for exactly the same reasons that Guglielmo Marconi chose the Lizard for his pioneering work in maritime and international "wireless” telegraphy. The Lizard offers an uninterrupted view across the Atlantic and little electrical interference. The first transatlantic wireless message was sent from the Lizard on December 12, 1901. Three faint but discernible "dots” of the Morse letter "S” were sent from Marconi’s transmitter at Poldhu and re- ceived by him in New- foundland, Canada. A year later Poldhu sent a signal to the vessel Philadelphia more than 2000 miles away in the ocean. Long-distance telecommuni- cations had been born. Sixty years later the advance of technology had made satellite communications, first proposed by the author and scientist Ar- thur C. Clarke in 1945, a realistic possibility. The United King- dom, the USA and France an- nounced in 1961 that they would co-operate in a programme for the transatlantic testing of com- munications satellites. The search for a suitable site in the UK for the station that would 12.24 etektor mdia december 1 987 Fig. 6. A British Telecom rigger examines the steelwork of Goonhilly Eart Station 's antenna No. 6. Photograph courtesey of British Telecom. receive the signals from the satellites, ended in the Lizard, on the flat expanse of Goonhilly Downs. The Lizard offered an unim- paired view of the Atlantic horizon, giving the longest possible contact with the low- orbiting satellites then being used. It suffered from little elec- trical and radio interference; was well placed to connect with inland communications, power supplies and transport links; and had a climate with moderate rainfall, little seasonal variation in temperature and only occasional snow. Equally important was the geology of the area. The serpentine bedrock reaching a thousand feet deep would give vital support to the massive weight of the antennas. Within a year of obtaining possession of the site, the first antenna, the control room and its associated equipment were installed and ready for the first tests which would use the Fig. 7. A section of the control area at Goonhilly Downs. Photo- graph courtesey of British Telecom. Telstar satellite, to be launched by the US National Aeronautics and Space Administration (NASA) on July 10, 1962. Those tests confirmed that satellites could have a commer- cial future in international com- munications. During a period of 16 days several world-firsts went into the record books— the first live television transmission be- tween Europe and the USA, and the first telephone calls, fac- simile transmission and trans- mission of colour television by satellite. Because of the low orbit of Telstar— between 590 and 3500 miles above earth— the satellite was only usable for three or four 30-to-40 minute periods in each 24 hours. As the satellite raced across the sky from horizon to horizon, the antenna had to be nimble enough to follow the satellite to one-fifth of a degree’s accuracy during each of these brief visits. Aerial 1 at Goonhilly was a unique design - an 870 tonnes "dish” antenna, compared to the French and American horn antennas enclosed in radomes. Some initial problems during the first usable orbits of Telstar caused experts to blame the design of the British antenna, but a small problem with a com- ponent which had been fitted faultily proved to be a twenty- minute job to correct and the antenna then went on to estab- lish its world-firsts. Goonhilly Station had cost around £800,000 to complete, about a quarter of the costs of the American and French sta- tions, and it was the unique design of the British dish anten- na which was to go on to be- come the norm for satellite communications throughout the world. The dish design is now used generally by nearly 700 . satellite stations in more than 150 countries. Following the successful tests with Telstar an international sat- ellite organisation was set up in August 1964 - INTELSAT. Interim agreements were signed by 11 member nations - the USA, UK, Canada, Denmark, France, Italy, Japan, the. Netherlands, Spain, the Vatican City State and Australia. Today INTELSAT is owned by more' than 100 member countries. INTELSAT launched its first sat- ellite into orbit in April 1965. The satellite, INTELSAT I, known as Early Bird , was a high-orbiting satellite in "geo- stationary orbit”. Arthur C. Clarke had proposed in his 194S paper that satellites, circling the earth above the equator at a certain height, would appear to be stationary to the earth’s surface— their period of orbit would exactly match that of the earth's natural rotation. That distance was 22,300 miles above the equator. After INTELSAT I’s successful launch to this height, commer- cial service opened in June 1965. Arthur C. Clarice had also pro- posed that three satellites in geostationary orbit could give world-wide radio coverage. A second satellite— INTELSAT II— was launched in December 1966, and at the same time. Aerial 1 at Goonhilly, which now no longer needed to track low-orbiting satellites across the sky, had an extra reflecting surface added, pushing its weight up to 1100 tonnes. Satellite communications had now truly entered commercial operation. As the demand for transatlantic TV and telephone transmission grew, so did Goonhilly with the addition of Aerial 2 in 1968. By 1969 three geostationary satellites were in orbit, fulfilling Arthur C. Clarke's prophesy of global communications. INTELSAT III was positioned above the Indian Ocean and de- mand for satellite communi- cations with the Far East grew. To meet this need Aerial 3 was brought into service in 1972. Aerial 4 was added in 1978, to meet an ever-increasing de- mand for communications across the Atlantic. This was also one of the first antennas in the world to use the 11/14 GHz frequency as soon as it became available for business satellite communications. Demand for satellite communi- cations grew by 20 per cent a year during the 1970s and early 1980s. Further satellites were put into orbit and in October 1978 a second earth station was brought into service by British Telecom St Madley in Herefordshire. Demand for specialist sevices also grew during this period and in 1983 Aerial 5 at Goonhilly was completed to provide satel- lite services to ships at sea. At the same time Aerial 6 was being built to provide further capacity on the busy transatlan- Fig. 8. Children from a nearby primary school being shown a model of the Intelsat V satellite. Photograph courtesy of British Telecom. tic route. Aerial 6 is Goonhilly’s largest dish with a diameter of 32m. It was also the first ’’dual- frequency” antenna, able to both transmit and receive on two frequencies simultaneously —doubling potential capacity. It entered service in September 1985. While aerial 6 was being built, Aerial 7 was also being brought into service to provide leased TV services to North America. With continuing growth in de- mand for satellite communi- cations, British Telecom announced plans in August 1983 to built a third earth station in London’s Docklands, primar- ily for satellite TV distribution and specialised business ser- vices. The London Teleport, in North Woolwich, opened for operation in February the next year— less than six months after site clearance began. Aerial 7 at Goonhilly, initially used for TV circuits, is now be- Fig. 9. The antennas are painted regularly: each one takes a 1000 gallons of marine paint and two full seasons' painting. Photograph courtesy of British Telecom. ing used for the trial of Skyphone—A telephone service to aircraft in flight— which is due to start by the end of this year. Meanwhile Aerials 8, 9 and 10 have been built. These are small-dish antennas below 14m in diameter. They are used for research and development, and to provide monitoring and con- trol facilities on the more than 130 satellites currently in use. Today, development at Goon- hilly continues. Aerial 6, the biggest antenna, has been equipped to operate to the latest development in satellite communications— Time Div- ision Multiple Access/Digital Speech Interpolation (TDMA/ DSI). TDMA/DSI means that signals from the station are grouped and sent by time rather than frequency, so that, on the principle that during the average telephone conver- sation either party is only speaking for one third of the time of the call, other groups of signals can be sent along the same channels during the lapses of conversation While British Telecom's earth station at Goonhilly provides vital links for today and tomor- row, it has not forgotten its past— a past that goes back far beyond Marconi's early ex- periments. The Lizard Peninsula is designated as an Area of Outstanding Natural Beauty and Goonhilly Downs was Corn- wall's first National Nature Reserve. In developing the earth station, British Telecom spent £200,000 landscaping the scheme to form natural-looking mounds, or bunds, inside and outside the station’s bound- aries. Local heathers, gorse and willow were planted in the station, in keeping with the natural character of the Downs. With little intrusion from the public, amidst the silent giants of Goonhilly’s antennas, the local flora and fauna have been able to flourish, making Goonhilly not only a pioneer in high-technology but also a botanist’s paradise. eiektor India december 1987 1 2.25 BASIC COMPUTER At the heart of this versatile and simple to build computer for process control and automation applications is Intel's Type 8052AH-BASIC microcontroller. As already noted in refer- ence (l> , the Type 8052AH- BASIC Vl.l is a single-chip microcontroller tailored to data manipulation in intelligent instrumentation, measurement and control systems. Not sur- prisingly, therefore, the 8052AH-BASIC features an ex- tensive and powerful set of in- put/output and timekeeping functions. By virtue of its compactness and ease of programming, the BASIC computer described here is suitable for a wide range of domestic as well as in- dustrial applications. Although not every programmer will ap- plaud the use of BASIC, it can be argued that this is still the most widely known, and often first apprehended, program- ming language. Moreover, the BASIC interpreter of the 80S2AH-BASIC is an advanced version offering instructions like DO-WHILE and DO-UNT1L which enable better structuring of programs than the GOTO statement. Also, variables can be stored and retrieved by means of instructions PUSH and POP. The BASIC interpreter is 12.26 elektor india decembcr 1987 reasonably fast as compared with competetive 8 and 16 bit systems. In conclusion, the 80S2AH-BASIC couples the power and versatility of the 8051 to the qualities of a well-written, reasonably fast, BASIC in- terpreter. The computer described is suitable for experimental as well as stand-alone appli- cations. Programs can be writ- ten, tested, and debugged by anyone with a reasonable com- mand of BASIC. The microcon- troller used is not cheap, probably because of its specialist nature, and the fact that it has hitherto found appli- cations mainly in industrial con- trol systems. None the less, the cost of the 8052AH-BASIC is justifiable considering its im- pressive potential. To aid programmers in writing efficient programs, Intel sup- plies the indipensable MCS BASIC-52 USERS MANUAL , which carries reference number 270010-003. It is important to note that ready-made programs for the BASIC computer are not available. The proposed system is intended primarily for appli- cations where the BASIC pro- grams are not an end in them- selves, but where the hard- ware-software link is readily ac- cessible to enable developing and testing computer con- trolled systems of a wide var- iety. Once a program is debugged and known to func- tion satisfactorily, the computer can act as a reliable stand-alone controller. Features The computer described features an on-board EPROM programmer, which is con- trolled direct by the 8052AH- BASIC CPU. This means that the processor can store its own pro- grams in EPROM after debug- ging and testing. Once it is EPROM resident, the BASIC program is available for direct T2/P1.0 T2EX i P1.1 PWM OUTPUT t P1.2 ALE DISABLE ( PI .3 PROGRAM PULSE f PI .4 PROGRAM ENABLE / PI. 5 DMA ACKNOWLEDGE / PI. 6 LINE PRINTER OUTPUT / PI. 7 RESET CONSOLE SERIAL INPUT CONSOLE 9ERIAL OUTPUT Fig. 1 Pinning of the microcontroller Type 8052AH-BASIC from Intel. elekior india december 1987 1 2.27 N1...N4 = 1C 7 = 74HCT32 N5...N8 = 1C 8 = 74HCT08 and autonomous execution by the processor. The EPROM contents form the token program listing rather than machine code obtained by a compiling process. The pro- gramming of EPROMs on the board is straightforward, and fully supported by BASIC in- structions. A single EPROM can hold a number of programs, which can even call each other when necessary. It should be noted that the BASIC computer has no key- board and screen of itself. These communication func- ' tions are taken over by an exter- nal console (terminal), connected to the computer's bidirectional, serial I/O port. As to the hardware configur- ation of the proposed BASIC computer, this is characterized by a high degree of flexibility, allowing the user to readily add, say, a UART ( universal asynchronous receiver/trans- mitter), an ACIA ( asynchronous communications interface adapter), a number of PIAs (peripheral interface adapter ), or other peripheral circuitry such as an alphanumerical dis- play, a sound generator, or a keyboard encoder. The pin- ning of the 80S2AH-BASIC is given in Fig. 1. The 80S2AH-BASIC has a number of powerful timing in- structions which, in conjunc- tion with the interrupt statements, special registers, and instruction counters, afford excellent control of time critical I/O applications. A real time clock is also available in the form of function TIME, which offers a resolution of about S ms. The Type 8052AH-BASIC is an 8 bit microcontroller, which means that it combines the functions of central processing unit (CPU), and peripheral cir- cuits (I/O; DMA). The chip has an accumulator A, a register B, a status register PSW (program status word), an 8 bit stack pointer, a 16 or 2x8 bit data pointer DPTR, 4 8 bit ports for use as an I/O and/or address, data, or command bus,, a double serial communication register SBUF, 3 register pairs THO-TLO. TH1-TL1 and TH2-TL2, which together form the 3 16 bit timers TO, T1 and T2, an in- termediate storage register pair RCAP2H-RCAP2L for a number of functions of timer 2, and, fi- nally, an array of registers for 12.28 elektor india december 1987 various command functions: IP (interrupt priority ), IE (interrupt enable ), TMOD, TCON & T2CON for the timers, SCON (serial control) and PCON ( power control). Circuit description The circuit diagram of the BASIC computer is given in Fig. 2. The 8 Kbyte BASIC in- terpreter is internal to the microcontroller, ICi. EPROM ICg holds the user’s BASIC pro- grams. The minimum amount of RAM for the 8052AH-BASIC is 1 Kbyte starting at address 0000. In the present application, the RAM area is either 8 Kbyte (0000- 1FFF) or 16 Kbyte (0000— 3FFF), depending on whether 1 or 2 RAMs Type 6264 are fitted (IC 4 ; ICs). Write and read operations are controlled direct by signals WR and RD respectively. The memory structure of the 8052AH-BASIC is not in accord- ance with von Neumann's model; the program memory is distinct from the data memory, which explains the logic com- bination of signal PSEN (program store enable : control of read operations in an exter- nal program memory) with RD in gate N? to select the ROM memory area (2764 = 8 Kbyte ! from 8000 to 9FFF; 27128 = 16 Kbyte from 8000 to BFFF). ; This does not exhaust all the possible memory configur- ations for the 8052AH-BASIC, but forms a practical as well as efficient combination— see Fig. 3. In the EPROM program- ming mode, the microcontroller addresses EPROMs in the memory area starting at ad- dress 8000. Decoder IC3 divides the memory area in blocks of 8 Kbyte. AND gate Ns makes it possible to combine 2 block select signals when the EPROM used is a Type 27128. Normally, octal latch IC2 demultiplexes the data and lower address bytes with the aid of signal ALE (address latch enable). In the EPROM pro- gramming mode, however, the LS address byte is kept latched Fig. 3 Memory structure of the 8052AH-BASIC. Table 1. Connector Ki: Connector K 2 : Pin Pin Pin Pin Pin Pin 1 NC 2 NC 1 + 5 V 11 PSEN 21 A1 31 D2 3 NC 4 NC 2 + 5 V 12 RESET 22 AO 32 D3 5 1/07 6 + 5 V 3 NC 13 WR 23 A14 33 D4 7 1/06 8 + 5 V 4 NC 14 NC 24 A15 34 D5 9 1/05 10 INTI 5 NC 15 A7 25 A8 35 D6 11 1/04 12 INTO 6 NC 16 A6 26 A9 36 D7 13 1/03 14 Tl 7 NC 17 A5 27 All 37 A13 15 1/02 16 TO 8 NC 18 A4 28 A12 38 A10 17 I/O! 18 i 9 RD 19 A3 29 DO 39 i 19 I/OO 20 l 10 ALE 20 A2 30 DI 40 1 Table 1 Pinning of connectors Ki and K 2 . much longer than during nor- mal bus cycles. This also goes for the MS ad- dress byte and the dataword— the normal duration of a pro- gramming cycle is of the order of SO ms. The software has no direct control over the length of the ALE pulse, and this is, therefore, inhibited with the aid of N i, Ns and the logic low level on CPU output P1.3. When port 0 is used in the I/O mode, pull-up resistors are re- quired on the open drain out- puts. Normally, this port functions as the data & address bus, but operates as an I/O port in the EPROM programming mode. The TTL levels at the serial out- put, P3.1, of the microcontroller are converted into the corre- sponding positive and negative levels for the terminal. Rectifier D 1 -D 2 -C 1 is connected to the terminal’s TXD line to provide the negative supply for TXD driver T 2 . Components Di and D 2 can be omitted, and Ci re- placed by a wire link, when the terminal accepts and sends pulses with TTL levels. The connections on the serial I/O connector, K3, are given in the circuit diagram. Table 1 shows the pin assign- ment on connector Ki, which carries the 8 lines of perip heral port PI, interrupt inputs INTO and INTI, and lines TO and Tl, which form the external inputs of the respective timers. Line pairs WR and R D, RxD and TxD, INTO and INTI, and TO and Tl together form port P3 of the 80S2AH-BASIC. Apart from their normal use as I/O lines, the lines on port PI may be used for special purposes. For example, P1.0 and Pl.l can provide trig- ger as well as clock pulses for timer T2. This is a standard function of the 80S2, and not a particular feature of the BASIC interpreter. Lines P1.3, P1.4 and Pl.S are used for programming the majority of currently available EPROM and EEPROMs Type 2764 and 27128. Output P1.6 is connected to in- put INTO for ready implemen- tation of a DMA (direct memory access) mechanism. Output P1.7 can act as a direct serial channel for driving, say, a printer, controlled with the aid of commands LIST# and PRINT#. There are more BASIC instructions for port 1: PWM, for example, offers control of the pulsewidth on output P1.2, while instruction P0RT1 enables direct read/wri:e access. The signal assignment on con- nector K 2 is shown in Table 1. This connector carries lines ADO. . .AD7, AO. . .A15, and the command bus, and so enables ready connection of peripheral extension, or DMA, circuitry. It is possible to halt the processor in the idle mode, and so ar- range for an external processor or microcontroller to tempor- arily gain access to the memory in the BASIC computer. The idle mode is initiated with the aid of the corresponding BASIC statement, and can be used for switching the microcontroller to the non-active state when no action on its part is required. The clock oscillator is internal to the 80S2AH-BASIC, and merely requires a quartz crystal and 2 capacitors. The indicated crystal frequency of 11.0592 MHz is required to ensure the correct timing for the serial channel, the real time clock, and the EPROM programming pulses. When it is intended to use, say, a. 12 MHz crystal, the processor should be informed of this by declaring XTAL= 12000000. It should be noted that any oscillator fre- quency other than 11.0592 MHz may result in reduced accuracy of the counter operations. The computer is reset and in- itialized on power up either automatically (R22-C4) or manually (Si). Input EA (exter- nal address) is made perma- nently logic high because the BASIC interpreter is an internal memory area. Programming EPROMs The (E)EPROM programming facility of the present BASIC computer is, without doubt, one of its most attractive features. It is important to note that the computer is not just an EPROM programmer, but a data hand- ling and storage system that can be customized as required for the application in question. While communicating with the user via the terminal, the 8052AH-BASIC can store edited, debugged and tested BASIC (sub)routines in EPROM to facilitate calling these as "tools” at any time. Before pro- gramming is effected, the microsoftware in the 8052AH- BASIC takes care af all the 1 tokenizing of the object program to ensure compact storage. Depending on the pro- gramming mode, certain parameters are stored along with the program, and are in- stantly available when this is loaded and run. These program parameters include the baud rate, variable MTOP, an autoex- ecute flag, and a flag that enables skipping the memory initialization routine at power- on— this is particularly useful when the RAM is battery powered. Finally, it is possible to use BASIC for loading an EPROM with an assembler program that is executed automatically after a RESET pulse. With reference to the circuit diagram, when line P1.5 goes low, transistors T3, T4 and Ts en- sure that the programming voltage reaches the Vpp ter- minal of the EPROM. The pro- gramming voltages for a number of EPROMs are listed in Table 2. The microcontroller places the LS address byte onto lines AD0...AD7, then disables ALE by making P1.3 logic low. The address byte re- mains latched in IC 2 during the remainder of the programming cycle. The MS address byte is placed onto lines A8...A15, and the databyte onto lines DO. . ,D7 of the EPROM to be programmed. Then, output P1.4 is made logic low, and the byte is progr ammed in the EPROM because PGM goes low while Vpp is applied. Instructions PROG and FPROG select a dur- ation of the programming cycle of 50 and 1 ms, respectively. FPROG uses the intelligent pro- gramming algorithm, and may require raising the EPROM supply voltage from 5 to 6 V, which is not supported by the proposed circuit. Details on the intelligent programming algorithm can be found in refer- ence <2) . In all cases, the dur- ation of the PGM pulse is deter- mined by the clock frequency of the microcontroller, and operator XTAL should be defin- ed as as discussed previously. Switch S 2 enables blocking the 3 programming signals. This is done for reasons of security because port PI can be used for purposes other than pro- gramming EPROMs. Up to 255 BASIC modules can be held in a single EPROM, and each of these can call any of the others. The 8052AH-BASIC auto- matically assigns a number to each BASIC program before storing this in EPROM. The number is sent to the terminal for the programmer’s refer- ence. Loading and running a particular BASIC module is ef- fected with the aid of com- mands ROM X followed by RUN. Variable X is the number ' of the relevant module. Modules can be copied from EPROM to RAM by means of command XFER. The programmer has direct ac- cess to an extensive library of routines in the BASIC in- terpreter. Also, BASIC allows calling external machine code subroutines provided by the user. It should be noted, though, that writing (fast) machine code requires an 8051 assembler, and, of course, con- siderable experience in work- ing at the assembly code level. Table 2. Manufacturer Type memory organization Vpp AMD AM2764 8K x 8 21 V AM2764A 8K x 8 12.5 V AM27128 16Kx8 21 V AM27128A 16K x 8 12.5 V Fujitsu MBM2764 8Kx8 21 V MBM27C64 8K x 8 21 V MBM27128 16K x 8 21 V Hitachi HN482764 8K x 8 21 V HN27C64 8K x 8 21 V HN482764P 8K x 8 21 V HN48271 28 16K x8 21 V HN27128P 16K x 8 21 V Intel 2764 8K x 8 21 V P2764 8Kx8 21 V 2764A 8K x 8 12.5 V 27C64 8K x 8 12.5 V P2764A 8K x 8 12.5 V 27128 16K x 8 21 V 271 28A 1 6K x8 12.5 V P27128A 16K x 8 12.5 V Mitsubishi M5L2764 8K x 8 21 V M5L27128 16Kx8 21 V National NMC27C64 8K x 8 12.5 V Semiconductor NMC27CP128 16K x 8 12.5 V NEC //PD2764 8K x 8 21 V PPD27C64 8K<8 21 V PPD2764C 8K x 8 21 V pPD27C64C 8K x 8 21 V PPD27128 16K x 8 21 V PPD27128C 16K x 8 21 V Rockwell R87C64 8K x 8 21 V R27C64P 8K x 8 21 V SEEQ 2764 8K x 8 21 V 27128 16Kx8 21 V SGS/ATES M2764 8K < B 21 V Texas TMS2564 8K x 8 25 V Instruments TMS2764 8K x 8 21 V TMS27128 16K x 8 21 V Thomson- CSF ET2764 8K x 8 21 V Toshiba TMM2764 8K x 8 21 V TMM2764DI 8K x 8 21 V TMM27128 16Kx8 21 V The type indications as given may be followed by ao access time specification. Table 2 Programming voltages for a number of EPROM types that can be loaded by the BASIC computer. elektor India december 1987 12.29 The practical use and operation of the EPROM programming fa- cility is extremely straightfor- ward. All that is required is to fit an EPROM in the socket for 1C6, apply the correct program- ming voltage, switch S 2 to PROG. EN, load the BASIC file in RAM, and issue command PROG. The other programming commands, (F)PROGl . . . (FJPROG6 enable storing auxiliary program infor- mation, including the baud rate indicator, and the autoexecute flag. The available options are described in the previously mentioned programming man- ual from Intel. Construction It should be reiterated that the computer described is in- tended mainly as an aid in developing software and hard- ware for automated processes and stand-alone, intelligent, controllers or data loggers, where timekeeping is an essen- tial requirement. The printed circuit board for the BASIC computer is double- sided and through-plated. The component mounting plan is given in Fig. 4. It is recommended to fit good quality sockets for all ICs. The socket for EPROM IC6 can be a type with turned pins, although a ZIF ( zero insertion force) socket mounted as shown in the i photograph of the prototype is probably the best solution. Be sure to purchase a microcon- troller Type 8052AH-BASIC Vl.l. Connectors Ki and K 2 are intended for extensions, and need not be fitted as yet. In- itially, a single RAM, IC 4 , is suf- ficient, since it offers a memory area of about 7 Kbyte for BASIC programs. Resistors R 9 ...R 16 inch form an 8-way SIL network, but it is also possible to use 8 ordinary resistors, mounted vertically and commoned by a short length of wire connected to +8 V as shown in Fig. 5. The function of the LEDs, D 4 and Db, is evident from the circuit diagram. The supply and pro- gramming voltage are applied to the circuit via soldering pins and mating sockets, insulated with the aid of heat shrink sleeving. Do not confuse the Vcc and Vpp connections. The PROG. EN switch, S 2 , and the EPROM selector, S3, may each be replaced by 3 pins and a mating jumper if it is not in- tended to frequently program EPROMs, or change between a 2764 and a 27128. EPROM IC6 is not required to make the circuit function. It is not fitted until it can be pro- 12.30 Parts list Resistors (±5%l: Ri;R2;R4;Rb;Ri9 = 4K7 R3,R23 = 100R Re = 1K8 R7,-R24 = 330R R8;Ri7;Rie;R2o;R2i = 1 OK R9. . ,Ri6 = 8-way 10K SIL network, or 8 1 0K resistors R22 = 8K2 Capacitors: Ct;C4 = 10/r; 16 V C2;C3 = 33p ceramic C5. . ,C9 inch = lOOn Cto= 100u; 16 V Semiconductors: Di;D2;D3:D5 = 1N4148 D 4 = green LED De= red LED Ti;T3;T4 = BC547 T2 = BC557 T5 = BC161 ICl = 8052AH-BASIC VERSION 1 I' IC2 = 74HCT373 IC3 = 74HCT138 IC4,IC5 = 6264 8Kx 8 static CMOS RAM ICe=2764 or 27128 (see text) IC7 = 74HCT32 ICe = 74HCT08 Miscellaneous: Si= Digitast SPST push button. S 2 = miniature SPST switch. Ki = 20-way right angled IDC header with side latches. K 2 = 40-way right angled IDC header with side latches. <3= 5-way DIN socket for PCB edge mounting. Xt= 11.0592 or 11.059 MHz, HC18 enclosure. 28-way ZIF socket. Jumpers and soldering pins as required. PCB Type 87192 (available through the Readers Services). Suitable ABS or metal enclosure. Suitable power supply. It is regretted that a ready-made front panel for this project is not available. Intel distrubutors are listed on InfoCard 505 in the March 1987 issue of Elektor Elec- tronics. The chip is also available from Universal Semiconductor Devices Limited • 1 7 Granville Court • Granville Road • Hornsey • London N4 4EP. Telephone: (01 384) 9420. Telex: 25157 usdco g. Fax: 01 348 9425. elektor india decomber 1 987 Fig. 5 Showing the use of 8 ordinary resistors instead of a SIL network. grammed with BASIC modules, and only when the computer is turned off. The power supply for the BASIC computer can be a simple type with regulated out- puts for 5 V (500. mA), and the programming voltage(s). Initially, the CPU and the memory chips are not fitted while the completed board is fed with Vcc and Vpp. Consult the circuit diagram and care- fully check the presence of the supply voltage at all the relevant points. Make sure that there is no short circuit around pin 28 of ICs, since the programming voltage is carried nearby. Switch off the power, carefully fit the CPU and the RAM(s) with the correct orientation, and switch the power on again. Communication: the terminal The serial data format for the BASIC computer is: 8 data bits, no parity, 1 stop bit. Most terminals, consoles, or ter- minal emulation programs for computers can support this format. The 3-wire connection between the BASIC computer and the terminal is shown in Fig. 6. At the terminal side, it may be necessary to hard wire a number of RS232 hanshaking lines— consult the relevant documentation. A solution that works in most cases is to con- nect the following pins in the 25-way RS232 connector: 4—5—8 and 6—20 (sometimes 6—20—22). Where — denotes the con- nection. The BASIC computer has an in- ternal baud rate timing routine. Press reset, wait a second or so, and press the space bar on the terminal. The message *MCS-51(tm) BASIC Vl.l READY > is displayed on the terminal screen, and the BASIC com- puter is ready to accept commands. After reset is pressed, the CPU initializes its internal RAM, and a number of pointers and registers. It then tests, in- itializes, and determines the size of the external memory area (IC 4 and ICs). Next, the memory size is stored with the aid of operator MTOP ( memory top), operator XTAL is defined (default: 11059200), and, finally, the CPU reads the data at ad- dress 8000 to check for a valid baud rate definition, pro- grammed in EPROM ICs. When a baud rate byte is found, it is stored in register T2CON. The computer then skips its auto- matic baud rate timing routine and operates at the pre- programmed serial speed, ob- viating the need for the terminal operator to press the space bar after actuating reset on the BASIC computer. The maximum baud rate is 38.4 Kbit/s, and timing characters other than 20h (space) are not accepted. To verify the correct operation of the system, type PRINT XTAL,TMOD,TCON, T2CON to which the computer replies Inside view of a prototype of the BASIC computer. Fig. 6 The 3-wire connection between the BASIC computer and the terminal. 11059200 16 244 52 The system prompt > is displayed to indicate that the computer is ready to accept commands, which are not ex- ecuted until is re- ceived. Actually, the 8052AH- BASIC starts tokenizing and storing the BASIC commands after receiving a carriage return (ODh). Depending on the length of the line, and the com- plexity of the command(s), this takes some time, and new characters must not be sent un- ' til the CPU responds with the prompt, indicating completion of the storage process. The BASIC computer is prob- ably best programmed and controlled with the aid of a per- sonal micro sporting an RS232 port. As to software, a terminal emulation or communication program in conjunction with a wordprocessor enables ef- ficient editing and down- loading of BASIC files. A general flowchart of a serial I/O routine to support the above 7 87192-7 Fig. 7 The sending computer must wait for the > prompt from the BASIC computer before sending a new line of commands. elektor imlia december 1987 1 2.31 handshaking procedure is. j shown in Fig. 7. Table 4 is a hex dump of a simple filehandler for IBM PCs and compatibles. The program is called SENDBAS.COM, and was written by H Peters. It loads (ASCII) BASIC files from disk, and sends these to the BASIC computer via serial port C0M1:, in accordance with the previously mentioned prompt- based handshaking arrange- ment. The program is loaded and written onto disk with the aid of DEBUG, which can be found on ' the DOS disk (use version 3.1 or later). Format a new disk, and copy DEBUG.COM onto it. Sel- ect the relevant drive, e.g. B:. Follow this instruction if you are unfamiliar with the operation of DEBUG: DEBUG : Fill a 256 byte block with nulls: F 0100 01FF 00 < CIO ] Name the program: NSENDBAS.COM< CR > Ready for entering the 256 bytes: E 100 Enter the bytes ( not the ad- dresses) in Table 4, starting with B4. The first 2-byte address on each line is irrelevant in this case. Use the hyphen for cor- rections, and the space bar to proceed to the next byte. Type when the block is com- plete, and check the screen against the data in Table 4. If necessary, consult the chapter on DEBUG in your DOS manual. Table 3. COMMANDS STATEMENTS OPERATORS RUN BAUD ONTIME ADD ( -r ) DBY( ) CONT CALL PRINT DIVIDE (0 XBYO LIST CLEAR PRINT# EXPONENTIATION (**) GET LIST# CLEAR(S&I) PRiNTfa (VI 1) MULTIPLY (*) IE LISTfa (VI. 1) CLOCKO&O) PHO SUBTRACT ( > IP NEW DATA PHO.# LOGICAL AND ( AND ) PORT1 NULL READ PHO (!«- (VI I) i LOGICAL OR ( OR.) PCON RAM RESTORE PHI LOGICAL X-OR ( XOR.) RCAP2 ROM DiM PHI # LOGICAL NOT ( OR.I T2CON XFER DO-WHILE PH l/o (VI 1) ABSO ICON PROG DO-UNTIL PGM (VI i) INTO TMOD PROG1 END PUSH SGN( ) TIME PROG2 FORTO-STEP POP SQR( ) TIMER0 PROG3 (V1.1) NEXT PWM RND TlMERi PROG4 (VI 1) GOSUB REM LOGO TIMER2 PROG5 (VI 1) RETURN RETI EXPI) XTAL PROG6 (VI 1) GOTO STOP SINO MTOP FPROG ON-GOTO STRING COSO LEN FPROGl ON-GOSUB Ultl&Ol TAN() FREE FPROG2 IF-THEN-ELSE U0(l&0) ATN<) PI FPROG3 (VI. 1) INPUT LD (a IV1.1J FPR0G4 (VI. I) LET STfq (VI .1) ASCO FPROG5 (VI. 1) ONERR IDLE (VI 1) CHR( ) FPROG6 (VI I) ONEXl RROM (VI. 1) CBY( ) W Leave DEBUG: Q The PC filehandler is now available on disk, and can be called with command SENDBAS. Test the program: the screen is cleared, and the text ENTER FILENAME: is displayed. Type to return to the DOS command prompt. Table 3 Overview of the instructions supported by the 8052AH-BASIC. A close look at the component side of the populated board (prototype version) Call up the block pointers: RCX and type OOFF after the colon. Do the same with RBX and again 00FF Table 4. A > DEBUG SENDBAS.COM -D 0100 01FF 1E48 : 0100 B4 00 B0 02 CD 10 8C C8-05 10 00 8E D8 BB ED 00 1E48.0110 53 E8 3B 00 7A 26 E9 94-00 5B 8A 07 43 53 3C 1A S ; . Z& . [ . .CS< 1E48 :0120 74 F4 3C 0A 74 16 B4 01 -BA 00 00 CD 14 B4 02 BA t < . t. . 1E48 : 0130 00 00 CD 14 B4 02 8A D0-CD 21 EB DD B4 02 BA 00 » 1E48 :0140 00 CD 14 8A D0 B4 02 CD-21 3C 3E 75 EF EB CA B4 < >u . . 1E48 :0150 09 BA B0 00 CD 21 B4 0A-BA CB 00 CD 21 BB CC 00 1 i 1E48 .0160 8A 07 3C 00 75 03 EB 45-90 BB CD 00 B9 IE 00 8A < . U . . E 1E48 : 0170 07 3C 0D 74 06 43 E2 F7-EB 05 90 B0 00 88 07 B4 . . t .C. 1E4Q :0180 3D BA CD 00 B0 00 CD 21-8B D8 B4 3F B9 FF FF BA ■ » l r> 1E48 :0190 ED 00 CD 21 8B D8 B4 3E-CD 21 B0 20 B4 01 BA 00 • > i 1E48 7 01 A0 00 CD 14 B0 0D B4 01 BA-00 00 CD 14 C3 SB CD 20 — t. 1E48 : 01B0 0D 0A 0A 0A 0A 20 20 20-20 20 45 4E 54 45 52 20 ENTER 1E48 7 01C0 46 49 4C 45 4E 41 4D 4S-3A 20 24 IE 00 00 00 00 FILENAME: $ 1E48 : 01D0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 1E48.-01E0 00 00 00 00 00 00 00 00-00 00 00 00 00 1A 26 00 & 1E48 : 01F0 74 09 E8 40 El E8 IB F1-E8 BC El A1 D6 26 A3 04 t. ,e. . . &. 87192-T4 Write the .COM file to disk: 12.32 eleklor india december 1987 Table 4 Hexdump of SENDBAS.COM, the filehandler for PCs and compatibles. 8 llffirr FIUMHt: FOUUIIOU.TXT >11 M : C0SJI 2M : 101 HCKI NUWTM CNTML" >21 0HEX1 188 >31 mrur "wm sunum mo, puwr.i « >48 IF ft>4 COTO 38 >58 F*U) >68 if c=f mm wiri=8 : cor® 38 >78 If or TUB HBH list rorruz >B8 COTO 68 >181 IF P0IT1=1 THU P=F*1 >185 IF P0fTl=2 THU F=F-1 >118 IF F<8 THU F=8 >128 IF C=F THEM P0RT1=8 >138 Film* C.F.FOFTl >148 ITT I >288 •<1>=I : (1(2 1=13 : 8(3)=? : 8(0=23 >218 F0«Tl=8:imiW ft>_ Fig. 8 SENDBAS.COM has completed sending a program to the BASIC computer via the C0M1: port on a PC turbo XT. The baud rate is 1200. 9 MSIC VI. 1* ■Mr >UfT 11 M : COSH 2M : Ml HCKi NUNM CMM" 2i mm m m iww nrrn wruih am ru*sr,t 41 IF 8>4 WTO 38 SI C=Mft) 68 IF €=F 1WI P0IT1=8 : WTO 31 70 IF OF nan P0IT1-1 KLS F0»l=2 n wre w 100 IF P0*TI=1 THU F=F*1 1C IF F88T1=2 im F=F-1 lit IF Kt Ml M 128 IF C=F Ml FORTES 138 PtlHT C, F, P08T1 141 KTI 288 «1>4 : (M2)=13 : M3)=7 : (M4)=23 zia Fom=a : mm now MJ-F18 NZLF I MfSl-IBS | FK | 1288 881 | LOC CW8D [ FIT OFF j Cl | Ct Fig. 9 The BASIC computer is on line again, and has received a program for controlling a polarmount satellite dish position system. Note the system's welcome message at the top of the screen, and the status line of PROCOMM at the bottom. SENDBAS.COM was tested in conjunction with PROCOMM 1 2.4.2, a versatile communication program for PCs and com- patibles. BASIC text files were prepared and stored onto disk in DOS text format using the wordprocessor WORDPERFECT 4.2. Other combinations of communi- cation program and word- processor should also work, as long a the files for sending to the BASIC computer are written in DOS text (ASCII) format, i.e., without all the control codes specific to the wordprocessor used. As to the communication program, it is very practical if this offers a SHELL or DOS Gateway command to tempor- arily switch to DOS, start SEND- BAS for loading the updated file, and return to the BASIC computer by means of EXIT. SENDBAS takes over the set baud rate, and awaits the > prompt from the computer before it sends a new line via COM1:. The writing of the file can be seen on the screen. After sending a file using SENDBAS, and EXITing DOS to return to the comms program, type a when the BASIC computer displays READY > Type LIST to check the contents of the new program, and run it. . . The use of SENDBAS.COM on a PC-XT turbo is illustrated in Figs. 8 and 9. A simple filehandler for the BBC micro is listed in Table 5. This program works in conjunc- Table 5. LIST 18 MODE 7 28 FOR ADDRESS=S<4200 TO S<42iB 30 READ BYTE 46 ?ADDRESS=BYTE 50 NEXT ADDRESS <50 *SAUE PRDR-52 4280 4300 0400 0400 70 END 80 DATA &4C.&40 ,t,04.fe4C ,»<0F .I504 ,&4C .8,2* .2,04 ,t,4C ,4<3C .k04 ,1<4C ,t<3D ,3.04 90 DATA &<48.J,8A,&i48. 8,93. ?<48,&A9, 5,02.5,20 .S,EE . t,FF . J.A9 ,S<02 ,8,A2 ,tk6 1 .6,20 100 DATA &.F4 . $,FF . !L<58 . 2,A8 . 8,68 .(JeAA ,5.68 ,&,*0 .8,48 ,&8A .8,48 .8,98 .4,48 ,&A9 ,8,0 3 1 10 DATA 4,20 .«,EE.4,FF.ILA9.I!,02.S=A2,S<00 ,5,20 ,8 minimum) £ softer ? any SEQ volume := volume - 1 amplifier ! volume off ? any active : = FALSE Fig. 3 This Occam program controls the digital volume input on a hypothetical AF amplifier. DIMMER FOR INDUCTIVE LOADS A simple circuit overcomes the well-known difficulty in maintaining the triggered condition of a silicon controlled rectifier when this is used for regulating inductive loads. The vast majority of dimmer cir- cuits is only suitable for regulating resistive (non- reactive) loads, i.e., when there is no phase difference between the mains voltage and the load current. This means that the trigger pulses can be kept rela- tively short, since the load cur- renfis in phase with the mains voltage immediately after trig- gering has taken place. Nor- mally, the load current is greater than the holding cur- rent, so that the triac or thyristor is triggered immediately, and remains on. When the load is mainly induc- tive (e.g. a transformer, or a choke for a fluorescent lamp) the load current lags the voltage, and may either not have reached, or exceeded, the holding level. The SCR then conducts briefly, but is switched 'off at the end of the trigger pulse. This unwanted ef- fect can be kept within limits by means of stretching of the trig- ger pulse, triggering by pulse trains, or the use of an R-C net- work. The first approach calls for a control circuit with appro- priate drive power. The pulse duration requires exact con- trolling to prevent pulses occur- i ring after the zero crossing of the mains voltage, causing er- roneous triggering. Suitable circuits to accomplish this are, understandably, relatively com- plex. A simpler way out is the R-C network, which in essence raises the current to the holding threshold, so that the SCR re- mains on when the trigger pulse is inactive. Although SCR manufacturers usually provide the relevant design data for this application, it is still fairly diffi- cult to dimension the circuit for optimum and reliable trigger- ing. In most cases, therefore, trial and error adjustments are required, as well as signal analysis with the aid of an os- cilloscope. Triggering by pulse train The circuit described here is based on gate triggering by a pulse train, yet is composed of discrete components only. Figure 1 shows 3 ways of con- trolling a triac. Figure la illustrates a phase angle control circuit for the i load Zi. It is composed of a triac T, a diac D, and a timing network R-C, where R is (P), connected in parallel with D- A 2 , and C is connected in parallel with D-Ai. In this cir- cuit, the triggering is load de- pendent, in other words, synchronization is by the voltage across the triac, and this is a function of the load current. The circuit is, therefore, un- suitable for regulating highly in- ductive loads requiring a small conduction angle. Also, there exists a strong tendency to asymetrical operation, which can be dangerous in view of saturation of the inductance due to the relatively high direct current. , Figure lb shows a basic circuit for triggering the triac by the mains voltage. Here, timing re- sistor (P) is connected to the neutral line instead of parallel to D-A 2 . The trigger pulses oc- cur with a fixed phase differ- ence of 180°, irrespective of the load current. Although this cir- cuit offers more accurate con- trol of the load than the previous one, its operation becomes completely asym- metrical if the gate angle is smaller than the angle rep- resenting the current lag in the load. Another disadvantage is the requirement for connection to the phase and neutral lines as shown in the diagram. Figure lc shows a slightly more complex triac control circuit. Following the trigger pulse, ad- ditional pulses are generated up to the next zero crossing of the mains voltage. The oper- ation of the circuit is illustrated in timing diagram Fig. 2. Assuming a phase difference, (p, of 85° between the mains voltage and the load current, and a gate angle, 0 , of 60°, the triac is triggered after the trig- ger delay has lapsed (A), and remains on up to about 240° (B) thanks to the pulse train. It is blocked at point B, but is im- mediately retriggered by the next repetitive gate pulse. The operation is slightly asymtrical during the first half periods, but the duration of conduction gradually becomes more balanced, as shown by the dot- ted curve. The practical circuit The circuit diagram of the dim- mer for inductive loads is given eleklor india december 1987 1 2.43 in Fig. 3 . A small, sensitive, Capacitor Ci is charged from have a much shorter period auxiliary triac, Tri2, generates 0 V, and diac Dii triggers as (Rs+R 6 )Ci. After this delay, Tri2 the pulse train necessary for soon as its breakover voltage is is triggered, starting a new maintaining the gate control reached. The set conduction cycle. A succession of pulses is signal for Trii. Capacitor Ci, angle is equal for both half applied to the gate of the main compensation resistor Rs and periods. triac, Trii, until the mains potentiometer P2 define the A first pulse is applied to the voltage reaches the zero cross- gate angle . Preset Pi enables gate of TRii, and the voltage ing. Triac Tri2 is then blocked, setting the minimum conduc- surge on Rb triggers Trfr. Once so that the charging of Ci dur- tion angle, so ensuring reliable this is on, it bypasses resistance ing the following half period is triggering of Trii even when (R4+P2 // R3+P1), so that the re- determined by the time con- the load current is fairly low. maining charge cycles of Ci stant set by the resistance Fig. 1 Three ways of controlling the gate angle in a triac based dimmer. (R4+P2 // R3 + P1). Once more consult the timing diagram of Fig. 2 for further details on the operation of the circuit. Zener diodes Ds. . .Ds incl. af- ford protection against over- voltage, and at the same time ensure a stable supply voltage for the trigger circuit, eliminating instability due to fluctuations on the mains. Diodes D1...D4 incl. and resistors Ri and R2 ensure that Ci is completely discharged during the zero crossings, so that the hysteresis remains within acceptable limits. Damp- ing network C2-R7 has a stabiliz- ing effect on the control circuitry because it suppresses needle pulses originating from the inductive load when this draws less than the holding cur- rent of the main triac. Construction: safety first The dimmer is constructed on the printed circuit board shown in Fig. 4. Power resistor Rs should be fitted slightly off the board to allow for its dissipated heat. Inductor Li is a common triac suppressor choke, which is not strictly required for in- Flg. 2 Triggering by a pulse train synchronized with the mains voltage. 12.44 elektor india december 1 987 Fig. 3 Circuit diagram of the dimmer for inductive loads. Parts list Fig. 4 Track layout and component mounting plan for the dimmer PCB. ductive loads. For resistive loads, however, it should not be omitted because it limits the switch current surges. The in- ductance and current rating of Li are as required by the load; the indicated values of 100 ;/H and 10 A are only required when the dimmer is used for regulating loads of the order of 750 W and more. The size of the heat-sink for Trii is mainly de- termined by the available space in the ABS enclosure. A few holes should be drilled in the' lid to ensure sufficient cooling of Rs and Trii. Make sure that the whole unit is rugged and properly insulated. If used, the input and output cable should be fed through a grommet, and secured by a suitable strain relief. Be sure to use a poten- tiometer with a plastic shaft. VARIOUS PARTS IN THE DIM- MER CARRY THE MAINS VOLTAGE AND ARE, THEREFORE, DANGEROUS TO TOUCH WHEN THE UNIT IS OPERATIONAL. Finally, the circuit described of- fers good accuracy of control without the need for an ad- ditional supply. It enables vir- tualy complete variation of power on inductive loads rated up to approximately 1,000 W Sv Source: Triac Applications , Thomson Semiconductors. Resistors (±5%): Ri;R2 = 47K; 1 W R3=150K R4 = 27K R5= 10K; 10 W R6-4K7 R7 = 220R; 1 W Rs = 1K0 Pi - 1M0 P 2 = 220K or 250K linear poten- tiometer with insulated shaft. Capacitors: Ci = lOOn: 100 VAC C 2 = 100n; 250 VAC Inductor: Li = dimmer suppression choke e.g. 47pH; 10 A ' Semiconductors: Dl . . . D4 inch = 1 N4004 D5. . .Ds inch =33 V; 1 W zener diode Oil = general purpose 32 V diac, e.g. ER900, ST2, D132AC, or BR100-03'. Trii =TIC263D' Tri 2 = TIC206D-P Miscellaneous: Ft = 6.3 A fuse with PCB mount holder. Suitable ABS enclosure. Grommet and strain relief for mains wire. 5-way screw terminal block for PCB edge mounting. T0220-style heat-sink for Trii. PCB Type 87181 (available through the Readers Servicesl. Available from Omni Elec- tronics • 1 74 Dalkeith Road • Edinburgh EH 16 5DX. Tele- phone: (031 667) 2611. LED logic flasher The condition of the LED is determined by the logic states of the two inputs A and B If A is low and B is high then the LTD will be lit continuously. If B is low then the LTD will be extinguished, irrespective of the state of A. If A and B are both high then the astable multivibrator comprising Nl, N2 and N3 will start to oscillate and the LHD will flash at about 3.5 Hz. Component values are given for supply voltages of 3. 10 and 15 V. At the maximum supply voltage of 15 V the current consumption is less than 25 mA. Source: RCA CMOS Application and design ideas. elektor India december 1987 1 2.45 PRECISE MOTOR SPEED REGULATOR by Arturo Wolfsgruber * By virtue of an innovative dual control loop scheme, the TDA7272 motor speed regulator chip achieves both fast response and long-term stability without speed sensors. The speed of small DC motors is usually controlled either by regulating the current or with a velocity feedback loop using a tacho generator or speed sensor. But both of these systems have disadvantages. Current control offers a fast response to transients but poor long term stability, while vel- ocity feedback schemes need a costly tacho generator and only provide an adequate transient response if a high-frequency AC tacho is used. A new motor speed regulator chip, the SGS TDA7272 (Fig. 1), combines the best features of the two techniques, having a current control loop to guarantee fast transient response, plus a velocity feed- back loop to guarantee long term stability. Unlike conven- tional velocity feedback con- trollers, the TDA7272 needs no tacho generator or speed sensor; it determines the motor rotation speed exactly by sens- ing the motor’s commutation spikes. H-bridge output delivers 1 A Originally designed for autoreverse cassette tape players, the TDA7272 includes a H-bridge output stage capable of driving a DC motor in both directions with a single supply and delivering up to 1 A peak output current. Two logic inputs select the direction of rotation— clock- wise or counterclockwise— and fast braking (with the motor short-circuited by the device's output stage), or the standby/ free-running mode where all four transistors in the bridge are turned off. By means of external resistors or control signals the rotation speed may be set indepen- dently for each direction. In a typical uC-controlled auto- reverse car cassette player the two speed control inputs are commoned and connected to ground via a resistor which sets the play speed and is shorted by an open-collector output to select the fast forward/rewind speed. The TDA7272 operates on a 5-18 V supply and includes pro- tection against load dump tran- sients, output short circuits and thermal overload. The device is assembled in a special high power DIP package called Powerdip 16+2+2. This 20-lead package has a thick copper leadframe and uses the four center pins to conduct heat from the die to the printed circuit board copper. Suitable for automatic insertion, this package is ideal for appli- cations where space is limited. Senses motor commutation spikes One of the most interesting features of the TDA7272 is its ability to determine the true motor rotation speed by sens- ing the commutation spikes across the motor terminals. Figure 2a shows the current waveform in a typical three- phase miniature DC motor. In the TDA7272 this waveform, converted into the correspond- ing voltage waveform by a sens- ing resistor, is differentiated and clipped to obtain a feed- back signal consisting of six pulses per rotation (Figs. 2b & 2c). A hysteresis of 10 mV and 20 mV bias in the clipping com- parator assure sufficient noise immunity to make this scheme reliable in practice. In a typical cassette player the motor runs at about 2000 rpm so the tacho pulse signal will be roughly 200 Hz. These pulses are then inte- grated to provide a voltage pro- portional to the motor speed. This voltage is compared with a reference voltage— derived from the speed-setting inputs— in the error amplifier. However, the integration ca- pacitor must be large to minimize ripple, which ex- plains why pure tacho feed- back schemes suffer from a poor transient response. This is where the TDA7272’s 87 17V I 2 (a) nvo1 wavclotm is converted 1o a voltage and dilferentialed er, ise which will fill your senses as never u Cosmic, this latest generation never before model, has a dynamic one touch recording system, a super hard perm This classic black model — alloy head, soft touch controls, L.E.D. Nakamichi AX- 1 000 with its unique peak level indicators, double gap Switch Mode PowcrSupply (S.M.P.S.) erase head plus much much more for has music surging through its over all excellent performance. This It's pure black magiC sophisticated circuitry, with such powerful Ampli-Cassette Deck has sonic purity and clarity, that one hears arrived, to cast a spell even on tire not the reproduction of music, but the perfectionist, actual recreation of it. So get ready for some hypnotism. Cosmic Nakamichi AX-1000 cosmic We are sound Printer &: Publisher — C.R. Chandarana, 2, Koumari, 14th A Road, Khar, Bombay 400 052. Printed at Trupti Offset, 103 Vasan Udyog Bhavan, Tulsi Pipe Road, Lower Parel, Bombay 400 013. Implement' CTV '10