pF keyboard, serial and parallel ASCII out IR remote control self- locking morse decoder for 6502 or Z80 wattmeter Aff?-MAIL COPY COnKhCa selektor wattmeter This circuit will be of interest to anyone whose wallet feels decidedly light after paying the electricity bill. No ... it cannot be used to make money, but it can help you to control your electricity usage and thus save money. ASCII keyboard Keyboard projects are always popular and this is an advanced design incorporating many features not normally found in this sort of project. It includes: a separate hexadecimal keyboard, extra function keys, the com- plete ASCII set, the possibility of using other codes, auto-repeat, shift- lock, capital-lock and RS232C compatibility. It is,in fact, comparable to many professional keyboards used by computer manufacturers. Prelude p.s Those of you who have been following the Prelude project will now have quite a few, hopefully complete, printed circuit boards. This article gives a few final tips and some details which have not yet been mentioned. Also included are the technical specifications of the Prelude. multitester (E. Osterwickl A simple circuit with a multitude of uses. Its small size makes it particu- larly useful, especially as it can be used as a logic tester for TTL levels, a voltage supply checker, a clock pulse detector and because it has an acous- tical indication, all you have to do is listen. maestro (part 1 ) A remote control unit similar to that used for television sets. In this case, however, it is used to control the whole Prelude system, adjusting volume, balance and tone, switching all the ancillary equipment on and off and selecting any input desired. All this and much more, without moving from the comfort of your armchair. what is power? Our wattmeter can help tell you how much power is being used. This article gives some insight into the 'whys and wherefores' of power con- sumption. parallel-serial keyboard converter Intended for use with our ASCII keyboard this parallel-serial converter allows the keyboard to be used with any computer which has serial input, with particular reference to the RS 232C. morse converter (R. Unterricker) Morse 'translation' is a skill which many people would like to have but it is often not really worth the effort. In fact it is much easier to 'teach' a com- puter (in this case with the 6502 processor) to read morse, which is just what we have done. 78L voltage regulators . . . and 79L A brief description of these very useful components and hints on how to use them. morse decoding with the Z80A (P. von Berg) Our second morse decoding program, this time with particular application to the Elektor Z80A card and using the Elekterminal and a CW signal forming circuit. market switchboard E PS service | advertisers index 5-59 5-60 5-62 5-67 5-80 5-82 5-03 elektor may 1983 You cant beat The System. The Experimentor System w — a quicker transition from imagination through experimentation to realization. With Experimentor Matchboard you can go from breadboard to the finished product nonstop! We've matched our breadboard pattern again, this time on a printed circuit board, finished and ready to build on. All for about £1.50 There's even a letter-and-number index for each hole, so you can move from breadboard (where they're mouldedl to Scratchboardru (where they're printed) to Matchboard™ (where they're silkscreened onto the component side) and always know where When you have a circuit idea that you want to make happen, we have a system to make it happen quicker and easier than ever before: The Experimentor System. You already know how big a help our Experimentor solderless breadboards can be. Now we've taken our good idea two steps further We've added Experimentor Scratchboard workpads. with our breadboard hole-and-connection pattern printed in light blue ink. To let you sketch up a layout you already have working so you can reproduce it later. When you want to save time and energy, you eat The Experimentor System. GLOBAL SPECIALITIES CORPORATION DEPT. 2W G.S.C. (UK) Lim Unit 1. Shire Hill Saffron Walden, Telephone: Saffr Telex: 817477 d. Dept. 2W idustrial Estate. sex.CBII 3AQ. Walden (0799) 21682 5-11 VAST STOCKS OF COMPONENTS AT RIDICULOUSLY LOW PRICES MAIL ORDER we offer the best component prices in the business, and no order is too small to receive our first class attention. COMPONENT WAREHOUSE we have a huge warehouse full of components, test equipment — in fact virtually everything you will ever need. Come and have a browse around. Open Mon. to Sat. — 9am to 4pm. You will easily find us opposite the John O’Gaunt Hotel on the A45. SEND A LARGE S.A.E. FOR OUR FREE COMPREHENSIVE CATALOGUE EMO S DEPT 5F HIGH MARCH, DAVENTRY 5-13 elektor may 1983 advertisement elektor Back numbers of Elektor currently available are detailed above, with a brief description of their contents. Send for your copies now, using the pre-paid Order Card inside the back cover of this issue. Prices are as follows: any one issue (except July/August) £ 1.30 additional issues, each £1.10 July/August (Summer Circuits) £ 2.60 Prices include postage and packing. Overseas orders requiring airmail postage add £ 1.50 per issue (£ 2.00 for July/August i ssue ) (Prices subject to change without notice) etewtor -«r 5-14 £52.75 £39.99 KD615 LCD DIGITAL MULTITESTER Multifunction 3*/2-digit tester including transistor tester and 10A d.c. range. Over-range, low battery and polarity indication. Full fuse overload protection. Supplied complete with carrying case, test leads, battery and instruction d.c. Volts:- 0.2 - 2 - 20 - 200 - 1000V Resistance: 200 ohms - 2k - 20k - 200k - 2M - ± 0.8% Impedance 10M 20M ohms ± 1% d.c. Amps:- 0.2mA - 2mA - 20mA - 200mA Transistor check:- hFE 0 - 1000 PNP or NPN; IbE 10s £52.00 DM2350/C MINIATURE AUTORANGING D.M.M. t-sJd.UL Super compact autoranging digital multmeter featuring continuity buzzer and large (10mm) clear 3'/; -digit display. Full fuse overload protection. Carrying case, leads, battery, spare fuse and instruction manual supplied. d.c. Amps:- 0 - 200mA ± 1 .2%; 20A with ac. Volts - 2 - 20 - 200 - 600V ± 1.0% shunt (included) Impedance 10M UNIT 5 COMET WAY. SOUTHEND ESSEX . SS2 6TR . Electrical language of fish Man has known about electric fish at least since the ancient Egyptians decorated the walls of tombs with fishing scenes that depicted the formidable electric catfish of the Nile. But millions of people in cen- tral Africa eat large numbers of another type of 'weakly-electric' fish, which use their discharges to communicate with each other and find their way about in complete darkness. Electrolocation Weakly-electric fish produce electric organ discharges (EODs) of only two to three volts continuously through- out their lives. Each discharge, emitted by a special electric organ in the fish's tail, sets up an instantaneous electric field in the surrounding water. Objects in the near vicinity distort this field in a predictable way, thereby informing the fish of their size, conductivity and relative movement. Thousands of electro-receptors constantly moni- tor the pattern of current flow around the fish. The receptors form conductive pores in the otherwise highly resistive skin of the fish so that current generated by the electric organ tends to leave the fish by those routes, returning along curved paths to re-enter the fish at its tail. The sensory cells at the base of the electroreceptors encode the current intensity directly into nerve impulses, which show the greatest modulation in the area of skin closest to the nearby object. This local modulation has been likened to projecting an electric image of the object on the surface of the skin. Continued study revealed several different types of electroreceptor. So-called ampullary receptors moni- tor the surroundings for low-fre- quency electrical signals generated by the swimming muscles of non- electric fish and insect larvae, pro- viding information about predators and prey. The sensitivity of such receptors is so great that navigation by measuring induced electric cur- rents as the fish swims through the Earth's magnetic field has been shown to be possible. Ampullary receptors cannot, how- ever, respond to the high-frequency content of electric fish signals. They are used only in a passive way and it seems that it is others, known as tuberous receptors, which are de- signed for the job of active electro- location. If tuberous receptors code the fish's own electric field, it seems likely that they should at least be useful for detecting the EODs of other electric fish. A rich variety of messages, regarding species, age, size and sex of electric neighbours can be communicated 1 5-19 Figure 2. Electrical discharges of some of the more common African Mormyriforme fish. At the left is the only 'wave' species on the African continent Gymnarchus niloticus.the subject of Lissman's classic experiments in which electrolocation was first demonstrated. The other, mormyrid, pulse-type fish serve to highlight the striking differences in waveforms between species. As with the gymnotoid pulse fish, the intervals between pulses are all highly variable and they overlap; in some species, discharge rates as low as 1 Hz occur. Head positivity is shown upwards. electrically, as are signals of threat, submission and readiness to mate. Electrocommunication Two groups of weakly electric fish can be broadly classified into 'pulse' and 'wave' species. Pulse species generate brief EODs separated by relatively long and variable intervals. By contrast, wave species produce i pulses separated by very short inter- vals, approximately equal to the pulse width itself. Wave fish also hold their EOD frequency amazingly constant, with variations of less than 0.1 per cent. Species differences Within the pulse and wave classes there are also quite clear character- istics that are specific to the EOD of every species. The waveform is fixed by the anatomical arrangement of the electrocytes, or generating cells of the fish's electric organ. Variations in the innervation and physico- chemical make-up of the electrocytes alter the pulse waveform recorded outside the fish. The diversity of the EODs of sympatric species of electric fish (that is, those sharing a common habitat) is quite astound- ing. Of the 30 or more mormyrid EODs which have been recorded we find variations in the number, dur- ation, polarity and relative amplitude of the pulse components. The most impressive differences are in the duration of the EOD, which had a range of 50 ps to 10 ms. Although the ranges of intervals between pulses are species-specific, there is considerable overlap and it seems that the form of the EOD alone is ample for species identification and is a vital block to interbreeding, thereby keeping the species genetic- ally pure. Sex and age differences It has been found that the waveform varies even between individual fish. Each has its own, discrete EOD, as characteristic as a fingerprint. Fur- thermore, the variation falls into two distinct classes corresponding to the sex of the individual. This obviously has important impli- cations for electric communication and suggests that the difference in waveforms between the sexes plays a part in attracting a mate. Is information about the age of the fish contained in the EOD? It has been discovered that the larval EOD is quite different from that of the adult. It is of the opposite polarity and 20 times as long as the EOD of adult fish. The first pulses appear between eight and ten days from hatching and the larval EOD con- tinuous for the first 40 days of life, after which it is replaced by the normal adult EOD. As well as signals identifying species, sex and age, more complex infor- mation can be sent electrically. It is not coded by altering the pulse shape (which is fixed for individual fish) but by modulating the pulse rep- etition frequency. The effectiveness of certain pulse sequences as sus- pected signals can be assessed by playing back the patterns, using a model fish. Messages of threat are coded in all species by sudden increases in fre- quency. Mormyrids, for example, normally discharging at around 10 Hz, sometimes produce sharp fre- quency increases of up to 100 to 120 Hz for a short time. Such signals are often seen when a fish receives the playback of an intruder fish. A typical response to a threat signal is to stop discharging altogether. Submissive fish turn off their EODs for a short time such as half a second; in extreme cases, for example, where the fish has been injured, the elec- trical silence may last as long as 30 minutes. This signal is highly effec- tive and a dominant fish rarely con- tinuous attacking an electrically silent partner. Its effectiveness is probably partly due to the fact that turning of the EOD renders the fish more or less undetectable: it is as though it were hiding electrically. Silent fish generally remain very still, probably to avoid detection; more- over, because they are then electri- cally blind and unable to electro- locate, they are afraid of crashing into things! One big problem with this dual- function electrosensory system is that there are many instances in which electric communication is either incompatible with or else upsets the efficiency of the electro- location system. Turning off the EOD is obviously incompatible with active electrolocation; but just listening to other electric fish can cause difficulties. At worst, the electrosensory system may be com- pletely jammed if another electric fish is discharging synchronously nearby. This is seen most clearly in wave species where another fish with an identical EOD frequency severely upsets electrolocation. The fish have a built-in jamming avoidance response, or JAR, specially 5-20 Figure 4. Gymnotus carapo reacting aggressively towards a plastic dipole model to avoid this problem. When a fish is confronted by another fish with a similar EOD frequency, it simply shifts its discharge rate away from that of the intruder. The JAR is triggered at quite a distance, long before the discharge of an approaching fish becomes intense enough to affect electro- location. Interference from other species is not a problem because EODs from other species are filtered out at a peripheral stage. JARs in pulse fish involve sudden jumps in discharge frequency as attempts are made to avoid im- pending coincidence of discharges. Another trick is to lock on to a neighbour's EOD and discharge at a short fixed delay, rather as an echo, thereby completely avoiding any possibility of simultaneous dis- charge. Mormyrid pulse species appear to be exquisitely well-designed to solve interference problems. Firstly, the tuberous receptors are of two types. The Mormyromasts respond only to the fish's own EOD. The Knollen- organ functions solely in electric communication and, because of its high sensitivity, is well suited to detect distant fish of that species, and is tuned to the species-specific EOD. The Mormyrid has solved the jam- ming problem by time — sharing the two functions of the electro- sensory system, rejecting communi- cation signals during electrolocation and attending carefully to them during the relatively long interval between pulses. Dr. G.W.M, Westby, Spectrum 181. 1859 S) Stereo TV sound BBC finds dual FM system workable, but digital system might be better Towards the end of 1982 the BBC conducted over-air tests to establish whether a two-carrier sound-with- television system can be compatible with normal UHF reception. These tests took place out of normal service hours and were observed by staff from the BBC, ITV and receiver manufacturers in the area served by the Crystal Palace transmitter. A total of 414 questionnaires was com- pleted, and the analysis of these is now complete. The system tested is a variant on that used for stereo TV sound in Germany, in which the additional sound signal is carried on a second FM carrier set at around 7 dB below the main sound carrier and separated by some 300 kHz from it. The results confirmed the expectation that cross- talk from the second sound signal into the first is not a problem, and that patterning caused by beats be- tween the sound carriers can be kept to a tolerable level if the amplitude of the main sound carrier is reduced a little. They also showed, however, that buzz-on-sound can be a problem with existing receivers, regardless of the level of the second carrier, and that this buzz problem is increased by turning the main sound carrier down. Buzz is to some extent re- ceiver-dependent, but the main fac- tors affecting it are multipath pro- pagation, which can cause the re- ceived sound-to-vision carrier ratio to vary by ± 5 dB or more, and the spectral content of the picture. All in all it appears that a system of this type might give a largely satisfactory service, but investigations are con- tinuing into alternative possibilities. Stereo TV sound will be available from 1986 via DBS in digital form, and broadcasts of this sort might precede terrestrial two-channel sound with television. It is thus important to establish whether a digital sound package could satisfactorily be re- ceived from terrestrial transmitters as perhaps a better alternative to a second FM carrier. Preliminary assess- ments indicate that the digital option could give a better compromise between compatibility and rugged- ness. A thorough examination of the digital system has therefore begun, and this will call for further over -air tests in due course. BBC Engineering Information (867 S) How much current is drawn by a dimmed light-bulb? Does the extractor fan actually 'consume' the rated power specified by the manufacturer? What output power can I expect from my home-made windpowered generator? Or even: What is the power consumption of my super hi-fi FET power output stage? All these questions, and more, can be answered simply, using an electronic wattmeter. watt-meter If the wattmeter is expanded to a kilowatt- hour meter by adding a suitable extension circuit (this will probably appear in the June issue), the user will also be able to answer the following questions: How much can I save by placing the refriger- ator in a cool room and what is its average consumption per week? What contribution to energy saving is made by insulating the electric boiler? What is the cost of a ‘machine wash’ at 90°, compared with one at 60°? The wattmeter can be used simply and safely as an intermediate socket between the load and the mains socket. The terms ‘power’, ‘energy’, ‘r.m.s. voltage and cur- rent' are explained in a separate article in this issue. measuring electric power the electronic way! mains voltage u(t) is brought to the proper level by an input stage (Al) and fed to the input of a four-quadrant multiplier. A volt- age is developed due to the load-current i(t) flowing through a shunt resistor (R s h). This voltage is fed via a second input stage (A2) to the other input of the multiplier. The multiplier forms the product of the alter- nating voltage and current and supplies a current as a measure of the instantaneous power p(t). A moving coil meter takes the average of the current and indicates the average power. Why do we use a four-quadrant multiplier and not, for example, a two-quadrant mul- tiplier? This requires some explanation: during multiplication of alternating voltages and currents four different situations can be encountered: instantaneous voltage and instantaneous current are simultaneously positive (quadrant 1); the instantaneous volt- age is negative and the current is also nega- tive (quadrant III); the voltage is negative and the current is positive (quadrant II) and vice versa (quadrant IV). Figure 2 shows these possible situations. If the instantaneous power is positive (I and III), power is being consumed. If the power is negative (II and IV), the load returns power to the mains on account of its capaci- tive or inductive characteristics. This can also be expressed as follows: if the average power (product of the mean values over one period of mains voltage) is positive, we are dealing with a load. The multiplier supplies a positive output current and the Block diagram The operation of the electronic wattmeter is best explained on the basis of the block diagram in figure 1. The (average) power is equal to the mean product of the instan- taneous voltage across load X and the instan- taneous current through it. The alternating meter indicates a positive power (average). A centre-zero meter indicates negative if the device to which the wattmeter is connected is a ‘generator’ (i.e. delivering power to the mains). Let us return briefly to the block diagram: the purpose of the two LEDs is to indicate when the wattmeter is being overdriven by an excessive voltage or current. The reading is then incorrect. Overdriving cannot be seen on the meter itself. A curious situation can therefore arise, in which the pointer deflects only slightly but the LEDs light up. The circuit This appears considerably more complicated than the block diagram. The part of the cir- cuit containing A4 and A6 (a VCO) is pro- vided to allow for future expansion to a kilowatt-hour counter. The input stages consist of Al, A2 and the associated components. A voltage divider (R1/R2/R3) reduces the mains voltage to one which is suitable for the wattmeter (mains voltage divided by 60). Since a 1/8 W resistor can only withstand a low volt- age, two resistors are connected in series here to make up one resistor of the voltage divider. The measuring current is taken from shunt resistor R4. Although overdriving is indicated by two LEDs, additional protec- tive circuitry is still needed. Diodes D1/D2 and D3/D4 are protective elements. If the input signal is greater than 12 V the diodes conduct, thus the maximum input voltage is limited to approximately 12 V. OTA (A5). The sensitivity can be selected at input stages Al and A2 with two jumpers (A and B). The VCO circuit based on A4 and A6 is only required * JVt- T T 5-23 1983 The value given (0JZ47. 5 W) should be safe for loads up to 350 W (mains- powered). For higher The amplification factor of the input stages can be set to 1 or 10. For a factor of 1, the terminals at A and B should be jumpered; otherwise the amplification factor will be 10. The choice of amplification factor depends on the load voltage and current. If desired, switches can be used for selecting the amplification factor, instead of actually connecting wires at A and B. This is a con- venient method to use as then it is easy to change the amplification factor if the meter deflection is too low or if the multiplier is overdriven. To minimise power dissipation in R4, A2 should be allowed to operate at maximum gain (omit jumper B). The output signals of A1 and A2 are fed to the four-quadrant multiplier A5. OTA 13600, which we met in the April 1982 issue, is used here. Readers interested in the oper- ation of this IC can consult that issue. The OTA amplifies the differential voltage ap- plied to its inputs (pins 13 and 14) and supplies a current at its output (pin 12). The amplification factor is quoted in mA/V and is referred to as ‘slope’. This slope is rela- tively linear and varies as a function of the (control) current flowing in at pin 16. Thus the OTA multiplies two variables and pro- vides a current as the product. In this case, one variable is the voltage derived from the mains and converted to control current by P2 and R16, and the second variable is the voltage which results from the load current through R4. The situation is clarified by figure 4. The OTA is represented as an amplifier with slope S. The voltage derived from the mains is designated u, and the voltage derived from the load current is designated u 2 . The slope S of the inverting OTA is adjusted with P2. This circuit produces current i 3 which flows to chassis earth (or virtual earth, to be precise). This current, in turn, is pro- portional to the product of u, and u 2 . This means that if one of the two factors is zero, no output current will flow because zero multiplied by another value is zero. If the OTA has no u 2 input signal, this condition is met so there is no gain and therefore no current. The slope is adjusted with P2, so that i i plusi 2 is equal to zero when u , is zero. According to the rule of nodes, i 3 is then also zero. If neither voltage is zero, an output current i 3 , proportional to the product of u i and u 2 , is produced as a result of the linear characteristic of the OTA. The four-quadrant multiplier is followed by a stage with a virtual earth input. We refer to this as a ‘virtual earth', because the non-inverting input is connected to earth and the voltage difference between non- inverting and inverting inputs of operational amplifiers is assumed to be zero. Integrating network R28/C11 forms the mean value of the alternating output current of A5 and drives meter Ml via D5 or Tl. In the description of the block diagram, we said that the meter takes the average of the alternating current. Network C11/R28 would therefore seem to be superfluous. In fact, the meter does not take the average of the current but of the torque, i.e. the force which moves its coil. The VCO circuit (with A6 and A4) is provided to allow expansion to a kilowatt-hour meter; since, however, this circuit can only process an average current, we have to include network R28/ Cll. For use as a wattmeter (without VCO exten- sion) a centre-zero moving-coil meter can 5-24 indicate both positive (absorbed) and nega- tive (delivered) power. Since the VCO cir- cuit can only process positive currents, the wattmeter expanded to a kilowatt-hour meter will also only be capable of indicating positive power readings. In order to measure the power of a generator, the input of the wattmeter is connected to the generator. Two LEDs are contained in the circuitry of A7 and A8 to indicate overdriving. These circuits operate as fullwave rectifiers. Posi- tive voltages are applied via D6 (D6’) and negative voltages via the inverting input of the operational amplifier and D7 (D7’) to transistor stage T2/T3 (T2’/T3’). If the signal level filtered by C8 (C8’) is sufficiently high LED D8 (D8') lights to indicate that the wattmeter is being overdriven. Construction and alignment Once the components have been fitted to the printed circuit board (figure 5), the active part of the extension circuit (A4 and A6) is also complete because A4 and A6 are already contained in IC1 and IC2. The passive components of the VCO circuit (Cl, R19, R20, R21 and P4) can be omitted for the time being. Voltage divider R 1/R2/R3 is designed for a mains voltage of 220 V. It may be necessary to select another value for R4, to suit the load current. The power rating for the resistor is calculated as follows: P r = R4 I&n S . Since one of the mains voltage lines is connected to the circuit negative supply, the printed circuit board must be installed in an insulated plastic case. If the wattmeter is to be expanded to a kilowatt-hour counter, a larger case and a bigger transformer will be needed. Three 2-core mains cables are inserted into the case: one with a plug for connecting the power supply of the circuit, a second one with a plug as the ‘test cable’ and a third one with socket as the output of the circuit. If it is only desired to measure the power drawn by a mains-powered load, the voltage for the power supply can be obtained directly from the wattmeter input. There is therefore no need for a special mains cable (see photograph). Please take note of the following warning before beginning alignment: Do not touch any component when the circuit is connected to mains. Use a well- insulated screwdriver to adjust the preset potentiometers. Insert jumpers A and B or close the corre- sponding switches (if used). Connect pin 5 of A 1 to chassis earth and pin 3 of A2 to the positive pole of a 1.5 V battery (negative pole to earth). Switch on the mains voltage. Adjust P3 to its extreme anti-clockwise position (most sensitive setting), and adjust P2 so that the meter indicates zero. Switch the mains off again. Disconnect pin 5 of A1 from earth; remove the battery and connect the mains voltage to the input of the watt- meter. Switch on the power supply and adjust PI so that the meter indicates zero. Repeat this procedure (first adjusting P2, then PI) several times so that the presets are set to an optimum. Now remove jumper B or open the relevant switch. Connect a 60 W bulb to the output of the wattmeter and adjust P3 to its extreme clockwise position (least sensitive position). Plug the test cable' into a mains power socket. Switch on the mains and adjust P3 so that the meter reads exactly 0.6 mA (= 60 W). As a further check, this adjustment can be made with other bulbs. With high- grade bulbs the power indicated will agree with the rating printed on them. A more precise method is to measure the voltage across the bulb and the current through it. Multiply these values to obtain the power, then set this figure on the meter. After alignment of the wattmeter, the power can be read off in divisions of 10 W per 0.1 mA. If voltages lower than mains are to be measured frequently, the sen- sitivity of the wattmeter can be increased by a factor of 10 by removing jumper A. M 1983 Resistors (all 1/8 W, except R4): R1,R2,R22,R22' R23,R23’ = 100 k R3 = 3k3 R4 = 0.47 n/5 W R5,R7,R9,R1 1 = 18 k R6,R10,R24.R24' = 2k2 R8.R12 = 1k8 R13.R15.R20 = 10k R14 = 4k7 R16.R18 = 6k8 R17 = 820n R19 = 22 k R21.R27.R27’ = 1 k R25.R25’ = 47 k R26,R26’= 15 k R28 = 22 k P1.P3- 1 k preset P2 = 50 k preset P4 = 500 £2 preset Cl - 15n C2.C3 = 220 m/25 V C4.C5.C8.C8' = 1 0 m/ 1 6 V C6.C7.C9, CIO ■ 100 n C11 - 10 p/63 V Semiconductors: B1 * bridge rectifier B40C800 D7.D7’ = 1N4148 D8.D8' * red LED T1 ■ BC557B T2,T2\T3,T3’ = BC 547 IC1 = TL084 IC2= 13600 or 13700 IC3 “ 78L12 IC4-79L12 IC5.IC5’ = 741 Miscellaneous: Trl = mains transformer 2x15 V/0.2 A sec. (1 A for expansion) Ml - 1 mA moving-coil (p.c.b. type) Plastic case 2 or 3 mains cables 5-25 ASCII- Our first ASCII keyboard was published in November 1978 (Elektor No. 43) and proved to be extremely popular. However, times change and the field of electronics and computers has taken several steps forward. It was therefore considered that it was time for a new design that was a little more sophis- keyboard . . . complete with hexpad As its name implies an alphanumeric key- board includes both alphabetic characters and decimal characters (numbers), as well as all the punctuation marks. In order that the computer and the terminal can 'converse' they must obviously speak the same language; to do this several codes have been devised which give a specific binary word to each alphanumeric character. The best known and most widely used format is the American Standard Code for Information Interchange, usually abbreviated to ASCII. This is an 8-bit code which uses the most significant bit (MSB) as a parity bit for error detection. The remaining 7 binary digits provide 1 28 different combinations, so even when all decimal, alphabetic (upper and lower case) and punctuation marks are coded we still have a few codes left for control functions. Table 1 shows the com- plete set of ASCII characters, including command functions. This table also shows that there is a logical connection between specific groups of characters; so for example bit 5 is logic ‘1’ for lower case and logic ‘0’ for upper case. Table 2 lists various abbrevi- ations used and their meanings. Keyboard circuit Even though it is theoretically possible to have a keyboard with one key for each of the 128 functions, this could be rather confusing. To sidestep this difficulty every key is normally given a double (or triple) function and, in the same manner as scientific calculators, a shift key is added to the keyboard to select which particular function associated with a key is required. When a key is pressed the corre- sponding ASCII code word is formed by a coding IC. This simply consists of a ROM containing all the ASCII codes, and is addressed by the keyboard via two counter circuits whose outputs form a matrix. The RC network connected between pins 2, 3 and 40 of the decoder/encoder IC deter- mines the frequency at which the matrix is scanned (in fact, the counter clock fre- quency). One of the counters delivers its 5-26 particular code to lines X0 . . . X7, and the pulse for the oscillator around N6. The other sends its binary code to lines Y0 . . combination of R4-C3 ensures that the . . Y10, this then forms the address of the oscillator starts after a delay of about ROM in the encoder IC. Not all the lines '/2 second. When a key is pressed briefly the for the ROM are addressed by the second strobe pulse arrives via N7 and N8 through counter circuit: in fact two of them are tied connections f and h (or via N7 and connec- to the SHIFT and CONTROL keys. Table 3 tions f and h where it is inverted) and the shows what function is achieved with what oscillator doesn’t even have time to start, key, and Table 4 lists the control functions However if a key is held for a longer period available. the oscillator outputs a repetitive strobe The RC network connected to pin 19 pulse, so that the character present will be ensures that contact-bounce is eliminated. repeated for the time that the key is pressed. The inputs at pins 6 and 20 of the encoder The CAP-LOCK key is an interrupt with two IC are wired to either logic levels 'O’ or ‘ 1'. stable positions; when it is operated bit 5 is Normally they are both logic 'O’, but if both inverted by gates N1 . . . N4 so that the are wired to logic ‘1’ then the data- and ASCII codes output are all for upper case strobe-outputs (c) and the parity bit (b) (CAPital) letters. This is very convenient respectively are inverted. for BASIC programmes. The keys on the hexadecimal board, 0 . . . . 9, A . . . F and the decimal point are Features of the keyboard connected in parallel with the same keys on Rather than using a supplementary repeat the alphanumeric keyboard. Keys FI . . key we prefer to use automatic repetition. . . F8 simply provide logic levels defined by The strobe pulse provided by pin 16 (eventu the user and are usable for special functions, ally inverted - see table 5), acts as a trigger Another notable aspect of this new key- 5-27 FS — file separator GS - group separator NUL NUL NUL NUL NUL NUL NUL NUL NUL RS FS ) ( &%$#" I ~ J 987654321 A \ table 4 (FORM FEED) (LINE FEED) (HORIZONTAL TAB) (VERTICAL TAB) (CARRIAGE RETURN) (BACKSPACE) (ESCAPE) (FILE SEPARATOR) CTRL + L = FF - CTRL + J - LF - CTRL + I = HT ■ CTRL + K = VT = CTRL + M - CR = CTRL + H = BS = CTRL + El = ESC ■ CTRL + = FS * home cursor + page clear LF + cursor l cursor t CR * erasure to end of line scroll up even parity: 5-28 Figure 2. The location of the alphanumeric keys is determined, in principle, by the keyboard encoder. Figure 2a shows the normal QWERTY configur- ation which can be including a code- conversion EPROM in the output of the encoder. The hexadecimal keys (Figure 2b) are placed at parts are on the big key- Table 1. The complete ASCII code in binary (7 -bit) and hexadecimal (00 . . . 7F) forms. Table 2. The CONTROL (CTRL) key combined with certain other keys allows special functions (see also Table 3). Table 3. A number of keys in the keyboard provide special functions when used in conjunction with the SHIFT (uppercase) or CTRL keys. Table 4. Some functions that are used frequently independent-key. Table 5. The active logic board is the possibility of locating the keys The EPROM can be divided into sections wherever you like on the keyboard, thanks by means of connections at m, n, o, p, so to the option of code conversion shown in in one 2716 we can have 16 different part of Figure 1. The ASCII information combinations of 128 characters. If only the provided by the keyboard converter is normal QWERTY keyboard with no code applied as an address to an EPROM (2716). conversion functions is required then the The EPROM is programmed such that a EPROM should be omitted and the address given input (in the form of an address) inputs connected directly to the corre- corresponds to a particular code which sponding data outputs, appears as data at the EPROM output. A parallel/serial conversion to provide The ribbon cable from the computer or RS 232 compatibility is a very interesting terminal connects to the data lines of the possibility with this keyboard. It is discussed EPROM through a 14-way DIL pin head. in greater detail elsewhere in this issue. 2a vo » ' ! j 1 y 1 [ III „ s <° U! \ ' . \ I8SI \ A fit. \ V \ \ v c < A A £_\ ^ X \ nc \° V \ \ v \ \ A V \ iM "[< iv,> \ \ — -1 1 i_ \ \ A >: . II pC 1 III 1 nn - i o 5-29 ASCII-keyboard elektormay 1983 3 « F* F3 F4 cm | 0 | W | E | R | T | V | U ] 1 | 0 1 P || ; | | ||*™|S c D E F -1 8 9 A B "1 ~ HMMMMMMMI’imi = ll - 4 5 6 7 "1 « INI 1 11 _L±ifc±= 0 . 2 3 J Figure 6. Positioning the involved than the other keys caps but will pose Construction Before starting construction you should look at Figure 5, which clearly shows that the inclination of the keys and that of the caps are different. This gives a ‘terraced’ keyboard with a inclination of about 15° to the horizontal. The positioning of the space key is illustrated in Figure 6. Don’t solder in the keys right from the start. Better just to solder one pin, which makes moving them easier later on. Supply voltages to the keyboard are carried via the ribbon cable used for data transfer between the keyboard and the terminal or computer. Note also that the SHIFT-LOCK and CAP- LOCK keys have two stable positions and should not be confused with the other keys. The wiring for the 8 function keys is left to the initiative of the user according to his needs, the printed circuit board design enables each of these keys to be connected to any point in the keyboard matrix. Finally, regarding the choice of a case for the keyboard, bear in mind that the printed circuit board will be inclined at 15° so the case should accommodate this. The case size will be governed by the dimensions of the printed circuit board in Figure 4. The BOT 880G from West Hyde is an example of a suitable case. M 5-32 Readers who decided to construct the Prelude preamplifier from the earlier series of articles will by now have a total of ten printed circuit boards hopefully in the throes of 'final assembly'. It is a fairly complex undertaking and, although everything should work perfectly, there may be one or two questions that could arise. It is intended in this summary to cover the problem areas where confusion may occur and also to put forward a few ideas on the use of the completed Prelude. Prelude p.s. pro's and con's of the Prelude It may be of interest to know that the com- plete Prelude consists of 10 printed circuit boards, 14 ICs, 106 transistors, 11 diodes, 262 resistors, 26 potentiometers, 149 ca- pacitors and 13 switches. Undoubtedly of more interest however, is what can be achieved when all these components are united into one big circuit called the "Prelude”. Probably the first question that will be asked is "how does it all perform?”. Rest your mind on this because there should be no reason why any Prelude (constructed on Elektor printed circuit boards) should not meet the specifications given in Table 1. These are reasonably conservative figures and it is likely that your Prelude will improve on this performance, if it has been con- structed carefully. It has been suggested by those in the know that Rome wasn’t built in a day and we firmly suggest the same for the Prelude. Poor workmanship and over- eager assembly is a quick way to degrade the performance. Not only must the Prelude be constructed correctly, it must also be used properly in order to achieve the best results. The case for presets The Prelude departs from conventional preamplifier design in one major aspect, and that is the positioning of the volume control in the circuit. Contrary to the normally accepted ideas, the volume level control is situated at the output of the preamplifier. Initially this may seem a little odd but it does have one significant advantage. Any noise that may be generated in the preamplifier stages will be attenuated together with the volume level at the output of the preamp. This of course would not be the case with a volume control at the front of the preamp. A good idea but where is the snag we hear you say and, of course, there always is a snag. With no means of limiting the input levels the risk of over- driving the preamplifier into ‘clipping’ could be very high. We would then be trading a reduced noise level for increased distortion - not what we had in mind at all! The gain of the line amplifier is approxi- mately x 20 (the fixed attenuation of the balance control in midposition is 6 dB, so that the total line amplification is about 10 times). The maximum line amplifier output voltage of approximately 26 corresponds to a maximum input level of approximately 1.3 V pp , or approximately 460 mVrms- The output voltage of the tone control amplifier can be higher than the output voltage of the tone control; how Missing Link In the circuit of the tone control (april issue, page 4-53, figure 1 >, R 16 and R16’ are shown as 6k8. This should be 1 k. The parts list was correct. Output impedance Harmonic distortion: < 0.015% (1 V from 20 Hz. . (also holds good for headphone output; class A range) Frequency range: 6 Hz . . . 60 RIAA deviation. < 0.5 dB (20 Hz . . Input sensitivity /impedance: MC: MM1.MM2: other inputs: Tone control: Low (400 Hz): Low (800 Hz): High (2 kHz): High (4 kHz): Signal/noise ratio Balance control: MC. MM1, MM2: V rms /100 SI >grammable) erlude 30 k) t 12 dB a s 12 dB a t 12 dB a 100 Hz 10 kHz 20 kHz 5-33 much depends on the position of the high and low control. In other words, the tone control stage is also sensitive to being overdriven. The answer to the problem is to use presets for a number of the inputs. The phono inputs are not provided with presets because there is a more elegant way to set the phono input amplification (if required at all). In this case the gain is set by selecting the value of R7 and R7 ’ of the magnetic cartridge preamp up to a maximum of 390 SI. However the presets are a necessary evil and it would be better to get rid of them com- pletely if at all possible. This is easy with a modern receiver, say, that is equipped with a built in, low impedance AF output level control. Bear in mind also that a 250 kS2 preset can be replaced by a voltage divider consisting of two resistors as long as the input voltage level is known. A total resistance value of 5 to 10 times the (nor- mally low) output impedance of the corre- sponding audio voltage source is quite sufficient and will even help to reduce crosstalk and noise level. Under all circumstances make sure that the input level of the tone control amplifier (tone control switched 'on') or line amplifier (tone control switched ‘off’) does not exceed 100 . . . 150 Vmis; this corresponds to 1 ... 1.5 Vnns at the output of the Prelude, which is more than enough to drive any output amplifier. One minor advantage of presets is that they can also be used to limit the output level; handy if you object to your house being turned into a disco in your absence! The assets of low impedance! In spite of the large number of switches and potentiometers and the rather long track runs in some cases, the cross-talk between the channels is surprisingly low. It is not helped by the ‘bus board’ concept with inputs and outputs on the same ‘plug in boards’ facing each other. However, the cross-talk level is still much better than the DIN standard minimum requirement which is 30 dB in the frequency range of 250 Hz ... 10 kHz. This is generally an acceptable level but it can be improved by the use of the buffer stage in Figure 1. This circuit was originally intended for use at the tape and auxiliary outputs but it can also be used to replace the 250 k presets. A point to note: it is a waste of time inserting a buffer for the phono inputs due to the fact that the output of the MM amplifier is low impedance anyway (cross-talk attenuation is at least 60 dB). But why buffers? The answer is simple: buffers ensure that the inputs to the tone control and line amplifiers are low im- pedance. This is desirable because the lower the impedance the lower is the cross-talk since the interaction between the channels is mainly capacitive. The wiring of mode-switch Sll must be changed if a buffer is connected in series with one or more inputs. Figure 2 (a and b) show how this should be done. During the 'mono’-mode the resistors Ry and Ry’ see to it that one buffer is not loaded by the low Prelude ps. | elektor may 1983 output impedance of the other buffer. These resistors are switched off during ‘stereo’ and reverse-stereo' operation, other- wise they could be the cause of a still higher line impedance. Figure 1. The circuit illustrated here can be used as butter tor the 100 mV inputs of the Prelude and as output buffer for the tape recording and actual emitter follower Construction There are some points of note regarding construction: 1 . The wiring data for a number of switches situated on the bus board (see March issue) are not always clear. That is why this particular section of the component side of the bus board is repeated here (see Figure 3). After wiring S3 and Sll use an ohm-meter to check that they are switching properly. 1 2. The bus board contains 3 wire links which cross the connection board (see Figure 3). Connect these (insulated) wire links to the copper side of the bus board, cascode T1 and T2. Ca- pacitor C2 ensures that the base of T2 follows the emitter voltage of T1 , which is very favourable for its modulation *behav- iour'. The supply for the emitter follower is pro- which is also connected as cascode