770268 451111 l i *.§• j t if j j 1 1 i * u \ jm ’ - f t i ;I -ji i ■ f ’ 1 > ■ f V 1 1 ;r 7 ki rS A The leaders in PIC development ♦ 4 4 4 All you need to get started with PIC Industry standard/quality board Open the box and get coding Available with C compiler or use our PicScript to write programs using simple commands... NO ASSEMBLER, NO COMPILER, JUST WRITE AND RUN AUTOMATION SCRfPTVIBIUTY i PicDev Board with PicScript £99.00 (plus p+p) This is a complete development suite for the novice or non programmer. It is shipped with: . PicDev Board • PicShell and PicScript software . Breakout board • Cables • Example scripts Both items require » PC with serial port available * Power supply adapter To order: www.p agmxoAik PicDev Board with C Compiler £165.00 {plus p+p) This is a complete development suite for the more advanced programmer. It is shipped with: PicDev Board PicShell and PicScript software C compiler Breakout board Gabies Example scripts ICD1 sales@pagm.co.uk Tel: +44 (0)1792 891927 1 * Dr DAO i ter DftVAQ . / \\ Temperature ^ Microphone ^ r- * , ,, g External sensors: H i • Low^&st^mder £60 '* • Built in sensSrs^or light, temperature and sound V (level and waverorms) ^ • Use DrDAQ to capture fast signals • Outputs for control experiments \ • Supplied with both Pi coScope (oscilloscope) and PicoLog (data logging) software \ For more information on DrDAQ, please visit: \ www.picotech.com/drdaq1 01 • Scope and spectrum analyser functions • A fraction of the cost.of benchtop scope • Save multiple setuojf for ease of use • Save, print and e-mail your traces • FREE technical support for life * • FREE software and upgrades f • Automated measurements l Ave-srz Vjriuaf instrument For more information on our scopes, please visit: g www.picotech.com/scope1 91 Tel: 01480 396395 Fax: 01480 396296 E-mail: sales/S)Dicotech.co "^ m a ■ L1 -^— -* r— ii _ J ml S— — Affordable, Professional ARM7 C/C++ Development! Everything required for LPC2000 Philips ARAA7 development in a single, upgradeable kit, 0 Industry standard Keil UVISION3 IDE, C/C++ compiler and simulator Z Full Simulation of LPC2000 with peripheral & interrupt support S Fully assembled LPC2129 board a 1 6k RAM, 256k FLASH on board Z Dual CAN and RS232 interfaces 1 JTAG and ETM trace debug interfaces Z Example program library 0 uUNK U 5 BTTAG interface (optional) easier 6k code development kits from £75 +VAT Full 16k development kit with JTAG-USB debugger £24g+VAT (Academic price just £i4g+VAT!) hitex For full details see www.hitex.co.uk/arm ^philips i.SJlEW lectromcs KJ n PiH «- ct ' 1 ztun -■ Micro Web Server for Internet and Intranet El * * * * Our incredibly popular MSC1210 microcontroller board (also known as Precision Measurement Central ) now provides network and Ail software for the project is available free of charge from our website! Internet connectivity, allowing the processor to publish its own data pages onto the web. The article describes a temperature logger allowing the user to enter, via the Internet, temperature limits and an email alarm address. The Micro Web Server can also switch network ports from an Internet-connected PC, literally anywhere on the globe. Order now using the Order Form in the Readers Services section in this issue. Now available: * MS Cl 210 board (assembled and tested) * Network extension (assembled and tested) * Combined package [incl. af! related Elektor Electronics articles on diskette) £ 69,00 (USS112.5Q) £ 41.95 (USS 73.95) £103.50 (USS 134.95) Elektor Electronics (Publishing) RG. Box 190 Tunbridge Wells TN5 7WY England Telephone +44 (0) 1580 200 657 Fax +44 (0) 1580 200 616 See also www,elektor-electronicsxo,uk 4 dekl&r e'ecHonlts - 9' 20Q4 I Ali new this September Sure, every issue of Elekior Electronics contains nev/ articles, else ir would not be worth buying or subscribing to, would it? However, while planning the contents of this September 2004 issue, producing the copy and finally selecting the articles and regular items ihot would fit the 7G-add editorial pages to fill, it struck me that 'new' may also have a deeper meaning. Apart from the 'Beefy T 300-watt audio amp mat goes back to June 2004, this month's issue shows a lot of nerve and innovation, two characteristics we know are highly valued by our readers. To kick off, the news item on Wireless USB and the technical backgrounder on the USB Embedded Host Controller contain pioneering et authoritative information we received from our friends at semiconductor giant Cypress. Elektor Electronics was rne irst electronics magazine to uncover and employ USB for circuits you can actually build at home, and massive suc- cesses they were with PCB sales in the k range. Now we claim the some for Bluetooth, a wireless interface standard that's taking the PC world by storm but so far remained well out of reach of most of you when it came to microcon- troller connectivity. Ready-made Tlexi Panel modules with on on-board Bluetooth radio are remarkably easy to pro- gram and to cap it all they re available from our advertiser Milford Instruments. Quizz'away is a premiere for those of you who like thought-stimulating riddles and puzzles hopefully pushing the limits of your theoretical knowledge of electronics. We coaxed one of our long-standing and widely respected external authors, professor Martin Ghsmonn, into supplying a batch of not-tco-easy questions for you to solve, and maybe win o prize, too! Slightly less ambitious (no prizes, just fun and learning from your mistakes), is Andy's Quest you can play an our website. Back to printed paper, Rolling Dice h another first, not only because the finished project will actually roll before it shows ihe number [and drop off the table if you're aver enthusiastic), but also because of the photo story illustrating the 3-D construction. It will be hard to overlook this month's focus on Microcontrollers, with one article covering Trends and another a basic Buyers Guide together with o Manufacturer Overview. True to our principles we add practice to theory by publishing Jim Spence's fantastic Swiss Army Knife, a microcontroller project so adaptable and easy to use it can only be compared to the renowned tool from Victor! nox (mine was recently confiscated by airport customs because I forgot to remove it from my hand luggage . Bogus Parts in electronics covers a subject you wi !, I'm sure, care to know about rather than see the actual 'first per- formance' in front of you and suffer the consequences. The diverse content and length of some of the main articles in this issue resulted in all design ideas prepared for she popular 'start here' section to be held over nil next month. The October issue will contain an extra large helping of these — it's o promise. jan Suiting, Editor lektor lectronics Subscriptions W&nd’.vBe SiiSiriHan Series Lul„ LHt 4, Reed Fa/m, Read, Tieehurst TN5 THE fcj^fefsd. Telephone: (+44) (0)1 550 2G0657. fee (+44) (0)1 5®} 200616 Er'ii : sir . ■ .r r“ r: Ffetr-i ana terr.s ri-= t .zr, d~ && C:2sr r : — Volume 30, Number 335. September 2004 ISSN 0268/45 1 EJektor Electronics aims at inspiring people to master elec- tronics at any personal !eve! by presenting construction proj- ects and spotting developments in electronics and informa- tion technology. EkdnurUcs is pnxkjced.and puhfisht&dby Bektor Bettror»cs (PUbfe^ - . EG, Bo* 190. Tur&ndge VfeSs TN5 7W£ Btg&d, TdL (+-44) (0)1 5 BO 200657, fe*= (+44) (0) 1 500 200616. Email: — “ = rvag£2 ■ ~ i, : lar - from - t. . sagers Moisn zzz and HacDrar r rzzz g ji- ff ir or QTi subscristki-n. zfcc — t pudSs*>:-d I : - a - - - .% a 2, UnieMi a t it; dr'- ■; - ±rd r =« t~e magazine i sfeo m'srtiz rt Pierdi. Ge and Djfict; Tc^trar rr-r '-.r? :~e 5 or oraj a- - r. more than 5” cctifiLr ss International Editor '" J v — f“tr Editor -r. Edt-rg .. _ c . :. .. International editorial staff: Harr Bagger Daria Ro J Gsrsefi«kK7 k Errst foempeh&ier Gi*> Design stall: Karel Wafre.-en of deign), Tort QesbSJts, Paul Gcosens. Lemmens • r:r;-r“.- Edltorial secretariat: Hedvrig Hertn^ens (& aj eia* Graphic design DTP: r o~ Gu vers, G : I : s Managing Director Publisher: ra. G-.i-'S- Ciroihticm Control: rtargrvi-t Debt (m d-ibe _G-5 ' : "" “ Head Office: Severs b,v, f?Q 0ax75 NL-6l9&ABBed: The I Sfehsrtamfc —i ^ — Efe. - 5 +6 4570 6 Distribution; 5 c- * — :-_r E - L .■= ~ an Street ^G.D r.. : UK Advertising i- 5 C- -iYt" : G'^&rhz- GL50 3=fc. & -zc -='^y-z:-~- : 2415 — - : i+z ue&is ErrE 4 ; ■ : ■ ; _ : : e : . _ _ : -g Yites '.f _- F- s-’sh^or: InternitiDniJ Advertising ■ . iii IsJtk z - zzd rsss as H fid “ “ It i I Itfk 2 I r ■ - Z T“” ~ 2 2"? ■ ~ — =« 7 . . 4c. t 1 y .- v -c e -t : Copyright notice “■■-I croits tfcscroed nir-a ^ _ e re ■-- : -e r_ c re - - ri;, -i. pr&s- rri'.- :- r -leC ewi trim ^r..-- art rr , r er - r- ezzi ■ z secret cf —irr -e a-e - = 5ev r r- : a , E">- '"E- ' :i :e -ei-o:_-:ir : - : , rr rer “ '’i— : i ■ r . ' i_i"£ : ' r.:-::-: ■ .-t sr. g5i?=cc‘“r!g n .-.rre - p-ac m : r “r r : - : r i P. :'.reT r- - J --- :■ - ysi az: he niar ez ire sr.y pa?t r r-i : ir ir s r _ +C ~ a re* - cf z~ - nalLm feerS pnatecticri rrey cost in r oTcsrciite, derices, ccmponenss ac. cfesrased n t+5 frega^jeL The Rubfeher tkes *£££pL nsscctsbiSly tor feTnglo kteit^y such -rervs'j C' rira- cnotsrLO' Tne s?j&mssas\ of or ariides enpSes pemisBrai in the ftijfehers to sSer the and to use the in other Segmatt prides. The P _3 r: r 3 cst:* r;jr:-“r reTvrri a.-y rrEiarG i.i r --r.&z to rer & Segment b.v 2004 Printed in the Netherlands 9/2001 - ekklar electro nj cs 5 iiews & new products 1 Vireless USB Figure l . topography o f the WUSB standard promoted by Intel. Thomas Biei Conventional USB has certainly become on indispensable fea- ture of everybody's desk* It is used to connect scanners, cam- eras, hard disks, sound systems and webcams after the Initial installation and the PC or lap- top can remain switched on while the cobles are connected or disconnected. This is natu- rally all very convenient, but the drawback is the large number of cables attached to the sys- tem, The backs of many desks have come to resemble cable cabinets. This could all be remedied by a new standard for wireless USB devices. In the some way that wireless LAN replaces LAN cables, wireless USB is Intended to replace USB cable connec- tions in the future (see fig- ure 1 ). Under the leadership of Intel interested manufacturers have formed the Wireless USB Promoter Group to develop a common standard far wireless USB devices. This Involves deveL oping a radio technology that provides reliable data transmis- sion at high data rates over short distances among devices such as home entertainment equip- ment, PC peripherals ond mobile devices. For example if could be used to transfer multimedia content without any cables or stream high-resolution video dota from o digital video recorder to a television set In the living room. According to Intel, wireless USB (WUSB) is Intended to be fully compatible with the USB 2.0 standard. Among other things, this means a data transmission rate of up to 480 Mbit/s, as well os driver standards and device infrastructures that com- ply with the USB 2.0 specifica- tion from USB.org. The targeted working range is 1 0 metres, In order to comply with the device power consump- tion requirements defined by USB.org. Intel believes that development of commercial products using wireless USB will be possible as early as 2005. This is Intended to be assisted by support from various indus- try organisations in the wireless data communication ond mobile telecommunication industries, such as the Multi- band OFDM Alliance (MBOA), the Wi Media Alliance and the previously mentioned Wireless USB Promoter Group. Something completely different and significantly more concrete is a technology that Cypress has been promoting since late 2002 under the name Wire- less USB™'* The Cypress Wlre- JessUSB technology differs from the standard being pro- moted by Intel in the data trans- mission rate, the frequency band that is used, and above all in the intended application area. The maximum data transmission rate is only 62.5 kbit/s. This very law da to rate (even relative to USB 1.0) is fully adequate for applications such os alarm sys- tems, PC mice, keyboards, gamepads, joysticks, household appliances, pagers, regulation and control units, inventory man- agement, instrumentation and the like. The designation "Wire- lessUSB' thus does not refer to ihe data rate, but instead to the fad that the connection at the PC end Is made vio the USB port. A wireless USB transponder using a Cypress 1C is simply plugged into o USB port, just like the familiar Bluetooth USB adopter (which also has a higher data rote of up to 723 kbit/s). Cypress cites the following advantages of their approach compared with Bluetooth: shorter latency [the time required for a connection to be established - less than 8 ms for W i re I ess USB, versus os much os 2 s for Blue- tooth), lower hards vo re complex- ity, lower cost, ond no need for an extra driver (with operating systems having USB support). Like Bluetooth USB adapters, the wireless USB components from Cypress are available in Kvo working range versions: J LS' for ranges or a few metres and 'LR' for ranges up to 50 metres. The Cypress wireless USB family is already in production (since 2003). It uses the 2.4-GHz band which is available far use 'without licensing in most coun- tries, while the frequency range preferred by Intel and the MBOA (3.1-10.6 GHz) con be expected to encounter problems with licensing, as It is often used for military purposes in Europe. Cypress offers a variety of ICs and development kits for users of the WirelessUSB family. At least two units communicating wirelessly with each other are always required for product development. The basic architec- ture of the 1C Is shown In Fig- ure 2, using the CYWU5B6934 as on example. A developer's kit is available for this type and sev- eral other types. Strictly speak- 8 elekloi electronics - 9/2GCH Nearly every single week a new product appears on the market. Choosing the right microcontroller for a particu- lar design is becoming increasingly difficult. Reason enough to appraise the latest developments. In this extensive article Jim Spence proves that an ultra- versatile microcontroller board can be built and pro- grammed even by relative newcomers, included is some very special (freej software that enables even the most code shy among you to make the controller do some- thing. There are two alternatives to communicating with the circuit: USB 2.0 or R5232. Informative Articles Regulars 1 10 Trends in Microcontrollers 5 Foreword & Colophon 16 Microcontroller Buyers Guide 8 News: Wireless USB 56 review copy: Proteus VSM 78 Mailbox 58 USB Embedded Host Controller 80 Quizz'away 66 Bogus Electronic Parts 82 Readers Services 84 Sneak Preview 84 Index of Advertisers 2mm mm 8220 > VU21 193 mss fed Different designs and shapes of elec- tronic dice have found their way into this magazine, but one thing they had in common: they were oil iwo-dimen- sional dice. But now that is about to change! Bluetooth is a huge commercial suc- cess but so for hobbyists and lab workers have been barred from access to ready-made modules for this wonderful new medium, That's about to overturned by ibis article, written using the motto: Bluetooth modules for everyone! A tracking robot does the trick. In recent years, even electronic com ponents are being copied. From the outside these parts are indistinguish able from the original, but on the inside they are pure fake. This can have nasty consequences when you solder one in your circuit! % UGWR2US Juno - LPA Module Figure 5 . The WirelessUSB module made by OEM manufacturer Unigen has o range or more than 1 km. mg, each of the ICs in the CYWUSB69xx family is just an integrated RF data transmitter ar tra n s m rite r/ rece i ve r ( fra nsc eive r] with on SPi interface, which makes it a sari of SPI/RF inter- face [5PI-RF bridge). The CV //USB6934 is a transceiver of this sort with on SPI interface. The only difference between the CYWU5B6932 transmitter 1C and the CYWUSB6934 trans- ceiver 1C is that the receiver por- tion with the RF input (RF1N), shown outlined in Figure 2 # is omitted in the transmitter 1C. The CYWUSB6932 is thus suitable for applications such as a 'wire- less mouse (Figure 3], where It is only necessary to transmit data and the receiver channel is unnecessary. Figure 4 shows a iypicol block diagram of the cir- cuit at the USB host end [PC end]. In this case it is naturally necessary to have a receiver channel, which is provided here by the CYWUSB6934 acting as a WU5B transceiver tor bi-direc- tional] communication. The sec- ond 1C in this circuit is a Cypress enCaRe USB controller, which provides the USB link to the PC. This combination works without any special driver and utilises the Microsoft USB HID class. It supports up to six peripheral devices and offers several differ- ent error correction methods (FEC, CRC and ARQj, as well as 1 23-bit encryption. The circuit does not require any external chokes, and the antenna is implemented in the transceiver 1C. The ICs comply with the USB power saving standards, and all ICs in the Cypress WirelessUSB tamily are optimised for opera- tion using disposable or rechargeable batteries (2.4-3 . 6 V). During this year, Atmel will became the second !C manu- facturer to produce and supply WirelessUSB 7 v ICs. A correspon- ding licensing agreement with Cypress was announced in late June. WirelessUSB is also being supported by OEM manufacturer Unigen which started produc- ing (ow-cost modules using Cypress WirelessUSB compo- nents in June. The first deliver- able product is a transceiver module called 'Juno LPA {Fig- ure 5). The Juno LPA module supports separate transmit and receive antennas and has a sup- plementary RF output stage far an increased range of more than 1 000 m. - ■" 1 - x T x: n Figure 2. Block diagram of a Cypress WirelessUSB transceiver 1C, Figure 3. Basic schematic diagram of a wireless optical mouse with a WirelessUSB transmitter Figure 4. Basic schematic diagram of a Wireless USB transceiver with a USB host link , Web pointers WUSB (Intel) www. i nf el , c om /u pd at e/d epo r tm e n is/ w ireles s / w i 0204 \ . p d r www.i nte I . c om/ 1 obs/wus b WirelessUSB™ (Cypress) www. cyp res s . com /prod u cts/a □ f a s h eet . c Fm ? partn um=C YWU S B 69 3 4 www. deviceforge. cam/artides/AT90 1 5 1 45687.html www.eetimes.cam/designJibrary/OEG2Q031O3 1 S0Q54 www. unigen.com/ p rod u ct/w i re I e s so verv t eve cfm 9 2D04 - elekler efetlraaTcs 9 Christian Tavernier appears on jT 1 | * T t r i \ f r i 1 jT fi ) j iThTS I IXWLLLIW timer. IF oil of this is not enough, the \ 2F675 may be more appropriate. Incidentally, the numbering scheme escapes us. This one is identical to the 629, but in addi- tion provides a 10-bit, 4-channel ADC. These ICs operate from on internal RC dock source up to 4 MHz or From an external crystal up to 20 MHz. Atmel hasn't been sitting idle in this area either, and has the m ATtiny-farhily, which comprises evices nine different versions. Even M m m though it can't really be called >e Old hat new, Jfie ATtiny23 I 3 deserves some of our attention. It has 0 The microcontroller market is mostly dominated by a few 'heavyweights' such as Microchip, Atmel and, to a lesser extend. Philips. In addition, there are many smaller mqnu Facte rers who make very interesting developments in inis area. There are also a number of manufacturers who are not at all that well known for their microcontroller prod- ucts, and are often forgotten as a consequence. Names that come to mind are § * Toshiba with its TMP86xxx- | O'DiT family, and Zilog, the inventor of the famous ZBO, who now COOGClT" offers the Z8 Encore! and eZ80 Families. Also don't fan get Ddfas Semiconductor with its DS89C420, Cypress with its PsoC (Programma- ble System-dn-Chip) such as the CY8C27x, or the, until recently, completely unknown company Cygnal with its C805 1 xxx . The majority of these products, however interesting, will have to have some very desirable properties in order to Vi |j r r. 1 secure a prominent spat in an already overs uppiied mar- ket. A lew years ag6, the PIC from Microchip succeeded in doing this, fer "other manufacturers this is not a prob- lem; Toshiba, ror instance, makes enough end products such os notebooks and other consumer electronics to use plenty oi its own microcontrollers. r ivY^.6 In the area of 'small' microcontrollers it is Microchip who steals the show. Nov/ Shot microcontrollers are becoming more common in remote controls. Microchip has decided to offer ihe rfPIC, literally the radio frequency PIC. This one is part o the small PIC-Family that we discussed just before. In o single package, the rFPIC contains, in addition to the microcontroller, a complete circuit for an ASK- or F$K- transmitter (Amplitude or Frequency Shift Keying). Also provided, to ensure a stable frequency, a VCO (Voltage Controlled Oscillator) and a PLL (Phase Locked Loop), based on the crystal frequency of the circuit. The basic version, the rfl 2C509 comprises a 1 2C509 and a built-in transmitter. But For the creative among us the rfl 2F675 is much more interesting. This is, after all, the aforementioned 1 2F675 wilh ihe radio added. Applying these controllers is very simple, os is illustrated by Figure 2. 3 n irate mostly on the products >, because their broad expen- ded start means that we con Ovative developments to come v larger or smamrf ^ A very obvious trend is that ihe micro- H. f Wk con trol lers o re becom i n g increasingly more powerful: more memory, more inputs and outputs, more integrated peripherals, etc. A (esserTaiown 2 l development is currently in progress at the bottom end of the || g H market, both at Microchip, and, to 11 a smaller extend, at Atmel. / / For example, Microchip developed K |||V I the 1 2Fxxx from the 12Cxxx. The ^'W j different tetter indicates an important Wjf difference: the 1 2C is an OTP {One /./ Time Programmable) device, while the y 1 2F is provided wilh Flash memory, which con be electronically programmed and erased a few thousand times. These chips are available in either B- or 1 4- yr pin packages and are mainly intended for low cost oppl realigns where until a few years ago microcontrollers were avoided because of their size or cost Faithful Efek tor El&ctrohics readers will know the 1 2C508 (Figure 1 ), the first member of this family. But let us first take q took at the 1 2F629, which, in its S^pin package hos the fallowing to offer: I k Flash program memory, an EEPROM 1 28 bytes in size, 64 bytes of RAM, 6 l/O-lmes, an 8-bit and a }&h\t programmable Beside the usual increase of on-chip, integrated memory, the last few years show two more main areas of micro- controller development The first concerns the operating speed. Although count- less circuits are stilt provided with a 4-MHz crystal, the product catalogues from the Microchip, Atmel and Motorola are fell with ICs that will function at 1 6 or 20 MHz. Note that it is not that straightforward to just compare clock speeds. An ATmegal2B From Atmel oper- ates on a clock frequency of only' 16 MHz, but executes nearly all instructions in a single clack cycle. On the other hand, an MC9S1 2D From ihe HCS12 family from Motorola runs a I 25 MHz but requires multiple clock cycles per instruction. The second main trend concerns the specialisation of the internal peripherals. The UART and SPI interfaces have Been common in the higher-end microcontrollers from most manufacturers for many years. But now more spe- cialised interfaces are being added. Virtually oil mono- 9/20B4 - eUkror efedromts Rea r siver/Tran; ‘ iT i imiiter) 1- - - ■ *- — rreq *- . • * uency ma> Figure I. A window through v.hich the memory is erased with ultraviolet radiation. This image will scon he condemned to the past as a consequence of the rise of Flash memory. Figure 2. The RF part tn an rfPlC is easy to use . facturers support the I^C bus. Sometimes the interface operates only in the simplest slave mode, but more often than not. In master mode as well. The USB (Universal Sen lol Bus] Interface, popular because or the PC-market, is quickly making its entry into the microcontroller world. Microchip has the 16C745, the 765 and the future 1 8F2455, 255, etc. Atmel offers the AT91RM3400 and even Motorola has adapted a version of the old 6805, such as the 68HC7G5JBx. The use of microco becoming increasingly important H5 H.L 0 _ c 2 ? rfPtC12FG75 RS 22QQ L2 1£0nH I sop sntenna L3 XTAL C2 SpF XI 1 > fl.B4175l.lHz 1' Ca ttpT CS CJ01ES * 13 1 TDOpF ARM On our whirlwind tour oF the microcontroller world we cannot ignore the products from ARM. Although ARM, strictly speaking, doesn't actually manufacture microcon- trollers, it has provided for many years the 32-bit cores that well known manufacturers such as AMI, Atmel, Cir- rus, Philips, Samsung, STMEcrcelectronics, Texas Instru- ments and even Intel happily use in their own products. We get the impression that this concerns an important development. Why worry about developing your own 32-bit microcontroller when an industry-accepted core already exists? The need for increasingly advanced prod- ucts, which, at the same time, are still easy to maintain and use, inevitably influences the intelligence of each sys- tem: the microcontroller. The need for an ever-increasing number of functions translates into o transition from the traditional 4- or 8 bit controllers to 32-bits. It seems that progress has skipped over the 16-bit versions, because 32-bit offers a much higher performance and unequalled flexibility. Applications Especially in cars, the use of microcontrollers is becoming increasingly important. This has resulted in manufacturers not only integrating CAN bus controllers on their chips but the microcontrollers themselves are becoming more advanced. This is the case, for example, with the ] 8F2332 from Microchip, which can operate or 40 MHz. The same is true for the MC68HC9G8MRx from Motorola. Even In this ocean of digital chips, the * * analogue world ers in cars is has not been far- gotten. These days, all manufacturers have ICs in their product catalogues with advanced analogue/drgital-converlers. An example is the ATmegal 28 from Atmel. It contains o 10-bit, 8- channel model, which operates in normal mode (single ended) as an 8-channel converter. 7-channel differential mode is also possible and 2 channels are provided with an integrated programmable amplifier (1 to 200 times). Far many applications there is no longer the need to resort to an external converter. The addition of internal peripherals has no negative impact on the amount of memory. On the contrary, the better-endowed ICs often contain memories of amazing size. Table 1 provides an overview of the three largest' presently available microcontrollers from Microchip (She 1 BCxxx-family], from Atmel (the ATmega family] and from Motorola (the HCS1 2-family). Conspicuous in this table is the MC512H256B from Motorola (Figure 3) with the overwhelming 99 parallel 1/0-1 ines and 256K-Flash memory. This is quite a bit different than the 687Q5P3 with 20 l/O-lines and ] .6K-memory. Phoenix You know, the mythical bird that rose from its own ashes. There is a microcontroller that we certainly have to give some attention despite the fact that we re nov/ in the sec- ond half of 2004: the 8051 . Even though this mtcrocan- ntroll 12 c!rfcte! d.£ > A * J A- j L im M J_4 aa L- J Figure 3. Photograph of a microcontroller- ohipr higher programming language. Most programmers now select either BASIC or C in preference to assembly. There are now C compilers for all microcontroller fami- lies. This varies from the quite pricey products such as the Table 1 . Main spots of three modern controllers from Atmel, Micrc >chip and Motorola. Parameter ATmega128 (Atmel) 1 3FS720 [Microchip) MC9S1 2H256 (Motorola) Flash program memory 128 K 128 K 256 K EEPROM data memory 4 K 1 K 4 K RAM memory 4 K 3.8 K 12 K 8-bit timers 2 2 0 1 6-bit timers 2 3 1 Capture and compare timers 4 5 8 PWM channels 8 5 6 I/O lines 53 68 99 UART (serial asynchronous interface] 2 2 2 5P1 (serial synchronous interface) 1 > 1 l 2 C interface — 1 1 A/D converter 8 channels 1 6 channels 1 6 channels A/D resolution 1 0 bits 10 bits 10 bits Analogue comparators 1 2 - Maximum dock frequency 16 MHz 40 MHz 32 MHz 9. 200-5 - s! iVfor efedr&nia 13 Figure 4. Although MPLAB is free, it contains everything to develop on application hr a PIC vvrrfi a maximum of user friendliness. Figure 5. Operating principle of in- circuit programming t ISP or tCSP). - It II ;irviti 1 : 1 1 jaq TTil jf t-l— 1 J - - - -■ 4 -ill : t— b r : s£ u at - t ix a— -» ~ ±-Z- t hiiliEEist ■£* I 4 * It ftuliti m - ~-i 1 1 1 1 * i • _ : ■. : : * t " . Tithtuii Z '.'.Z 5»ti filliv Ji- 117 :»/C ; - iMiiit* - u-fi ntuna - iiTii = 4 " I 'l'I i ■ jt : i £ : . i. ; , : it. : i [,ie:ni Jir.7 t fItiib srii" Zri'Z 7 3f*t* I II *1 1 brt rl-w I jay- 7 ■ nfliwl 7 i_£LlA ] i vlrl i'i'iS-t OQOI1&30 G-I-I IGOD-9 00300003 c:vcco-g 5 QCKCCOSM 0 DCMOC-COO 0 Q3SCS S 3Q o aoccootui o a g poo d o Q D2MKKKM d oogim a 6 OwOOCOCEJ ; i ££: E ill J i i . t i4-; £ r * i Ml til* rtut i?w; itm 1 IjiiJarj-ss - Eftfuffei Txso>: *=? T_J Itm DllRtJ dft I;. ry m. ' V * j - — d ] I # -i * t ft-. t I ;i :i iii:i s. ttt tui&i ;:££ tit It *£*"£. ■ji.T i ■- = - -■* 4 r 1 t :i I £ I--II -7 ■ ITILI'lIlLlt 4 A. Z~£^.Z i lsd,A I fc E II l T . ItfTJ | *£.£.. 4*-f Eii v= Ii= — :4 jsiiilia tn t* p 9 is= 1 * ar^tr ttntttl *1 «4t t4 Vmlvtt LKl* ttlfAi-tsi rtfiiitti CCTflC fiK l&Wi Ft-H j-?a»5crc£i cew**« P S ■ ■ 4 -- ■m.wk-m ■ - i-» ii ip ^ " 0K3 03 Cj GO 00 CO &a □0 cc CO cm £2 D3 CM oc nc M2 . gem CO DO M cc CD CM 00 cc n- CM- CM ca CO 00 09 so . com 2-1 CO 02 M CO cm 30 00 CM CM CO 00 CO so SQ . _£2_ _£2_ _£2_ _22_ Ji. Ji. _£3_ JKL _£2L _EL -£2- JSL ■ i- ■« # § 4 a % + * + ■* ; m; - -■ -a - -r -■ ” Lf S/^hc: H » nasmj ws - 3t C si:i CCS C PIC compiler to the freeware PICC-Lite C compiler from Htsoft, which is often sufficient for many applica- tions. For those who prefer not to work in C or assembler there are excellent BASIC-compilers, such as the PicBasic Pro Compiler from Micro Engineering Labs and Proton from Crownhill Associates. For ihe AVR-ramily from Atmel you could use Bascom AYR from MCS Electronics. For the 8051 family there is, among others, o special Bascom version from MCS, and SDCQ a free C com- piler. Only the Most programmers now prefer BASIC or C over assembler Vqu from circuit © Hfi R1 f*E SET microconfiotter 3 1 ISP connector £ S3 v° v° \ SI \ S2 V ” V V 7 to remain tfer of circuit Gp#n during programming mol. Motorola prod- ucts suffer from o sparse availabil- ity of compilers, since the amount on oner is absolutely mini- 040165- IE Accepting the fact that most software developers often use identical programming elements. Microchip has coma up with on original idea: a new program called Maestro. Using this, you can develop an application with next to no actual programming. This development envi- ronment can be downloaded free from the Microchip website and makes it possible to stick together standard modules. In this way a program can be put together nearly automatically. In addition to a compiler, a microcontroller project also requires other development tools. Microchip and Atmel have the upper hand here with MPLAB (Figure 4) and AYR Studio respectively. These development environ- ments, running under Windows, contain everything a programmer could only dreom of o few years ago, including a program simulator. This development is still in progress, because MPLAB is currently up to version 6.5 and AYR Studio is up to version 4, so that even new products are well supported. Despite the remarkable number of features these develop- ment tools ore completely free. You only need to down- load them from the manufacturer's website to get started. It has to be noted that Motorola and other lesser-known 14 el-ktor slettroaa ■ 9/2G04 manufacturers are running behind in this area,, teriainly when compared with these free products. /n circuit programming Although it isn't really new, ISP (In System Programming) or 1CSP (In Circuit Serial Programming) is without doubt the most important development regarding the programming aspect. When the programmer has created the program in ine correct form, microcontrollers that support It can be programmed from o standard PC via a very simple inter- face, while the controller ilselt can remain in the circuit Figure 5 illus- trates the operat- ing principle of this concept. The microcontroller obtains its power supply and clock signal from the PCB. Two or three part pins on the 1C temporarily have an alternative function, which makes it possible to erase and program the program memory. 3f the application doesn't use these pins, then they may be connected directly to a PC. Otherwise a few jumpers or DIP switches may be required to isolate the circuit during programming. All modern microcontrollers with Flash memory support this programming method and on the Internet countless free software can be found for all the various controllers to program them in this way. A program that distinguishes Itself in this respect is FLIP (Figure 6). It is offered free by Atme! and con program countless microcontrollers from this manufacturer, pro- vided they hove some kind of serial interface [RS232, $PI, USB and even CAN-bus). This is currently the most versatile program around. M/croconfrol/ers or not? In this article we must not forget to mention special micro- controllers such as the Basic Stamp, the PIC Basic and the Basic Tiger. These ICs v^ith 24 r 28 or 40 pins have, on a tiny PCB, o fast microcontroller, which is preprogrammed v/jfh an interpreter For a higher language. This is usually BASIC, but other programming languages are emerging, such os Java for the Javelin Stamp from Parallax. Even programming in on object-oriented language is possible with the OOPic. Even though these products ore very successful, they are very expensive compared to real microcontrollers, mainly because of they way they ore manufactured. They seem to be most suitable for experimental applications or small production runs. Conclusion Much more con be said on this topic. But if we have to summarise the developments of the microcontroller area in a few words, then we can say that the advance or microcontrollers in all aspects of electronics is becoming increasingly important These can be either more powerful devices on the one hand or with ever smaller and cheaper versions on the other hand. The application of microcontrollers is becoming easier and easier with free development tools and powerful compilers. The microcontroller has become an Indispensable port of electronics. This is testified by the many projects contain- ing microcontrollers thot have already appeared and wifi appear in Elekfor Electronics. i Free development tools running under Windows contain everything that program- mers until recently could only dream of Figure 6. The FUP io/fware program from Afmel for the in-circuit programming via practically any serial connection. (internet addresses Zilog: http://www.iilog.com/ Author's website (in French}; hllp://wvw.1oveiiiier-{.tom/ Special microcontrollers Parallax: ht1p://www. parallax .tom/ ! Conventional microcontrollers and development tools rnfic http://www.oopir.roai/ V Basic Tiger: hl1p://www.wilke.de/ ARM: http://www.flrm.com/ Atme): htip://www.fltmel.coai/ Compilers Microchip: htfp://wnv,micf adiip.com/ CCS C Pic Compiler: http://www.coin fo.com/ Cy§noL: hi tp:// sww.cygnol.com/ PICC-Life C Compiler: hll p://www.hlsoft.com/ Cypres: http://www.typress.cam/ fiasco m AVR en Boscom 8051: htlp//www.mcselet.tom/ Maioroto: http://m 0 Ksps.com/ Proton - fiosk compiler: hi tp:/ / www.picba5ic.org/ Philips: httpy/vw/wsemicon duclws.phili ps.com/ PtcBnsic (Pro) Compiler: h tl \rjf www.melobsiom/ Toshiba: h lip:// www.1oshiba.com/io ec/ 5DCC Compiler h 1 i pr/Aourcefe rge.net/pr ojeds/ stfcc 9/2D04 - debar detircda 15 versions micro Comparing and weighting microcontroller specifications being largely subjective, it's just not possible to give hard and fast rules to anyone wishing to pick "the best 1 micro- controller for o given job. In nearly all cases the starting point will be the actual application with its very specific requirements* This article does not aim at comprehensive- ness by listing thousands of different microcontrollers but rather summarizes selection criteria to help you reduce the number of micros you could use from stunning to manageable. Speed What is commonly referred to as the speed of a micro- controller is not just dependent on the maximum CPU dock and the clock generator (quartz crystal) — you also need to look at the number of clock cycles the micro fakes to execute an instruction, os well as the program- ming language used (assembler may be many times faster than a higher language). Depending on ihe clock frequency, universal controllers are suitable for applica- tions well into the megahertz range (video processing). Program memory The program to be executed by the micro is stored in non volatile memory. An internal OTP EPROM can be loaded once only, hence the more expensive Flash ver- sion of the controller is usually employed during the pro- gram development phase. Flash memory can be loaded in seconds and is equally simple to erase* This may be done using a programmer or in-circuit (ISP)* These days the size of conventional internal program memory ranges from zero to 1 024 kB of Flash memory (perhaps even more?). tion. RAM on board microcontrollers is usually limited to 4 kB and the actual requirement is often much lower. External RAM Is also possible. Digital Input/Output (I/O) The number of digital I/O lines you'll need in your target application should be easy to tell. However, if the inter- nal resources are exhausted, I/O may also be used to conned peripheral circuits. For simple applications you have a wide choice of controllers sporting little I/O (for example, Atmel s Tiny devices with just eight pins). In some cases, whole ports are required in parallel made, and that's when you cannot avoid those difficult to solder multi-legged beasts. Timers/counters If o program is to measure periods, or count evenrs, fhen fhe controller should have timers and/or counters on board* Fortunately, most current models contain up to three each of 8-bit or ] 6-bit timers/counters under the control of infernal registers* Timers/ counters are also needed to generate a clock-independent signal (PWM, DART], The Watchdog timer is a special case. It is set to an inter- val by the running program having to reset it all the time. Externa! interrupts Nor only fimers/counters generate interrupts. When an external event is to holt the main program execution and force a service subroutine to be run, one or two external interrupt inputs are available on most micros for this pur- pose. Microcontrollers with a little window for EPROM erasure using UV light are now old hot. External windowed EPROMs are now only used in the case oF very large pro- grams — Flash RAMs ore increasingly seen instead of EPROMs* EEPROM When program variables are to be retained even if the microcontroller is switched off completely, EEPROM non- volatile memory, Infernal or external, is called for. Con- trary to some papular beliefs, the number of write opera- tions sustained by EEPROMs is not infinite* In general, external EEPROMs are connected to the microcontroller via a two-wire bus. They are typically used when certain application-specific data [like calibra- tion values) are to be read at the start of the program. RAM RAM is used to stare variables during program execub Interfaces Very useful to hove are on-thip Industry standard inter- faces like I2C, I2S, SPI, CAN, USB, LIN or one for o common LCD, True, such interfaces can be emulated in software, but you 1! find that doing so takes time and deep knowledge of assembly code programming. Analogue hardware Microcontrollers frequently feature integrated interfaces to fhe analogue world* These interfaces Include ana- logue/d igiial converters (with different resolutions and analogue multiplexers In front of them), analogue com- parators and even operational amplifiers (with output to a pin). Modes of operation These are interesting to look ot if a micro is to work In a battery-powered circuit. A number or sub-circuits in the controller may be switched to "sleep' mode to save power* 9/2004 fitter e ledronlts 17 Programmability When the controller has an ISP interface, it can be pro- grammed in the host circuit. If not, you'll need a more or Jess complex programmer. An ISP-less controller soldered into a circuit can not be reprogrammed without a lot of work. Special features There exist microcontrollers that are only suitable for o specific application like motor control, DSP and con- trollers with an RF input section. If you Ye planning a related application, these special devices may be well worth considering. Price, availability, case The price of a microcontroller is not too important if you are doing a one-off project or a small series. However, there's little satisfaction in finally having found the ideal type for your application and then discovering thor the chip is only available in 10,000+ quantities directly from Korea. The enclosure your dream micro comes in is also an important factor, after all, who's capable of manually soldering a 256-pin 'flat-something' cose with pins at sub-millimetre distance? Development Systems & Co. This point is of marked interest to semi-professional devel- opers. If you program in assembler, every new controller family you embrace requires a new language fa be learned. If you do not like that, you either stick to the same controllers for years or invest in a higher-language compiler like C, Pascal or Basic. These products are usu- ally suitable for several controllers, but tend to generate bulkier cade than assembler. To this should be added the cost of a development sys- tem. For some controller families, IDE's are offered of no cost while for others you need to dig deep in your packet. In particular commercial programmers that came with complex pods (controller sockets) may have extor- tionate price tags. wwse : Microcontroller manufacturers overview 4-, 8-, 16-, 32- and 64-bit families Altera - www.aifera.com 32-bits: EPXAxxx (ARM V4T), Nios (Nias) Analog Devices - www.anafog.com 8-bits: ADuCSxx (8051) Cygnal Integrated Products ■ www.cygnai.com 8-bits: C805 1 Fxxx (805 1 ) Cypress Microsystems - www.cypressmicro.com 8-bits: CY8G2xxxx (M8C) AMD - www.amd.com 32-bits: AulxOO (MIPS) Atmel - www.afmel.com 4 bits: T48C5 1 0, ATAxxx (MARC-4) 8-bits: AVR (AVR), AT89xxxx [805 1 ], Mega AVR (AVR) 1 6-bits: C25 1 (805 1 ), AT9 1 xxxx (ARM) ARC International - www.arc.com 32-bits: ARC501 [ARCampact], ARCZxx, ARC6xx, ARCSangent (RISC) ARM - www.arm.com 32-bits: ARM 1 Qxx, ARM 1 1 xx, ARMZxx, ARM9xx, SOxxx, MPCore (ARM) Cirrus Logic - www.cirrus.com 32-bits: CS89Z1 2 f EPZ3xx, EP93xx, PSZ50Qxx (ARM) Cybernetic Micro Systems - www.controIchips.com 8-biis: P-51 (8051) Dallas Semiconductor {Maxim Integrated Products) - www, maxim- ic.com 8-bits: D52xxx, DS5xxx, DS80Cxxx f DSBZCxxx, DS89Cxxx, MAXZ65x (8051) Fujitsu Microelectronics - www.fujitsu.conn 8-bits: MB89xxx (F2MC-8L) 16-bits: MB90xxx (F2MC-1 6) 32-bits: MB91xxx (FR) Infineon Technologies - www.infineon.com 8-bits: C5xx, C868 (8051) 1 6-bifs: Cl 6xxx (Cl 66 vl ), XC1 6xxx (C 1 66 v2) 32-bits: TCI 1 IB, TC19xx (TriCore VI. 3), TCIZxx [Tri- Core VI .2) Intel - wwwJnfel.com 8-bits: 8xC25 1 x, 8xC5 1 xx (MCS5 1 ) IDT - www.idt.com 3 2-bi ts : RC 3 2 xxx [Ml P S j IS bidder dstlr^.iu - 9/2004 T 16-bits: BOCIBx, 8xCx96xx (=MC5-x96xxx) 32-bifs: 80960 (i960), IXC1 100, IXP4 (StrongARM v5TE) Microchip Technology - www. mi c r o c h i p ,com 8-bifs: PtC 1 2xxx, PtCI 4xxx, PIC16xxx, PEC17xxx r P1C1 8xxx, rfPIC (PIC micro) 16-bits: dsPICxxxx (Modified Horvord RISC) MIPS Technologies - www.mips.com 32-bits: 4Kxx , M4K, 24 Kx (MIPS) 64-bits: 20k, 1 OKx, 5Kx (MIPS) Motorola Semiconductor - www.freescale.com S-bits: MC68HXXX (HCOx) } 6-bits: HCS1 2x, M68HCxx (HCS 1 2) 32-bits: 68300 (68K), MCF5xxx (ColdFire), Mcore xxx (RISC), MAC7xxx (ARM), MPCSxxx (PowerPC) National Semiconductor - www.national.com 8-bits: COPBxxxx (Modified Harvard RISC) 1 6-biis: CR 1 6xxxx (Compact RISC) Silicon Storage Technology - www.sst.com 8-bits: 55T89xxxx [FlashFlex 51) Sharp Microelectronics - www.shorpsmaicom 16-btts: LH754xx (ARM) 32-bits: LH7952x, LH7A4xx (ARM) STMicroelecironics - www.sfm.coin 8 bits: ST62xx (ST6), ST72xxx, STZFLife (ST7), uPSD3xxxx (8032) 1 6-birs: ST1 Oxxxx (BOC 1 66), ST92Fxxx (519), STRZxxx (ARM) 32-bits: ST40RA [SH4] SuperH - www.superh.com 32-bits: 5H-4xxx (SuperH) 64-bits: SH-5xxx (SuperH) k Tensilica - www.tensilica.com 3 2-bits: Xtensa V, Xtenso LX [Xlensa] Texas Instruments - www.ti.com 1 6 bits: M5P430xxxx {MSP], TMS470 (ARM) NEC Electronics - www.necel.com 8-bits: 78K0S/Kxl, 78K0/Kxl (NEC K] 32-bits: v850E5/Kx 1 [v8GQ] 64-bits: VR4 T xx, VR5xxx (MIPS) Old Semiconductor - www.okisemi.com/us 4 bits: M5M63 1 8xx, MSM64 1 5xx (nX) 32-bits: ML67xxxx (ARM7TDM!) Philips Semiconductors - www.semiconductors.philips.com 8-bus: P8xC5x, P89LPC9xx, P8xLPC76x (8051 ) 1 6-bits: PXAxxx (XA) 32-bits: LPC2xOx (ARM7) Rabbit Semiconductor - www.rabbitsemiconductor.com 8-bits: Rabbit 2000, Rabbit 3000 (Z80/1 80) Renesas Technology - www.renesas.com 4-bits: M45xx (720), H4xxx (HMC5400) 8-bits: M38XX, M7Bxx, M3754x, H8/380xx (H8) 1 6-bits: M77xx, M79xx (740), H8/30xxx (H8), HBS2xxx (H8SJ, M16C/xx, M32C/xx (Ml 6C), H8/36xx, HBSX/lxxx (H8) 32-bits: SH-xxxx (SuperH), M321xx (RISC) Toshiba America Electronic Components - http:/ / chtps4oshiba.com 8-bits: TMPxSxxxx (TICS) 1 6-bits: TMP96xxxx, TMP9 1 xxxx, TMP95xxxx, TMP93xxxx (TLC5) 32-bits: TMP92xxxx, TMP94xxxx (TLCS), TMPR19xxx, TMPR39xxx (MIPS) 64-bits: TMPR49xx, TMPR99xx [MIPS] Triseend - www.tnscend.com 8-bits: E5 (805 1 ) Ubicorn - www.ubicom.com 8-bits: SXxxxx, IP201 2/2022 (MA5I) 32-bits: IP3023 (MASI V2) Xemics - www.xemics.com 8-bits: E88LC0x (RISC) Xilinx * www.xiltnx.com 32-bits: PowerPC 405 (PowerPC) Ziiog * www.zifog.com 8-bifs: eZ80xxx, ZBxxxx, ZBFxxx, Z8 Encore! (Z80/180) 9/2094 '=!-ktcF ebctronrcs 19 Easy- from High performance Windows based PCB Design Capture, Simulation and Layout softv/are at prices you'd expect from your local computer store ! N>W! in Easy»PC 7 8 Library Databook * Step and repeat plotting • Swap Connection Mode 8 Dimensioning 8 Copy to Metafile plus much more Stop press,., by customer demand, now with Tsien Boardmaker 2 design import., 2BM. WE JS Vrtnd^-s PCF^ I f, ! I £ *.**1*7^ ■- " = - *.* * ~ It*? . r - Number One Systems delivers true 32 bit Windows software applications including features that a few short years ago would only hove been available in software tools priced in the thousands! Test drive Easy-PC ond Easy-Spite for yourself and be prepared to be amozed at the super value... il - » ♦ Call for a brochure, price list and demo CD on +44 (0)1684 773662 or email sales@numberone.com JLL liiUU tttttttt lektor dcfctuur Cp4 f ': r lecltiroinics © CD-ROM Robotics RRP £12.05 \\ (US$21,25) In Robotics, electronics meets information technology as well as mechanical engineering. The meeting results in a boundless experimental field. Do you want to explore it? For beginners the shortest way is along the kits line, while experienced users and programmers are best served by DIY construction. Both options are available on this CD-ROM thanks to a large collection of datasheets, software tools, tips en tricks, addresses, Internet links to assorted robot constructions and general technical information. All aspects of modern robotics are covered, from sensors to motors, mechanical parts to microcontrollers, not forgetting matching programming tools and libraries for signal processing. Robots buiit from LEGO " bricks also get a fair amount of attention. _jC ® £11 : ■ ■ ' r Enter the fascinating world of robotics! r COmte/i I lifuH CTfiP RO. Box 190 Tunbridge Wells TN5 7WY England Telephone +44 (0) 1580 200 657 Fax +44 (01 1580 200 616 See also www.elektor-electronics.co.uk 20 elefeier decfrorics - 9/20-04 Handyscope HS3 2 ch Resolution Menu - 12, 14 or 16bits Sample Rates - 5,10,25,50,100 Ms/s models / Oscilloscope / Spectrum Analyzer / Voltmeter plus! / Transient Recorder / Arbitrary Waveform Gen. / Two hi-z probes 1:1-1:10 / USB 1.1 or 2.0 / Windows OS- all iTp Ltd 28 Stephenson Road. Industrial Estate, St Ives, Cambs. Pe27 3WJ Telephone: 01430 300695 Fax: 01480 461654 info@itp10t.com www.itp101.com www.tiepie.com ■ Servicing Ydur C □ mplete Prototype Needs 0 Prototypes at a fraction of cost ti Tooling and satup included v~ 0 Any contour 1 t ri4 1.6mm, 35pm Cu a-TC££UWl£ EUROCARD tiznf + Tooling t PtlGlQplQtS + m O Industry standard quality 0 Folio w ups tries runs O CAM f CM) consulting £ 29 . 89 * fsZ --5 irsf-.'sny. F \ race - non !*K ' * « 1 fitic limply send you/ /fe oaf onfe/ OWiWf. " eeP sS®® .COM V u : fiTS/? t fctrwrRs TPdTEtl Mt4 & quickly NSI ‘C’ compiler, assembler cer all Windows32 based. Source Level Debug, ml 'Driver Support with H Libraries. A\ Time Multitasking OS with la free run time licence. 5 feE Unlimited email support./ mb r'i ;^[q| sy li ; 12 rn EEpag jjjj' ! [jjj Jus >i 1 wieIiMIm - rjn f I fJ ini / * \ nSl f HU r - '* _ 1 1 ■ || I * 1 3 i i T ut 1 or www. ms. uk. mm see our web site for full details CAMBRIDGE MICROPROCESSOR SYSTEMS LTD Unit 17-18 Zone 'D J Chelmsford Rd. Ind. Est. Great Dun mow, Essex CM6 1XG Telephone: 01 371 875644 email: sales@cms.uk.com 9, 20D4 - Victor tlftlrtmiEj In a fix? Need to get a microcontroller project off the ground FAST? This article proves that an ultra-versatile microcontroller board can be built and programmed even by relative newcomers. The main circuit is based on the Atmel 89C8252 which has an 8052 architecture. Included is some very special (free) software that enables even the most code shy among you to make the con- troller do something. There are two alternatives to communicating with the jSrcuit: USB 2.G or RS232. The original intention of the project was to produce a controller with built in BASIC that could retain the program after switch off, automatically start at switch on and not consist of too many chips. It should also be very easy to use and not require any special soft- ware on the PC. This has been achieved with more or less a single chip. This is possible because the 39CB252 has 2 kB of data EE PROM that can be programmed with high level instruct ions. Trie ATS9C8252 micro was hrst used in the Elektor '5? Hash Micro Board published in Decent her 2001 and now a classic 1 with PCB sales in the k r range. You may well he wondering why not use a BASIC or C compiler on your PC and blow the object code into the micro. Tnese are good options, however you loose the immediacy of your actions. The Swiss Army Knife board immediately executes any code sent to it. TYping: P2l = 0 ai the console will immediately set ail of the port i lines to Low. Also, a level of knowledge is required of the BASIC and C compilers before anything can be achieved. If you simply want to get on with your favourite robot project, then this is the way to do it. Mind you, you can still use the compilers or assembler later when you have done some experimenting. Along the way the author got fed up with incorporating a dedicated com- munication system with every board especially when it was not usually needed in the final application. This lead to a separate power supply and RS232 connectivity that could be used with other circuits. However, as the RS232 format is getting a hit rusty and is not even included on some modem PCs It was considered nice to produce a USB interface as well and of course the USB can power the circuit. The result of the design effort is that you, the user, may choose between RS232 and USB when it comes to talking to the micro in your Swiss Army Knife. The Swiss Army Knife board consists of three sections: microcontroller (MCU). RS232 interface and USB inter- face. Each of these will be discussed separately below. M§€F @ drcmt The MCU circuit shown in Figure 1 contains the popular AT39C8252 microcontroller clocked at 22.118 MHz and programmed with a version of Tiny Basic called Tiny Control Basic (TCB). The circuit shown is about as minim al as you can get. It is possible to program the code memory allowing a mix of high-level and assembler can be used. To facilitate this IG2 has been Included although the chip could be omitted in the finished application or if in-circuit progr ammin g is not required. Regarding connectors, K1 takes all of the I/O lines to a 40 -way header and K2 is a 14- way header that mates with either of the two other boards. Pins 1 and 2 form the serial communication. The handshaking pins are not involved in the serial communication. The ATS9C8252 can be programmed serially using just three lines: SCK (clock), MI3G (output) and MQS1 (input). Using these three lines and sending special bytes it is possible to get direct access to the code memory without I assembler, all in one project re mowing the chip from the circuit, hence the term in-circyit programming. Pin 6 on Kl, the DTK line, initiates tins process and the other pins are as described in Table 1 . The DTR signal enables the top half of IC2 S a tri -state inverting buffer. All of the lines are inverted by IC2 so the software must take this into account. The By Vac ter- minal described further on has suitable software built in. Along with the in-circuit programming there are various other signals avail- able that apply to the USB interface. Pin 5 Is the Ring Indicator. Providing the PC is set up correctly and the USB board is also configured correctly, this line can wake up a sleeping PC. By taking the line low the USB chip will send the correct signals to the PC to activate the PC from a suspended state. For this to work properly the microcontroller cannot be seif pow- ered, as the current available on standby is insufficient to operate the microcontroller without that also being in power down mode. In the power down mode the microcontroller wall not be able to initiate a signal. The USB specification has strict control over how much power can be taken from it and at what rime. A normal USB Is capable of providing a limited amount of current (100 mA) until it is properly configured. Ouce it is, up to 500 mA can be delivered by the USB bus. Pin 7 goes low to indicate that the USB is properly configured. This action enables the lower half of IC2 and as a result the PWR LED illuminates indi- cating that PWR is active and that cur- rent can be drawn from it. Power to external devices is taken from pin 8. Tbe USB circuit (see later) will not pro- vide any power to this pin until it is configured properly. Pin 9 is a signal from the USB interface that goes low during suspend. The user can monitor this line. Pin 14 is power provided from the USB bus, con- 9/2004 -ilrifDf ekdttnks 23 Features - Built-in integer BASIC (TCB) - BASIC can call assembler programs - Instant cade execution, no compiling phase - Only needs a simple terminal emulator to program - Auto Baud detection - User BASIC program, line 10 runs on reset - Can program code memory in-circuit using ByVac-Terminal - I/O connectivity - USB 2.0 option - RS232 option - All software available free of charge Figure LGrcuit diagram of the microcontroller main board (MQJJ. ft employs the 8958252 Flash micro from Atmel. figured or not. This is only capable of supplying about 100mA when the bus is not configured. For this reason, external devices must use the PWR lines rather than Vcc. By monitoring the above lines IC2 can be put into power down mode when the PC goes into the suspend state, RI Can he used to awaken the PC pro- vided the USB and PC interfaces are set up correctly. To do this IC 1 must also be self powered. The Pl.Q LED is connected via two inverters to the PI G I/O line of IC1, this can be used for anything. It is use- ful to have something there for resting purposes. USB Interime The USB interface shown in Figure 2 uses a chip from Future Technology Devices Inti Ltd. (FTDI) and the circuit follows their data sheet. The FT232BM is designed as a quasi-replacement RS232 interface and when installing the device drivers, it becomes a COM port on the PC. Drivers for other oper- ating systems are available. The chip and associated software drivers remove any hassle from building a USB interface. There are only a few aspects of this cir- cuit worthy of attention. The first is the N channel MOSFET that supplies power to pin 3 of K2 when the FWREN signal is low. it is set up this way so that external devices can be powered from the USB bus when the FT232-BM is initiated. The initiation process is called enumeration. The other part of the circuit is IC2. This part is optional and is only required if you need to use the special features of the chip, USB 2.0 for example, or are using two chips in the same system. The circuit will work perfectly well without it. Before going any further it is helpful to know something about the USB inter- face. The interface is incredibly useful in that not only does it provide a high- speed interface but power as well. When first plugging in the device it must draw no more than 100 mA until the device is enumerated. Once enu- merated the bus is capable of supply- ing up to 500 mA, In suspend mode this reduces to 500 UA. All USB devices have a unique, registered ID. The FT232BM has a built in, default ID. For 1 shklw entries - 9/2001 Jim Spence Jim was born in 1953 and has a degree in Construction (1979). He is currently an IT Project manager working for a global IT company. Jim's last article was published 10 years ago in Electronics Today International. That was another single board computer based on a Z30 which ran Forth. Before managing projects Jim was a Lecturer in Computer Aided Design. His main interests are electronics and software languages. Jim says he goes back to the time of valves and has been lucky enough to watch the introduction of transistors, integrated circuits and then see the personal computer industry grow from nothing. jim@byvac.com commercial use the ID must he regis- tered. Also if you intend to use more than one device on the same system then each device must have a unique product ID. It is possible to set all of this up by fitting the E EPROM IG2. Once enumeration has taken place, which is all taken care of by the FT232BM chip r the PWREN line is taken low. This is passed on to pin 7 of K2 so that it can be monitored by the microcontroller if necessary It also activates T1 which in turn allows 500 mA to be drawn from the USB bus via pin 8 of K2. There are two main types of socket: A’ and J B\ The f A T socket is a power provider and is the type fitted to the PC. The type is a power user and to our knowledge comes in about three different shapes, 'The one used on the PGB is the most common although smaller ones can be obtained with dif- ficulty, these are usually found on cam- eras and the like. The FT232BM requires a device driver, even on an XP system. All the device drivers, software and documentation required for the device can be obtained from the FTDI website* The driver needed is the Virtual COM Port (VCP). This will enable you to use the device as if it were a COM port. The EE PROM device, if fitted, can be programmed using the D2XX drivers and one of the many software utilities provided at the site. Note the drivers will no co-exist, you need to uninstall one lo use the other* +5V p'i Gomel old RS2S2 This is for those of you who do not fancy USB. Tne RS232 interface circuit diagram appears in Figure 3, As RS232 port is not capable of enough supply- ing power it is necessary to incorpo- rate a simple 5 V supply into the design* Bridge rectifier BI may strike you as unusual but is well worth the Figure 2. USB interface schematic * extra cost, not only can you use an AC output power supply but also it does not matter which way round the polar- ity is on a DC power supply — just plug it in and it works. Power from the supply is raken to pin 8 on K2 to indicate to the main board that power is available. Pin 7 is permanently at ground indicating to the main board that power is available. The circuit 9/2001 -*! 5 Vter eklnmks 25 COMPONENTS iisr|i ggy, s||;| PCB, order cods 030448-1 Project software on two disks, order cede 030448-1 1 or Free Download. MCU board Resistors; RI-R4 - 1 kD R5 - iokn Cl ,C2 = 22pF C3 = 10pF 16V radio! C4 r C5 = lOOnF Semiconductors: D 1,D2,D3 = LED r low current, colours to personal taste IC1 = A789S8252-24FC Dip40 case programmed, order cods 030448-41 IC2 - 74HC240 K = 40-way boxheader [two pin rov/s] K2 = 14- way socket, angled pins, fwo receptacle rows SI — pushbutton, 1 make contact, minioEure XI =22.1 1 84MHz quartz crystal USB interface All ports SMD. case shape 1 206 Resistors; R1 =\0kn R2 = 2kU2 R3,R4 = 270 R5 = 1 kns R6 - 4700 R7= IkO Capacitors; Cl r C3,C5,C6 - lOOnF C2 = 1 OnF C4 =47nF Rl Figure 3. R5232 interface schematic. Internal RAM 00 -FF 256 by Us SFR 60 - FF 126 bytes External RAM 8000 - FFFF 32 K EEPflOM 0000 - 07FF 2 K Program Flash 0000 - 1 FFF Q K TCB -B K -6K J - 0 DStHlJa - 14 Figure 5. Harvard memory structure applicable to the 8953252 Flash controller in this project. TCB occupies 6k of the 8k available in the Program Ft ash area . formed by R1 T R2 andDl limits the volt- age on the RTS line and make it suitable for feeding into IC1 on the main board. All of the I/O lines are used on IC1 in order to facilitate the in-circuit pro- gramming, Only TXD and RXD are required if the in-circuit programming is not required. Some of the functionality of the USB board is not available to the RS232 interface, so pins 6 and 9 of K2 are left unconnected. €onstruefi&n & tsBfs ansf RS 232 ... If you look at the PCB artwork shown in Figure 4, you'll notice that the MCU, USB and RS232 sections are supplied as one board, order code 030448-1 from our Readers Services. Depending on the connectivity you have in mind for the Swiss Army Knife you will have to populate the USB or the RS232. Sure, you can build both sections but do remember you can't use them at the same time, Tne MCU and RS232 sections are noth- ing special when it comes to building them — simply work along the lines indicated by the parts list and the component overlay. Sockets are of course recommended for the ICs The 14-way connector can be cut from a larger one if required. Voltage regula- tor IC2 does not require a heat-sink. Before inserting the ICs into their sock- ets, connect the MCU board to a 5-V supply and power up. Check with a meter that 5 volts appears at the cor- rect polarity across pins 20 and 40 for IC1 and 10 and 20 for IC2. If all is well disconnect the power, insert the IC s and re-connect the power. If yon have a logic probe or oscilloscope, monitor pin 2 on K2 (pin 1 1 on ICl). Press reset and after 1 or 2 seconds the sign-on signal should be seen. This will be a short burst of pulses at 9600 baud. 26 cltkloi dklrofiks- 7-0 C 7 - lOpF 6.3V SMD Semiconductors; T1 - IRLML6402 1C 1 = FT232BM (FTDl, www. ltd i chip .com) IC2 = do no3 fit (93C46B S08( Miscellaneous: K1 = USB connector, type *B' r , PCB mount K2 “ 1 4-way socket, angled pins, two receptacle rows X 1 = 6 MHz ceramic resonator, 3 pins RS232 board Resistors: R1 ,R2 =2 kfi7 Capacitors: C 1 -C5 “ ] Opf 1 6V radial C6 = lOOOpF 25V radial C7 = tOQpF 16V radial C8 = 1 QGnF Semican ducfo rs: B ! =8800 500, round case [BOV oiv 1 .5 A) D1 4.7V zener diode, 500mW 1C! =h\ AX232 (Dip 16 case) IC2 = 7805 Miscellaneous: K3 = mains adapter socket, PCB mount, angled pins K 1 = 9-way sub-D socket (female), angled pins, PCB mount K2 - 1 4-way angled pin header, two pin raws Hgure 4 > Component overlay for the combined MCU / RS232 / USB beard , order cede 030448 - 1 If you won/ to use USB etfner leave the USb interface section attached to the MCU or separate the two and connect them with □ flotcoble. Figure 6. Finished and tested prototype of the Swiss Army Knife. Here,, the RS232 interface is connected to the main board by means of a connector pc if. 9/2Q04 - elskltt dfetrens 27 ByVac-Terminal ByVac-Terminal does have some built-in features to get rrioxi- mum performance and ease of use from the Swiss Army Knife. Version 1 .0 is free from the Free Downloads section of our website: v^Av elektar-elecrronics.co.uL As on example, to download a program from your text editor you can simply use Send File'. If however you are using the EEPROM memo- ry space then there is a noticeable delay while the program Sine is written. An option on some terminal emulators is to send line by line and insert a delay between lines. This works Fine but you have to cater for the worst cose meaning the download is much slower than it should be. Built into TCB is the lOADB' command that has o very sim- ple protocol and it works like this. After issuing the command TCB waits for a line of BASIC to be sent, when the line is received it is processed and on ASCIi code 6 (ACK) is sent back to the terminal to indicate it is ready for the next line. This simple protocol works exceptionally well and the ByVac terminal has this protocol built in. Another advantage is that ir is capable of using the in-circuit programming features so assembler code can be written and downloaded Into the cade space. We've already seen hov/ to turn the an beard iED on and off using a simple program that you typed in oi the terminal. You con verify that everything is okay by typing: Pz 1-254 Pzl -255 The above action should have tinned the LED on and then off again. You can edit TCB programs by retyping the line, to remove □ line simply type the line number. This however con become very tedious. A much better way is to create and edit the program using Notepad or a similar text editor and then down boding this to the board. Open your text editor ana enter the program below. This is very similar to ihe program you used in the TCB introduc- tion. Note that at lines 20 and 40, instead of assigning a value directly to port 1 a logical operator ('and' 'or ) is used. This will have the same effect but it does not affect any of the other lines on the same port. Observe also the A r.dTert » C:\TempWest.1cb Ffe CtrvrfWt Abc*Jt &{ | jfj »|jg| >|tn if CS -Vlfxi -.Sjftfm Ran Found 0064 b GOFF ;■> - rc-r Fk*n U-Oj Id QTrF rtr Sasdbiictfe £ Se&rgE SSQGjd.SJ - 3 - It goes without saying that IC1 should be pre-programmed with TCB (Tiny Control B ASIC) for the above to work. There is not much else you can do without the other two boards; the MCU circuit is so simple that just about the only thing that can. go wrong is the soldering and component loca- tion (is everything in its correct place and the right way round), ...§snd USB As you can see from the PCB artwork, the USB Interface is connected to the MCU section by copper tracks. If you want to fit the USB interface at some distance from the MCU board, the PCB sections have to be separated by cut- ting or sawing and a small connection cable installed between the respective connectors. Now for some bad news. The FT232BM chip only comes in a surface mount ver- sion and it's a small one at that. You need to be brave to build this but It can he done with a simple soldering iron, solder wick and some solder paste. We would urge you to have a go at this, it's not a beginner lask bnt it’s not impossible either. Unfortunately, solder paste is expen- sive but it does make the process much easier. An alternative to using the paste is to use far too much solder and get rid of the excess with the sol- der wick. The solder wick does such a good job at tidying up that it is not that impor- tant if the solder goes in all the wrong places at first. The most important thing to get right is the oriental ion of the IC1. It must be perfectly in line and square with all of the pads and remain there whilst the first heat Is applied. If It slips then youTe in trouble. We would recommend that you spend a lot of time lining IC1 up and when you are satisfied, solder just a few pins, (one pin if you can) the minimum cov- erage of the author's fine tipped sol- dering iron is two to three pins. If all is well solder the rest of the pins, once in place it is almost impossible to remove. Remove all of the excess solder with solder wick and double check no shon circuits exist between the pins. 28 ffsklor entire.' its ■ 9/2(104 end without a tine number at the bottom of the program, Th is will tell TC8 that the download has finished. In practice, if you forge! io do ibis it still works okay. 10 for j = 1 to 10 20 pz 1 - pzl and 254 30 gosub 500 40 pzl - pzl or 1 50 gosub 500 60 next j 70 end 500 for k = 1 to 20 510 next k 530 return end Save the program with the extension TCB, e.g. "LedFlash.tcb'" If you ore using Notepad be careful to select all file types before saving otherwise you end up with a file colled " LedF lash. tcb. txf". This only happens on the first save but it is something to be aware oh As indicated TCB has a very simple but effective file transfer protocol that the By Vac-Terminal takes advantage oh Start the terminal and use the initial settings as shown in Figure A, Note that the End of line wait for character is checked. At the terminal type LOADS as Figure B. TCB is now ready to accept a basic program using the simple protocol Use File and "Transmit text file or use the forth icon from the left. Select your file TedFiash.fcb and it will be loaded into TCB. The program will load, type RUN to see the fruits of your efforts. To speed things up if you alter the text transfer settings to that of Fig ure C. The term] no I will now type in LOADS for you if you select a file with on extension tcb . Changes to the RS232 settings require the connection between the PC and the Swiss Army Knife to be broken and then restored again. Use the fifth icon from the left to reload the same file. The cycle for development then becomes: t * Edit program 2. Save 3. Use the reload icon 4. RUN 5. Bock to 1 If you want io stop the program running use CTRLC or simply press reset. The beauty of an interactive system such as this is that everything is immediate, you can try things out at the command line and It will be instantly activated. At the end of development you hove your finished product. Two dice programs, one simple and the other, well slightly less simple, io test the above sequence may be found on our website. The other components are not too bad. They were chosen for their large size (relatively speaking). The connector K2 is a pinheader that will probably need cutting from a larger one. Before plugging in the device to the PC, download the FTD! device drivers and unzip to a suitable directory If all is well when you first plug the device in you will be asked for the device driver. Take some time after building to inspect the circuit for shorts, use a meter if necessary. Plug the device into the USB port on the PC or preferably onto a hub to prevent any possible damage to the PC. Although the USB specification calls for short circuit pro- tection, you never know, and a new hub is much cheaper than a PC. If ifs any consolation the prototype circuit was not checked well enough the first time it was plugged into a PC and all the USB devices suddenly stopped working, this included the mouse. It rook a reset of the PC to restore things back to normal — not a pleasant expe- rience. Assuming all is well the PC will detect the new device and request the loca- tion of the device drivers. Install this just as you would any device driver, if you are not sure how to do this look on the FTDI website for information, installation instructions also come with the device drivers for Windows and other operating systems. All being we!! you should now have a new COM port. To find out which port number has been allocated depends on the operating system. For Windows XP this is in the Control Panel — > Sys~ tern. — s- Hardware — ^ Device Manager then open up the Ports tree by clicking on the Hr sign. You should see a new port. If not, re-install the device driver and make a note of any error mes- sages. Comp/efe circuit test Connect the two boards together, use either the RS232 circuit or the USB cir- cuit. Launch the free By Vac terminal utility, see the ‘ByVac-Termiaai' inset. If using the RS232 board you need a straight-through (1:1) cable where pin 2 goes to pin 2 and pin 3 goes to i '5, 2004 - ekktor dgrtonics 29 Table 1 Programming & USB interface J1 Pin Name Function 1 RXD (SCKJ Part or 1C 1 serial, in-circuit programming interface. This is the dock line. 2 TXD Serial output from 1C 1 1 3 CIS [MfSO) Output from [Cl serial programming interface. 4 RTS (MOSI) Input to !C1 serial programming interface 5 DTP Low activates programming mode, also low and back to high again will reset 1C 1 6 R1 Take low to wake PC (requires special set up) 7 PWREN Low o/p from USB interface indicates that 500mA is available on the PWR line 8 PWR 5V @ 500mA 9 SLEEP Goes low to indicate that the connected PC has gone to sleep 10-12 Not used r i3 GND Ground 14 VCC ] 00 mA, 5V pin 3 etc. In some cables the pins are crossed, check this with a meter. You also need to enable RTS in the ICP box. Press reset (SI), wait for a few seconds and you should see the sign-on mes- sage. If not, check that the sign on message is coming from IC1. If there is a signal and you still do not see the sign- on message check the settings, Baud rate etc., check the connectors , cable and wiring. Here's TCB At the heart of tins project is the TCB (Tiny Control BASIC) software that will incidentally run go any 89G8252 sys- tem with or without external RAM. If there is any RAM present it will auto- matically detect it, obviously there is no RAM in this project. There are three ways; you can get the TCB software onto IC1: 1. use the programming interface; 2. buy a pre-programmed chip, order code 030448-41 from Readers Sendees ; 3. use an S9C8252 programmer. Although possible, option 1 is not rec- ommended. the programming interface and software being designed for short progranis(< 100 lines), also it will mean that yon can't properly test the circuits until you have done this so how do you know if the circuit has been built cor- rectly? It is possible however but will take about 25 minutes, see the Assem- bly Code inset. Options 2 or 3 are rec- ommended if you are building the cir- cuit for the hrst time. This processor and its architecture have been mentioned many times in various articles, however the memory aspect must be at least partly under- stood so it is briefly discussed here. Memory The memory space of the 8052 uses an architecture that shares parallel areas of memory. By logically combin- ing the OE and PSEN signals to access the RAM it means that the external RAM can be used as program memory. The 8051 architecture is old and we’re sure that separating out the data and program memory seemed like a good idea at the time. This is what is known as Harvard Architec- ture and in theory at least it means that it is possible to fetch a code instruction at the same time as data in a single machine cycle. Figure 5 shows the memory map and may cause some confusion for those of you who are more used to the conven- tional memory arrangements. The EEPRQM space is pure data memory and assembler programs cannot run in this space, high level programs can. see later. There is provided 256 bytes of internal RAM that shares the upper half of this space with special function registers. The trick to ‘getting at' the various spaces lays in the instruction set. It would take up roo much room here to go into detail but to give an example when accessing the code memory the MOVC instruction is used but when accessing external memory MGVX is used. Other techniques of direct and indirect addressing are used to access the internal RAM spaces. The on-board Flash memory contains TCB, version 1 and only occupies about the first 6 k. If this is good enough for your applications then you can forget ail about the various mem- ory addressing modes, TCB will take care of It. introdoeti&n to programming in TCB The integer BASIC is a modified ver- sion of Tiny BASIC called Tiny Control Basic (TCB) that was designed specifi- cally to enable users to get the maxi- mum out of a microcontroller in the shortest possible time without having to go through a massive learning curve, or installing any special software. The 8052 architecture has three mem- ory spaces that are dealt with by TCB. Internal RAM, EE PROM and external RAM. These are accessed by the key- words IRAM, ROM & RAM respec- tively. Type IRAM and you should see this message: i>iram Internal Ram G0B4 to GOFF OK i> The 1 i> 1 prompt indicates that we are now in internal ram space. As you can see there are only a few bytes but tills is good enough for a 2 or 3 One pro- gram. TCB will let you know if you run out of space. To access the E EPROM type ROM: 30 ebklu electronics- 9/2D04 Table 2, Tiny Control BASIC main specification Numbers: 1 6 bit signed integers range from -32767 to 32767 Variables: single letter A through L (1 2) L Arithmetic: + f % *, /, and MOD Logic: NOT, AND, OR, XOR Comparisons: >, <, =, <>, > = , <= Commands: RUN, LIST, NEW, DUMP, RND, ABS, IF, THEN, GOTO, FOR, TO, NEXT, REM, CALL, RETURN, GOSUB, ROM, RAM, [RAM, LOADH, LOADB, DECIMAL, HEX, LET, PRINT, INPUT, BAUD Special function registers: PZO, PZ1, PZ2, PZ3, ICON, TMOD, TLO, TLI, THO, THI, SCON, SBU, IE, IP, T2CON, WMCON, SPCR, SPSR, SPDR, PCON Interrupt: ONEXO, ONEX! , ONTO, ONT1, ONT2, ONSP, El, DI i>rom Rom 0000 to 07FF OK e> We are now in ROM space and as yon can see there is 2 k of memory from 00 00 to G7FF. At any time you can type ‘DUMP 1 to see the contents of the memory. The advantage of using this space is that it will retain the program even after power down. The disadvan- tage is that it is slower than RAM to write to and there is a limit to how many times you can write to it T approx- imately 100,000 times. In this project there is no external RAM so typing RAM will return an error. AH TCB pro- grams will he written to the EE PROM. TCB is capable of running a program at start up but it must begin with line 10. if line 10 does not exist any the pro- gram will effectively be erased. The start up procedure is as follows: 1. Check for input from user (space bar) - waits about 1 to 2 seconds 2. If no input, check ROM space for a program starting at line 10 3. Run it if it exists, if not check RAM space for a program starting at line 10 and run that. If no line 10 exists and there is RAM it will erase (NEW command) the pro- gram in RAM and the sign on will be in RAM space. 11 there is no RAM then it will come up in internal RAM space (IRA hi). Memory will not be erased if you press the space bar within one to two seconds of switch on. hi this proj- ect of course there is no external RAM so the default will be to come up In internal RAM space T> ' unless there is a line 10 in ROM space in which case it will run the program there. If the space bar is pressed within approximately two seconds of reset or switch on. TCB will detect the Baud rate and come up in Internal RAM space, TBC does not actually erase all of the RAM but simply puts the end of pro- gram marker (FF) into the first byte. You can verify this using the DUMP command after the NEW command. Referring to the MCU circuit, LED D3 is connected to port line Pl.O via two buffers in IC2. By default it will be off. This is because at start up all of the port lines are taken high. To turn on the LED simply type: PZ1=254 i>pzl=254 OK i> PZ1 is the port 1 variable, anything you set this to will occur on port 1. By set- ting port 1 to 254 which is 1111 11 10 in binary it will set pin 0 of port 1 to 0. By convention this pin is referred to as pLO Ify: ROM 10 FOR J = 1 TO 10 20 PZ 1-254 30 GOSUB 200 40 PZ!=255 50 GOSOB 200 60 NEXT J 70 END 200 FOR K - 1 TO 50 210 NEXT K 220 RETURN The above should Hash the LED on and off 20 times. Table 2 gives a brief description of the language. ®df«£s H ends The massive amount of documentation Jim produced for this project would easily fill half this magazine, hence some items had to be moved to our website from where they can he down- loaded free of charge. The items include the illustrated Quick St an Guide — Swiss Army Knife t the Tiny Control BASIC Manual and Simple Dice , so get downloading... Web pointer FT232BM USB drivers: www.ft dlchip.com Free Downloads Byvac-Terminal for PCs (install Fife with supporting OCX files), TCB (hex file}, Fib number: 03G448-1 1 .zip Two simple dice pre-grams (Word fib). File number: 03Q448-I2.zip Quick Stars Guide for Swiss Army Knife (Word file). Fib number 03Q448-13.zip Tiny Control BASIC manual [pdf file). Fib number: 030448-I4.zip PCS layout in PDF format. Fife number: 030448-1 .zip www, e fek tar-electron ics.co.uk/dl/dL htm , select month of publication. 9/2004 ■ ekktor sbtlicaks 31 Assembly code At some point in time more control or foster speed may be required than a high level language can give. There is no alternative but to resort to use assembler, which es the direct equivalent to programming the processor itself. To do this effectively you will need an assembler. This is a program that translates 2 to 4 letter mnemonics info num- bers that the processor can understand. There are many available free for this processor. In the examples shown ASM5 1 ' hos been used. l\ can be downloaded from vari- ous sources. RAM would be required to run assembly cade using the LOADH feature but none is available in this project. However, we have free code space in EEPRGM starting at 1700h which is accessible through the in-circuit program- ming feature. Getting Started Always the hardest part? You can't really program in assembler without knowing something about the processor and for this you will need at least a data sheet for the processor and some knowledge of the 8051 / 8052 instruction set but the following example will get you on your way. Example program We will keep on Familiar ground by flashing she on board LED again. As you know, to do this we need to set PI .0 to zero and back to 1 again* } Example of flashing an LED ; Use Asm5I ; PI, 0 has the LED connected to it $MQD8252 cseg org 1700h flash: ; pulse P 1 . 0 up setb pl.O call delay clr pl.O call delay 9 jmp flash t delay : ; delay mov rO r #0f Oh de!2 ; mov rl r #0 dell: nop djnz rl ,deli d jnz rO , de!2 ret end The operation of the program is conveniently explained by means of a table. &M0D8252 First of oil Inis contains oil til the special names ossocioEed with that pro Lessor so this needs lo be In place for our 8958252. Cseg Tells the assembler thal the following is cede, (here is □ cor- responding dseg’ for data. Org This is the program origin address. TCB finishes at about 1 6 5 Oh so we don't want to be nny lower than (his other- wise we will da mage TCB. setb pl*Q - - Sets the bit 0 of port l to high, just os pzl— 1 would do. Call Is the equivalent of gosub delay: This is a subroutine, nalice ihe asm51 requires this. Because of Ihe raw speed of ihe processor 2 delays are required* In fact this carries out over 61,000 instructions before returning which gives o delay of about 0.25 second. RO , =0f Oh RO is o general purpose register of which there are 8, RO- RY There ore in fad 4 bonks of them hut only one bank can be used ol a time. What this instruction does is to place the value of FO (hex) into register RO. The is known as an 'immediate' modifier. If you did RO J OfOh then ihe con- tents of memory address FO would go inlo RO. (yes (here is plenty of scope for error). Djnz Tnis is Decrement and Jump if no! Zero so on the inner loop Rl will be decremented ond if it is nol zero then the program will jump lo the label deflf. Somelhing to note here is ihal the register is decremented before zero is test- ed so a register slanting out wilh a value of im will be decremented to FF before being tesled. Assembling Use Notepad or any text editor to create the above pro- gram, save it with an 'asm' extension, for example FlashLed.asm. Now ihaf the program is written it needs converting to a format that the processor can understand. To do fhis you will need to use the command prompt if you are using the Windows operating system. If you are using DOS then you are already there. Choose a directory to put the files in, you should have FlashLed.osm, Asm51 and AAOD8252 in the same directo- ry (unless you know how to set paths up). At the prompt type asm51 FlashLecT* On pressing enter you should see something similar to that of Figure A. Note that Asmdlor indeed any other 8051 assembler has to be obtained sep- arately, it is not included with the software for this project. This process produces two files using the same file name bur with different extensions thus: HasLed.hex and FlasLed.lst. The LSI file is where you will find ony errors if there are any and the HEX file is □ special format devel- oped by Intel to enable code to be loaded into processors. As a matter of interest the format consists of lines of text preceded by a colon. :1 01 70000D290 1 2 1 70CC2901 2 1 70C80F478F07900A6 The first two numbers J I0' is the length of the code in hex, the next 4 numbers is the memory address, in our case 1 700 this is followed by a record type which is almost always 00. The rest of the line consisted of the actual code to be loaded at the given memory address except for the lost two numbers, 66' which is o checksum to verify that the line has been received correctly. 32 ehktw sortie is - 9/2034 V' J 88 Load Up The next job is to load this program into code space. This where ihe special features come in. Click on the 101 icon and the background will turn black. We are now in Rash programming mode. Press p and the text will turn yellow this indicates that we will be using Program or Code space (the flash memory area). Typing and then "99 will enable you to view the contents of the code memory from memory address 0088 to 0099. This is where the sign-on mes- sage of TCB is located. Alt numbers are in hexadecimal format, see Figure B. To program this area with our assemble program type J h This will pop a dialog box that v/ill allow you to select the FlashLed.hex file. This will be loaded info the memory and you should get some- thing like Figure C. Programming will now commence automatically (and if does take some time to complete). is This will start flashing the LED whenever applied to the board. Okay so a flashing rations but we're sure you get the idea. is power LED has its liml- ] j*i DrxBVUflCvPHACTmsFLflSHL^iycisfi^I flap hied 8651 Ci'flpp- flssenblei'-, Uers ian t .2 )i Coiiyi-iglit 1984, J9K5, t9Gfr. 1987, 1988, 1989, Ik; He t a Link Corpordi, ion Fiist pass Second pasrs ASSEMBLY COMPLETE, 0 ERRORS FOUND t> : \HYU ACvPRfiCT 1 M'LASIIL^l 199H Running the program First of all get back info terminal mode by pressing V or the '10T icon. To run this program TCB has provided CALL. The syntax is CALL n where n is the address you wont to jump to. The address we chose to put the program at was 1 700h, TCB works by default In decimal, to change this type HEX. Another word of caution, everything is in hex from now on until you reset or type DECIMAL This applies to normal basic program, hex line numbers look very strange. Type the Following to run the program: 4_ A r-'e 'wrAc-rt Abm. ir PJt Gomote mods - use HEX Data jpemray Mj P. D • ' V. H ? rrseriioiy space I rrpjde yfp HE C Piopiin miinoty M P 0 vV H ■ V [Comofc mode - use HE; ; PfcMparf* -rpaeeCtiffifflarfdi M P D..>! V H ? HEX CALL 1700 if you don't want to use HEX then CALL 5888 works just os well, 5888 Is the dec- imal equivalent of 1 7G0h. The LED should now flash indicating ihot you are running the assembler program. Note because this is such a simple pro- gram, the only way to stop it is to press reset. Do this at the terminal using the icon next to "101 or using the push but- ton on the main board. Once in flash memory, the program will remain after power is removed. Because of fhe slow serial programming nature It is not really suitable for large files. Although this can be done, expect TCB to take about 25 minutes for the basic. hex file. Some things simply can't be done using TCB alone, this feature makes the project completely versatile. You can quite happily use a mixture of TCB and assembler. You can for example assemble the code at address 1700 and use o simple 2 line basic program: 10 HEX 20 CALL 1700 I $?aji Address (return toi El) 00 ^ E nd Addle i i 1 rekun toj Of 0050 00S8 OD 54 43 42 20 2p 20 % JC8 - V QG0O 31 28 78 28 20 2D 20 53 73 73 1 p| Sys Cttrisote ri»de ■ use HE! ' Piogiaflj nrneflftoiy iprceCcmrnaixfc M P & ; i V H r ? | S elEiri^s: 3800. a 8,1 j llfr - pjiiBfUil 31 m 1 rts- COiT rr-- c-rt About f 1 2 1 Jd id _J _ 1 1QT H ET- | End Addffci - lieJtum for 0| 33 OflSSOO S 4 43 42 20 2 D 20 5 G ,TC 8 -V OHO 31 28 78 29 29 20 20 53 73 73 1 (*) Sys I jm I Console mode * use HE I Piogiarn ritemoiy spaesComfn^rtds M P D.X V H ? h I L oTisofe r^>de - use HE; Program memory ;pace£o«rrtands U r P. D,X,Y„ H, 7 M 0170000D 2301 21 70CC2301 21 7QCSGF4?M73GGfcb 061 7 tCOOflOD 9 FDO®f 922 te OOUOOQOIFF |Coosc 4 e mode - u;e he; ; | Program memory s^crCufmriands M P 0 K, V, H. ? I I Settings; 96 QQ/l82I 9/2004 - clsklor efectronks 33 Paul Goossens Projects for electronic dice have previously appeared in Elektor Electronics. Different designs and shapes have found their way into the magazine ; but one thing they had in common: they were all two-dimensional dice. But now that is about to change! Electronic dice are usually constructed on flat boards. To give the impression of a Teal dice, seven LEDs are often used in a pattern similar to that on a dice. The original intention was to base this circuit on a traditional 'flat' design, until somebody from the edito- rial staff suggested that you should really be able to throw a dice. After all. a dice is not an item that lies still on the table. s But that is the advantage of an elec- tronic diceF you'll say. You don't need extra space to throw it and it ivcn’r roll off the table either. And this was exactly how our design staff reacted to this unusual suggestion. But the editor was adamant: this dice has to roll! Fortunately the team at Elektor Elec- tronics handles such situations smoothly and it wasn't long before the lab were prepared to have another look at it. It didn't take long before the nisi ideas were put on paper. One obvious design for an electronic roiling dice is to mount LEDs onto a cube, showing the proper value on every side. The LEDs are driven via current limiting resistors from a 9V battery and Bob s your uncle! It quickly became apparent that with a homemade dice it was extremely dif- ficult to get the centre of gravity exactly in the centre. Such a dice would therefore have a bias. The chance that the lightest side ends on top is greater than for any of the other sides. The value on that side will there- fore occur more often than the value on the 'heavier side. N&w ehef After some more thought we came to the conclusion that a dice with seven LEDs on every side was the best option. After throwing the dice, the six sides would each take on a differ- ent random value. In this way you can guarantee that the dice is com- pletely 'honest'. This solution does require a bit more electronics. First of all, you have to detect when the dice is in the process of being thrown. For this we used a mercury tilt- switch. This also makes it possible to 'roll' the dice just by shaking it. The electronics then has to generate the random numbers that appear on the six sides of the dice. Toe use of a microcontroller comes to mind straight away This keeps the circuit relatively small, which comes in handy for a dice. Another part of the design that required some thought is the method used to connect the boards together. It doesn't look very nice if dozens of con- nections go from a main PCS to the other five boards. To keep the number of connections down we've chosen serial connections between the boards. On every board a shift register takes care of driving the LEDs. This way only four connections are required: two lines for the supply, one for data and the fourth for a clock signal. Another area that needs to be consid- ered is the current consumption and on off switch. In this design a standard switch can t be used of course, because nothing may protrude from the dice. It would otherwise roll very strangely and at worst switch itself off. We got round this problem with the addition of a (recessed) push-button to turn the circuit on. It is turned off com- pletely automatically. Mesh* P€B After these considerations we arrived at the circuits for the dice. At the hart of the circuit is ICl, a microcontroller by Aimel (Figure 1). We have used this type previously and have given a detailed description in pasi issues of Elektor Electronics. It therefore suffices just to mention that the software for this project can be freely downloaded from the Elektor Electronics website. As this controller has an internal hash memory for the program there is no need to add external memory. Crystal Xi in conjunction with C2 and Cl pro- vide a clock signal. IC1 drives the 7 LEDs directly via its I/O pins. As we have used low-current LEDs there is no need for an extra buffer. The supply section may appear a little unusual at first. This is because we want to turn die circuit on with a push- button and let the microcontroller itself turn the supply off. The part of the cir- cuit round T1 and T2 provides this function ality. K2 is the connector for the 9 V battery. When push-button SI on board 2 is pressed, a small current will flow from - 9 V via the base emit- ter junction of T1 and R8 to ground. This causes T1 to conduct, feeding a current to voltage regulator IC2. This then supplies the rest of the circuit with 5 V. When the push-button is released, the current can no longer 0ov. T through R8. It is of course undesirable that the cir- cuit would then lose its power. Just try to keep the push-button held down during a throw; it r s not exactly user- friendly for a dice. To get round this problem we've added resistor R9 and transistor T2. T2 is driven via the microcontroller. When the circuit is switched on, T2 is also turned on, causing a current to flow from the base of 71 to ground via R9 and T2. The supply is then no longer dependent on SI being pressed. When the processor notices that it has- n't moved for a while (several min- 9/2004 -ehhdf didrcnTcs 35 C4Q24S - 11 Figure !. The main heard is more complex. utes), it stops driving T2. The dice then turns itself off automatically. When switch SI is pressed again, the whole sequence repeats itself. When the supply is applied a reliable reset signal is generated for the micro- controller by C5 and RIO. The OLK and DATA signals are fed to the next board via connector K3. K3 also has connections for the supply and the on-switch (pin 5). The switch had to placed on board 2 due to a lack of room on the main board. Other hazards The circuits for the other boards (2 to 6) are almost identical. The main differ- ence is that circuit 2 has a switch, which isn’t present on the other boards. Figure 2 shows the circuit diagrams for hoard 2 and the other four boards. There is obviously no need for a feed- through connector (K2) on the last board. At the centre of the circuit is the shift register, a 74HCT4094. This type of IC has a parade I output register. Every rising edge at the clock input causes the 8 bit data in the IC to shift by one bit. The first bit then takes the value of the data input. The last bit shifted out is connected via pin 9 to the data input of the shift register on the following hoard. This effectively rums all boards into Gne large shift register. Construttion The construction of the boards differs in a few ways from the usual method, in several places we have used stan- dard components,, which have to be surface mounted. The reason for this is that we'd rather not have any leads sticking out through the boards. This would result in a number of sharp points on the outside of the dice, which would damage your furniture when the dice is thrown, and this obvi- ously isn’t our intention. To make things clear, we've included a senes of photos of the construction of the proto- type in Figure 3. as a picture is often worth a thousand words. The component layouts for all boards axe shown in Figure 4. First of all r the SMD components are soldered to the boards. Then it is the turn of the IC sockets, which also need to be surface mounted. You need to bend the pins outwards and cut them to length {take a measurement from the board first 1). Next it’s the turn of the 42 (!) LEDs. Tne 36 ddlQf dakor.Is- 9/2004 leads of the LEDs need to bent in the right form, as shown in Figure 5. Take gTeat care that the anode and cathode are positioned correctly on the board. The case of the LED is then stuck through the hole. The ends of the leads should now be Hat on the board, where they can he soldered. At this stage it is not important if the LEDs are nor all at the same height. Alter soldering all LEDs they are pushed outwards such that they stick out just a little above the surface of the dice, if we now press the board onto the table, the LEDs should ah be at the right height. Apart from the ICs in D1L packages, there are a few other components that have 'normal' leads. As we don’t want the outside of the dice blighted by pro- truding leads and solder, these also have to be surface mounted. This includes the crystal and the mercury tilt- switch. The leads of these compo- nents have to be cut fairly short., and the ends turned through 90 degrees. These ends are then soldered onto the board. Ihke care that you don't shorten the leads too much! ConneefSstg fhe hoards Once all boards have been populated it’s lime to connect them together. Fig- ure 4 shows how this is done. You should use individual pieces of wire for this, with a length of about 5 cm. If the wires are too short it makes it more dif- ficult to hx the boards together at a later stage. There would also be a greater chance that one or more of the wires became loose! Lastly the ICs are plugged into their sockets. (Make sure that you plug them in the right way round!) Now that the electrical construction is Figure 2, Above is the circuit for boerd 2. beneath it the circuit for Jne other four finished, the circuit should be tested. It is wise to do this before the dice has been fully assembled. At this stage the electronics are s till easily accessible, should you need to make any repairs. After you have carefully checked for short circuits you can connect the 9 V battery. When you press the switch (on board 2), the circuit will come alive and a random number of LEDs lights up on the boards. If you then shake board 1, the dice will simulate a roll. The numbers on all sides will change regularly. After a few seconds the changes slow down and the result of the roll is shown on the boards. 9/2004 - efeltlsr the! rode 37 3D The electronics may now be com- pleted, but it doesn't look anything like a dice yet. The boards now have to he fixed together into a cube. Board num- ber 4 is placed flat on the table and boards 2, 3, 5 and 6 are fixed at right angles to it (see Figure 6). Use a plastic angle section (available from most DIY stores) to fix the boards together. Yon should cut the angle sec- tion into small lengths and use these to glue the boards together. You shouldn't glue the last board (board l) r since this has to be removed every time the battery needs replac- ing. You need to glue a piece of angle section on the other boards, such that they line up with the 3 mm holes in board 1. Now carefully drill a 2.5 mm hole through each angle section at the point where it meets the mounting hole of board 1, then make a 3 mm thread in it. If you want a stronger litre ad you can glue a flat piece of plas- tic onto each angle section, which should be drilled and threaded as well. The inside of the dice should be filled with cotton wool or foam rubber, pre- venting the 9 V battery from moving or causing a short circuit. You can now screw board 1 into place. And §ssi&ISy You could give the dice a nice lick of paint, as we did with our prototype, but we leave that to your own prefer- ence. In any case, we hope that yon enjoy constructing it and have fun using the dice in many games! COMPONENT LIST PCB # 2 Resistors: R1-R7 = 1k£25 SMD R8.R9 = 1 Oka SMD RIO = lkilSMD R1 1 = lOOkilSMD ABS (hard plos'ic) angls section 2 /v'i3 screws (countersunk head) PCB # 2 through # 6 (per board | Resistors: R1-R7 = lfc£15 SMD Capacitors*, Cl = lOOnFSMD Capacitors: Cl ,C2 = 22pF G3,C4 = TQOnF SMD Semiconductors: D1-D7 = LED 3 mm, red low^currenl IC1 - 74KCT4Q94 C5 = lOpF 16V redid Semiconductors: n 1 _p 7 - 3 mmy re d, low-current i = ATB9C2G51-12PI, programmed, order code 040248-41 tC2 = 73L05 T1 - BCP28 (Conrad Electronics # 1 63225-8 B) T2 = BC547B Miscellaneous: XI “ 4MHz quarlz crystal 51 = mercury switch (Fame!! # 178-338) 9-V battery wiih dipan lead 20-way 1C socket 38 drifc-i tls-ftronia- 9/2304 Order of construction - Solder the SMD resistors and capacitors Bend and cut the pins of the iC sockets - Solder the IC sockets - Bend and solder the LEDs Prepare the connections between the boards - Testing - Connect the boards together - Add cotton wool and the battei - Fix the last board into place Final test Miscellaneous: 1 6-way 1C see kef 5 i ~ switch type DT56 1 K [only on board # 2 ) FCB r order code 040248-1 (contains six ssetions For a complete dice) Disk, source and hex code Fibs, order code 040248-1 1 or Free Download Figure 4. Component layout. Four of ihe six hoards ore almost identical. r-sn-cr-i! f/gyrs 5. Bend ihe leads of the LEDs according to this example. © Figure 6. The six hoards make up a cube. 9/2G0J - editor ekdrcrki 39 kitchen-table I — ^ — i I - even at standstill! Ralf Nolde _A autumn approaches cyclists become more aware safety and in particular their visibility to other road users. Dynamo lighting offers the cheapest running costs but has the disadvantage that when the wheels stop rolling the lights go out. This neat circuit stores energy while you are moving to keep the ight shining even when you stop. 4 i 40 tl filer elEtlrnnks ■ ?/ 2 fi 04 see text BC547B R3 r n C3 □ □3 12 GOLOCAP Q5 IF 5V5 V© 05 BC547S R4 f- cv 2x 1N4148 030093 ’11 Figure 1 I he circuit looks similar to a stabilised mains power supply. It is not too difficult to construct a sim- ple and reliable rear light unit for a cycle dynamo using high visit) ill ty LEDs. They have a much longer lifes- pan than filament lamps and this design uses a high value capacitor to store enough energy to keep the lamp burning for a few minutes after the cycle has come to a standstill. The circuit The circuit diagram for the rear light is shown in Figure 1. A typical cycle dynamo will only have a single output terminal; the return path is made through the dynamo body and cycle frame, A connection to the frame will form the earth input while the dynamo output is wired to the D input on the circuit. Rectifier B1 produces a ruLL- wave rectified DC voltage and capaci- tor Cl provides some smoothing. The Goldcap capacitor G3 is charged from the rectified dynamo output through resistor R1 and transistor Tl. The zener diode D4 fixes the base ofTi at 6.2 V and its base-emitter drop of 0.7 V ensures that the voltage output at the emitter does not exceed the 5.5 V maximum voltage rating of C3. Capacitor C2 smoothes the voltage ref- erence and resistor R1 limits the charg- ing current through the transistor. The constant voltage produced by Tl is used to charge C3 and also pro wide energy to light LED D3 when the bike is moving. D3 is an 8 mm diameter ultra bright red LED with a clear lens and a supply current of 26 mA, The T' suffix indicates that this model has a high luminous intensity in this range of LEDs manufactured by Kmgbrighi (available from Maplin). The LED is driven by a constant current source formed by T2 and this ensures that its brightness is largely independent of the voltage stored on G3, Diodes D5 and D6 fix the base of T2 at approxi- mately 1.4 V which in turn defines the voltage drop across R4 at 0,7 V because it is equal to 1.4 V minus the base- emitter conduction voltage of T2 {Vg£ ’ 0,7 V). With the voltage across R4 fixed a quick application of Ohms law indicates that the current through R4 (and therefore D3) is constant at around 26 mA. With the bike at standstill LED D3 is powered from energy stored in C3. Using the components specified D3 remains lit for at least two minutes before any decrease in brightness is noticeable. This afterglow period is defined by resistor R4 : increasing its value to330or39Q will prolong the afterglow at the expense of reduced LED brightness. The light intensity of D3 is much higher than a conven- tional filament lamp but has a smaller beam angle. The two 'driv- ing 1 LEDs D1 and D2 are powered directly from the dynamo output and are positioned either side of D3 to increase the effective beam angle of the rear light assembly when the cycle is moving. Current consumption of the circuit is approximately 45 mA and with a dynamo output voltage of 6 V this gives a total power consumption of around 0.3 W. This figure is about one half of the power consumed by a con- ventional filament type rear lamp and reduces loading on the dynamo. The effect of this is that the voltage to the front lamp will be slightly increased 9/2004 - sector dedrcuits 41 UK laws al a standstill? In the UK fights on a bicycle are not required when stationary and to comply with the law the lamp should have a filament! British Standards have been updated to allow LED light sources and these have been commonly in use for a number of years but to be legal the lamp should have a filament* So a lamp with a BS approval could be illegal. The (aw is seldom if ever enforced on this point and rightly so because it's safety that matters. Cyclist also use flashing lights even though they are also technically ille- gal. Surveys indicate that most cyclists (about 90%) use battery powered lights. The two documents concerning cycle lighting are the 1989 Road Vehicle Lighting Regulations and British Standard 6102 part 3* Any form of home-made lighting will not have BS approval. The Bike Tail Light described in this article should only be used os a secondary means of lighting which is fitted together with a BS approved system. COMPONENTS LIST Resistors; R1 = 12Q R2 - 1 fcQ R3 = 3kQ9 R4 - 270 R5 = 3900 R6 = 1500 1W Capacitors; Cl = lOOuF 35V radial C2 = 22uF 16V radial C3 - Goldcop IF /5,5V (Conrad Etsoiranics # 473 1 20] Semiconductors: B1 = B8CC15CD, round ca=s (80V iv, 1 .5 A) Dl,D2 = LED t red, 3mm. KingbngHt L- 9345 RC-J (Rsicheif, LED 3 3500RT} D3 = LED super-red, 8 mm, Kingbrighf L- 7935RC-F (Mcdin # N46AT) D4,D5 = 1N4148 D6 - zener diode 6.2V, 500mW T1 J2 = BC547B Miscellaneous; Bike rear light cose, Busch & Muller type 339 ( w.'/. b u m m . d e / docu / rueckllcht 1 .him (UK distributor: Amba Marketing) PCB, available from the PCBShop Figure 2 . The small PCB is designed to fit into a standard rear light assembly. and it will born brighter for a given speed. This will reduce the front lamp lifespan if you habitually descend long hills at high speed. Resistor R6 is fitted as a 'dummy ioad : to avoid this potential problem but if you never break into a sweat while pedalling and your cycle is the type fitted with wicker baskets, you are unlikely to need this precaution and R6 may be omitted. C enstruetion The circuit can he built on the single- sided circuit board. The PCB layout accepts conventional wire-ended com- ponents with some of them fitted to toe underside (alternatively you can keep them all on the same side by fit- ting R5 over the top of D5/D6 and R6 under rectifier Bl). The PCB is quite small but this should not pose any problems when mounting the components. It is important to dou- ble check that all polarised compo- nents (diodes, transistors and elec- trolytic capacitors) are fitted the cor- rect way round before power is applied to the circuit. A 9 V battery or mains unit can be used to test the unit. The power source is connected in place of the dynamo, polarity is not important because the bridge rectifier ensures that power will always be correctly supplied to the cir- cuit. At power-up all the LEDs should light and after a short charging time the voltage across the Goldcap can be measured (approximately 5.5 V) while the x'oltage drop across R4 should be less than 0*75 V Once the circuit has been tested, mask off the LEDs with tape and give the whole unit a few coats of spray lacquer to protect it from the effects of the weather. Once the lacquer is dry ihe unit can be mounted in the taillight housing. The PCB is dimensioned to fit in a housing type 339 made by the company Busche & Muller and distrib- uted on the UK by Amba Marketing, It can also be adapted to fit into any sim- ilar rear light housing. For the housing specified, the PCB is fitted behind the reflector part and fixed with a smalt (rust proof)- self-tap- ping screw. Cycles are subject to sur- prisingly high levels of shock and vibration so it is a wise precaution to support all the major components like capacitors transistors and LEDs with an application of hot-melt glue after the circuit has been fitted and wired to the dynamo. Lastly fit the rear light lens and ensure that the LED is cor- rectly aligned with the reflector lens opening. 42 drdioniu- 9/2004 FRUSTRATED! Looking for ICs TRANSISTORS? A phone call to us could set a result. We offer an extensive ranee and with a world- wide database at our fingertips, we are able to source even more. We specialise in devices with the following prefix (to name but a few). 2N 2SA 2 SB 25C 1SD 2P 2SJ 2SK 3N 3SK 4N 6N 17 40 AD ADC AN _AN1 AY BA BC BD BDT BDV BDW BDX BF BFR BFS BF T BFX BFY BLY BL_\ BS BR BRX BRY BS BSS BSY BSW BSX BT BTABTB BR\Y Bl BUK BIT BUY BUW BUX BUY BUZ CA CD CX CXA DAC DC DM DS DTA DTC GL GM HA HCF HD HEF ICL ICM IRF J K_A Kl A L LA LB LC LD LF LMM M5M MA MAB MAX MB MC MDAJ MIF M1F MM MN MPS MPSA MPSH MPSU MRF NJM NE OM OP PA PAL PIC PN RC S SAA SAB SAD SAJ SAS SDA SG SI 5L SN SO STA STK SIR STRD STRM STRS SV1 TTATAATAGTBA TCTCA TDA TDB TEA TIC TIP TIPL TEA TL TLC TMP IMS TPU U UA UAA L C UDN ULN UM UFA CPC LTD VN XXRZZN ZTS - manv others We can also offer equivalents (at customers' risk* We also stock a full range of other electronic components Mail, phone. Fax Credit Card orders and callers welcome Cricklewood Electronics Ltd 40-42 Cricklewood Broadway London NW2 3ET Tel: 020 8452 0161 Fax: 020 8208 1441 PtcoServ provides all that Is required to enable an Internet web server to be Integrated into your system or product, providing remote control and remote access via the Web or mobile phone Simply Embed the Internet with PICO SERV Creating a ;.eb browser or mobile phone based interface is s T,p:a using the modular PicoSer, system. The PfcoSe/v web module takes care of o Network interfacing o Internet protocols # iVeb page storage PicoServ yo modules provide simple analogue 2nd cigiia 1 interfaces io the real world and the SMS gaie.va, module elfOAS remote access us : ^g 3 me a e phene, Basic K1ML programming is all that is required for you to be rapidly in control of your system from anywhere! Com - r ‘2 Kit us*?,.. www.computogic. inf cj;| ccsTtpulDgi c.co. uk CS& t 44 (0j 1234 756048 FM)USTRHi4UnJ T ^TlCV * fl£V!GT£ SEH&t ‘iG • fiEWTECOWTROL o EtYiimvsmM, msrwmsG lumMQHijmsG o EVSJGEVCT CU1 o LOW COST 0 UJjYPgUEH O SVVJ1 SIZE O 5 a lektor lecfrohties Flash Microcontroller Starter Kit Elektor Hardware & Software Contents of Starter Kit: 89S8252 Flash Microcontroller board (ready-assembied and tested PCB), 300- m A mains adapter, serial cable for COM port an a software bundle on CD-ROM. Article compilation on CD-ROM: ■ 89S8252 Flash Microcontroller Board (December 2001) • Microcontroller Basics Course parts 1-6 (January through June 2002) * Microcontroller Basics FAQ (September 2002) * Port Line and ADC Extension for 89S8252 Flash Micro Board (December 2002) • Chess Computer using the Flash Micro Board, 9/2004 - =[=hai dsrticsiu 43 I m. I Take out an 18-month subscription to elektor electronics and receive a free 128-MB USB Memory Stick. Please fiii out the Order Form with this issue. Subscription rates and conditions may be found at the back of this issue. Visit our website www.distel.co.uk THE ORIGINAL SURPLUS WONDERLAND! THIS MONTH'S SELECTION FROM OUR VAST EVER CHANGING STOCKS Surplus always wanted for cash! GIANT 10" 7 SEGMENT DISPLA YS I IC's - TRANSISTORS - DIODES A puthsKf erases us so tetog b you GWT 7 soanart dgra deptojS at s tv* affordable crises TVs 1ET character fitei gr-.es eqxctcri^ nced- dAys or^i ^i^ri^^OTgUsa ho^cfappjca- xrs nixing scare bonis, c3g^ dodcs, com- ten, evanl limors eto As trig urJts ere a simpte se^rored^r^ deMce and cperaie fox" 12 V "C siTpfe SAbchrg \ia a*%: has,, retejS RC gt PC may be to ccrfcd shtfe or mu^fe digs Lhfe fe^ire rtorra! Taro Pcv** 1 mcmoey v-hscti geeriy ©TpflSes descn For an excellent CHY practical article. a _ x practical article, sec be May issue of 'Evefyifey & Practical Efectrorecs’ mrozzire. Idej School / CeFege ca> sfrucbon project S^epled to good RFE ccriz'tLri ecrrpfcte a ^31 csa shea. Less than 30% Only £29.95 3 or 4 / £99.00fD) of makers pnce [ OrtfcrRV«4 Drier Pn^ THE AMAZING TELEBOX TV SOUNDS. VIDEO TUNER CABLE COMPATIBLE * Converts ycur colour monitor into a QUALITY COLOUR TV! i The TELEBOX is an s^TEiCi.’.^ ££y cased r r^rs powered mt, corteunrij &1 escrorics rasfy to pug rto a hcst video rrortfcre or AV eQLtpmeri sraf^ Aihararr^te^ib^orSCA^'rc^ Fne cajnpcstawJaootJ^ii *■" I siac p! jg dreed/ rb mos video recorders, alcwtog reception c J TV channefc not rrofrnaVy recavabia on most television risttfy&tf (TE_E- BOXMB^ Push bUcn corsDfe on ba tnt panel afcwieoebioncr B My Ln&sbte fori af LHF ccfcur to*?.ean (namefe. TELEBOX ¥1 0 a?fSra .'i r iuT- eJy t] sfeiiEcn heouefides VHF ana UhF ndutfing be HYPER3AH0 as used toy most cable TV operators, dssf for desktop computer video sys- ferns $ RP {actra ri bcLra) seduce. Fct rcnpisle oonckLdiy - even fcr ircn'nprs w? ol sxrri - an i )egd 4 wad suae arctLer and tow tevto R H a j: o cutout ana frevded as standard- Brail nsw - iffy ojararoea. TELEBOX ST for cotrceshs video toput type men lie rs £36,95 TELE HO X STL £3 ST but - iisd with intact sp&stor £39.50 TELE BO X M B F^uttbard VH FAJHFJC^^Hnwband tuner £69 .9 5 q vefseas PAL vers. : cns stata 5 5 cr G rr~z sound s^cnca’icsi. Ter car. Tr f hypsrtaivd s^gr^J reoafrtkn Te.ebox V3 should be cen- Dec4ed to s csb^e t^tpe &ervk». on al' Te'eocx T s r code (B) . . w'ds composite IV co vzoec & c-irp-uti. Micro electronic* a' cn ens FOB only 73 x ■ c j x =2 mm enabla fuJ tufina cc r-tml via a Atm pie 3 wire link to OBSOLETE - SHORT SUPPLY - BULK 10,000,000 items EX STOCK For MAJOR SAVINGS CALL or see web site www.distel.co.uk COMPUTER MONITOR SPECIALS Legacy products High spec genuine multysync. CGA, EGA, VGA, SVGA M^ubbhi FA3415ETKL UT EVGAlfcJ&ync odbiff mxfty . . t frs Q^S dot ffefi ttoe aril resdilfen of 1024 x 7BR A ybr- gyat rpTs akw$ ameeKTi Jo a host cr carroufee hdUd'MTB IBM PC‘b In CGA, EGA, VGA & SVGA mntii^s BBC, COMYODORr (radtim An 33 12!L ■ AHCKWEDES sni APPLE. ?.tafr/ faceplgta, ted and LOW RADIATION MFR speifcatiorL FuV, guararfe^, ,n EXCcLLep usaa ccra-xn Ttt & Swrvei Essa £4.75 VGAsUsfcflMPClnefuded 0 nly£129(E) External cables for other types cf computers avai^irie - CALL Generic LOW COST SVGA Monitors We excise fi^e make, which includes Compaq, Mitsubishi, IBM, etc. Supplied ready to mn with all cables. Standard RTB 90 day guarantee. w £79.00 order TJcS Supplied in guc-d used condition. Sn ipp r,g code (D) Stsfo of the art PAL (UK specj UHF TV tuner module NIC AM ri t stereo sound ■ d j x =2 rr.Ti enabta ft£J tuning c an iS 1 , 1 pc type cxxnptiier. Suppled complete with Blmple vrorklng program and* bJCUTBftatioa Req^inss +12V & -r 5V DC to cc^'s'.e, brand NEW - Order as MY00. Only £39. 95 cods (B) Sqq. Vr'A'MV.dlstelcaufdctela^rttyOfl.htin for picture + fuf! details HARD DISK DRIVES 2YA - 14' 2 ,r TOSHIBA MK1O02WAV t.lG4)l^itep(1Z.5 mmH) New £59.95 : L TOSHIBA WK4313J-.IAT 4.3Gte teptof) (82 mm H) New £105.00 2 Tff TOSHIBA YK54C^f.'AV 6.1Gb iaptop (12.7 mn HJ Mew £MM 2:/ TOSHIBA MK1B14GAV IS Gb laptop (12 Iran H) NewEUSSS 2 -A* to y/r coiTverston kit for Ptrs, complete with cbrtKctori5 £1 5.95 3:^* COMPAQ 313706-321 (BM) 9 bb ULT/SCSI3 New £199.00 £59.95 £59.35 £69.00 £49.00 £49.95 £69.95 £69,95 £99,00 £195.00 E99.00 £195.00 £345,00 (I EM) 9 gb t MrM lr” Rri 3:z- FUJI FK-3QST2S 20rrb UrjA W RFE CONNER CP3024 20 mb JDE hT (Or aoujv.J R- E 3 Ti* CONNER CP3044 AQ mb IDE IT (orecutv.J RFE yjy QUANTUM 403 Prodriyfl 42mb SCSI VF. Hw FEE 5% + MINFSCR15E 3425 Krrj MFV t-r for ecuY.) R“E 554* SEAGATE ST-233 R 30 mb RU l r Refurt) 5VS CDC 94205-51 4 On* m NFM VF REE tBStfid 5 W HP 97549 ISO Mb SCSI RTE ts=ted f' T HP C3010 2 Gbyte SCSI differential RFE tested 5 c NEC D2246 B5 1 3 SJ. J D i ftisifece Mew 6' FUJITSU M2322K t60Mb SMD L F RFE tested e h F U J'JTSU V '2332K 2 Gb SM □ L r RFE tested Many other ffppp/ & H drives, IDE. SCSI. ESDI etc from sfocfr, see website for full stodt list Shipping on -ill drives is corf? (C) TEST EQUIPMENT & SPECIAL INTEREST ITEMS this £Kf»n ere pre owned. MTTSUBUSHI FA3445ETRL 14’ Ind. spec SVGA m&ttcra £245 FARNELL O-SOV DC @ 50 Amps, bench Power Supp&a^ £995 FARNELL AP3080 0-30V DC @ SO Amps.bendi Suppy E1B50 KJNGSHILL CZ4tKW1 0-50V @ OC 200 Amps - ISEW £3950 1 '□ i:o k 1 ^ ^ 400 Hi 3 p has pm**r Source - ex stock £POA IBM 5230 i ype 1, Tcksn ring base unh dm,Tjr £760 W a yne Ke it RA20-3 And ]p feju&r^ reso c«se an a : .>se-r £2500 INFODEC 1U, 24 pert RJ45 rteteork psichpane's. =TH93 £49 3COM 15670 12 Port ELherrujl hub - RJ45 comsrl-m ^ FA 7 £39 3COM 16571 24 Pan Ethernet hub- RJ45 cor.rsoi- 3 £S§ 3COM 16700 S Port Ethernet hub - RJ45 connecbxa \E A £39 IBM 53F5501 Token R_rg ICS 2D port lobe modules £POA IBM MAU Tckan r_nq da8&birtion psr^ £223-23- S^fv N £45 AIM 50 1 Low (fefortJbn C £ 5 . a 3r 9 Hz to yymsz, IEEE l D £550 ALLG O N 8360. 1 1 £€5- 1 SB0 MHz hybrid pm*sr Ctorr: £250 Trend D S A 274 D= ta Ar syssr v. in G7u3 2f,t j E4 c'a £P OA M 3 re. d n i 63 1 0 ProqiB.mmabe 2 to 22 GHz sweep geneie ’ zt £4500 f , la reen i 2022C IOKKz-1 GHz RF serial gener^for £ 1 5 59 HP165QB Lode Analyser ’ " £3759 HP3701 A Pattern generate' 3 KP3782A Err&r Detector £POA HP6521A Dual Pnpg ram^ ab:e GP=3 PSU 0-7 V \ m yofls £1809 HPS264 Ra-C', rr^uot veriab'e 0-2 DV g2UA meteied FSU £475 HP54121A DC to 22 GHzfcur Charlie-! teetKrt £FOA HP3130A opt 020 230 MHz pu3b nensrafix, GPlB aid £7909 HP A1, ADS pai HPGL high speed drum pte-ts -3 -frero £559 HP DRAFT MASTER 1 8 pan Lhn scaed pfotter £759 EG+G BfODkdoal 9593 5C PreciSKh lo ck in amp £1800 K&ilh!ey 520 CV cacadtery vbtag-e anahyser £P0A Racal ICR49 dual a’O cftarmsl votes m™Aler system £3750 FteXers 45KVA 3 ph On Lina UPS - Ham batteries £4500 Emerson AP130 2.5KVA EndLSti^l Spec.UFS £1 49 9 Mann Tally I4T 645 High speed Enq pr' 1 - tar £2209 Intel SBC 48071 33SE Modbus 486 e>s:st, BhLa Ram £945 HP £030 A Qr-lAW uZ z 17 Ajt^s bench pewter stipe , £1950 Intel SBC 436 j' 125C03 Eritancsd hWrius (I'BA) Hew £1150 Nikon HFX-1 i (Eph p > f c? ) expci ajrg centre! un'i £1 450 PHILIPS PH5518 pro. TV steial oanerater £1250 Mctorola VME Bus Boards & Corrpcrer Ls List S4E CALL £POA £559 £195D El 250 £295D £500 £3509 £3259 Trip 0-11 vdd iiear, mstered 30 amp bench PSU. New F ujitsu M 3041ft 600 LPM, h r ch speed band prurter Fujltau M3 04 10 600 LPM printer wtte ne?A^ tnterfoce Siemens K4400 64 Kb fo 1 Euro craft Enclosures Ud fo the highest pts- aible spec, rack fostur^s all steel ccnsjructicn with -z'r-fzz -2 5'z5 nect and tozi: doors ar- hinged fer easy access and at teck5t r s wfth frra secure 5 lever barrel locks me front doer is constructed ol double wa:;sd n. V s:eet ¥iTh 3 ^designer rtyle' sroked c front panel Ic enadte steins Indicalors to na sesn through Ihe Qflnei, yst remain unobtrusivs. Internally the rack features fully skited re : av rcrced ir=n. ; si fodng msmbets to take Iho heavi- est of 19" rack equIpmsnL Tha twa mavst.'a .3nic£] futing siruis (ajctras avallabte) ^ro pra 1 Altai for ite'esra caz-h, rriA. A mains dis- Lribution panel interna -y rricunted cc the bottom rcar T provide* 8 x EEC 3 pal Euro scckete and t x 13 amp 3 pn switched uLTly socket. C-.-era . ronlia- rjon is provided by Mfy leuvared back door and double sk;sr ad tz- seebon win top ar.d sic a kyu'rros. Tna fop pansi may fca r&T.wvc. for fitfinn of integral fans to ihe sub $aie eic. Clher features foduds rued caster and fsor fevsfero, prepunched utE ty pare! a: kivirer rear fa' cab 1 ? t ccnnecter Eaz&ss ete. Sirpp^ed fn excellent, slightly used csMuttbou with keys. Colour Royal blue, some grey avsitebce - CALL - Can be suppled ei many other oonbgifiabans. VIDEO MONITORS PHILIPS HCS35 isgma shfe &s CM8333) abracsively stated 14 1 cotour monitor with both RGB and standard composila 15.E25 Khz video inputs via SC ART socket and ssparate phcfn Isdca. Integral audio powv amp and apeaJcar for all audio visual uaas. Wi I connect bred fo Amiga and Atari BBC ocmmjtBrs. Ideal fer a : i video monitoring l security Epp-.cabo^s wvth direct connection to most colour cameras. Kgh ouafity wrth many fegtores surh as (rent conceefed fisp controEs, VCR ccrractfon cattcn atz Gqq-z used corxfiticn - fufoy teet&d - guaraLTitaad p, . 5 , , rnn nn Dimensions: W14"*H12JTxi5W ,r D. UI,l Y s-tJa^ULP DJ PHJL1PS HCS31 Uara compact 9 l co'our vids> man'-foT vr-ir sten- dard composrto 15,825 Khz video inpul via SC ART sccksL Ides! for siT madiitohjig •’ securiy spC' r cahc r 'S Kgfi tjua'fo,. ex-equipnteot fu'.y tested * guaranEesci (pos&ate ersnor screen bums?. Fn steac* Lve square SLac k c’sslp dsa- rreEsmng vnd* x HTB* x 1 yv D. Z40 VAC ir.2;ns powered. ' O n ly £79.00 (Dj INDUSTRIAL COMPUTERS Tiny sncrcbc.x steed indusths! 40 J»(hz 3B6 PC system msasuilng orfy (mm} 256 wX fid h X 272 d. tdsai for de^fiostsd conbo) appC- cauaas runnhi DOB. Lrnitt cr even WTrdG-.vg I Steel case ocn- tains £5 fo 255 V AC 50 / 60 hz 70 Watt PSU. a 3 stot ISA passive fcsckp'are end e Ffo:tev 31a. (PCTD4J sLsnd^Tf. SEigte btE.^1 com- puter Vi h 3 MByte NON VOLATILE sofid stete 'C-isk On Ch'o' RAM DISK. Sysakn Rocky 31B (PCItMJ SBC ESA cam wteh iOMHz AJJ 386SX CPU, 72 pm SIMM s ot vriii 16 Mbyte SJM M, AMI BIOS, cattery backed up real lime clock. 2 x fl p h D 16550 sens! perte. EFP/ECP printer port, mini DIN kaybo^d con- nector. floppy port IDE pert for hard drives up to 52 B MByte cgps^ty. wstchdog timer and PC104 bus socket. T ha B MByte so-"d atite 'ask on s chip' has its own BIOS, esn be tasked foTTTF-tted & booted. Suppled BHViD NEW fo .y ts?fo-d snd c;:3. r - an+eed. For ful date see fastured item on webs^fi. Drcter as QG3Q O^y £99.00 33U 42 u 47U 1 Order as BC44 Order as DT20 Order ss RV35 Etleimal dinr.ETtsfo^s External dTmensfons External dimensions mfn=1625H x B35Q x mm=2aiSK x 635D x mm- 2235 H x 63 5 D x 693 VI. 154’ H < 2W 603 W. {79.5" H x 25" 6-03 VI. jS8 r H x 25 4 □ x 23%’ V, □ x 23%’ V, | Dx23%' W ) Only Only Only £245 £345 £410 Cal! for shipping quotation j COLOUR CCD CAMERAS Undoubted . a mlracte of mod£rn technotogy SjK Cur spscal buying pc.v= r 1 A q ua 1 s ty product fa=* F f G tunng a fj ,. c-^s’ad COLOUR GCD ca^.a r a st s ™ c:.= s-as 1 / price ! Ur * testeres fuf autoigrt ssrs.=n.3 for use in low llghl ^ high fight ^ appfitfltions. A 10 mm fixed ■‘□cjs wide angle fens gives excellent focus and resolution irem closa: up to fen:: range. it\s composite video w^ut wi □ersneot to sry ccmpcsite monitor or TV ivia SCART socket} end most video recorders. Unit runs from 12V DC so ideal for securty & portable applEca- liens where mains power net a^raiabte Cverai djean-sfons 65 mm wide x 117 deep x 43 high Supplies BRAND NEW b fte.y guarertesd with user dels, IC&s cl appOca- Ifans tedtking Security, Home VS-feo. WebTV, Weh Cams efo ^c. Ofoer SS LK33 ONLY £79.00 or 2 for £149.00 ,5 SOFTWARE SPECIALS NT4 Workstation, complete with service pack 3 and licence - OEM packaged * qnl Y £89.00 a ENCARTA B5 - CDRO.M, Not the latest - but at this price 1 £7-95 DOS 5,0 on 3^* t£ste wtte ccndse txxj!s QSssk: £14.95 Windows for Workgroups 3.11+ Dos 6.22 on 3.5" disks £35.00 Windows 95 CDROM Only - No Licence - £19.95 WordPerfect 6 for DOS supp ei cn 3 ! V r^-te v. th £24.95 shipping charges for software is code B SOLID STATE LASERS VfSbte red, STOnm laser tfcce g»ai% . Uhl runs from 5 V DC at a.cpmx 53 mA. Crighte.v made for cemi'xicus use Ln industrial fcar- ebee scanners, the laser is mounted ri a reroovaii& soft! aurrintom : Ddt which bncSorrs as a heats Ak era rigid op-tral mount. C t.s of t xk areSOwxSOdxtSh mm. integral features tod Jda over tarrv z-sratore sfiLfodjATi, cunarji cortrof, laser OK ouput and gstod TTL CN / OFF. Many uses fer expadirLenteJ Dptis. OdfrtTrS &. :ghtsh£?*s air:. Eupz- .Ei-d ccrr.z Ate v.Tth d^te sh&eL Cruder es tt>91 ONLY £24.95 (Ai DC POWER SUPPLIES Virtually every type of power supply you can imagine.Over 10,000 Poiver Supp//es Ex Stock - Call or see our web site. RELAYS - 200.000 FROM STOCK lUffi Szva £££ls ty chpesir-g yc _ r next relay from our Massive Stocks covaring tyyzz- ±--h JJ.iMzry. Octal Cradle, HetmedcsSy Seated, Continental, Contactors, Ttma Delay Reed. Mercury We Ted. Sold Stefa, Printed Ctrcu'1 Mounting etc CFlL c* see our web site s :k)n \ fo r, y cbsc.'ste t , das freer i^rtW-disreJ. co r Lrk for more trr. s:oc k. Sev-s £I££fo Vfll * • 1 I ■ * ill ftltt I t * i K * I 111 * ■ it * * m * I * Itl I V ■ a -ELECTRONICS- ALL MAIL TO Dept EK, 29 / 35 Osborne Rd Thornton Heath Surrey CRT 8PD r UK Open Mon - Fri 9.00 - 5:30 18 Million Items On Line Now ! Secure Ordering, Pictures, Information v^riSgn www.distel.co.uk gma/f = admln^distBl.co. uk ALL ^ ENQUIRIES 0208 653 3333 FAX 0208 653 8888 £41 26 At press for UK l.'fihs-d _ < r^zir-r^ add 17_foi VAT to TOTAL erts - armrt Mmun order £1D. Bona Fcfe aoccul on fe3 a^csctsd fern Gcf.wrrerl, S:ron : ^■■■. f--r. H^18iKLCFFOALL A Jc 1 . 1 . secrox 3 days fcr CALL AlgixcfeaniBdtooiJiSteKferriCtonditonstfS^^tddieantevteAed^afviabsteaod cress slated aaaiifesd far 90 days; Ai gjsr^tees ert a retem to bess basis. AJ rig^S reserved to change prises f sp ec fflcaj oess prior note. Qfaristsai|aa tostoA Dsasufefor -.niirre Tcc i2A=H prices p^d ^rsurpljsg:>:cs AJ radaTsrfe gaderemesstoadkroiiilet^ed i Dsf^y Eectun s 2DTL EI.GE 46 ebkltt elscftcala - V/200-f Animated Head 3- Axis Machine Si x* Legged Walkers Robotic Anns Robotic models for both the beginner and the advanced hobbyist Servo Drivers Motor Drivers On-Screen Displays DMX Protocol U/ Sound Ranging Animatronics and Specialist Interface-Control Modules Quadrovox MP3 & Speech Systems Sensorylnc Voice Recognition Parallax U bkom Tool Kits iech- loots PiC 8t Rom Emulators BASICMkro PIC BASIC Compilers Development Tools Milford instruments Limited Te! 01977 683665, Fax 01977 681465, saies@milinst.com BS2-IC BS2-SX BS2E-IC SS2P/40 Parallax BASIC Stamps - still the easy way to get your project up and running! Serial Alphanumeric and Graphic Displays, Mini-Terminals and Bezel kits bluetooth is a huge commercial success but so far hobbyists and lab workers have been barred from access to ready-made modules for this wonderful new medium. The reason is simple: manufacturers like to treat their produc its as black boxes and are only interested in their 100-k/day the Far East or China. We oppose this attitude article, written using the motto: Bluetooth modules for everyone! A tracking robot does the trick etekfuyi - VZ0G4 Flick through any electronics magazine - professional or hobbyist - and yon will see a wide range of single-board computers and microcontroller boards. For many applications, they make prod- uct development so much simpler than it used to be, say, 5 or 10 years ago. Attach a few auxiliary components and a control panel, write the computer pro- gram, and you're finished. What makes the process easier is that the computer board is programmable, so one off-the-shelf component can be applied to many tasks Could this con- cept be taken even further? A few aux- iliary components will always be needed in any product, hut what about the control panel (user interface)? Couldn't an off-the-shelf progr amma ble component be made to replace custom control panels on electronic devices like PDAs. GSM, but also custom-made microcontroller systems? The TlexiFanel BASIC Stamp Edition' module from Fiexipanel Ltd. could pro- vide the answer. In this article we'll concentrate on the Bluetooth version or Fiexipanel, see the Device Pinout inset. Using Bluetooth radio (at 2.4 GHz), it asks a remote device within range — say, a mobile phone, a notebook PC, PDA or another handheld computer — to create the required con- trol panel (on if you like, GUI ) on its display. The module has a Class- 1 radio, so the remote device can be up to 10D m away. The module operates at TTL levels, and we are informed that a standalone R3232 device will soon also be in production. A user within radio range of the Flexi- paneLBluetooth module may connect to the appliance at any time using any Bluetooth- enabled device. The device will display the required control panel, but the panel's appearance may vary according to the remote device used. Some examples will be shown later. The software on the remote devices is the same for each application and does not require customization or re instal- lation, It is freely downloadable from www, fiexipanel. com. At the time of writing, Pocket PCs, Windows PCs, and Smartphones (e.g. SPV E2QG from Grange) software are supported. Soft- ware for Palm Operating System and Java phones supporting the JABWT standard (e.g, Nokia 6600 and Sony Ericsson P900) has also been released. Pr@fevJtedg^ , . ffijjTyww l " dg s : £31! Ll Jd Macros Pau:e Deer Clo:e Ecfoa Off tracking Robot user interface on o Pocket PC. r text Panel Designer for a Data Logger project. Design your own control buttons os they appear on Bluetooth devices. Pm sure we missed a turn somewhere, dear! The Tracking Robot route trace displayed on a Pocket PC. BASIC Stamp Editor busy programming the F'sxi Panel module (old version, now replaced by drag n drop). 52 titiJcr dedronks * 9/2004 ATice'i We re tost aren't we? Tracking Robot route trace displayed on a Smartphone. temperature history on 0 Smartphone. E22CJ ' 'ft.- ' — r = is c 1 Access Controller graphic user interface on a Smartphone . Temperature logger graphic user interface on a Smartphone , 27 tQ*, 14.24 42 ZI Set TiM u Cla^ tt Paiivcf d t 2 B/ 4 , 15 : 59:20 AiCtU HistOTf Se t TtJ^r VtofU E.PV S 1 *V )) * = -c : &j-ar«rp; 330.1 ftfWJ.J Left Access Conftro/fer /on c/rsp/oyed on o Smartonane, Tracking Robot graphic user interrace on a 5 m a rfphon &. - 4 " — J -A. i— sicp Severn ROlfl# tfdCft i^re l fenu &i=v r 9/2^04 - t'skt-zr plrdronrcs 53 A bluetooth Protocol Bluetooth Is o 2,4GHz digital radio communication proto- col developed and licensed by Ericsson. Serving the 'per- sona! area network/, Bluetooth devices can come and go ad hoc. In contrast, the WiFi protocol, operating of the same frequency, is more suited to longer-term wireless infrastructure, with each individual node needing to be assigned a fixed IP [internet protocol) address. Thanks to Bluetooth headsets, Bluetooth is now solidly entrenched in the mobile phone market. Intel intends to incorporate Bluetooth into its Centrino 2 chipset, to be launched in Autumn 2004. Not only will this allow PCs to connect wirelessly to printers, etc, but if will boost the growth of VoIP (voice over internet protocol), i_e. phone calls over the internet. The Bluetooth standard provides interfaces for a wide range of communications protocols, From a simple serial port to audio. Like mony higher-level protocols such as OBEX file exchange, FlexiPonel sits on top of the serial port emulation layer of the Bluetooth protocol stack. It is not part of the 'officio! Bluetooth standard. However, the standard is relatively open in that anyone is free to create software for remote devices, and product-side components such as the FlexiPonel module are manufactured under license, just like any Bluetooth radio module. The first FlexiPonel products were software libraries to provide remote control for Windows applications and high-end embedded systems. From the electronic product s perspective, the FlexiPonel module is o peripheral providing graphical user interface services. If maintains o list of the controls required by the product, and the current state of the controls. The product can update a control at any time and if a user modifies o control, the product is notified! Installing a Desktop PCs will typically employ external Bluetooth adapters to communicate with devices like FfexiPaneL Usually, the installation of such adapters is □ breeze using the supplied software, however in the case of the FlexiPanel some fine tuning is required. For these adapters a series of COM ports is installed Bluetooth adapter !> Control Piinc-E r»e cdt V** F|vcf*s5 To:s fj / Szxdx '--Fotefs ^ S' CorfrdParcf Coat ml P^nei ” ta f '*A:i:555Ddr; Camera VC Add e /jtaldce -1^73-5 -„U roots fi iJWIIMBM ^D3£*4rtjT re >E^ay Optacrs V r " -tXJ V v C3 go Ccrrnetti Adjust ■;u r Jicrrij:.,, List at end trait... Irsioi €£ tzr&ft pr.„. Cifl Oj ! 5d“irKS7r., nfcwSfoitoqi^... Se tnedsu. trr Cfergs the ■ ■ Cistcns ire: . . Add. d-.snge, nd ... u: or) ibis c::‘ : a - yqu fp the wit ndm (fob: C/ienf Applicpti&fis) inspect the COM port properties and make sure Secure Connection is unchecked. that look after the link to other Bluetooth devices. These links are normally protected against nan-authorised access to the PC by the in stall at Eon software. However, FlexiPanel does not employ a protected link and that's why you need to tweak the PC's COM port settings. You start from the Control Panel where ihe Bluetooth configu- ration may be found. For these and ofher niggling details on Bluetooth see the FAQ at vrwwJlejripaneLcom/compQrts/indeX'htm 54 tickler elfthrmiG - 9/2004 Listing 1. B52p code for Tracking Robot [extract) Backup : PUL 5 OUT iPort , lHaxZ PUL 5 OUT r?ort , ri€ax S PAUSE 20 FwRvSp = 2 GOSUB CheckC omp ass tf DataPin = 1 TEEN ReadCantrals GOTO Backup Ch e ckC ompa s s : 1 only check every 50 pulses CmpCouirt = CmpCounr - 1 IF CmpCount > 0 THEN GoBack CmpCounb = 50 ' Get compass direction In binary radians and in tenths of a degree I2CIN SerPt , Cmplii, X#- [brad, degs . BIGHBYTE , degs -LQWBYTE] ' Send degrees value to bearing control {code generated by FlexiPanei Designer) SERGUT TxPin\CT5Pin, BaudM, [SetData, ID_Bearing, degs -LQTCBYTE , degs . HIGHBYTE , 0, 0] ' Calculate position with Send binary radians value to bearing control * (code generated by FlexiPanei Designer & cut' n 'pasted ) IF FwRvSp = 1 THEM xloc = xloc a- COS ( brad ) yloc — yloc +■ SIR( brad ) ELSE IF FwRvSp = 2 THEN xloc - xloc - COS ( brad ) yloc = yloc - SIN{ brad ) ENDIF J x f moving, send to trace IF NOT FwRvSp = 0 TEEN 5 E ROUT TxPinXCTSPin, BaudM, [AddRow, ID_Route_trace , yloc . LOWBYTE , yloc . HIGEBYTE, xloc . LOWBYTE , xloc , HIGH3YTE \ ENDiF ' return ro motor control GoBack: RETURN After initialization, the program tests to see what kind of motor control pulse it is supposed to supply. Then it reads the compass and writes the bearing to the bearing display and the route tracker. More about the project software To get started with this project you will need the following: 1. Windows 2000 or later 2. FlexiPanei Soft: rare Development Kit (SDK) 3. Basic Stamp Editor (BSE) 4. FlexiPanei Some notes: the FlexiPanei Software Development Kit SDK (previously known as FlexiPanei BASIC Stamp Developer s Kit) only works on recent versions of Windows. The SDK allows the GUI to be designed on a PC. i,e. you decide on the controls necessary for the final product, and their ’look' as they appear on the Bluetooth device, see Tlexi- Panei Designer 1 above. Regarding the BSE, only the Bs2. Bs2sx r Bs2e and BS2p are supported. The -p version is preferred because of its speed and memory size. Note that the 40-pin Bs2p4Q will not fit on any BoE as only a 24-pin socket is avail- able, A version of FlexiPanei for Windows 95/98 is available as a free download, as well as versions for MS Smartphone, Pocket PC, Java JABWT devices and Palm OS. Closing notes on the tracking robot project Tne BoE-Bot is powered by four AA batteries which, in practice, will only last a few tens of minutes before they are exhausted or their voltages start dropping to levels where the electron- ics start 'brov/ning-outl Tne FlexiPanei module can generate a signal indicating when a remote unit is connected. Tne robot could automati- cally halt if it went out of range of the remote unit. The operation of the electronic com- pass is significantly influenced by the surrounding metal and direct currents. These effects may be counteracted by local calibration of the compass. Web pointers Parallax: vr v, p o rc ; b x . co m FlexiPanei: v/v/ w. ft ex i oa n & I . co m Milford Instruments: v aw. m i I j n s L demo n .co . uk Free Downloads Basic stamp Fbspj and Frexipane; ( FxP] pregrams far Tracking Rabat, Datalogger and Access Controller projects, roll project documentation (.dec). File number: 040 1 86-1 1 .zip PCB layout in PDF format. File number: 0401 86-1 .zip wvw. e! ekiar-el ectran i cs .to . uk/ d I / d L htm, select month of publication. 9/2004 - efdbr efectrcrics 55 review copy Proteus VSM Also simulates microcontrollers! David Daamen Schematic drawing, PCB designing and off you go testing the design. These days we do everything on a PC. Simulation pro- grams have now reached a level of sophisti- cation that includes co-simulation of a micro- controller in your design. Proteus VSM from Labcenter Electronics is an extensive soft- ware bundle offering professional features at an affordable price. Piateus Virtual System mod’ elling (VSM) is software that allows digital and analogue circuits, or a mixture of the two, to be simulated on a PC. Of course, it all starts with circuit diagram entry ('schematic capture'). Here, ISIS schematic capture is used. From the same suppli- er comes a separate utility, ARES, for the PCB design phase, providing a seamless Unit with ISIS. Tb gather, ISIS and APES form the tradition- al combination that makes 'putting a circuit onto PCS’ very easy indeed. Naturally we found features like con- nectivity verification ( elec- trical rule and connectivity check 5 ), an automatic com- ponent placer and an auto- matic track router. So far, nothing unusual as other software products may be found with roughly the same functionality. In the case of Proteus VSM, it 5 s the simulation part that offers a number of unusual features* including one we've not seen before in affordable design/simula- tion packages: micro con- trollers may be included in the circuit. That, in itself, is possible with other design software, but Proteus VSM is actually capable of simu- lating the code executed by the micro! Again, you may argue that even that is not unique but wait, there's another novelty* During simulation, you can work interactively with the circuit: switches and potentiometers may be operated “as if for rear and the status of LEDs or infor- mation on LCDs is immedi- ately visible. The feature is fast, too r as it is perfectly possible to make periodic signals with frequencies in the audio range audible via the PC's soundcard. A com- plete graphic LCD touch screen hooked up to a microcontroller is not only refreshed during Simula- tion n but may also be con- trolled using the mouse. It all happens virtually in real-time. On a 300-MHz Pentium II you can simu- late a standard 8051 sys- tem ticking at 12 MHz. The simulator The core of the simulator is called ProSPICE, a combina- tion of an analogue simula- tor and a fast event-driven digital simulator, showing a mix of analogue and digital electronics (a 'mixed mode' circuit) to be simulated without problems. The advantage of SPICE is that component models supplied by manufacturers may be added at the drop of a hat. Incidentally, Proteus VSM comes with about 6,000 SPICE models. The simulation also employs animated models': graphic animations whose appear- ance can change during sim- ulation, for example, to indi- cate the current flow direc- tion, or showing that a lamp actually lights up. It is also possible to define your own (animated) models, in princi- ple, without the need to pro- gram them! A documented 'software developers kit' (SDK) is supplied allowing models to be created in the form of DLL files. Measuring Virtual testing implies virtu- al measurement — not just using simple volt and ammeters, but also more advanced instruments like an oscilloscope, a function generator, a pattern genera- tor, a counter and an asyn- chronous terminal. As far as operation and options are concerned, these are simply 'instruments 1 as you may see them on the test bench. A useful ‘extra’ is the ability to display the logic level of any connection or junction in the circuit in real time using a coloured dot. More advanced measure- ments like graph plotting or frequency response meas- urement, noise and distor- tion analysis, are available in the utility Advanced Simulation Option". Microcontroller co-simulation VSM is capable of linking two simulations: one of soft- ware executed "inside' a microprocessor, the other, of the complete electronics cir- cuit around the micro. For example, the act of a proces- sor writing code to a port results in corresponding logic level changes in the circuit. And the other way around if a (sub-)circuit changes a logic level then the simulated program will notice it. VS Ms included models not just support simple I/O ports but also interrupts, timers, USAKTs etc. — depending of course on the processor being simulated. It is even possible to include multiple processors in the circuit — it’s just a matter of drawing a few lines to con- nect the relevant chips! At the time of writing, Proteus V8M versions are available for the BASIC Stamp, PIC, AVR, HC11 and 8051 processors. Debugging Because the design of a microprocessor or microcon- troller circuit is hardly ever finished and approved in one go, the process of debugging or ‘error elimina- tion remains essential. Not surprisingly, Proteus VSM gives great attention to the subject. In particular the single-stepping feature will be welcomed by designers. Just as with the software debugger you normally use, code for the processor may be executed line by line. However, this time you can observe the results of the code execution on the whole circuit rather than the micro alone. Depending on the processor family selected and available programming tools it is even possible to 'step' through code written in higher programming lan- guages like C, Proteus VSM is Irighly rec- ommended for designers fre- quently working on circuits containing digital as well as analogue electronics. _ ■ ^ ■ _ The price of Proteus VSM is dependent on processor family, optional extensions and commercial or educa- tional use. For the latest price info, contact Lobcenter Electronics, 53-55 Main Street, Grassington BD 23 5 AA, UK. Tel. (+ 44 ) 1756 753440 , fax (+ 44 ) 1756 752857 . www. labcenier.co.uk, mfo@ 3 abcenfer.co.uk . 3iJ . . r ; ■ . — - • Z - _ ^ 5 ” wwTh e PC B S H O -xom r g _ t _ 7 __ . _ 45 UlVEttC J-.zin. 1 1 wr Double Sided, 1,6 mm, Plated Through, Green Solder mask, Hot Air Level, 1 White Legend. Price including tooling + plotting + VAT 9/2QCM - eld lor elstirwuES 57 USE Embedded E for removable mass storage devices Mark Schultz Senior Applications Engineer - Cypress Semiconductor now USB has been available only on personal computers, leaving large, untapped potential in the area of embedded systems. New embedded host controllers from Cypress herald a new era. An embedded system is defined as hardware and firmware — either stand-alone or port of a larger system — usually with same sort of operating system. The oper- aring system can be Windows CE, Vx Works or a more simple system consisting of home made code. Using the above definition, it can be said that any electronic device that has a processor has the potential to be an embedded USB hast. Designs that incorporate a USB Host controller have a distinct advantage over traditional designs in the sense that they can now host any type of USB device. The obvi- ous advantage here is that storage space for a design can be dynamically added or removed ot any time. Con- sider the case of an MP-3 player that contains a USB Host. MP-3 files can be easily downloaded via a USB flash drive or any other media that includes USB support. Many other types of applications should be able to real- ize similar performance with the addition of a Host USB solution, such as the ability to perform Field upgrades or download critical data to a nan-networked system. Existing solutions for expansion of embedded systems usually involve a laptop or same other type of portable computing device connected to she embedded system via a serial cable. Although this is o simple and effective solution , it requires the extra PC and additional cabling. Additionally, there could be problems associated with the use of legacy ports. Typically, o PC is a USB host. Anything else containing USB is o peripheral. As an example, take the case of a digital camera. A digital camera has traditionally been a USB peripheral. To print an image to a USB based printer, a PC is first used to upload the images from the camera to the PC and then to download them to □ printer, if the digital camera had USB host capabilities, it could download the images directly to the printer. Of course, such functionality comes with a price. A USB Host is responsible for a number of tasks including enu- meration of devices, task scheduling and bandwidth alio cation. Fortunately, there will be o cade framework that will handle these tasks for us. This article will outline some or the basics required for interfacing a USB Host controller to a removable mass storage device. A short primer on the use of SCSI com- mands and how they relate to file systems will be pre- sented as well as a quick overview of the FAT file system. This will be Followed by a design example. Mass storage basics Communication via the USB interface uses SCSI com- mands embedded inside a UFI Packet. A file system is a logical structure used to track various parameters of the storage media. FAT File System This design will support the File Allocation Table (FAT) type of file system. In the FAT file system, there is a table that contains o number corresponding ro each section or cluster on the disk. It will be necessary to use the File Allocation table to locate the individual dusters within a fife since they may not all be contiguous. There are other types of file systems such as NTFS (NT File System) and Partition Info FAT (first copy) FAT {second copy) Root Directory DaiaArea Figure I . File structure system. UFS (Unix File System) that will not be supported by this design. Our file system will be logically represented by a data structure called a volume. A volume contains information about the location of the File Allocation Table (FAT) root directory, and a data area that is subdivided Into sectors and dusters. All mass storage devices contain a boot record. Aside from containing cade that can be used for boolstrapping the device, this area also contains other useful informa- tion about the device that can be used to fill In the vol- ume information. There is also a partition record ter each useable partition on the device. We will use this later on as well. The basic outline of the file system is shown in Figure 1 . There are a number of distinct areas on a moss storage device beside jus! the directory and data area. The parti- tion information begins at offset 1 BE^ of the first physical sector on the drive. After this sector, there are a number of reserved sectors, followed by the actual file allocation table. The FAT operates on groups of sectors colled clus- ters. The FAT contains information about the physical clus- ters on the drive such as whether they ore available to be written to and where the next duster in the rile is located. There are actually two copies of the FAT per drive for redundancy purposes. The root directory is 5 12 entries long in a FAT1 6 system with each entry occupying 32 bytes. Thus the total root directory takes up 32 sectors. After that is the dato area containing files and subdirecto- ries. I he start of the data area is said to be at duster number 2, although in reality it is actually more than 512 sectors from the beginning of the drive. Table 1 shows the volume information for one particular USB flash device: the beginning of the actual data is 235 ,-j sectors from the beginning of the drive. The area before this con- 59 Table 1 . Volume information Volume Data Size Value for Information current drive Fat Size BYTE FA h Total Sectors DWORD 3E7E0h Total Data Sectors DWORD 3E5c8 h Number of Clusters WORD F972 h Root Dir Sectors BYTE X o CM First Data Sector | WORD 23 5 h 1 Bytes Per Sector WORD 2O0 h Sectors Per Cluster BYTE 0Q4h First FAT Sector BYTE 21h First Dir Sector WORD 2I5 h Jains ihe partition record, boot record, two copies of the FAT and the roo t directory. This information v/ill he used later on Jo locate files on the drive. SCSI Many mass storage devices use SCSI commands for com- munication between the host and the device. We will be using three SCSI commands to perform our file opera- tions, The commands are Inquiry, Read Capacity and Read[10). The format of the three SCSI commands Jo be used in this design is shown in Table 2. Each command takes an Op Cade ond a Logical Unit Number (LUN). Some commands have an LBA field. An LBA is a Logical Block Address. A Logical Block is the 0*87 \i QkC3 ACr C<43 ^_iC_ Cm-13 C: == S3 42 43 46 SC €5 SO 24 00 00 00 SO 00 05 12 16: Du DD DO 24 GO 80 Q0 QD DO *30 OP 00 00 03 00 B: 00 00 00 00 GO GO GO 00 43 73 10 12 S3 “3 13 20 16: 46 SC 61 73 6fl 20 44 EB 13 20 2D 20 28 20 20 32: 20 20 20 ZQ \ ““ Figure 2. UFI transaction using CBWundCSW. N I thS? 1 ' -TAt ' 1 C*D2 1 55 52 4Z :I 4= iT zz- =Q DO 00 00 00 flOl | A ~- [ Q*JS 1 smallest addressable section of a mass storage device, often referred to as a sector. Later an, we will see how to use an LBA to access file data. The Read {10] command also has a field for transfer length. Transfer length gener- ally refers to the number of sectors to be sent or received. For the purpose of simplicity, we will work with only one Logical Unit. Thus, the LUN field will always be 'O'. UFI Removable media mass storage devices containing a USB interface use a common interface known as the UFI interface. The SCSI commands ore embedded in the UFI packets. A UFI transfer is carried out In three phases: command , data and status. The command phase employs the Command Block Wrapper (CBW) and the status phase, a Command Status Wrapper (CSW). The CBW is a 3 1 -byre packet with the First 15 bytes con- taining four bytes of signature and four bytes of tag, three bytes of commands and flags and 4 byres for the length of the actual data to be read or written. The find 16 bytes comprise the command block, which is the actual SCSI command. The CBW signature Is used to identify the device ond is hard-coded to 55 53 42 43 by the UFI specification. Interestingly, the signature in ASCII is U5BC for o USB Command. The tag can be any 4 byte value. The CSW will use the tag value received dur- ing the CBW phase to report the status of the CBW. The CSW is a 1 3 -byte packet and is similar to the CBW in that it contains four bytes of signature hardcoded to 55 53 42 53 which, in ASCII is 'USBS for USB Status. There is also a 4-byte tog that will be matched against the tag of the CBW. The CSW also contains four bytes for the residue, which is the expected transfer length minus the actual transferred data length. There is one additional byre used to report transfer status. An example of a USB transfer using a CBW and a CSW is shown in Figure 2. The first transaction is the CBW. The signature is con- tained in bytes 0 through 3 and the tag is con Joined in bytes 4 through 7. The tag can be any random 32-bir number. The CSW will use the tag value to Acknowledge completion of the command specified in the CBW. The '24' in byte 8 is a hexadecimal value representing 36 decimal and is ihe actual length of the transferred data in the second phase. The second transaction is the data stage and includes the 36 bytes of data read back from the USB mass storage device. In Shis case, the data is in response to an Inquiry command { 1 2|_j] that can be seen in byte 15 of the first transaction. Converting the 36 bytes of data beginning af the ninth byre to ASCI! v/ill reveal ihe string Cypress Flash Disk C The third transaction is the CSW. Note the match between the tags of the CBW ond the CSW. There is no remaining data to be transferred as shown in bytes 8 through 1 1 . Byte 12 contains ihe status of the transac- tion. For this field, a 'O' denotes success. The Cypress EZ-Host controller The Cypress EZ-Hosi Is a 16-bit RISC based microcon- troller, which contains two Serial Interface Engines (SIEs). 60 d<tor - 9/2001 Each SIE conirals two USB hast ports or one USB periph- eral port. The EZ-Host also contains a number of periph- erals such as RS-232, 5PI, HP! and HSS. There are 16 K byres of internal memory space and provisions for on external memory interface. The EZ-Host includes a firmware framework that takes core of most of the USB Host details. With full support for various types of USB transfers, reading and writing to USB mass storage devices is os simple as tilling in some information and letting the frameworks handle the rest. The EZ-Host framework contains oil of the necessary firmware to implement USB Host functionality. Included in ihis are task scheduling, device enumeration, bandwidth allocation and power management. Applications on the other hand, ore the firmware to con- trol specific USB devices and communicate their data to an end application. At the heart of the frameworks is the TD processor. The TD processor operates an a data structure called o Task Descriptor (TD) using its information so communicate with the USB hardware, specifically the Serial Interface Engine (S1E) + !i is important ro note that each of the SIEs controls two ports and that there is a TD processor far each SIE. The framework code incorporates o simple round-robin scheduler. The scheduler handles a number of tasks such as checking for device insertion and removal, checking the UART far incoming messages and executing the run function of every installed device driver. Basic USB transfers are used to move data in either direc- tion (Host to Peripheral and Peripheral to Host). The host initiates the transfers. To move data to a peripheral, the host uses the function usb_send_bulk_out To get data from o peripheral, the host uses usb_recv_bu]k_in. Each of these functions requires some additional data - a pointer to the device structure, the USB endpoint to be used, the length of transfer, and a pointer to the send or receive butfer. Once these derails are specified, the framework takes care of the rest. Framework Flow The framework cade will execute os follows. On power on reset, the EZ-Host microprocessor will initialize oil reg- isters and counters as well as all device structures, it will then enter a loop: - Check the host USB ports far any changes in status (devices inserted or removed}. - Check the TD processor and get status of all IDs run- ning on the two SIEs. - Go through the list of active device drivers and execute the run function for each. Checking the host USB port for status changes requires inspection of a change variable. The port change inter- rupt handler will set this variable if a change occurs. If the port shows a change, enumeration code will be exe- cuted to service this change. If a device is found, frameworks code will attempt to match the device to a registered driver. Driver matching can be accomplished in a number of ways. If there is Table 2, SCSI commands SCSI command Inquiry Read Capacity Read[10) Byte #0 12h 25 h 28 h Byte m LUN LUN LUN Byte #2 Page Cede IBA (MSB) LBA (MSB) Byte #3 Reserved LBA LBA Byte #4 Allocation Length LEA LBA Byte #5 Reserved LBA (LSB) LBA [LSB] Byte #6 Reserved Reserved Reserved Byis #7 Reserved Reserved Transfer Length (MSB) Byte #8 Reserved Reserved Transfer Length (LSB) Byle *9 Reserved Reserved Reserved Byte #10 Reserved Reserved Reserved Byie #1 1 Reserved __ Reserved Reserved only one specific device to be supported, the device's VID and P1D can be added to a Targeted Peripheral List'. The device s VID and PID are then checked against this [1st A more common method of device/d river matching is via device class and interface class. Jn the case of mass storage devices, both the device class and interface class have a value of "S' and their respective subclasses have a value of '6. So, when the driver is created, these val- ues will be entered into the appropriate fields [see Fig- ure 3]. Building an application In this section well show how to build a simple embed- ded USB design that controls a USB Flash drive. First, we will need to create o driver for the mass storage device. We can call the driver the mass_sto rag e_d river or some name indicative of the capabilities of the device. The most important fields in this data structure are the class and subclass fields. The framework will use these values to match ihis driver up with any Flash device with the same doss and subdoss values. One other possibility here is to enter a specific Vendor ID and Product ID in the driver template. In this cose,, only the device containing ClAas JSRIVZ 2 212 ss Etoisirs dr- vsr * i oxdB. DlE£, „■ m mat 6 ClQS, 2 2 E ■ 2 ltS E , ■JIG 2 2 0x0 5, 2eG4E4* /• Hitt ; E orrecc. UI5tl6 isEd. ^r_= t-2j , •2 I Z t 1 2 ZL= -i rV2T_ETt CD. / ■ ■zizt-L Tl =:_■* rr-vj-rr — Y2 id t ' }: class: s^bcl a s-s : KieS atorsgs ifjcliMj : :. L iE if _i e = : * 1-2 1 - " 22 2 2-2 : I ; » r 1 : • praJttrt_U>; * f ( *sian | ( U53_DtVICt *dtv J r */ •step ivaic i ; * 1-22 -;vo: f . ■ Figure 3: Device Drher Template. Vim - dskfor 61 Figure A, Readfslr Code. Figure 5: Simple USE Host Stack ■ ■ ■ ■ P iff fl I I fMf I I ■ iti f ri ■ in ■ ■ if f f 1 1 i i a i fcesi I ItfiE5_E£f »Jir. IT. !!? fmm 5^^— 3>TtCJ.7i7 L— * T. iirtl= £:;+ mviII ■ — I “ E : ■; r ’^~T i Jcias*mcscnL^n_z3aleJ it < Cteua iInfciH) ■"* ™ **'*« Ifcongi llii a, Tim, i bt:ai tl= si wlI^i tkt rln'= <7 if* gsUfe* jemad it U4 isa rte![^ ir " a J ii=iim J li.‘i ia ciiciltla z*m local i 3 . zc. tk dj-, t- i-Tird ** «= wtsft_as=izr 5*t*a-=*± ir riu^'U acts iti‘ r T — j — >— -in — t_-‘ , i-i -*-*-*t * 1 -- '-V--— Jl' Z£ r _ L j 3 : ., IS 1 7.1 Z. ■ . iz. - --r i >- rSC - — Ull ■ .-r- L * -- ’ L- =r .1 5*7 7~ - t 5 ■._=,! t-S_TCCti3 * r-_«^- + n~r - Iz3cati,ci-Jl*Ts.ii PrmU * t i t- 7 — ~ - L- ■ ■ :i-i Pui ►=r±l Ti^ z= iii:; ; - , iJ_: - 71= - -■ |'I_ ;i-t : - _ r:. r 1 1 ■_! ■ •■ : ■ SppIi - det. EJ IJi^S£JI_ IJ_rTTY . . Ii^Si: !c ■ : tLt rii.* ±i£i is ♦*— ftsiBUMfliersilfsr. SizmJ: = - x>. - v fenit - i Ij =a =fcj i*s_ iSi 1; I ■ 1 WTg| ■ FT^J*.- r 1 T ' I - rr fcrrCLcsrsa those Vendor ond Product IDs will be started when plugged in. Once the driver is created, the next steps ore to odd the start, stop ond run functions plus the class codes for the device so the driver can be found, A driver structure is shown in Figure 4. The name of the driver function has to be added to the file drvrlist.h: #deftne FVVX_DR1VER_LIST { &mess_sto rag e_d river } r ------ ■• : : ;■ -_.il- Ft _.n !fl ic7C33 Jie&L-jJ ■CTjeiXP'.-J V J >--* - _r- - iif £=ltz*n - : -£ _L-C- £nr*ra ■‘irCLz-x- -rfccr* :r_: l EZ-Kt =; The mos5_5torage_driver s 'start' function wifi use the CBW/CSW protocol to interrogate the device to deter- mine its characteristics. Code inside of these functions will get the data and pass it on to the application layer of the design. This will enable the higher-level layers of the application to handle the specifics of file management. The stop function will dean up ony pending operations or transfers and notify the application layer that a device has been removed. The run function, finally, will be used to check for any incoming commands from the applica- tion code. Using the frameworks to read a USB Flash drive Nov/ it is time to create some application code that actu- ally does something. At this point, we have created a driver and have a means fa match it up to a device by class and subclass matching. Next up Is to add code to the driver for its start and run functions. When the driver starts, we wan! it to go out and interro- gate the flash device to gather information about its File system. Then, the run function will be used to periodically check as to whether the user wants to read any File data. The driver's start function will gather data about the file system in the following way; - Perform a SCSI Inquiry command to get information on the attached device. - Perform a SCSI Read Capacity command to get infon motion about the size of the attached device. - Perform a SCSI Reod[I 0] with the L8A set to 0 to get data from the first physical sector on the flash device. - Type cast the 1 6 byres beginning at offset 1 BE^ of the first sector to a parti I Eon record entry. - Using the partition record information, locate the "Start LBA' — the number of the cluster containing the boot record. - Perform o SCSI Read) 10) with the LBA value set to the Start LBA to read the sector containing the boot record. Use the information in the boot record to fill In the vol- ume information. At this point, we have used three SCSI commands and our knowledge of the drive layout to obtain the informa- tion that was presented in Table 1 . We can now use this information to read any file on the drive. The directory entry for a file will contain its Start Cluster number. I his value will be passed to the file reading func- tion in the Location field. The ReodFile Function will read each sector in the cluster, then check the FAT to see if there are additional clusters for the file. The code required to perform a file read is shown in Fig ure 4. The Sector value can be calculated using information contained in the Volume structure. Note that the file read- ing loop executes once for each sector in the cluster. When a cluster has been fully read, the FAT Is checked to find the NexiC luster value. Also note the use of CBWs and CSWs for communicating with the drive. 62 clfkl or - 9/2004 Application Programming Interface Figure 5 shows ihe hierarchy of fhe EZ-Hosf Firmware. An externa! processor or application can communicate with the interface layer via RS232. Application code can be written to provide an AP! between the interface layer and the FindFile and Read File functions. One possible interface layer is shown in Figure 6. Here, the UAR7 is checked for a one byte Op Code fal- lowed by a filename, file extension and directory start location. An Op Code of ' 1 ' causes the Find File Function to be executed. An Op Code of 2 signifies a file read operation. The FileName and FileExt fields in the packet specify the file to be found or read. The additional packet field, Di r Start allows for the location of files in either the root directory (DirStart = 0) or in o sub directory (DirStart = start duster of the subdirectory). As an example, suppose we wanted to read a file called File! in the root directory: The first UART Packet sent to the interface layer would have t he parameter FileName set to File ! , a DirStart value of 'O' and an Op Code of 2 J for a file read. The EZ-Hosf firmware would return the contents of the file File?. Now, suppose we wanted to read a file colled File2 in the subdirectory SubDirh The first UART Packer would have the FileName pararm eter set to SubDir I, the Op Code set to ' ] ' for file find and the DirStart value set to '0’ The PindFile Function will return the starting duster of the SubDir 1 directory fa the application. Next, another UART packer would be sent, this time with the FileName parameter set to File2 r the Op Code set to T for file read and the DirStart value set to the starting cluster of SubD/r? which was returned from the previous FindFile Function. At this point, the EZ-Host will return the contents of File2. Using this APf and the above examples, □ File from any directory on the drive can be read. Conclusion Using an embedded Host USB controller, removable mass storage con be added to any design. This Fealure allows for do%vnloading of critical data or for firmware upgrades to the design via USB. An embedded USB hast may be implemented with just one additional 1C and no third-party software. An embed- ded USB Host framework has taken care of all of the lower-level details for us. Cypress EZ-Host USB host can support the full speed Bulk transfers required to communi- cate with mass storage devices. The present code size is approximately 13 kbytes. File system support can easily be added to support application specific devices. -fl:: 1 .11. I.**,. i.th.iM, ...It, 1*4 * * ■ * 1 * M **** t * * * M * i ■ - ■_ = - : i = t r-=~_riz . : r_" i j .. IT *■ i ;i:i t - r -.’ -- ■ s. _i.il Hr±J 1 -.-‘-IT ZZ t : LziZlliZi ■ i i i ra' -it l*— ' « ■ir.u * :i-rr TTziiiizi:’ li tStaiiH ““4! ■ c ii r i ills ii i ni 4i. iz^rr * * 5^1 ;!r iJ-mf in:-: Ifii iL; » ‘ 1 i=il » ^J-lC.lilii ilT=Iiil ■ : ::i : -.1 - . — : : i“ i-— 1‘-:— - ir=- r . . " 1 * r > *'■ Wd lii -r~T - r-mln*- TIE Uc IJJtT * .. i~-r= : ii : ■ . Fltc:=l=-.I=C=^ 3 L tJT i I ' m £ 4 *j E ilk * a s’. lii i ■ rr i t j— a 1 ir 7 ii? » ‘ -i - : ~ izi. r 1*-. iiiai iz ; I--_i i;u i 7.1.1’ C * =rr: -y.T ; i .- *:r ■- k tijZ.il 1 = » -ZC171.ZZ._ri lii 7 111? Z ii: Lxj: izh * i'Ei7z«c7zr et « A |g tSHtaii ■ : *-±i =aczzz '■ 7 i-r.— - 1 i Figure 6: Example Interface Layer . Web pointers FAT File system: www. microsoft . co m /hwd ev/downlogd/hg rd v. j a re/ fatpenl Q3.pdf UFI Command Specification: vavw, usb.org/dsvel 0 per 5 / devcbss docs/ usbmass-ufj 1 O.pdf USB Mass Storage Class Bulk Only Transport Specification: wv/w. us b. o rg / devel ope rs/ d evclo ss d ocs/ usb m qss bulk 1 0 . cdf Mark Schultz Is a Senior Customer Design Center Engineer with Cypress Semiconductor. Mark holds a BSc in Information Technology from New Jersey College. Before arriving at Cypress, he worked on CCD camera bus interface boards at Princeton Instruments. Mark is a member of IEEE and has over 20 years experience in the electronics industry. 9/2004 - dektM 63 Quasar Electronics Limited PO Box 6935, Bishops Stortford. CM23 4WP Tel: 0870 246 1826 Fax: 0870 460 1045 E-mail: sales@qiiasarelectronics.cam Add £2.95 PSP Id all UK orders or 1st Class Recorded - £4.95. Next Day (insured £150) - £7.95. Europe - £5.95, Rest of World - ES.95 (order online for reduced price UK Postage). We accept all major creditfdebit cards. Make eheques/PO’s payable to Quasar Electronics. Prices include 17.5% VAT Cal] now for our FREE CATALOGUE with details of over 3GQ kits, projects, modules and publications. MAIL ORDER ONLY. VISA O QUASAR electronics H&pfrc? mote i ,v>o rigv conoeeftor*' Motor Drivers/Controllers Here are just a few of our controller and driver modules for AC, DO, unipofar/bipolar stepper motors and servo motors. See website for full details. DC Motor Speed Controller (5A/1QQV) Control the speed of almost any common DC motor rated up to 100 Vi 5 A Pulse width modulation output for maximum motor torque at all speeds. Supply: 5-15VDC. 8ox sup- plied Dimensions (mm): 60VVx1 OGLxSGH. Kit Order Code 3C67KT - £12.95 Assembled G'der Code A33C67 - £19.95 NEW1 PC / Standalone Unipolar Stepper Motor Driver Drives any 5. 6 or Sdsari unipolar stepper motor rated up to 6 Amps max. Provides speed and direc- tion control. Operates in stand-alone or PC- controlled mode. Up to six 3179 driver boards can be connected to a single parallel port. Supply: §V DC. PCS: 80x50mm. Kit Order Code: 317SKT - £9.95 Assembled Order Code: AS3179 - £16.95 PC Controlled Dual Stepper Motor Driver Independently control two unipolar stepper motors (each rated up to 3 Amps max.) using PC parallel port and soft- ware interface provided. Four digital inputs available for monitoring external switches end other inputs. Software provides three run modes and will half-step, single-step or man- ual-step motors. Complete unit neatly housed in an extended D-shell case. All components, case, documentation and software are sup- plied (stepper motors are NOT provided). Dimensions *mmi: 55Wx70Lx15H Kit Order Code: 31 1 3KT - £15.95 Assembled Order Code AS31 13 - £24.95 NEW! Si-Polar Stepper Motor Driver Drive any bipolar stepper « motor using externally sup- iCmB rsi plied 5V levels for stepping 3 ~ " and direction control. These |-^ s ] LL usually come from software running on a computer. Supply: 8-3 QV DC. PCB: 75xS5mm. Kit Order Code: 3158KT - £12.95 Assembled Order Code' AS3153 -£26,95 *T|1 ■■ wr <~'. . ^ ; : ; .. t~ 2 Taa : ~ ■ ; ■ . : a Tdftsii 7Z52 Dste Eaatigt Srao* (Xi&3 trfce ICtXfcz ' " ir i ■ : a: ! ifu m m a * In ... H P. StSGlA : ; - z ■ ; fee lCU‘2 H: emus csus-4 □tad (L?+^j 1^1 r-rfgp** £0-l2Gd3 UO . £55 £ttOW( HDI1S j i : •- * ry.i.r Bfifer/. fry* 2 , carr,-*^ Ete; pa WAYKf KHB 5424 pg rJ . 1 -l : ■ . f z r 1 5 . : : - : " ' ' '. r - 1 . ; : : : ■ : H.P. 5: e.k AJ,F , m 5I‘A ^-5-1 Vt £2H KEKW DOE} CS4025 C ■ ~ibg= 20Vhi . £125 Ijaitf U3S523 fenEiisi-Gfe B-s? 7/gei 35MJ& _ Etti GOUUJ 0S3»0ssiksc^ fr-Ee 5SIB& PS hah om pamasdfl ;c wmu z. . nzs KENWOOD mm imn&BS&i2QfrgK& _ £=3 KEKWQDQ R140 VfV & Refer £5 I KEh~W0DDFL1E£AVi: i : '. f :‘2rUi£d E75 Has £53 Girt 43 Wlt| Wsfef HI iiHK f75 WROQH £32C^F ¥uz*f Serf tlasa^ ” US-J&ed £1M used EM ' 1 ! - " 1 , : i : 1 1 ' A© - 25TiLii . . £195 KWTii RACAL ;:::5 :: fjq i GGUID JI3 JrA-Sq CsltWr-llBIfii : a: i : ■ tJ 5 4VCE rr >5 - ©- -a©: 1 LV^tM’O? Titm m - £125 I ■■» «» ««* t,™ FAflMHl A1HI?S Ifcd Jjfesr !£\_S5e F4HHQJ. C5GI ll . ?■; : E-~ Zz Izi ■I "'::■= ‘I-: "" : rt „ SSUHTaOH r:=: : ,r|1 - f: : IjBb ISsaortkiCs TTL-Sg^EnEr Pk&l OV p fs tt. FILKE 4SGCH Tt^ RW3 SU3JE 45 Egi: S C'UJrreoM 7151 r - _ :- 2*e**n». UiiiESS I S^Lt ^ H?.33i:4 r _- Gar : :c-T-:-51.iH i.'-iS: FA^hTLL LPU 5 ’iS; 5 tt' a^zn EErS-'U^ _:■ . ■! rn -.■ : \ ^ ^ H P ;-L:A Lie : 7 ■: :■! , ' r :E ' _:■; : : ja i~ z i-EA E . ■ ' Tr^: F^UAE 77 l - ■ RUXE heme i |[ ck.tKS 1 ®6gg= :■.■ i.rti” n::- fcn^a£75-ri25 mu THDrLaf TKA-SDEFI P3D F. 0-5Zih T - 0-2A iwios | fe eSsara^} Ratal Oatron 1 High QuairSy 6.5 Digit Bench Wullurieter' Thib RMS/4 v/ifetEyrr«it Convextef mui?3}±ic : cc:v, AP £2 v- - litzm^rg FAB. WELL 5' El CHC. : :7- FAJUtaj, FS5 l5 :-E'Jh E-2EA Fwvet S^t] K 1 S3StO 030^ 04M FAHWFI I feat XA35-ZF ChPALft-o? GIUJ. ICO Ife-ptef £1 e 3 f AfUJfU LS^Z (KSW:fr3A PS FARmi L3Q-1 0-T4 ESt Friiri 5::; ri : : i: - : TrsrsJ^.- - =-t ' iC; F'-.r^ 5X'7A £4ii ©ff KRAPo^f? I/A, KING STREET, MORTIMER, NR READING RG7 3RS Tel: 01189331 IN, fax: G1 189332375 www.stswart^f-roadlng.co.Lk felSltlli! ^ir533piE ItartSj _ : i •”■ :; - 1 • Famed DTV 12-14 Oscilloscope QeisE Txacs 12 MHr TV Coupling Only Famed LFI Sme/Sq Oscilloscope 10 Hz - 1 MHz Only OSCILLOSCOPES It* ”Z E: ’ 1 . • "-■■•; . . . ■ : TBtrasai T5S3J3 Dj* Tn« itO^ioa^s TIlTrSn I ..AT T : . I :T'. r -: lite-ol S53SV asM tiaa 173UferS£ «U7 ". Dsn 7rS:i lOV.-z IT-L pwaips ?4tsGS2 sasutfi E3atej miffs =yEGI2i2L.: -jSii;-, -r ■Biz Car t TEilRCX' W C-irsin ifc _ j - ■“v-I 't 7*1 ....: J j7- J I: a. E.-: E’.I' L'l'L [^i. M£ rAA r - T "-'.r, E : ■ i- P :.f ll 1 !' ' . L J ■© ^ 1 -::T :.: ' FT' r-r.UPS -‘■■‘-.y.i 2- PHltPS =V:A5ig mm Fusj t g ezh iTi T . -T _ £l _ © : T : . : 1 A A T . : . . : . ■ or Oscilloscopes Available .. _ -:-l - : - ■ : ■ ■ .. :: e-:i: ■ ■ J . 3 . : : : '1 ::::: i ■ ;■ n- : 1 -. ; ©- -if ■ n; _:o :,. .. : : up. «57A $f* 1 - mem fe= fzm BJ.fe^SSrjn tcoo*2-sg^t5t^s» ns* -H r :-TA© =. ■ v ‘ -= TAAJ-I T .: !•©■ f= j; SIS A ae? Si5 lftrfSSaz &5 &t1 £415 T A : I-.© . ; _ JI_: _I_ I : ; r. PffiiPS FliWES ?.i7 ■: ■ .• ZOCV-^ES-I : i© ATE FATJLL SSSt SfV«a M4T3I £« &bS ^»U-aZ3UKr H P 31SA i z _“™!r. T-€- . r " ' - ■ iuxom £503 A-Cilrjif Vii'.-ir H.F. -'ll- _ .:-7Z7 T :£ -.©. :-■■ M.P. - - .A- Vff„- Cv: -: ,r -4 H_r. EDCIrA I-itiic. - wam iess i-^r^ -nrf iiT^se^-5 Hf. ilia Ah auft HJtRCtU 2«3 F:f; ■ . — iy=il a aaa f;ti 2assu EIP. SStlAl£fii -ieS^5iS|anii& ^ F Tf5;5 .. . c -rj.'tiL" ST UAPjCOS 23E U.zC Uf3T SIC ■ -r - .'■> - £25-5 ei fiis l£7£.ii ET5IS £2IH £1LI3 ■ :::: 1113 in: Spectrum Analysers H P. i= TT - ir! -j T TT-." : — ee-i! " ■ilti HP Tiy- !•' -- " T'- r H P. Tf-A - Tin--.; I-T-- “I : jf :: HJ 1 - ?=*5f4 5 ■ ifiz-II .--■ _ Eli; I -1 F. TTT ! : .■ t tr.T.- - - "j- - © " A - -:- L : A ' ' . £1E=S HJ*. '-ZnjJSlHr rues H P. T:: A =-‘ - irAAT. Q« r;.i\ 7 E5‘ : - T'F -A-.: TT-: TITirWaiinfc 3=7 ODDI-ZSHf maf.loH'J ttt: -T'T-i-iyj£±r ^ ft? HABHHQ 1T1 -SIAt Itflflfife ILF. 152 rua E5a7 HSH=-35aftfe (LF.UfT Sf-rETTE irz: i '-7--\'’ r -.- fii: ; j TUT £3£:j etsa-s QM - t= ^ tm et:t _- . £733 - r- Eli'V £SJ» 175T £71’ fjftSLi^Cj- A Tint E225B Wk . fls lllIBb ... r - : .. ... £U£: DM! HP. TAT" 1 '.A- UaiJaCon Ltrraib fcai j^a: fi!L3 E5|M at t : t:t a-e: e “ - -e :■: :: .F, ±T5tA A-tr'fss OettipfeBU H P. h5TIA Nttm Arnrjidj StEGIE^ “ f. ttt "- z-i- um H_F. 56E1T5 ' - - 1 £. ■ E4I3 HJ- 66 SOSO PSU CtflS 0-l5¥0-3AC“tW frl zA tt.f. T-TA-T TT. --;A f© osa CSBi HP. tc 22 A?SU 1 rc 4 GuCSIiS fuftprnji Cheu £ 1*1 :- . :-zA n: : -- litot a mmi e Hi: £451 HP. 147X4 PjUHJ 5 ^ flijril TJIS HIKE-tS DVU Dtd Qe^ U*i 9CHHSCT ‘A: [ V 1 , 1 7 z ztlt . £5-53 H3TKLET r"” ~ — •~ t ~- — — t.~. j — ,i-jt fit-i HP- i£v:r UyffitfEqs^r a ■w F ft ■» * El :• 1 3 BlOLfeuiaH-rjse 1 S 9 &?£ --■ E:J: HP. I 7..-7E- - - A’"- T-J . ftp:A7-.rvi "---u k/t-jt- ICC - ©l.-J ■ -: !r --- SSVr.'iaihtiO Aras3i3 A.'-ilxri -_ri:r::'- T© £1F$3 K.F. E3*i A E . ■ - - 7 T-- A’ - - ; ■ - : Fwatizss EtACt 5U3 JUKI QA A -A ;- ia-.-iv: EW ~ E-..©.:, C.T'.r— ■ ILF, r 3a» fijBjffiE f IsIt-SnWKl Lt ? t : ILF, Sjfi SujPiS &£» n 1-23SOWKZ Elsli Cfl-AllU SViTttH f EAT its* -T-Ate- £K K H Radio Communications Test Sets ; Hiljrill ZTSz — it dSM 1 flSECE 4 ttPMSlCtrt K t-'TKXHfrz E13H ffiHjmaafia © 4 : 11 = 11 1 Used Equipment - GUARANTEED. .Mariuals supplied. Tfe is a VmY &mL EAi-l FL£ Gf STOCK- SAE of Te^iuoe for fsfe. Ptease dieck avaifefiility te'K : ■ Zc-a . : "Gf 3 _ *3 £16 A ' ie z:: z i ::■ ~:k : : 5c-:d3 ro ii- ■ - 9 / 2(304 - dak lor elttfrcjiks 65 E-ONLINE Bogus Electronic Parts Beware of fakes! Harry Baggen The forgery of expensive brand-name products is an easy way to make some money quickly. Lots of products, anything from T-shirts to watches that strongly resemble the original are offered for sale, particularly in Asia, for ridiculously low prices. In recent years, even electronic components are being copied. From the outside they are indistinguishable from the original, but on the inside they are pure fake. This can have nasty consequences when you solder one in your circuit! 66 ebktor efectrariics - 972004 Forgery of brand-nome products has been a phenome- non for a long time. Everyone will hove heard the holi- day stories where you can buy a 'real' Roiex on the beach for just 5 pounds! It is too good to be true.., Bui if is not only with clothing, handbags and watches that shady factories and slippery individuals fry to make easy money at the expense of someone else's reputable name. These days, counterfeiters go much further. Every- thing that con earn money is a potential target for the for- gery industry. A very serious problem in the area of copied parts is fake ports for aircraft, so-called bogus ports. Aircraft ports hove to comply with very stringent quality demands and ore quire expensive as a consequence. A very attrac- tive market for forgers, who will refurbish old parts or will attach other brand names to cheap parts in order to sell them on for a lor of money. But such fake parts can cause serious problems if they are used in or on an aeroplane. Experts have attributed several accidents in recent years to such bogus parts'. The counterfeit parts turn up in all sorts of areas: clothing, watches, bank notes, pharmaceuticals, foods, toys, sun- glasses, automotive parts, computer software and elec- tronic components. This problem is not just something that started in recent years, but has existed at least since the seventies. In 19B1 a scandal was uncovered where millions of fake contraceptive pills were distributed, with all the conse- quences resulting rrom that. Now you can only smile about these things. Much more serious are fake aorta pumps for open-heart surgery, your life Is then really hanging by a thread! Even the space organisation NASA con f avoid the prob- lem, They started legal proceedings last year against a company far supplying fake connectors. In the electronics area you may remember the issue with fake capacitors on PC motherboards, a few years ago [1]. Even motherboards From reputable brands were fit- ted with eleclrolytic capacitors of very poor quality (but with the label of a v/ell known manufacturer] that gave up the ghost after a very short time by exploding or by leaking the corrosive internal fluid all over the PCB. Recently there was a problem with fake batteries far GSM mobile phones, which reportedly had a risk of exploding. This did not only involve batteries from unknown brands, but also fake batteries on which the labelling would indicate that they came From the official manufacturers. Experis suspect that most of these counterfeit parrs origi- nate in Asia, or China in particular. The damage caused by this Is estimated to be several billion pounds (just for the electronic components). Because of the strongly grow- ing industry and the increase of chip manufacturing facili- iies in China this is likely to increase significanily in the future. A good overview of recent counterfeit products can be found on the website for Designchain Associates [2j. There are o number or organisations worldwide that occupy themselves with fighting the 'counterfeit terror', A .- z ;i: s St su ss c 1 4 V ?■, ■: Cojtii 1 1 : :-i •- v 3 %rr* such os the IACC (International AntiCounrerreiimg Coalition) [3], Serious problem With electronic components it Is not so easy ro check if a part meets the specifications of the manufacturer. You could perhaps run a few logic tests on a digital 1C, but it is much harder with an analogue component. It is a big problem for manufacturers of equipment to determine in rime (that is, before assembly) if oil parts originate from a trusted supplier. Mast semiconductor manufacturers have recognised how serious this threat is far them and will warn their cus- tomers as much as is possible when counterfeit compo- nents have surfaced somewhere. These are often accom- panied by detailed descriptions so users can determine the differences between authentic and fake for ihem- | ft i ttJ Sttr.ii- km l- ^v- _ 1. -j:r. j- - ?, 3 i _ — : -r HfC * . a J~r ■1 J* 1 3 j: - .T i |-ujrr^x=?T.-i.T5_. T , i . r-" . : r- Uzz—^r 1 -- -j International AntiCounlerfeifing Coalition -■ I'KviivnA 'r“ Sri.iim-'rfRij '-alter iilt Fttfcejii 2! --VJ * m ■ - Crlr, 'La, r In - - “ ■ S - "■ r, T,fc-T, wI^C 3* ' iSISi it ‘.■dUT'i.i i .i-.Jr-iiit; (! wc:^fa (flifl f 1*1 ” ILrj isT Z* 2CC2 S'tfjol ± 1 = 1 . Dirtciorv of CotiaterftiLi ■j -Hr ■ f-. 1 • 1 * ■ I ' ■ | . . 1 . : fc . | : ■ * 1 1 ■ 1 1 ; i : lit ' . • ; • » HiHf Pi iijlt |^-r i ---» H q i Ml j ’ ' I . : ; '■* z. _ ■ j : t j j j . • „ » ? — -—■•:** . 1 : jii i F^ 2 ;ci Fji* I - ^ 9/2004 - ef'kior ehcfrcnis selves. Various famous brands such as NEC, LG r Hynix, Agilent. Vishay, Altera Atme!, Hitachi, Motorola and Toshiba have already had to deal with counterfeit copies of their products. Quality The quality of fake ports appears to vary enormously. There are (often passive) components that are so well made that it is very hard to tell that they are not from the original manufacturer. But in most cases the quality is sig- nificantly lower. Power transistors ore a favourite subject for forgers. Here the packages are carefully copied, so thot they look as much as possible as the original, but on the inside is o chip with much poorer characteristics. Usu- ally the chip is also much smaller (i,e., cheaper!) than the original, so that the transistor will fail in a very short time. Several examples are already known from Toshiba and Motorola. But it can be even worse. In one case, o company bought o botch of ICs (IT 1 040] that were desperately required, for a considerable amount of money because they were scarce on the semiconductor market. After inspection if was realised that there were no chips inside the packages! Another phenomenon that has appeared in recent years, is offering microcontrollers with OTP memory. These can be programmed only once (One Time Programmable). Already programmed ports are sold os new and the new owner is then stuck with a batch of useless parts! The moral of the story: Be alert! There is no single woy to provide 1 00% protection from fake ports. Semiconductor manufacturers recommend their customers to obtain their components only from the official distributors or trusted suppliers, but if has already transpired thot even these channels con be corrupted with forgeries. If is, in any case, a good start to buy from known suppli- ers and to check on the manufacturer's website if there are warnings far specific parts. A number of companies have put together lists of fake components [9], with short descriptions of visible discrep- ancies with respect to the original ports. A glance at such a list is also recommended. In addition there is a special website for fake power semiconductors [10]. Everyone who builds or services audio amplifiers should certainly pay a visit there. And finally the simplest advice: caveat emptor , be on your guard for deals that just look too good to be true. After all, you get nothing for nothing! Readers with experience of fake parts are invited to con- tact the editor, because we ore keen to find out how big this problem is in Europe. We con then also warn our other readers! . = 7 >. . 1 Fqdflrt Nil Si 51 - ! > H « * f! L-Sf ’3 r.* &p. AL . LAS yH/Jxivn tt LMLKKJKl.OOk-.UJXE CGMPOVLYt.M fxj'xi — LZ.--.ryi i— “13 rzzc^fj JTWT fiu -stf TtiErr riijlr '-x.Ut 1 CiS,W r ZL-X.CT, Icrmiri XI - ■■■ i v ... •’ .!.• . s X" l r- : _ :: x .:x :.i_- — ;e T'.-s— ■ sr. ", - V — i -ri h firi HciX TTT| TT 1 ' 1 3Ti.ii.jO j; X. -^»iUrdl B Ik 4 Jeff Ulz VjihsjiJ ii l i rS+i i ’ i r : j-r . ' Dl —i '■ — zxrkzJ n- |x - [ T_rifi imj -l z r - Ife bx rf dbrz! L vc xir . t af=iz 5 s 4 u tj jj 3 ui»fm.U €* r xz,;t-fc;;n 5W x 1 "i: ■ • i = ';i t = Mi; 3 L- ; : i. l Z-l-lT. x:_ ■ 1 L-iT-xx:,.— i^rl- - V' r'ri r; =_ ; : i : f nnz^i-Tizin HQf main-TiXTKjKt Afe En taiHUZir iMil ^ S mH n-r Vi.T> hhxji T’x 1 ='■■•* >jf -.1 x : . f ime - ~ — x-- O ■ h ■ ■If- Lri t J. Internet addresses [1] Leaking capacitors muck up motherboards: www.spectruni.[eee.orqyWEE0Hiy/resoyrte/feh03/ncQD.hlm[#n [2] Designchain Associates: www.dKiqnchQinossQriate5.com/co1tnlerfeit4html [3] IACC: wwwTacc.org [4] ^axim: htip://Ddf5erv4maximTc.com/Qrpdf/alertl.pdf [4] Kamnka: Counterfeit parts listing: www.kiimaka.de/deiitsth/service/counlerfert-nDrtsTistinq.him [5] ESP: Counterfeit semiconductors: bltp://sQund.weslhD5t.cam/cQunlerfeit.him 68 ebfctor elictrcnla - 9/2004 Forest Electronics - PIC and AVR ANSI C Compiler Products FED's ANSI C Compiler for PIC or AVR processors * Fully integrated editor with syntax highlighting, multiple pages etc, * Full project support - include and manage multiple source files, simulator, assembler fifes and notes tom merits within one project * Fully integrated simulator and waveform analyser step from C line to C line, or examine code in assembler form. View device pins using a logic analyser application. * Simulator supports LCD modules, keypad, buttons, LED's, displays, analogue inputs, serial and asynchronous data. ■ Designed to ANSI C standards » PIC - Supports IBxxx. 16xxx, 12xxx series 14 and 16 bit core processors * AVR - Supports standard and MEGA core processors ■ Generates MPLAB/AVR Studio projects and source files and completely standard hex output files. Prices from £45,00 - www. fared, co.uk for full details, W/Z-C / AVIDICY Drag and Drop rapid application development using ANSI C for PIC and AVR ■ Rapid Application Development for the PIC or AVR microcontroller using the C language (W!Z- C for the P1C r AVEDECY for the AVR) * Drag and drop your software component selections on to your design * Included components support timers, serial interfaces, I2C, LCD, 7 Seg displays, keypads, switches, port contro!s : many bus interfaces including 1IC and Dallas iBurton, AVR/PIC Hardware, and more, * Connect software components to MCU pins by point & dick ■ Parameters set from drop down fist boxes, check boxes, or text entry * Links your code automatically into library events (e,g. Button Pressed, Byte Received etc.) ■ Automatically generates your base application including full Initialisation, interrupt handling and main program loop * The complete C Compiler and AVR Simulator programs are integrated into AVIDICY - total editing compilation / assembly / simulation support in one program * Also includes the Element Editor to enable you to create your own components with ease, * Demonstration available from our web site Prices from £50.00 - full details from www.fo red.co.uk A Forest Electronic Developments 12 Buldowne Walk, Sway LYMINGTON, Hampshire, $041 6DU. 01590-681511 (Voice/Fax) Full details from - www.fored.co.uk jncsna Email - "info@fored.co.uk VISA If For rapid development of electronic systems... Low cost USB PIC programmers (SS'fng at £27, S-hoiin ££5) plus a wide range of adcHjn boards anc accessories... ^~.p!us incredibly easy to use software based on flow charts— ...equals extra me iy rapid system development: like this mobile text rressag'ng system built from E-blocks, ..and solutions for learning and development. Hands on training courses Resources for learning CPLD programming Complete courses in electronics and programming Equipment for datalogging, control and PC 'scopes foainrrg courses in PICmitJo£R} programming,. CPLD programming eral ECAD mm ii see www.matrixmultimedia.co.uk ...and more at Matrix Multimedia Limited s ates@m a liixm ulti m ed ia, c o, u k L 0870 7G0 1831 f. 0870 700 1832 E-b£ocfes a-e smaa ti-ail boards eacti of which cortairis a L'ocx cf electronics typ-'ca c iy found in an electronic system. E-c'ocks can be programmed In C, Assembly and srs bgjhcy integrated w?ji Hmvcoda - which instancy cofiv&fts f 4 / device programmer manufacturer selling through contracted distributors all over the world universal and dedicated device programmers excellent support and after sale support free SW updates once a months new SW release reliable HW three years warranty for most programmers 1PEVA LIMITED http : //www. i peva , com 1PEVA sell low cost USB FPGA development boards, IPEVA provide Design Consultancy for Embedded Systems, OpenCores-lP, FPGA, ASIC, HDL translation and migration. Tel. GB7G 080 2340 KOMCARD http: Vww w. komcar d.com Leam how to design a PCI card, and write a PC! device driver. We lead you step by step with practical PCI projects you build. ERVAN INTERNATIONAL CO. http:. Vwww.fi rva n -in f .com Power Electronics and Solar Energy Design and Consultants. Also offers: Discount prices of: * Ultra Bright LEDs ■ RGB LED" Cluster Kits * Laser Pointers * Solar Modules * Batteries FOREST ELECTRONIC DEVELOPMENT hit p : W r ',\w.f or e u .co.u k FED supply PIC programmers. Basic modules, and development software including a PIC C Compiler, Prog n Drop Visual Development and a well featured debugging environment. FUTURLEC rip-//wvAv,fulurl ee. com Save up to 60% on * Electronic Components ■ Microcontrollers. PIC, Aimel • Development Boards, Programmers Huge range of products available on-line for immediate delivery, at very competitive prices. LONDON ELECTRONICS COLLEGE http: www.fec.org.uk Vocational training and education for national qualifications in Electronics Engineering and Information Technology iBTEC First National. Higher National NVQs, GCSEs and Advanced Qualifications). Also Technical Management and Languages. MOP ELECTRONICS ftp : w ww. mope lectio nics.co.uk Leaders in Device Programming Solutions. • Online shop • Low Cost Adapters for all Programmers • Single Site and Gang Programmers • Support for virtually any Programmable Device NEW WAVE CONCEPTS http:vywwv;.new-wave-concepts Software for hobbyists: ■ Livewi re c i rc u it si m ufatio n software, only £29.36 • PCB Wizard circuit design software, only £29,36 Available from all Maplin Electronics stores and www, map) m. co.uk 76 r!rp:[-j rfedrcnics - 9/2 C 04 LINKS PCB WORLD http : / Vayw. pc b w orld xrg . u k World-class site: Your magazine project or prototype PCB from the artwork of your choice for less. Call Lee on 07946 846159 for details. Prompt service. PEAK ELECTRONIC DESIGN LIMITED www.peakeJ ecxo.uk Cool component test gear for your passives snd semis. Instant identification, measurement and validation. Connect anyway round. The Peak Atlas family starts from £59. QUASAR ELECTRONICS v. :;.C asarBe.ctrQnics.com Over 300 electronic kits T projects and ready built units for hobby education and industrial applications including PIC/ATMEL programming solutions. Online ordering facilities. Tel: +44 (0) 870 246 1826 Fax: +44 (0} 870 460 1045 Email: salesgQuasarElectronics.com ROBOT ELECTRONICS ft ftp. : f, vvww, robot- e I ectro nicsxo.uk ■ Ultrasonic rangefinders * Motor H- Bridge controllers Magnetic Compasses * RC ser\ms and controllers * PIC programmers and components * Electronic Design/Developmeni and Manufacturer to industry TECHNOBOTS http:; ' vAvvdechn obotsco. u k Welcome to Technobots - the one stop shop * ■ specially for the remote W- j operated robot builder, radio control and engineering hobbyist. TELNET http: ■//lelaelukxom I The site shows graphically Telnets wide range of quality second -user test and measurement equipment including oscilloscopes and spectrum analysers. ULTRALEDS n8p;//vA’,'w.ultraie!ls.co.tJk tel: 0871 7110413 Large range of low cost Ultra bright lecis and Led related lighting products. Major credit cards taken online with same day despatch. USB INSTRUMENTS http: v, xw.usb* insirumentscom USB Instruments specialises in PC based instrumentation products and software such as Oscilloscopes, Data Loggers. Logic Analaysers which interface to your PC via USB, VIEWCOM h ttp : ■ ^www.viev;com J9 x o. u k tel: 020 8471 9338 fax: 020 8552 0946 • Mail Order supplier of: • integrated Circuits and Components, • Kit and parts for Etektor projects. • Transistors, FETs, Capacitors, Resistors, Crystals, etc and hard to find devices. Viewcom Electronics, 77 Upperton Road West, Plaistow. London El 3 9LT Elekior Electronics have a feature to help customers to promote their w ebsites. Net Links - a permanent feature of the magazine where you will be able to highlight your site on a regular basis. * Tor just £120 + \ AT t £10.90 per issue for eleven issues) Elekior will publish your company name, a 25- word description and your website address. * For £31X) - VAT for the year i£27.27 per issue for eleven issues! we v, ill publish the above plus run a 3cm deep full colour screen shut from vour site. Places are limited and spaces will go on a strictly first come, first served basis, please fax back yotir order today! 1 wish to promote m\ company, please book my sp;iec: * Text insertion only for £120 + V AT • Text and photo for £300 + VAT NAME: ORGANISAT JOB TITLE: ADDRESS: »■# *- -- S- + m t a TF1 * a- a a a a .a a a. a a i. a ■*■*--- - -r- - - -r-arr-m «n a a^ia a ■ a ■ a ai a ai.a a. a a. e b. a a. s a. b b. ^ -r -a a- a a- * « a a< a ia a (■ a :a a X J 1 a a a . . b. ^ - - _ - _ - T s T B t aa- a v a ai a -a a.a a .a a a a ■ a a a-aa-.a a. a a. a a - B . T r m a mm mam PLEASE COMPLETE COUPON BELOW AND FAX BACK TO 00-44-10)1242 226626 COMPANY NAME WEB ADDRESS - * a t - - a t a a 25- WORD DESCRIPTION. ----- - - - ------ - a -a ELECTRONIC ENTHUSIASTS Only one magazine rests its projects and circuits in its own lab before publication - THE ELECTRONICS & COMPUTER MAGAZINE Contact: Worldwide Subscription Service Ltd, Unit 4 Gibbs Reed Farm, Pashiey Road, Tlcehurst TN5 7HE Telephone: (+44) (O) 1580 200657 Fax: (+44J (0) 1580 200616 Or visit our Website: www. elektor-efectro nics.co.uk 9/20 04 - d? Siler dertrsnin 77 mailbox Andy's Quest A new quiz has been launched on our website www. eleklor-elec - tra-ics. co.uk in which you can test your knowledge of electron- ics theory. Participation is free and anonymous. Each round of Andy's Quest draws o random selection of five multiple choke questions from a base of about 400. Have font Railroofer project soft- ware The author or the proj- ect , Mr. Pay King, kindly advised us that the "Serial OCX module he originally used in the Rail router software was protect- ed by copyrights owned by Everyday Practical Electronics it Ft) magazine. A new version of the compiled Rail router soft- ware , eliminating the dependen- cy on EPEs Serial OCX utility, is now available from the Free Downloads section of the Elekfar Electronics website . We apolo- gize to EFE for having distrib- uted their copyrighted CCX module curina the period 1 6 through 28 June 2004. C for AVR Micros A num- ber of readers keep asking us about C compilers for Ahnel A\ ‘R - ic re cc r. t rc : i e rs . V Ve ca n recommend AVR-GCC for sta- bility and the fact that it s heel See w :vw.avr freaks. net Out of Step Dear Jan, I believe the photograph print- ed os the head of your article "First Steps' in the May 2004 issue shows the internals of a synchronous three-phase motor, not a stepper motor. The letters printed near the three solder pads in the cen- tre provide clues to the motor having been taken from a floppy disk drive. D. Jansen, The Netherlands Our apologies and we make amends by printing these photos or a reaf stepper motor. Clarity Class-T Amp Dear people at Elektor, con- gratulations on the awesome dass-T amplifier (June 2004), But where is the chip avail- able from in UK? I managed to locate the MOSFETs at wwv/Jameil.co.uk, but a search of the TA3020 revealed nothing. Many thanks for a cut- ting edge publication. Gerard Galvin Fishing for chips Dear Editor, first let me congratu- late you on the new look magazine' it is o big improvement. I imagine your main readers are profession- al electronics engineers who have ready access to obscure chips direct from ihe supplr ers. As an amateur i find many of your projects of interest to me cannot be built because they depend on chips that not available in single quantities even after a search on the Internet world- wide). In particular the high- end pre-amp and the versa- tile final amplifier of a Few years ago. The same prob- lem arises with your new Closs-T amplifier project. These all depend on a single crucial, but unobtainable, chip. Would it be possible to supply these through your magazine or at least for ihe authors to specify a supplier? Malcolm Read Here is the con fad information tar Tripath s UK distributor: Profusion pic. Aviation Way / Southend-on-Sea, Essex SS2 6UN. Tel: t-44 1702 543500 Fax: +44 1702 543700. so ■! e s Cp ro fus io np Ic . co m Two internationally operating sup- pliers of kits and component s specifically for Elektor projects are: Ceisf Electronic , v- v. j r a eis f - e lectro nic.de DU Electron ics wv w. dil.ru PA 300 Amplifier Hi again Jon, I'd like to con- struct the PA3G0 amplifier, but r d like to know if this is possible. I don't have ihe 625-VA transformer required, but Instead I hove two of 30Q-VA 40 0-40V transformers which I was going to use to build a stereo version of the PA3 00- Now 1 understand that I will not achieve 300 wafts Into 4 ohms per channel based on 300 VA. What I'd like to know dearly is what the estimated power output will be for 8 & 4 ohms on 300 VA. I will use one transformer per channel. 1 know there will be reduced power which will be enough for my needs but like to know what that is and for example will there be higher distor- tion? Also I have 1 0,000 uF capacitors rated at 63 V, can I use 63-V capacitors in the power supply instead of 100 V as specified in the parts list? As my transformer delivers 40 Vac per roil this would be about 56 Vdc, so well below 63 V. Can I still build this amplifier with this reduced power sup- ply and is the setup of the quiescent current the same? I've always wanted to build 78 eifktDi dedTQsits- 9/2004 this amp but haven't been too sure on a Few things, I ve heard many good things about it. Ed Zammit (Melbourne) Well Ed the lower transformer voltage will cause a supply volt- age reduction o f about 4 volts (at zero lead}, f his will only decrease the maximum power output. The music power to he expected is 260 W mfo A ohms and 150 W mfo 8 ohms. Continuous power will he even less, due to the reduced power rating of the transformer and is hard to pre- dict,. because of unknown over- load properties . USB-fo Analogue Converter Dear Jan, in the November 2003 issue, downloads for the USB Analogue Converter were stated to be available from the Elektor website. However, the HEX file used in the proj- ect (Elk. hex) was not one of the files included in the zipped file 020374-1 1 (hex code and Windows soft- ware). Also, it was not dear what files were required in the MPLAB project to compile and program the P1C1 6C765. If possible, could you provide the neces- sary information to enable me to finish this excellent project Kierem McAreavey Several readers have asked basi- cally the some question. The required HEX file (EIK35.HEX) is in me zip file under the director v iic_ ass'. The source cods pro- vided is not guaranteed to be of direct use in MFLAB. it is not clear which assembler the author of the article used so we are unable fo help you with assembling the source code using MPIAB. This should be fairly easy however. Due fa the fact mot the HEX -hie is included there is no direct need tor you fo assemble the source- code again,, unless you wanf to modify the firmware to suit your own requirements * High-End Preamplifier Dear Editor, by now this should be a very popular question: what is the manu- facturer's name (and P.N.) for the 16x2 LCD used in the High-end Preamp (April and May 2004)? I mean the one used by the author, Benjamin Hlnnchs (the audiophile com- munity owes him a loft). I don t know if there's a stan- dard interface and any equiv- alent part would fit,... Sergiu Ignat (Montreal) rornell (wwfarnelLcam) have a senes of All Shore Industries f Inc . in stock. Look tor order code 412-7316 . The module Mr, Hin- ders used is of unknown origin. Simple 12-to-230V Power Inverter Dear Editor, I am a teacher at a Polytechnic and would like to use the Simple 1 2-k>230V Power Inverter [February 2004) os a classroom proj- ect. Unfortunately I can not quite grasp the function oF the R-GZ diode r combination [D4, R 1 4, C9, C 1 0) in your circuit. Is this some kind of protective circuit? Also, what is the specification for the heat-sink as that information Is missing from the article. Oliver Sluka (Austria) When H or T2 switches off. harmful voltage peaks may occur at the dram because an induc- tance (in foci, an non-ideal trans- former] is seen between X2-X4. Diode D5 shunts fh ese peaks into C9 and CIO. These capacitors have to be discharged however to prevent them building up excessive voltage levels. As soon as the voltage on C9 exceeds the supply level plus the zener voltage (i.e., approx . 30 volts), the charge is shunted off preventing the capacitor voltage from rising further 05 and D6 ensure that C9 and CIO do not affect the operation or te inverter under normal circumstances . Without these diodes , the capacitors could give rise to resonance. 05 and D6 only serve as damping devices when the voltaae exceeds 30 V The heat sink specification is 10 K/W minimum l CORRECTIONS & Upbatis Build Your Own DR M receiver March 2004, p.!2 r 030365-1 New software has been developed for this project that allows an USB/RS232 adapter to be used. This means the receiver can now be controlled from o laptop without a serial port. Free Download, see September 2004 Items. First Steps May 2004, p. 30-34, 030203-i In the circuit diagram the value of R17 and R1 8 is shown as 1 0 k, while 1 M appears In the parts list. The value Is not critical bur In practice 1 0 k will provide the best protection against noise at the FET inputs. Personal Sound to Light Unit June 2004, p. 58-60, 03001 9-1 The type code of 1C 1 should be LM358, not LM385 (text, parts list and schematic). DDS RF Signal Generator October 2003, o. 14-22 020299-1 Constructors are advised that o new version of the con- troller firmware is now avail- able (ref. 020299-41). The update solves the problem of the software crashing when the B r key Is pressed to switch between dBm and V. For a free update, return yaur controller chip with the Elektor ESS sticker on it fo Readers Services, aft. Mr. J. Visser, Software Service. MailBox Terms -Pub Sica U q n of read e ; * ccrraspon - aerce :s at ins ci seretion i 1 the Editor -•Viewpoints expressed by cr ---- porKi&nis s?e not '-scsssa' , Ihcse of the Editor cr Pub is her. - Cor r -25 p c n ce n c e m a y c £ tr an s \ sr . ad or edited '"cr length. clarity and styEa - .Vn=n y ing Ic Male z. :: --- 5 p Or d a r. oc p? es 3 6 G uq ia as li a r. timber Fieess send your Ms Bo- corre- spondence to: SZtC 7 dz Ob lo-E lEEsirc- ZSCD £T E ’■ e trio l E : G-ctro nics. The Editor P O Bov. 190 Tunbridge Wells TN5 7WY Eng Sand. 9 / 2 v 04 - ekktor dsefranks 79 Professor Met fin Ohsmann Martin Ohsmann was born in 1959 and as the photograph shows, got the hang of 'all things electric' (including hammers] at a very early age. Martin read electrical engi- neering at Technical University * Aachen (RWTH), Germany, gradu- ating in 1984. He became a staff member of the RWTH Mathematics Faculty (dissertation 1988), devel- opment engineer, scientific staff member of Philips Research Labs in Aachen. Since 1999 Martin is a Professor of Electrical Engineering and Information Technology at FH Aachen, lecturing in Operating Sys- tems and Distributed Systems. Martin Ohsmann has been reading the German version of Elektor since 1972. His first contribution to the magazine was an article on RDS decoding using a PC; this was pub- lished in 1989. m Many of you %vill have substantial amounts of identical resistors tying around, perhaps bought years ago as a 'super pack 1 or some ofner 'scoop offer. To practice the noble art of soldering dozens of these com- pa nents may be soldered together to form a square grid array (Figure 1], Supposing you had an infinite number of resistors available, the array, too, would be infinite. This rrtonih we kick off our Quizz'away series wllh ihis problem: A square array of inf bite size is built from identical resistors with the value R = 1 kQ, What is the resistance meas- ured along a single resistor as shown in the illustration? [low is the measured value explained? If you feel like solving the problem the prac- tical way, simply start soldering away a few dozen resistors and perform a simple meas- urement in order to get an approximate answer. Alternatively, why not push the lim- its of your electronics simulation program? Note however that we're not satisfied with just ihe value, but also require a well-sub- stantiated explanation, comprising os little mathematics as possible, please! It is also possible to hove a go at three- dimensional arrays like cubes [Figure 2). Have Funl Supplementar y question If you are not convinced that your explana- tion with the value measured in Figure ] makes sense or is as simple os possible, you hove o second chance to participate and win in this quiz. In ihe cube shown in Figure 2, ihe resistors form a three-dimen- sional array resembling the crystal structure of a diamond. The supplementary question is: How many resistors is the cube made of? r 1 1 < — _J □ c HUH H? i — — Mi 1 n F 4 80 tlAfa ilettrcnks - 9/2EHH Figure ) . Infinite resistor army. Figure 2 . 0/>5mof?n 5 Cute; a three -dimens ion al resistor army. hi . duizz'awoiy and win! Send in the best answer fo this month's Quizz'away question and win this Voltcraft USE Oscillo- scope From Conrad Electronics worth £135. Alt answers are processed by Martin Ghsmonn in co operation with Elektor editorial staff. Results are not open to discussion or correspondence and a lucky winner is drawn in case of several correct answers. Five participants with the correct [or best) answer ore rewarded with o 1 28-MB Elektor Electronics USB Memory Stick. Quizz'away conditions Please send your answer to this month's Quiz- z away problem , and/or the supplementary question by email, fax or letter to: Quizz'away, Elektor Electronics , PQ Box 1 90 1 Tunbridge Weft TN5 7WY t England. Fox (+44) (0)1580 2006 16. Email editor^ elektor- elecfronics.co.uk subject ; quizzawoy 094)4 The closing date is 24 September 2004. The outcome of ihe quiz is final. The quiz is not open to employees of Segment b.v. t i/s business partners and/or associated pub- lishing houses . 7 2D04 - cttktcr e!etfronlcs 81 readers services Please Note Software ferns ra ft ed z: z :v gt l iba rra= EVrstioads page (tf the Pi&Sstes’ wefcsSe ra.-g* . IXsteSss are suppSed For Be carw^izflce of tBad&s wShorfi kfemel az : e zz READY-BUILT PROJECTS Gameboy Digital Sampling Oscilloscope (GBDSO) 9z. _ 52-91 F ilZ : EGG. ixd EG-G listed tGOM Micro Webserver wrlft M SCI 210 Board 0300630* VC&oprDDGSsaf 5:-=rd. r^:y-i==r: zs £W 4 D 23-51 ?£ strt c-f* btt " e : -. F: v r ■: re i 3 >- ns m£fcd £ i/SS 77-55 137,50 69-00 112.5B 41-95 73.95 044026-92 CG-T^GEd patena #30060-91 - 044 026-51 era * f*r-3te-3 sraJss. 103-50 i :-i EVERGREENS Rn^diad (pC8s} ; sS-aliste Gai panel ftj&, EFROAfe. KLs, Gflls, rracrDcsn- i~G DfVsttfS Ik pfG{SCJ5 A" l” "ElE e: :e zt-= ~ 7v i_ G r E-.z'te'.h Tiy ggzzg ls f& tkder Form pitobd foem may afco :e _ee g :? : g t ‘ :■ :*-> :.£e;te e :' '. T _ z z r : "E" “ -j: - : - P£3 e :: EiE. - sb fe resriy-rreifc Btuuy Si tie Reader Szrwss n.i> - -=■ T;,rt xgxz. EPF 7 Vi 2-.E. FAii S}FUJs i!ACHs. ftCs ant otbw iricnKonfraiSas are resfy-pro- &"TiTEG Rices aid fern dtscripQx$ sisjed to cfe rg§. Fre : _: E“ : ~ TrE-i g, f “ ? nrstD cfangs .■ G'Gl. •I- - :*' - :”:?' :" F «ce s a _ 3 fern dss-:*v ,J -- “ s itsun hire sspiFsedf lr he Id preiiiKiS t£SjtS. 2 i 7 E PAST ISSUES PiF: HGEF r? i jE: Ei i iV. £ i-5 . l~i€ f ‘Z~ ^i r ;rii«[^E $Eb£?:rfpU£ii SEfnic lid, ITt t 4. G4':i Pir~. PiiMe'i RcE-3. TTC=EHU FlST Hi 5 7HE E>5ies3 r tEJefifs2re i-44) laiu 200517. fii i-44 1550 20S&1B, ETE.J a 7l« S unfSi.dfiffiSajCQ.lll = ~-i ;”t ii.Tz i=:r*E — h “_:.ei r: iJsCEjrtsa), toctoJog postage fa sanie ccpess^ are H .75 pt god &eF £5 l 30 {air nsi Europe); EBL1 D iixrr^ h 2 ^o£ Bxope). Rices. of past Jtfyite&st aid Dtc^nfces todbding postoge tor sn^ ee i.~ iB E5 i - : Eri £7.35 'ETTiil ■;-: : srd ES--45 i^jrra Eii-e-p* PAST AUTICLES For rjam^on en ptw canfacj or EiStorial a^d Officss . fifepfiorve oi = i: :cc-:.r ^oo:61b el^- g^'-- =r=-7ZZr ZE " 1 EIeHdt Electronics Help Disk 955022-’ D ; z.V /. r GdirAS VErtiloa £-15 14.45 Elector Eteclramcs Item Tracer 19B5-2003 £ US S CISCOS-* " carets dil^ZE? id?< A* ri: .■. s .sr^n^ 815 14,35 UHF-Low Explorer Universal Prototyping Boards ■3 020-416-7 PCS 980 15.50 UFSS-t PCS 245 AM UPBS-2 2 PCBs 410 7J5 No. 330 MARCH 2004 UFES-4 4 PCBs 5-55 11 55 Build Your Own CRM Receiver 030365-1 PC-3 9-10 16.10 no <335 SEPTEMBER 2004 @ 030365-1 \ D;e k Dn v t .©e ptogr 4 ti 4-5u £.65 ClariTy 3GD-W Class-T Amplitief Code Lock D I-jZI 7-&t A~p , ~ u SMDs pee-7T!rd, c ; j cE fer LI L L2 34-50 55.70 @ 0264 34-1 PC3 tea 1695 Rolling Dice ;5. 02043=: -r {jjai ^our^ i ^ gggs ^g 4-90 865 m ^0246-1 PCB^a 6 sates) 13 75 24.30 0204 34 -4 T Rd 6f&4A-4 R pnigrsn 14 70 26.00 § 640245--- £■,=>, sciste A hg» L ' : :- 4-SO 865 Hands-on CPLDs l2) § 040242-41 ATB9C2C51-12P1 pcmrsmTSd 6-JD 15.40 @ 630052-1 Fl5 8-90 15.75 Swiss Army Knife @ G3dD52‘11 SoftA^'s 4-93 8.65 I 0704434 FC4 =4Ei IJMJU. RS232, USB 9=4) 1650 036052-51 EP’47 1 2 E S LC £4-15 preg r iT3TGd 33 40 59.10 3 03044 5_i - Ifeic seS =-bi aSprGjcCiSSflA'Sre 6-50 1150 Mullichannel Faitsale lor Radio Controlled Models 030448-41 4T292S252-24FC prearaicrrad 25-35 45.75 3 020332-1 1 DsX c-Gie '..t 4-&Q 8.65 no, 334 JULY/AUGUST 2004 IR Servo Motor Inlerlace @ 000356-11 tesJt, ftCX prasren Pf€ secirce ^ ofeci coi= 020356-41 F^IOFG^S, prmranen&d 020356-42 RC1 67628. pro^jrimaed Micro Webserver with MSC121Q Beard @ 044025-1 N^tvmric Exlensoii Boaid . PCS octy Ft C Analyser % OM 1 7tf-f T m^K F ■ C- s Qtice kge Q3017B-4! PICt6IF627*4?t3R programmed USB Converter Canlrolied via HTfilL 3 0— D 34-1 t I g. £ F itg: e ped: t=t& Working with ActiveX m 030431-11 D t no. 3 33 JUNE 2004 Multi Programmer 4-SS 1000 1000 r :-Gf 4^9 10-25 4-^3 490 E=v 17.70 17.70 13.50 £.55 16 T5 E = = Bw :_: FEZ - - : :: : -:: Matti function Freguency Meter @ 036136-1 PCS @ 030136-11 D-=f - pnj:=St EORWETe 03013641 ATOOS^jlS-t^C. pniEpanr^d No. 329 FEBRUARY 2004 Digital Alarm Clock @030096-11 Disk, RC soura aid hsc code 03009641 PKl6f64-04 p h progrsnvQed i Access @ 020163-11 I^^sfflm^rxjdeaidccjttnXsafrA^rs 020163-41 ATS9S6252-12PG. proyammst Simple 12-ie-Z30V Power Inverter 3; 02D4Z5-1 PC3 Touch- contrail ed Svritch @ 030214-11 Resource code 036214-41 F^G12C53£A04SD8. pmgraniied £70 9^35 - :: 7^95 4 90 1 5-20 750 : :: e =.: 4-90 61 5 15,40 -e =7 6,65 14.55 e.65 26.90 13.30 24 60 15,05 5t-: 10.50 @ 020336-1 FC3 S80 ’ 7 =: S> 020336-1 1 J.lV l i. EG-_"r CCGE 4-9Q 3.65 Pnckel Pong 1 '330320-1 1 Le- FrL 4439 £.65 Rail Router @ 030403-1 PCS msa 19,15 § E ’ DL0 F ; : L FE sofTWHis 4-0Q 3.65 03O4C&41 PIC1^aT7-20d’ prt^^naT^d 21-45 37.95 Smooth Operatar El: GE0209-11 Disk. PfC SGmwiTe 4^50 8.65 030209-41 Pi C 1 5F84. i OF proBrarr,^ 14 l 70 26,00 no. 332 MAY 2004 Design Ynur Own 1C !:• 05 E 3-55-1 PCE 15 65 27,70 High-End Preamp @ 02jl'- 5-! PC8— frti.0 board 845 14.95 @ B20D46-2 P€ £ — fefey toad 7-50 13 20 ^02^04^3 PCS — P£U boixd 6-70 11.85 3 020348-11 m 4-93 £.65 D2534841 R€l£iT452-L L pr^-rT-rJ 28-20 49.50 Wind Speed & Direction Meter 'll E E . ] 7 ; - 1 i Disi. . pr l >:i z ctrivirz 4-90 £.55 630 571-1 • BC16F07 1 17-55 31 05 no. 331 APRIL 2004 □rap-in Microcontroller Board 3 920140-1 P^a 9 60 15AQ @ 910 T 4 3- 1 ’ D z'- sgt“lg &Ti ■:-: l ■ ■ : 490 fl.es Pandora's Sound A Music Box @ 030402” 1 P£3 WW 1S.75 @05G402-11 D3St,sa?ce and hejtcorfe ties 4-90 £.65 03Q40Z-41 PClcfflZi F. pfugraim^l 2fr55 36.40 Na, 328 JANUARY 2004 64-K G0C552 Flash Board @ 030042-1 PCS 9-35 ■552 g. 030042-1 : L : sfc. - .eg. rro.f:: sof; a are 4 00 6 55 0 3-0 1 142 -21 2 9rQ ID prog r=m~£-d 104)0 17.70 D 30042-31 fifij. 1 6VSD1 5GR pr c^ammai 6-10 wm Climate Logger •x: 0EO076-1 FC6 7-75 13.70 @ 03C976-T’ D-s j. Vi7- do ,v z z e ‘r.vare 490 2.-55 FMS Flipht Simulator Encoder m 030056-1 PCS 102O 1805 G32D5&4 7 67LPC767BN. c^'s.Tr.BS 17-05 59.15 LED Roulette 3 Q20163-1 PCS 17-99 31.60 @030186-11 0-=' sauna ss j tex flez 4-9Q £.65 9301 65-1 1 S9C 2951 -12PC : ' •: g^t . -rS 8-05 14 25 Multi -event Alarm Clock X D203Q4-1 1 C'Z". C fgt:: r " z? 4-90 £.65 0203 34 -4’ -72 9C2051 - 1 2PC , p- = -t - 1- : 6-10 10, £0 Stepper Mulurs Uncovered 020127-41 RCl6f 873-20 SP 1910 53 cO No. 327 DECEMBER 2003 FM Remote Control Transmitter & Receiver m 934044- ■ PCS 1020 1B.05 LED Chrislmas Decoration m 030157-1 PC 3 7-55 1335 P87LPG76X Programmer S &39313-11 n:^ proieci EatFrt3TB 4-90 S-65 Project Timekeeper ;§y 020550-1 1 Cd-. Goxrr.z i DKecl f zz 4 99 665 Q2 0550-41 P ; fCl 67=4- ’ C R pog r.LT~ -id 13-15 23.25 82 Elfktzr d^tronki - 9/2004 £ US 8 Stopper Motors Uncovered |2] @ 02012741 Di^snKce^ii| 4^93 6.65 Universal Clock Generator @ 020355-11 tfe^soucecadefle 4-SC B.65 V/ireless RS23Z link ® 030204-1 PCS e-70 15 40 No* 326 NOVEMBER 2003 Precision Measurement Central @ 0300504 PCB B-70 15.40 No. 326 NOVEMBER 2003 Rev Counter for R C Models © 6241114 PCS 17-50 31.00 62411141 Ocsft, scarce and hex code 4-50 8.65 024111-41 65C2{^1 -12PC, p#C^r2?sT?ii6d 8-E5 15,65 Running Tail Display @ 0204074 1 tKsfc,Sffi»ceercf ter code 4-90 3.65 USB Analogue Converter @ 0203744 FC0 7^5 13,50 @020-374*11 C'sk. hat cods aid Wsidows softwse 4-50 3.65 020374-41 FfC 16C765, piogramrted 13*25 23.45 No, 325 OCTOBER 2003 DOS RF Signal Generator @ &202S5-1 PCG r g^e^ar ii-eo 20.55 @ 020299-2 PCB, m nfro tt a wfr 12-10 2145 02029^4; AT90SS51 5 8PC r programmed 30-55 54.05 Minimalist induction* B slan ce Mels! Detector @ 020290*1 PCB 8-S5 15.35 Xilinx PROM Programmer @ 0101 IB-11 Softtfra 4 -SO B.65 No. 324 SEPTEMBER 2003 ATV Pielure Generator @ 020235-11 EK&, source &hac code ties 4-90 8.65 020295-41 £19058515*£PC. programed 15-20 26.9<3 D2029642 AT9QS12BG-12PC,. programmed 13 - 5 Q 24,60 DTftlF Remale Telephone Switch @ 020294-1 RCS 1165 20.6a @ 020294-1 1 project software 4-SQ 8 65 020294-41 PKM 6F84A-20G prixpBrraTtd 1470 26,00 LC Display wrlh I2C Dus © osma-i pcb 7-35 13.00 PIC Prog 2003 @ 0102024 PCS g-05 1 fcdti S 010202-11 Disk, Widows software 4-SQ 8 65 01020-241 F44 GFa74-20^ progim red 23-55 41.05 Polyphonic Doorbeli @ 020354-11 D^pTOfKt software 4-90 865 020354*41 PIC 1 6654 A4 0- ? prcgrantred 14-45 25-55 Precision Measurement Central 030060-91 feady-ass^iejled^lested boaTO 0900 112.50 Valve Preamplifier (1} @ 020353-1 PCS. a rlpfi^ tyrant 11. 55 20.40 @ §29383*2 FCB, ponsr supply board 11-40 20.20 @ 02O3S3-3 P€3, I'D toed 10-10 17 60 No* 323 JULY/AUGUST 2003 Add a Sparkle @ 0203334 1! B*s!l HEX soitfce fifes 4-90 8.65 020293-41 P1C1 2C509A-O47iJiL program^ 7-40 13,10 AT9DS2313 Programmer @ 034035-1 PCS 9-55 16.00 Hard Disk Selector © 0340504 PCS g-45 16.75 Mins Dunning Text Display @ 020355- 11 Dask. sente coda fie 440 a .65 Mini Test Chari Generator @ 023403-11 tfet PiC Souza a>i 4 -go a.65 Programming Tool tor ATUnylB © 030030-1 FCB 7.55 13.35 ■@ 050030-11 Dfefc. pra^SCftware 4-30 B,w Quad Bridge Car Amp @ 0340394 PCB 8-70 15 35 Remote Light Control with Dimmer @ 020337-11 CfeX. HEX and source fife 4-90 S£5 02033741 AJ1SC2051-1 2„ progranmed 6-25 1105 No, 322 JUNE 2003 AVR TV Tennis @ 030026-1 Ifeti FC3 @70 15.40 @ 030026-2 PlrsfiiXiB&n PCS 8-60 1515 @ 030026-11 Diss. AVU source cods 4-90 3,65 03602641 AJ9085T5, pro^anmed 15-20 26,90 Electronic Knotted Handkerchief @ B293S8-11 Ifek, pc ami cornrofcr software 4-90 3,65 02038841 AigosZSIS-IOPC, progranned 12-60 22 30 Low-Cost LCD Controller 1 , 2 ) g 020114-1 PC3 r 6-70 US s 15.35 % 0201 S 4- n D-4;l preset soft ware 4-90 E 65 Night Light Control § 020115-11 Dili hetarrd shsie nofe 4-ao 8.65 020 1154* 41605231 3-1 DFC. ptc^tt^S 12 £5 22.75 Universal XA Development Board 1 010103*1 PCB 13*20 23.35 .§> 010103-11 ffisl GAL code, ErRQV ?=.. v « X4DEY 4-90 LRE5 §10163-21 EFR9V ICB. 27C256-90. pregramriHii UHH) 1770 01 0103*22 EPROM m 2TC256-90, pny&m&l 10-03 17.70 01 01 03-31 GAL 1 && . pfijgri-TOTsSd 4-SD 650 No, 321 MAY 2003 Countdown Timer g §20296-1 1 Osl saii;;:;ni ;c*4? 4-9<§ 3.55 029296-4 1 A 1 9 L-^d r=< f.is 4-90 8 65 020 1 -441 FvCl 6FS4A-2C ?. pn>giafr.msd 1520 15 9j Dimmer wilh. 040 V Control Input @ 010125*1 cr-/: FCB 960 1 7.6rO @010125-2 terarPCB 6*65 15.5-5 Eieclronic Hourglass @ 020036-1 PCB 16-55 32.B5 7; 02603 5-1 1 §■: ■_ p-:: ; e : : s^jfTv, i - e 4-90 S.65 §200364 1 PSCl t.-04- [4 P pfOQfSnVm-J 1560 26 90 Products for of der projects (if available) may be found on our mb site http://www.eIektor-electronfcs.CQ.uk 9/200-5 - etekter elecfrtnia 83 sneak preview t* #^1/7 71 fi U -VS H : 7 Oscilloscopes An oscilloscope is one or she most versaiile and powerful look you can have as your disposal when If comes to analysing electronic circuit behaviour [weird, erratic or as expected'), fault- finding and repair, in ibis ariide we provide an overview or CRT oscilloscopes currently an the market and tell you v/hat to look for in respect of specification, look and feel and ease of use, oil depending on your budget, of course. Measurement Software far PCs Professional systems for measurement, control and process technology are heavily dominated by PC-hosted measurement cords. To ensure they can be used in many configurations, these cards have only the bare minimum In respect of intelli- gence 1 , and their lull potential is only unleashed in combination with dedicated software. In this article we present tab View and Pro flab Expert, two programs for this application area, that differ considerably not only in complexity but also in popularity and price l-JUULl : fi t Operate loc h Wln±»» tjsfe m - IT] t9? [4gj gf - r=ra CZ f J-T-T-j: :~-C'-r 3 T — =&>- >' 'Jr- s ] Uj J, -tT Goadbye M6, Welcome P1C1 8F The devices In the 1 8Fxx2 series of microcontrollers that has been recently introduced are pin for pin compatible with their predecessors from the l6F87x series and incorporate some significant improvements. In this two-part ariide Ron Coates leaks at the advantages o? these powerful cousins in the 1 8F series. Also*.. Capaciiivdy Coupled SMPSU r USB Memory Stick, CO 2 Sensor, Slave Flasher for Digital Cameras, F1CXEX18, Body Fat Meters, Wideband Active RF Probe RESERVE YOUR COPY NOW! lb Od&bsf 2004 Tssu«- gee; on k\z on U:kj 11 September 2004 UIK disrrib^stDfi c-- : «h UK suWiibsrs vi IM receive She mo^oiTre g Fevr days bef ore this- date. Article fifes and magazine contents: subject to change. NEWSAGENTS ORDER FORM SHOP SAVE / HOME DELIVERY Please save J deliver one copy of Elokior Electronics magazine for me each month FT a me . . ***«»«* ■■-a,* Address: IPosr c o ct e . * * « * * * , .... * * — * .... ........ .... ■ •*■*******...■ 1 J _ ri I c r ~i o 11 o . . . . . . . 1 ...it ... -1 , , * , .... . . .■ .... ......... I - Jsts * ............... - » » * i .. I . Signature: ektor lectronics Please cut out or photocopy this form, com- plete details and hand to your newsagent. Elektor Electronics is published on the third Friday of each month, except in July. Distribution S.O.R, by Seymour (NS). Index of Advertisers Ai good Technology. Net Licks Beta Layout ftei Links ....... 9£ Bec&ontcs Bum Technology LTD, “let links CMS ......... ...... CcmpucuL Net Links ....... Ccmpuiogic , Cwiford CEutron'cs, Net links Cricktevraod Dsnlwiy, Net Links ......... Debug InnoYacGns. Net links Display Electronics Easysync, f»et Links Baxal. Net Links ............... Elnec. Ifet Links .... ... Erven InteniaSonaJ. Net Links ..... EuHKimifts ....... Forest Net Links Finer e Tednciagy Devices, Net Links Fufurtsc, Net Links .... ...... Hammond Electronics, Ns! Links . . . Hite* wv,w. hitex.co.uk ........... IpSYa Limited, Net Links FTP ■ Komcauf, Net Links ............. Labcenter ........ ......... * . An v" v ^igGv&echmktgy, cam .76 . . ./i'j'iV/Dr&iiooLcsnj .21. 76 _ AwmhkE^cam .... ............. .87 . * jTlYVV. biiJTTteC CO.TI .76 v vv crr-R.L iLco-r- ... ....... .21 . ft . v v* . cs ” L-cutie rs.c-c-r .76 .-,;v< v/ r c mp u . 43 wmkCQnfQrtf&Bc cQMk * 76 mwjrtc^d&noojx).tjk ................. .76 , . ,.'.v,Y,.cf r: oval: ■ . . AVA'i v. nls IeKgb uk .. , AVftVA OaS/Sy EC.C&. iik ...... . „ AwmelexQlctffii ..*_.*.*. . ..ivv/i v.elnsc.com .... „:fiVVtver&rHr-i.cor . 7 ....... . . jffVnv^epcbstiGp.cosv . . .wmv.foftd.Co.U’: . . .iVAWJltitCh 'B.COnl ........ . . :fiV t v/Jishiife€.CGm . .av/a: - pzfa.cnn' ........ . :f/A\vi}pWlCGm . cc~ . .i wrA'jzhttfftEr.co-iik ..... 76 .....46 .....76 76 .....76 .....76 57 .69,76 .....76 76 .... .76 ..... .4 .....76 .....21 76 .....88 London Bectronics Co ,r ege. Net Links . . .,v,rs. =: . ' ; - Main* f4ultffi»edia Lid .............. .yaw. ’r&w~-'*300, Sle f f , Rate U 4WAiS, T.H.D. typtcaf 0.002%, Input Sensitiviy 5G0mV. S.N.R. ITOdB, Size 300 x 123 x 60mm.| Price:- £43.85 + £4.00 P&P • Light weight 3kg For further information please pi look at our website at Stunning performance Audiophile Quality vAvw.bkelec.com and click on the modules and hybrids button Special quantity pricing and customised artwork for OEM : s, Price £281.12 Inc Vat Each or £499.00 Per Pair when quot- ing this advert Carriage UK Mainland Only £0.00 WGfOC Eff rfc r-m Hxc z*r 50W to 500 WATT ACTIVE SUB BASS AMPLIFIER PANELS The BS3 Range of Sub Bass Amc-Te-rs consists of 5 panels wiih pcw&? outputs cf SOW to 500VV to suit rrest of toe DIY enthusiasts needs. All card's are aatigM and -Ctu eu zp-ad ,\’ti be to rp s.s r~ -is serera-e gain controis, frequency adjust and 0-180 Deg- contincus phase control adjustment A flill coarfedton toed pack included Model Shown:- BSBP200 MODEL PRICE IMP. T Please BSBP50 £89.95 8 Ohm State 4 SSBP100 £117.44 '4/8 Ohm or 8 Oh m BSBP200 £149.50 *4/8 Ohm when 8SBP300 £184.50 4 Ohm ordering BSBP500 £219,50 4 Ohm OMP/MF 200 Mos-Fet Output Pave: 200 watts R.M.S. into 4 ohms.freauency response 1Hz 1 100kHz -3dB. Damping Factor ?30t3, Siew. Rate 50V uS, T.H.D. tyorcai 0.Q01-:. Input SensEti^fty 500mV. S-N.R. 1 1 GdB. Size 300 x 155 l iCOmifi Price:- £67,35 + £4.00 P&P OMP/MF 300 Mos-Fet Output Power 300 .vaitsi R.M S- into 4 ohm^.frequency response iHzl- 100kHz -3dB. Damping Factor >300. Slew Rate 60V/U3- T.H.D. tyjtccei 0.001 c /a. Input Serteifvtyj 500mV t S.N.R, 1 iGcB. Size 330 x 475 x 100mm. Price:- £84.75 t £5-00 PSP OMP/MF 450 Mos-Fet Output Foi'rer 45Q watts RiM.S into 4 cb ms .frequency response 1Hz[- IfKJkHz -MB: Damping Factor >3D&, Stow Rato 75VfuS, T.H.D. typical 0,00 to; , Incut Sensitivit/ 500mV. SJJ.K: IIOdB. Far CoulEa. D.C. Loudspeaker Protection, 2 Second AnLi Thump Delay- Size 335 x 210 x 105mm. Price:- £137.85 t £6.00 P&P "0 M P/M F 1 00 £1 Sf6V-F et Ctox L : Pcv erTboO ,\atts R.M.S. into 2 cbmsT frequency response 1Hz - 100kHz -3-d B. Darino;rig Factor >203 Stew Rate 7 5V/uS r T.H.D. •typ:ca 3 ’ , 0.GD1 Irteut Sensitivity 500 mV. S.N.R HudB, Fan Cooted. D.C, Laud sneaker Protection, 2 Second Anti Them a Delay* Size 422 x 303 x 125 ttiiti. Price:- £264.00 + £12.00 P&P LOTZ L'ijS-FLT f.KOULES AF£AAILASLE N - LO.zFSaS. 5T tmXO - rail aJJnd.BA^AljTH m*L OR F6L ELL'R.ETT Cto^TBLB - S WT S0G 77 Bt c V t BA fc f?.'it}TH ORD &t SWiDARD OR SPECIFICATIONS:-' POWER 200W RMS ®4or8 OHMS 'FREQ RESP, 10Hz iSKHz; -3dB * DAMPING FACTOR >200 * DISTORTION 0.05% ' S/N A WEIGHTED >100dB ' SUPPLY 230V A,C. 'WEIGHT 5.0Kg ' SIZE H254 X W254 X D95mm THERE ARE 2 VERSIONS OF THE ABOVE PANEL AVAILABLE :-BSB200/3 8 OH VERSION BSB200 4 4 OHM VERSION CHECK WEBSITE FOR PANELS UP TO 500 W For MI and try 7 nc- FesrafiMisd Pstricss XLS sG Dn. e unit is partly nrec! the besi 1 0 inch A-ccfcrc“,E-5 sva at c tc-Ca). L'ncs m Dsn mark t, a company syr: jn^mous /.Tth quality cJ^rLimar.ih p Tfi ^ rinva un 1 i idsaJ ter iudus-ten nto ana.' encico-m-s arqynd 17 tres ar^ .v. g.ve a t-gn: ccntoc' c-z bass cutpito To torthe: Enhance the z-o::- bes of tri.s un;i greater output end deeper bass esn z-% s : " a -, ad by cc-u- P'Trq the XLS1Q. with is ccmpsr.cr past -e re-c a ter the XLS1C? Peerless XLS 10 £89,00. Peerless XLS10P 32.90 Carriage £0.00 specifi cation and prices goto our website at http:/Avww. bkelec.com our new shopping basket facility DELIVERY CHARGES:- PLEASE INCLUDE AS ABOVE. A MINI- MUM CHARGE OF £3.00 TO A MAXIMUM AMOUNT Of £30.00. OFFICIAL ORDERS FROM SCHOOLS, COLLEGES. GOVT., PLCs ETC. PRICES INCLUSIVE OF VAX SALES COUNTER. CREOnCARD ORDERS ACCEPTED BY POST PHONE OR FAX. B.K. ELECTRONICS UNIT 1 COMET WAY, SOUTHEND-ON-SEA, ESSEX. SS2 6TR + TEU 01702-527572 FAX.; 01702-420245 Web:- http://www.bkelec.com E-Mail sales@bkefec.com 7 9/2 004 - elsklor Eltttrcaiu S7 M Simulation Models The Coniplete Electronics Design System www . labcenter. to. uk info@labcenter. co.uk s Schematic & PCB Layout - j ^ M. JL a ( rti j vs ■ a Powerful & flexible schematic capture. Auto-component placement and rip-up/retry PCB routing Polygonal gridless ground planes. Libraries of over 8000 schematic and 1000 PCB parts. Bill of materials, DRC reports and much more. Mixed Mode SPICE Circuit Simulation Berkeley SPICE3F5 simulator with custom extensions for true mixed mode and interactive simulation. 6 virtual instruments and 14 graph based analysis types. 6000 models including TTL, CMOS and PLD digital parts. Fully compatible with manufacturers’ SPICE models. in Version 6.5 • Textual library part search. • User defined keyboard map. • C ADC AM output to ZIP file. • Bitmap import function. • T ruetype fonts on PCBs. • Enhanced printer output. Call Now for Upgrade Pricing Proteus VSM - Co-simulation and debugging for popular Micro-cont rollers Supports PIC, AVR, 8051, and BASIC STAMP micro-controllers. Co-simulate target firmware with your hardware design. Includes interactive peripheral models for LED and LCD displays, switches, keypads, virtual terminal and much, much more. Compatible with popular compilers and assemblers from Microchip, Crownhill, IAR, Keil, and others.