www.elektor.com MARCH 2008 AUS$ 12.90 - NZ$ 15.50 - SAR 84.951- US$ 9.95 £ 9.90 electronics worldwide n 0 a « o o-a o : ' • , ' f a 00'OODQOXO ° 0 a- o er (3 g o o o o Q g . 0 O at>oOOt>0 0 0-li& * U* \3 a a a o EGGS ■CJ ,-1 M w ‘Tlf N rt ^ cm 2 2 Q' [T Ct' Ci lr CL (Z iiii?i mat > i* V H 1 fi f"" » a Ull r-j t C> T H H d N cl a a. ce *i ui r* r v V f • ' N o I— o R13 03 770268 45113 5 1' all Till 1, f | 1 Vf u V- Fast Ni-MH Battery Charger Kit KC-5453 £11.75 + postage & packing A truly versatile charger, capable of handling up to 15 of the same type of Ni-MH or Ni-Cd cells. Build it to suit any size cells or cell capacity and set your own fast or trickle charge rate. It also has overcharge protection including temperature sensing. Ideal for R/C enthusiasts who burn through a lot of batteries. Kit includes PCB and all specified electronic components. Case, heatsink & battery holder not included. Remote Controlled Mains Switch KC-5462 £29.00 + postage & packing Commercial remote control mains switches are available but these are generally limited to a range of less than 20m. This UHF system will operate up to 200m and is perfect for remote power control systems etc. The switch can be activated using the included hand held controller or our KC-5461 water tank level sensor base station. Kit supplied with case, screen printed PCB, RF modules and | all electronic components. PIR Controlled Mains Power Switch KC-5455 £23.25 + postage & packing You’ve seen those lights fitted with PIR detectors that turn on when someone approaches. Well now you can do the same thing with just about any mains-powered device you like including security systems, decorative lighting, fountain pumps or even commercial advertising etc. The system uses a standard PIR to safely turn on 240VAC mains device(s) for an adjustable pre-set period. Kit supplied with case, screen printed PCB, and all electronic components. 12V Emergency Lighting Controller KC-5456 £20.50 + postage & packing This easy-to-build project is designed to automatically supply power for 12V emergency lighting during a blackout. The system has provision for its own 7.5Ah SLA battery, which is maintained via an external smart charger. The system includes a manual override switch & automatic protection to prevent over-discharge of the battery. Kit supplied with all electronic components, screen printed PCB, front panel and case. Charger and SLA battery available separately. Clockwatchers' Clock Kit - It's Hypnotic It consists of an AVR driven clock circuit that drives an 8 segment 12 or 24H display. The segments are 48mm high and consist of 3mm high brightness - but diffuse - LEDs. Additionally, around the PCB diameter are 3mm high brightness LEDs on a 60 second circle (every 5 seconds is a 5mm LED). When the clock is running the "seconds 11 are kept by a chase-LED running anti-clockwise from 12 noon back to the relevant "seconds" position. It takes exactly one second and this position remains illuminated. When the entire face has filled up one minute has elapsed, the digital clock increments by one and the whole process starts again. Trust us, the visual effect is mesmerising!! The kit comprises of 188mm diameter double sided plated-thru PCB with overlay and all board components. A special clock housing is included. Two versions: • With red LEDs KC-5404 £41 .75 + postage & packing • With blue LEDs KC-5416 £55.25 + postage & packing * a *h m in- !U D n ; I J / ■*+.,* ■ 1 Blue Version: Cat. KC-5416 Red Version: Cat. KC-5404 Build-lt-Yourself Electronic Project Kits Checkout Jaycar’s extensive range. We have kits & electronic projects for use in: • Audio & Video • Car & Automotive • Computer • Learning & Educational • Lighting • Power • Test & Meters • General Electronics Projects . . . , , - J f 430+ pages - just for fun! », , nrifies =„ pns Post and Packing Charges Order Value Cost Order Value £200 - £499.99 £500+ Cost £30 £40 £10 - £49.99 £5 £50 - £99.99 £10 £100 - £199.99 £20 Max weight 121b (5kg). Heavier parcels POA. Minimum order £10. Note: Products are despatched from Australia, so local customs duty and taxes may apply. How to order: Phone: Call Australian Eastern Standard Time Mon-Fri on 0800 032 7241. Fax: +61 28832 3119 Email: techstore@jaycarelectronics.co.uk Post: 320 Victoria Rd, Rydalmere NSW 2116 Australia Expect 10-14 days for air parcel delivery Check out the Jaycar range in your FREE Catalogue - logon to www.jaycarelectronics.co.uk/elektor or check out the range at www.jaycarelectronics.co.uk 0800 032 7241 (Monday - Friday 09.00 to 17.30 GMT + 10 hours only) For those who want to write: 320 Victoria Rd, Rydalmere NSW 2116 AUSTRALIA Handy Tools Digital Multimeter Kit KG-9250 £6.00 + postage & packing Learn everything there is to know about component recognition and basic electronics with this comprehensive kit. From test leads to solder, everything you need for the construction of this meter is included. All you'll need is a soldering iron! • Meter dimensions: 67(W) x 123(H) x 25(D)mm PIC Logic Probe Kit KC-5457 £4.50 + postage & packing Most logic probes are designed to operate on the 5V rails that have been around in logic circuits for years. This design operates on a wide voltage range down to 2.8V so it's suitable for use on the most modern circuits. It's also extremely compact with SMT devices on a PCB only 5mm wide, so it will fit inside a very slim case. It's capable of picking up a pulse only 50mS long and will also detect and hold infrequent pulses when in latch mode. Kit includes PCB and all specified electronic components including pre-programmed PIC. You'll need to add your own case and probe - a clear ballpoint pen. CAT III Autoranging Pocket DMM QM-1542 £14.00 + postage & packing An advanced pocket sized DMM that is suitable for serious work. It features detachable leads, capacitance and frequency ranges as well as a CATIII 1000V rating and non-contact voltage detection. • AC & DC voltage: 600V • AC & DC current: 200mA • Resistance: 40 MOhms • Capacitance: lOOpF • Frequency: 100kHz • Diode test • Dimensions: 120(L) x 55(W) x 40(D)mm laycar B PC Oscilloscopes <& Analyzers DSO Test Instrument Software for BitScope Mixed Signal Oscilloscopes '- 101*4 -.I — - WhQf | JL . - i Li j . "■ fl TEtH / V- *Sb. ■ 1 ' Vrf ^ i 4 ii iY j 1 ■ Zj JltI „U nxj JUl Pin njifin 4 Channel BitScope Digital Storage Oscilloscope Up to 4 analog channels using industry standard probes or POD connected analog inputs. Mixed Signal Oscilloscope Capture and display up to 4 analog and 8 logic channels with sophisticated cross-triggers. Spectrum Analyzer Integrated real-time spectrum analyzer for each analog channel with concurrent waveform display. Logic Analyzer 8 logic, External Trigger and special purpose inputs to capture digital signals down to 25nS. Data Recorder Record anything DSO can capture. Supports live data replay and display export. Networking Flexible network connectivity supporting multi-scope operation, remote monitoring and data acquisition. Data Export Export data with DSO using portable CSV files or use libraries to build custom BitScope solutions. 2 Channel BitScope Pocket Analyzer BitScope DSO Software for Windows and Linux BitScope DSO is fast and intuitive multi-channel test and measurement software for your PC or notebook. Whether it's a digital scope, spectrum analyzer, mixed signal scope, logic analyzer, waveform generator or data recorder, BitScope DSO supports them all. Capture deep buffer one-shots or display waveforms live just like an analog scope. Comprehensive test instrument integration means you can view the same data in different ways simultaneously at the click of a button. DSO may even be used stand-alone to share data with colleagues, students or customers. Waveforms may be exported as portable image files or live captures replayed on other PCs as if a BitScope was locally connected. BitScope DSO supports all current BitScope models, auto-configures when it connects and can manage multiple BitScopes concurrently. No manual setup is normally required. Data export is available for use with third party software tools and BitScope's networked data acquisition capabilities are fully supported. www . bitscope .com 3/2008 - elektor 3 lektor electronics worldwide CU at Embedded 2008 If you look at the contents of Elektor over the past few years then it's conspicuous that our March issues are crammed with articles on microcon- trollers, or 'embedded systems' to use the trendy expression. In March 2006, the Elektor FPGA system was prominently featured on the front cover; in 2007, our AVR/USB development board. Both fared extremely well. Two years ago our articles on FPGAs, consisting of a course and a hardware platform, first required convincing our international editor of the sheer potential of these devices and the fact that none of our competitors had the wherewithal to even mention FPGA technology to "enthusiasts". A hard struggle it was for Elektor designer Paul Goossens, as his articles were expected to "cap- ture only a small audience of very advanced enthusiast with industrial connections here and there". Wrong, and happy to say so! To everyone's amazement the Elektor FPGA develop- ment board and the associated FPGA module sold in the hundreds and in its wake created an enthusiastic community. The community members, I am always amazed to observe, are too modest about the results they get from our articles and kits and I would politely urge them to write just the odd line of text on their project so we can consider publishing it. For example, I heard of readers having cast vintage microprocessors like the 6502 and Z80 into the Elektor FPGA and cheerfully run emulations at speeds unheard of when the 'real DIP things' were available some 25 years ago. Ditto for old arcade-style games like Donkey Kong and Pacman. The reason for focusing on microcon- trollers in the March issue is simple and goes by the name of Embedded World, Nuremburg, Germany. This year the show is held on 26, 27 and 28 February. At Embedded World, trends in microcontroller land are defined, discovered, vapourised and talked about in two languages mainly: English and German. What better opportunity for Europe's largest magazine on electronics to present itself (in a modest way) and arrange meetings with industry leaders and their representatives (preferably well Elektorised) to see how we can work together on projects that make a dif- ference? cordially inviting to Booth 10-213, Jan Buiting Editor Elektor has a long history when it comes to publishing data acquisition systems and loggers. The data logger we are proposing here is unique due to its simplicity and compact size; a microcontroller and a handful of common components are all it takes for hardware. 32 The Secrets of l 2 C The l 2 C bus analyser described in this ar- ticle connects to the l 2 C bus of an appli- cation, extracting its start, stop, address, data and acknowledge signals for the purpose of examination. It can be used to troubleshoot a reluctant proprietary circuit or to 'reverse engineer' existing applications. Prc^aaiingTTread Begin Forever Do Veit for Bead md By using a Real Time Operating System (RTOS) the structure of the software and the timing characteris- tics of the microcontroller can be significantly improved. Here we describe the operation and specific characteristics of such an RTOS. Begin loY&y&x Wait for tm I is&'l M>C value# Fiat WC value# in iaei#age Bssid mzv&yv to EndDo End CONTENTS Volume 34 March 2008 no. 375 48 From C to Hardware Despite technological trends most new equip- ment does not take advantage of the capa- bilities of FPGAs. The main reason for this is that there are still relatively few FPGA experts. The latest developments in the EDA area can largely eliminate this obstacle. 64 ECI0PLC A low-cost ECIO module acts as the brains of a PLC board that has relays, opto- isolators, CAN (!) connectivity and an LCD. All this I/O capacity together with Flowcode allows the board to act as a versatile, powerful PLC for quite complex control and automation projects. projects 26 Data Logger "deLuxe" The Secrets of |2C 40 Cylon Voice 44 Real-Ti me Computing 54 'LAOS' for ARMee 58 DIY LED Projector 64 ECIO PLC Pimp your Shoes 75 Design Tips: XOR frequency multiplier Swap button cell for a Goldcap technology 22 Plastics Replace Silicon From C to Hardware info & market 6 Colophon 8 Mailbox News & New Products Get Stuck into Embedded Linux 18 Ethernut and the Kipp Family 69 Elektor Volume 2007 CD-ROM Atmel AVR32 Gateway 80 Elektor SHOP Sneak Preview infotainment 74 Hexadoku 76 Retronics: The 'Dekatron' decimal counter valve ELECTRONICS WORLDWIDE elektor international media Elektor International Media provides a multimedia and interactive platform for everyone interested in electronics. From professionals passionate about their work to enthusiasts with professional ambitions. From beginner to diehard, from student to lecturer. Information, education, inspiration and entertainment. Analogue and digital; practical and theoretical; software and hardware. Volume 34, Number 375, March 2008 ISSN 0268/4519 Elektor Electronics aims at inspiring people to master electronics at any personal level by presenting construction projects and spotting developments in electronics and information technology. Publishers: Elektor International Media, Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+44) 208 261 4509, fax: (+44) 208 261 4447 www.elektor.com The magazine is available from newsagents, bookshops and electronics retail outlets, or on subscription. Elektor is published 1 1 times a year with a double issue for July & August. Elektor is also published in French, Spanish, German and Dutch. Together with franchised editions the magazine is on circulation in more than 50 countries. International Editor: Wisse Hettinga (w.hettinga@elektor.nl) Editor: Jan Buiting (editor@elektor.com) International editorial staff: Harry Baggen, Thijs Beckers, Ernst Krempelsauer, Jens Nickel, Guy Raedersdorf. Design stc Antoine Authier (Head), Ton Giesberts, Paul Goossens, Luc Lemmens, Jan Visser, Christian Vossen Editorial secretariat: Hedwig Hennekens (secretariaat@elektor.nl) Graphic design / DT Giel Dols, Mart Schroijen Managing Director / Publisher: Paul Snakkers Marketing: Carlo van Nistelrooy Customer Services: Anouska van Ginkel Subscriptions: Elektor International Media, Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+44) 208 261 4509, fax: (+44) 208 261 4447 Internet: www.elektor.com 6 elektor - 3/2008 CD-ROM Elektor 2007, All articles published in 2007 haw All 2007 m C&’ROMi Ml* ftrtM 2007 ai* CD-ROM liui Its 2007 sw Ml* erliWtw 1 * tin 2007 op CD-RW* l e ^1 1 B ^ 1 1 1 This CD-ROM contains all editorial articles published in r Elektor Volume 2007. Using the supplied Adobe Reader r W mi, h HI l | program, articles are presented in the same layout as origi- Sl Annual i Jahrgang An nee j | nally found in the magazine. An extensive search machine WjjW Jaargang 11 is available to locate keywords in any article. The installa- 1 ! ' mil ■ V 4 \ 1 tion program now allows Elektor year volume CD-ROMs K 2 100 * life ln1««w'>wu!» Her W*ni^tw* clektmoiro-nw aafo\<* lektor you have available to be copied to hard disk, so you do not have to eject and insert your CDs when searching in another year volume. With this CD-ROM you can produce hard copy of PCB layouts at printer resolution, adapt PCB layouts using your favourite graphics program, zoom in / out on selected PCB areas and export circuit diagrams and illustrations to other programs. ISBN 978-90-5381-218-1 • £16.90 • US$33.80 SHOP Order quickly and safe through WWW.el6ktor.com/shop or use the Order Form near the end of the magazine Email: subscriptions@elektor.com Rates and terms are given on the Subscription Order Form Head Office: Elektor International Media b.v. P.0. Box 1 1 NL-61 1 4-ZG Susteren The Netherlands Telephone: (+31 ) 46 4389444, Fax: (+31 ) 46 43701 61 Distribution: Seymour, 2 East Poultry Street, London EC1A, England Telephone:+44 207 429 4073 UK Advertising Huson International Media, Cambridge House, Gogmore Lone, Chertsey, Surrey KT1 6 9AP, England. Telephone: +44 1932 564999, Fax: +44 1932 564998 Email: p.brady@husonmedia.com Internet: www.husonmedia.com Advertising rates and terms available on request. International Advertising Frank van de Raadt, address as Head Office Email: advertenties@elektor.nl Advertising rates and terms available on request. Copyright Notice The circuits described in this magazine are for domestic use only. All drawings, photographs, printed circuit board layouts, programmed integrated circuits, disks, CD-ROMs, software carri- ers and article texts published in our books and magazines (other than third-party advertise- ments) are copyright Segment, b.v. and may not be reproduced or transmitted in any form or by any means, including photocopying, scanning an recording, in whole or in part without prior written permission from the Publishers. Such written permission must also be obtained before any part of this publication is stored in a retrieval system of any nature. Patent protec- tion may exist in respect of circuits, devices, components etc. described in this magazine. The Publisher does not accept responsibility for failing to identify such patent(s) or other protection. The submission of designs or articles implies permission to the Publishers to alter the text and design, and to use the contents in other Segment publications and activities. The Publishers cannot guarantee to return any material submitted to them. Disclaimer Prices and descriptions of publication-related items subject to change. Errors and omissions excluded. © Elektor International Media B.V. 2008 Printed in the Netherlands 3/2008 - elektor 7 INFO & MARKET MAILBOX A handy use for the Elektor coil meter In the 'Practical use' section of the 'Coil Clinic' article (Ed.: June 2007 issue, p. 62), it was mentioned that this meter could be used to measure the A L spec of a ferrite ring core, for exam- ple by winding 1 0 turns on the core. Some other formulas that yield the same A L value are the nH- per-turn and mH-per-1 000-turns versions. I personally find the latter version more convenient in actual use. n = V (L / AJ where A L = L / n 2 and L = A L x n 2 ( 1 in nH) n = 1 000 x V (L / AJ where A L = 10 6 x L / n 2 and L = A L x n 2 / 1 0 6 ( 1 in mH) Square roots and squares always give 'odd' numbers, which means you may need a calculator - except with 1 0 2 or Vl 00 and variants of these numbers. You can put this to good use. If you do a lot of ring core calculations, you will notice that the A L value obtained with 1 0 turns is the same as 1 0 times the jliH value, or in other words the jliH value with an extra zero tacked on. For example, consider a 26-mm orange-red 3E25 core (TN26/ 15/10 from Yageo ferroxcube, formerly Philips) with an A L value of 6420. With n = 1 0 you have: L = A l x n 2 / 1 0 6 = 0.642 mH = 642 ^H Th is means that the A L value is only the same as the jliH value with an extra zero if the coil has 10 turns. through the core in one go, use a plug and socket to link the turns together, connect this arrangement to the meter, and read the value. The reading proves to be too high in practice, but passing a bundle of 5 wires through the core twice and connecting them together with a plug and socket (DIL) yields excellent results (see drawing and photo). This is a fast and convenient method for cores with diameters of 20 mm or larger. For smaller and even larger material (such as ferrite clamps), you can take along a bundle of 0.5-mm wire just in case. The stray capacitance of the bundle of wires proves to affect the reading (the higher the capacitance, the higher the induct- ance reading). It's best to use five separate wires in a loose bundle instead of flat cable. Even then you have to recalibrate the meter or subtract 2 to 3 jliH from the measured jliH value in order to obtain the correct A L value (which means a difference of 20 to 30 in AJ. Ferrite cores for the highest possible usable frequency range (nickel-zinc (NiZn) ferrite) and small-diameter cores (less than 23 mm) give A L values between 50 and 100. This is more or less the practical lower limit - not sufficiently accurate but suit- able as an indication. Small powdered-iron rings have even lower A l values and thus also give inaccurate read- ings with this method, but it is a convenient way to identify them quickly. The coil meter uses a 'digital' measurement method (frequency counting with a resolution of 100 ms), which means it has a specific step size. As a result, the count does not follow a nice 1, 2, 3, ... sequence, but instead proceeds in steps of less than 2% of the indicated value. Adding a zero to the indicated value makes the A L step resolution less than 20% of the full-range value. As ring cores can easily have a tolerance variation of 25%, this is not an especially large objection. Walter Geeraert PE1ABR (The Netherlands) If you want to use the Elektor coil meter for quick and easy measurement of unknown ring cores at radio swap meets or flea markets, the ideal method is to pass a bundle of 10 wires Thanks Walter ; that's a very practical suggestion for anyone who regularly uses ferrite cores and the like! 8 elektor - 3/2008 Standby switch - even greener? I welcome every article that leads to lower power consump- tion and makes our world a bit greener and really liked the items presented in the January 2008 Elektor. Power consump- tion by equipment operating in standby mode requires constant vigilance. I found that it's possible to build a 'green' USB switch with zero standby power. All that's necessary is to con- nect a 230-V semiconductor relay with optocoupler input to the USB. Required components: 1 USB cable (perhaps second- hand) or USB socket 1 230 V opto/semiconduc- tor relay with screw terminals (e.g. Clare) 1 power bar assembled using screw fasteners 1 fuseholder 1 fuse (to match the optocou- pler specification) If the circuit cannot be fitted into the power bar, you can remove the power switch to make room for the optorelay. You can use plastic screws to fit a small plastic cover (such as a scrap piece of PCB mate- rial) over the switch opening and mount the fuseholder on this cover. Ralf Schmiedel (Germany) There are always various ways to design a circuit. Some desig- ners may prefer the use of a re- lay because: - it can also be used to switch capacitive or inductive loads without any problems; - both leads of any device not permanently connected to the 230-V mains must be switched , as otherwise (if only one lead is switched) there is a risk that only the neutral lead will be switched off, leaving the other lead con- nected to a live voltage. Over Christmas Dear Jan — I wrote to you last year complaining that there were no Xmas projects in the December 2006 edition of Elektor magazine. I opened this December 2007 issue wondering how to idle my time over the Christmas pe- riod. Imagine my delight when I found the i-TRIXX collection of projects. My thanks to you and all the staff for such a wonderful Xmas edition. Ken Barry (UK) Thanks for that Ken , actually the December 2006 issue also had a free i-TRIXX supplement but it was not announced in relation to Christmas on the cover of the magazine. Vista vs. LPT Dear Paul Goossens and Jan Buiting — I read with sympa- thy your article in the January 2008 edition of Elektor con- cerning the problems you were having getting a parallel card to work under Vista. Recently, I bought a laptop which uses Vista, and it has no paral- lel port. I need the parallel port since we have a number of EVMs which use a JTAG through this port. I bought a PCMCIA parallel port card from Quatech, and it installed fine. However, it sim- ply did not work. Eventually, I looked in the Device Manager and changed the properties for the LPT port. First, you have to set the number of the port to be the same as the original in your XP machine (normally LPT1 ). Next, you also have to set up the resources to be the same. After that, everything should work ok. Patrick Gaydecki (UK) I've postponed binning my 2 5 MHz 386 PC indefinitely because I need to do PROM programming and PMR radio configurations occasionally — would not miss that ma- chine for the world. Using the OBD2 analyser with an Audi Dear Jan — I received the Elektor OBD-2 analyser yesterday. I want to use it with an Audi A4 TDI (2004), but the OBD connector does not mate with the connector in the car. Although the connector does have 1 6 pins, it is a different type. In Elektor I only see that the instrument can be used with all modern cars made since 1 January 2004. If the pins are in the right place, it's possible to cut off the housing. Please tell me how to solve this problem. Joseph Farnborough (UK) Volkswagen and Audi have a so- mewhat non-standard OBD con- nector. However , you shouldn't let this discourage you , because it does indeed fit. Simply make sure that the pins are all in line and then press the connector over them. Incidentally some of our designers have recently experienced the same problem with an Audi. OBD list Dear Sir — I am interested in the Compact OBD-2 Analyser (Elektor kit #070038-91). How can I find out whether it is suitable for our Alfa Romeo? Pete Jacobs (UK) The link below will take you to a list of all cars for which someone has already tried to see whether data can be read out via the OBD interface. If the date of manufacture of your Alfa is later than 2001 , it should always be possible to read the data. h ttp:// www. bla fusel, de/mi sc/ obd2_scanned.php Mai I Box Terms • Publication of reader's orrespondence is at the discretion of the Editor. • Viewpoints expressed by correspondents are not necessarily those of the Editor or Publisher. • Correspondence may be translated or edited for length, clarity and style. • When replying to Mailbox correspondence, please quote Issue number. • Please send your MailBox correspondence to: editor@elektor.com or Elektor, The Editor, 1 000 Great West Road, Brentford TW8 9HH, England. Advertisement 3/2008 - elektor 9 INFO & MARKET NEWS & NEW PRODUCTS Visit China with Elektor Elektor International Media is or- ganising a study trip to China on 12-21 April of this year - and you're welcome to join us! This is an outstanding opportunity to get acquainted with China. Naturally, the main focus is electronics, but there is also room for culture. For instance, have you ever stood on the Great Wall? In addition to visiting an electron- ics trade fair, you can visit interest- ing electronics companies in sever- al cities. This will give you a good impression of business opportuni- ties in China. These company visits are an espe- cially unique opportunity, because only a limited number of compa- nies in China are allowed to re- ceive groups of European visitors. Your contacts and business part- ners in China will undoubtedly of- fer you many opportunities. Natu- rally, you will also learn to know your fellow visitors - all of whom are actively involved in electronics - both formally and informally. This means that you can reinforce your local network during the Elektor China tour. And of course, you will have an oppor- tunity to see all the major attractions. China has more than one billion inhabit- ants with a unique history and culture. Your tour begins in Shenzhen / Hong Kong. Here you will visit the China Electronics Fair (one of the five largest electronics fairs in Asia) and an electronics company, among other activities. We then travel by air to Shanghai. Here we will visit not only several electronics companies, but also the well-known radio and televi- sion tower. You can enjoy an im- pressive view of Shanghai from the tower. That's something you don't want to miss! We conclude the tour in Beijing, where you will visit interesting industrial electronics companies and (among other things) the For- bidden City. We will also arrange for a traditional dinner with Pe- king Duck. Naturally, a visit to the Great Wall is included. After all, we know that everyone would like to stand on the Great Wall at least once in his or her life. The definitive price will be known in mid-February 2008. The price of this all-inclusive tour will be at most € 3,950* (ex VAT) per person. Business expenses are tax-deduct- ible, and on request the tour costs can be invoiced as follows: 50% personal / 50% business; 100% personal; or 100% business. * Including: Check-in service; Interconti- nental air travel Amsterdam-Hong Kong and Beijing-Amsterdam; domestic flights inside China; all airport taxes; security sur- charges and fuel surcharges (€ 198 per person); local departure tax; all overnight accommodation; transportation by air-con- ditioned bus; all meals, including V 2 litre wine per person or a number of equiva- lent beverages; excursions and admission charges; English-speaking local guides; luggage service. * Excluding: tips; Visa expenses; travel ac- cident and cancellation insurance; vacci- nations; personal expenses; disaster fund contribution; travel class surcharge for in- ternational flights; air travel tax. If you are interested, please email Mrs M. Debeij on m.debeij@elektor.com. Note: only a limited number of places are available. (071168-V) PSoC® CapSense™ controller development kit Cypress Semiconductor recently introduced the Universal PSoC® CapSense™ Controller Kit, a new kit designed for easy development and debugging of any CapSense design. It includes pre-defined control circuitry and plug-in hard- ware, along with controller boards for both the CY8C20x34 and CY- 8C21x34 PSoC devices. It also of- fers a breadboard module and a module for implementing up to five buttons and a slider with sample overlays to encompass a wide va- riety of designs. The kit works with both PSoC De- signer™ and PSoC Express™, and allows for monitoring and tuning of CapSense designs via an I2C- to-USB bridge that is included in the kit. The kit supports both the CapSense Successive Approxima- tion (CSA) and Sigma-Delta (CSD) capacitive sensing methods. CSA offers outstanding interference im- munity and low power consump- tion, making it ideal for portable consumer applications. CSD de- livers flawless operation in wet conditions, and offers superb tem- perature response, ideal for white goods and other moisture-sensitive systems. CY3280-BK1 kit contents: • CY3280-20x34 and CY3280- 21x34 Universal CapSense Controller Boards • CY3280-SLM Universal CapSense Linear Slider Module • CY3280-BBM Universal CapSense Prototyping Module • CY3240-I2USB Board • CY32 10 MiniProg 1 Programmer • PSoC Express Installation CD • PSoC Designer and PSoC Pro- grammer Installation CD • CY3280-BK1 Universal CapSense Controller Kit CD • 1 .5 mm and 3 mm Polycar- bonate Overlays The kit is available now from Cy- press's On-Line store and through authorized distributors. It costs US$ 1 58. www.cypress.com. (07 1 1 68-VIII) 10 elektor - 3/2008 mikroElektronika DEVELOPMENT TOOLS | COMPILERS | BOOKS CAN-1 Board - Interface CAN via MCP2551 . CANSPI Board - Make CAN network with SPI interface. RS485 Board - Connect devices into RS-485 network Serial Ethernet - Make ethernet network with SPI Interface (ENC28J60). lrDA2 Board - Irda2 serve as wireless RS232 communi- cation between two MCU’s. EasyPIC5 Development Board Complete Hardware and Software solution with on-board USB 2.0 programmer and mikrolCD Following tradition of its predecessor EasyPIC4 as one of the best PIC development systems on the market, EasyPIC5 has more new features for the same price. The system supports 8-, 14, 18, 20, 28 and 40 pin PIC microcontrollers (it comes with a PIC1 6F877A). USB 2.0 on-board programmer with mikrolCD (In-Circuit Debugger) enables very efficient debugging and faster prototype development. Examples in C, BASIC and Pascal language are provided with the board. Uni-DS 3 Development Board Complete Hardware and Software solution with on- board USB 2.0 programmer LV 18FJ Development Board Complete Hardware and Software solution with on-board USB 2.0 programmer and mikrolCD The system supports PIC, AVR, 8051 , ARM and PSoC micro- controllers with a large number of peripherals. In order to con- tinue working with different chip in the same development environment, you just need to swich a card. UNI-DS3 has many features that make your development easy. You can choose between USB or External Power supply. Each MCU card has its own USB 2.0 programmer! System supports 64, 80 and 100 pin PIC18FxxJxx microcon- trollers (it comes with PIC1 8F87J60 - PIC1 8 Microcontroller with an integrated 10Mbps Ethernet communications peripheral, 80 Pin Package). LV 18FJ is easy to use Microchip PIC18FxxJxx development system. USB 2.0 on-board programmer with mikrolCD (In-Circuit Debugger) enables very efficient debug- ging and faster prototype development. Examples in C, BASIC and Pascal language are provided with the board. CF Board - Easy way to use Compact flash in your design. MMC/SD Board - Easy way to use MMC and SD cards in your design. EEPROM Board - Serial EEPROM board via I2C interface. RTC Board - PCF8583 RTC with battery backup. ADC Board - 12-bit analog- to-digital converter (ADC) with 4 inputs. DAC Board - 12-bit digital- to-analog converter (DAC) with SPI. Keypad 4x4 Board - Add keypad to your application. Accel. Board - Accel, is an electronic device that meas- ures acceleration forces . PICFIash with mtkrcHCD suppc^ti PICFIash programmer - an ultra fast USB 2.0 programmer for the PIC microcontrollers. Continuing its tradition as one of the fastest PIC programmer on the market, a new PICFIash with mikrolCD now supports more PIC MCUs giving devel- oper a wider choice of PIC MCU for further prototype development. mikrolCD debugger enables you to execute mikroC / mikroPascal / mikroBasic pro- grams on the host PIC micro- controller and view variable val- ues, Special Function Regi- sters (SFR), memory and EEP- ROM while the program is run- ning. - All of our products are shipped in special protective boxes. -On-line secure ordering provides fast and safe way of buying our products. System supports 64, 80 and 100 pins PIC24F/24H/dsPIC33F microcontrollers (it comes with PIC24FJ96GA010 - PIC24 16-bit Microcontroller, 96 KB Flash Memory, 8 KB RAM in 100 Pin Package). Examples in BASIC, PASCAL and C are included with(in) the system. You can choose between USB and External Power supply. LV 24-33 has many features that make your devel- opment easy. USB 2.0 on-board programmer with mikrolCD (In- Circuit Debugger) enables very efficient debugging and faster pro- totype development. PICPLC16B Development Board Complete Hardware and Software solution with on-board USB 2.0 programmer and mikrolCD PICPLC16B is a system designed for controlling industrial sys- tems and machines. 16 inputs with optocouplers and 16 relays (up to 10A) can satisfy many industrial needs. The ultra fast mikrolCD (In-circuit Debugger) enables very efficient debugging and faster prototype development. Features : RS485, RS232, Serial Ethernet, USB 2.0 on-board programmer and mikrolCD (In-Circuit Debugger) on-board. mikroElektronika Compilers Pascal, Basic and C Compilers for various microcontrollers Supporting an impressive range of microcontrollers, an easy-to- use IDE, hundreds of ready-to-use functions and many integrated tools makes MikroElektronika compilers one of the best choices on the market today. Besides mikrolCD, mikroElektronika compilers offer a statistical module, simulator, bitmap generator for graphic dis- plays, 7-segment display conversion tool, ASCII table, HTML code export, communication tools for SD/MMC, UDP (Ethernet) and USB , EEPROM editor, programming mode management, etc. Each compiler has many routines and examples such as EEPROM, FLASH and MMC, reading/writing SD and CF cards, writing charac- ter and graphics on LCDs, manipulation of push-buttons, 4x4 key- board and PS/2 keyboard input, generation of signals and sounds, character string manipulation, mathematical calculations, I2C, SPI, RS232, CAN, USB, RS485 and OneWire communications, Manchester coding management, logical and numerical conversion, PWM signals, interrupts, etc. The CD-ROM contains many already- written and tested programs to use with our development boards. mikroElektronika manufactures competitive development sys- | terns. We deliver our products across the globe and our satis- fied customers are the best guarantee of our first-rate service. ] The company is an official consultant on the PIC microcon- trollers and the third party partner of Microchip company. We are also an official consultant and third party partner of Cypress Semiconductors since 2002 and official consultant of Philips Electronics company as well. All our products are RoHS compilant. EasydsPIC4 Development Board Complete Hardware and Software solution with on- board USB 2.0 programmer and mikrolCD The system supports 18, 28 and 40 pin microcontrollers (it comes with dsPIC30F4013 general purpose microcontroller with internal 12-bit ADC). EasydsPIC4 has many features that make your development easy. Many of these already made examples in C, BASIC and PASCAL language guaran- tee successful use of the system. Ultra fast USB 2.0 on-board programmer and mikrolCD (In-circuit Debugger) enables very efficient debugging and faster prototype developing. EasyARM Development Board Complete Hardware and Software solution with on- board USB 2.0 programmer EasyARM board comes with Philips LPC2214 microcon- troller. Each jumper, element and pin is clearly marked on the board. It is possible to test most of industrial needs on the system: temperature controllers, counters, timers etc. EasyARM has many features making your development easy. One of them is on-board USB 2.0 programmer with automat- ic switch between ‘run’ and ‘programming’ mode. Examples in C language are provided with the board. EasyAVR5 Development Board with on-board USB 2.0 programmer Li AVR The system sup- ports 8, 14, 20, 28 and 40 pin microcontrollers (it comes with ATMEGA16). Each jumper, element and pin is clearly marked on the board. It is possible to test the most of industrial needs on the system: tempera- ture controllers, counters, timers etc. EasyAVR5 is an easy- to-use Atmel AVR development system. On-board USB 2.0 programmer makes your development easy. Examples in BASIC and Pascal language are provided with the board. Easy8051B Development Board with on-board USB 2.0 programmer http://www.mikroe.com/en/distributors/ Find your distributor: UK, USA, Germany, Japan, France, Greece, Turkey, Italy, Slovenia, Croatia, Macedonia, Pakistan, Malaysia, Austria, Taiwan, Lebanon, Syria, Egypt, Portugal, India. System is compatible with 14, 16, 20, 28 and 40 pin micro- controllers (it comes with AT89S8253). Also there are PLCC44 and PLCC32 sockets for 32 and 44 pin microcon- trollers. USB 2.0 Programmer is supplied from the system and the programming can be done without taking the micro- controller out. dsPICPRO 3 Development Board Complete Hardware and Software solution with on-board USB 2.0 programmer and mikrolCD The system supports dsPIC microcontrollers in 64 and 80 pins packages. It is delivered with dsPIC30F6014A microcontroller. dsPICPR03 development system is a full-featured development board for the Microchip dsPIC MCU. dsPICPR03 board allows microcontroller to be interfaced with external circuits and a broad range of peripheral devices. This development board has an on- board USB 2.0 programmer and integrated connectors for MMC/SD memory cards, 2 x RS232 port, RS485, CAN, on- board ENC28J60 Ethernet Controller, DAC etc... BIGPIC4 Development Board Complete Hardware and Software solution with on-board USB 2.0 programmer and mikrolCD Following tradition of its predecessor BIGPIC3 as one of the best 80-pin PIC development systems on the market, BIG- PIC4 continues the tradition with more new features for the same price. System supports the latest (64) and 80-pin PIC microcontrollers (it is delivered with PIC18F8520). Many of these already made examples in C, BASIC and Pascal lan- guage guarantee successful use of the system. Ultra fast on- board programmer and mikrolCD (In-circuit Debugger) enables very efficient debugging and faster prototype developing. BIGAVR Development Board with on-board USB 2.0 programmer The system supports 64-pin and 100-pin AVR microcon- trollers (it is delivered with ATMEGA128 working at 10MHz). Many already made examples guarantee successful use of the system. BIGAVR is easy to use Atmel AVR development system. BIGAVR has many features that makes your devel- opment easy. You can choose between USB or External Power supply. BIGAVR also supports Character LCD as well as Graphic LCD. EasyPSoC3 Development Board with on-board USB 2.0 programmer The system sup- ports 8, 20, 28 and 48 pin microcon- trollers (it comes with CY8C27843). Each jumper, element and pin is clearly marked on the board. EasyPSoC3 is an easy-to- use PSoC development system. On-board USB 2.0 program- mer provides fast and easy in-system programming. Please visit our website for more info http://www.mikroe.com SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD 3/2008 - elektor 11 INFO & MARKET NEWS & NEW PRODUCTS EasyDAQ USB relay card EasyDAQ has announced the launch of a new low cost USB, 4 channel relay card, adding to it's existing range of USB powered data acquisition and automation/ control products. Controlled via a simple ASCII charac- ter text strings, the new USB4Mx range is available as a com- pact, integrated card with four opto-isolated relays, 4 general purpose DIO channels and screw ter- minal access to the USB power. Available with two relay options, the USB4PRMx is fitted with a 240 VAC/10 amp relay (PCB de- signed to handle 240 VAC @ 1 0 amps) and the USB4SRMx is fitted with a 30VDC/1 A, high sensi- tivity, (gold contact) signal relay. The DIO channels are capable of sourcing 20mA per channel. With screw terminal access to the NO/COM/NC con- tacts and DIO channels, and LED relay/USB power status indi- cators, the cards are suitable for a wide range of mains and DC volt- age or sig- _ nal switch- ing/ control ap- plications. Avail- able with a perspex cover/base and DIN rail cover/mount cover options which give general protection to the card and screw terminal blocks. Windows 98SE/2K/XP/Vista, c OSX and Linux compat- ible, with downloadable example programs available for Lab- VIEW, Visual Ba- sic, Visual C, Del- phi & Agilent VEE, the card can also be commanded via terminal emulator programs such as Windows HyperTerminal. From only $ 7 8/€ 55/£ 38, and with free worldwide shipping, the USB4Mx products are designed and manufactured in the UK. www.easydaq.biz (070996-III) LCD shop-window displays go interactive ZYFILM™, a new through-glass touch sensing film announced by Zytronic, adds touch capabilities to TFT-LCD screens up to 30" in screen size mounted behind shop windows or similar glass panels. The film attaches to the window unobtrusively without adhesive, and provides an industry-standard USB interface for fast and conven- ient installation. ZYFILM enables retailers to quickly add interactive features to window- mounted LCD displays, which are now widely used to present sales messages at street level. Touch ca- pability allows these displays to transact sales and collect custom- er information. The ZYFILM sensor detects user in- teractions through up to 20mm of glass, which allows installation on the inside of the shop window for extra security. ZYFILM adheres us- ing an electrostatic surface treat- ment, so that repositioning or re- moval leaves no permanent resi- due on the glass. It also features a convenient USB connection for data as well as power, which elim- inates the cost and complexity of an external power supply. ZYFILM touch sensors incorporate Zytronic's patented Projected Ca- pacitive Technology (PCT™), which uses an array of embedded micro- fine wires to create a capacitive touch sensor inside a clear, lami- nated structure. PCT sensors deliv- er several advantages to commer- cial operators, including drift-free operation, high durability, and re- sistance to accidental or deliber- ate damage, allowing operators to minimise overheads such as servic- ing, maintenance and replacement costs. In addition, ZYFILM sensors accommodate the full range of commercial TFT-LCD screen sizes, including wide-screen displays. The complete Zytronic product range delivers a variety of rigid and flexible touch sensors for use in e-commerce, kiosks, point-of-sale equipment, public information sys- tems and many other applications including terminals such as bank- ing ATMs or keyless entry systems where high resistance to malicious damage is a pre-requisite. www.zytronic.co.uk (071 168-IX) High power 2.45 GHz RF module for ZigBee Radiocrafts AS now expand their product line with a compact high power RF module design for Zig- Bee™ operating at 2.45 GHz. The new module deliver up to 18 dBm output power, and gives an in- creased communication range of up to 10 times compared to stand- ard low output power modules. The new RC2201 HP is compliant with IEEE 802.15.4 and is de- signed for ZigBee Full Function De- vice (FFD) and Reduced Function Device (RFD) operation, or other protocol stacks using star or mesh topologies. The complete shielded module is only 1 6.5x35.6x3.5 mm, option- ally available with integrated an- tenna. An integrated microcontrol- ler makes it possible to embed the complete application in this tiny module. The output power can be adjusted to comply with EU regu- lations for CE marking, as well as FCC and ARIB approvals. Some of the unique features for the Radiocrafts RC2201HP mod- 12 elektor - 3/2008 ule are: • up to 18 dBm output power, giving 10 times range increase • receiver sensitivity of -94 dBm at 250 kbit/s • 1 6 channels at 2.45 GHz com- pliant with IEEE 802.15.4 • small size: 1 6.5x35.6x3.5 mm • shielded module with integrat- ed antenna • 128 kB flash memory, 8 kB RAM • 32 digital and analogue I/Os, 8 channel 1 0 bit ADC • UART and SPI interfaces • Suitable for full or reduced function ZigBee stack The module is based on DSSS (Di- rect Sequence Spread Spectrum) technology and offer exceptional range and performance even in crowded and noisy environments compared to other 2.45 GHz technologies. Low power modes for increased battery life are available. Typical applications include home, building and industrial automation, wireless security and alarm sys- tems, automatic meter reading, remote control and telemetry, fleet and asset management. Operation at the 2.45 GHz licence free band ena- bles world-wide usage. The modules are suitable for pick and place automatic assembly in volume production and are avail- able in tape&reel. www.radiocrafts.com (071168-VI) National Instruments free technical seminar tour visits 22 locations around UK & Ireland Register now for a free, three-hour hands-on introduction to data acquisi- tion with LabVIEW Seminar to learn how to design and build powerful measurement and control applications using National Instruments Lab- VIEW graphical programming and Nl USB data acquisition devices. The tour of 30 seminars in 22 locations around UK & Ireland is designed for engineers, scientists and technicians who build test, measurement, process monitoring and control, or research and analysis applications. Attendees will test-drive professional PC-based data acquisition systems and learn how to create modular, flexible and scalable systems with short development times at low cost. Nl data acquisition and signal condition- ing products ensure highly accurate measurements, whilst the award- winning LabVIEW software gives engineers the power to easily acquire, analyse and present data. Locations and Dates: 10/03/2008 11/03/2008 12/03/2008 13/03/2008 1 8/03/2008 19/03/2008 20/03/2008 09:00/13.30 09:00/13.30 09:00/13.30 09:00 09:00 09:00 09:00/13:30 Newbury, Berkshire Oxford London Gatwick Chelmsford Hatfield Cambridge 26/03/2008 09:00 27/03/2008 09:00/13.30 01/04/2008 09:00/13.30 02/04/2008 09:00/13:30 03/04/2008 09:00 08/04/2008 09:00/13.30 09/04/2008 09:00 10/04/2008 09:00/13.30 15/04/2008 09:00 16/04/2008 09:00 1 7/04/2008 09:00 22/04/2008 09:00 23/04/2008 09:00 24/04/2008 09:00 Bournemouth Southampton Bristol Birmingham Loughborough Sheffield Halifax Manchester Glasgow Edinburgh Washington, Nr Newcastle Upon Tyne Belfast Dublin Cork Registration is free — either through www.ni.com/uk/handson or ni.com/ireland/handson, by calling 01635 572498, or by sending an e-mail to events.uk@ni.com. (071168-III) Environmental email alerts in real-time Lascar Electronics Ltd. has intro- duced the EL-USB-RT; a USB ena- bled temperature and humidity sen- sor designed to send email alerts of temperature or humidity readings that exceed acceptable conditions. The EL-USB-RT, which is connected to a PC via a USB port, is supplied with dedicated software that pro- vides a real-time indication of am- bient temperatures between -10 and +60°C and humidity between 0 and 100%RH. These, together with a calculated dew point, can be viewed as either a constantly updated graph, or a numerical in- dication of the last reading taken. Users can assign high and low alarms for both temperature and humidity, and the software can be configured to send email alerts as these levels are exceeded. This fea- ture is particularly useful for serv- er room monitoring, where keep- ing the servers and other network equipment in a controlled environ- ment helps eliminate down-time and minimises the risk of damage to expensive equipment. The EL-USB-RT is available imme- diately directly from Lascar Elec- tronics at a price of £ 29.50 at one-off. Discounts for quantity are available upon request. www.lascarelectronics.com (07 1 168-VII) 3/2008 - elektor 13 INFO & MARKET EMBEDDED LINUX Get stuck into embedded Linux Andrew Eliasz (First Technology Transfer) It is surprising how few electronics engineers and hobbyists are aware of the fascinating world of embedded Linux. Hopefully this article will put you straight! Figure 1. Robotic Microhelicopter and its components. ADDED 6-CHAMNEL FWM I/O -It 7 gumstix USB+IO \mJL J mi n M BLUETOOTH / ** || ANTENNA A S** GND & +5V ON UNUSED SERVO OUTPUT ^ +.SV REGULATOR One of the main things that transpired from the 2007 Em- bedded Systems Show was that surprisingly many compa- nies developing and marketing systems based on 8-bit mi- crocontrollers (e.g. 8051 clones, AVRs, PIC1 6s and PIC1 8s) were making plans to use powerful 32-bit microcontrollers and the Linux operating system as the basis for their next generation of products. My immediate thoughts were along the lines of "do these people realise what they are letting themselves in for?" The other source of 'inspiration' for this article came from a couple of outstanding software engineers from BT's Martlesham labs who attended an ad- vanced FTT course on Linux Kernel and Device Driver pro- gramming and who 'introduced' me to the exciting world of "Gumstix'. Gumstix For those of you who have not been exposed to them, Gum- stix [1 ] are cheap and powerful ARM9 embedded Linux sys- tems and add-on boards with a very small footprint (only somewhat larger than an old fashioned stick of chewing gum), and can provide a very good introduction to Linux, not just because of their relatively low price, but also because the Gumstix community is so helpful and enthusiastic. Just as Elektor readers have embraced 8-bit and 1 6-bit microcontrol- lers such as PIC1 6/1 8s, Atmel AVRs and PIC24s in a whole variety of projects, it's quite likely they will embrace Gumstix in a whole generation of new projects using a 32-bit ARM9 architecture and running the Linux operating system. Enter Linux For those who like a challenge and enjoy hard mental work Linux is great fun. To become an embedded Linux guru, many skills need to be mastered. It is possible to teach yourself Linux and there are many good books available covering both running Linux on PCs and using Linux in em- bedded systems. Skills learned on PCs can be transferred to embedded systems development and vice versa. Embedded systems engineers want to develop working systems as soon as possible — turn LEDs on and off, stop and start step- per motors, collect sensor readings, and implement various feedback control applications. The satisfaction of writing these simple Linux programs comes from an appreciation of the way in which the various pieces of Linux work together in the execution of the code, and an appreciation of how it is possible to put together far more complex applications built on these foundations. The whole point of working with Linux is that it permits the implementation of systems that can juggle many resources at once and to implement inter- active applications for both 'communicating with' and 'con- trolling' all this juggling. There is the further bonus that a vast amount of free and very powerful open-source software running under Linux is readily available. This software is as good as, and often much better than, much proprietary commercial software. Many companies selling tools into the high-end real-time and embedded market are not just quietly including Linux based products in their product portfolios but also upgrading their IDEs (Integrated Development Envi- ronments) using Eclipse as their starting point. The business model of quite a few of these companies is based on the selling of expensive support services with their particular 'commercial' distribution. For instance, Wind River Systems has acquired FSMLabs and has embedded Linux products in its portfolio; LynuxWorks sells not only LynxOS (a hard real-time Posix compliant OS) but also an embedded Linux distribution called 'Bluecat'. MontaVista's business model is based on producing Linux distributions tailored to specific markets such as the mobile telephony and telecomms mar- kets. For commercial organisations that need to get prod- ucts to market fast the cost of using these commercial distri- butions can be justified. For most Elektor readers these costs are just too prohibitive. The good news is that it is possible to learn and master embedded Linux systems development without using these expensive products, and that the skills learned are exactly the same as those needed when work- ing with the more expensive commercial distributions. Both 14 elektor - 3/2008 the embedded Linux community and the broader Linux and open-source community are enthusiastic and very support- ive of beginners. Gaining an understanding of developing embedded Linux requires focus and effort. How might this effort be directed? Here are some suggestions. • Getting to know how to drive Linux from a terminal — the various Linux commands and utilities with mysteri- ous names such as 'grep', 'find', Is', 'chmod' and so on; the techniques for combining them using pipes and redirection. • Learning how to write programs for the bash shell. • Learning how to program in C and C++ and how to write applications that make use of the Linux Application Programming Interface (API). • Learning how to configure network interfaces. • Learning how to install and configure Linux services such as DNS, mail servers, Apache, and DHCP. • Understanding how to drive hardware from user applications. • Learning how to build, load and boot tailored Linux kernels. • Learning how to implement Linux device drivers. • If you are interested in multimedia applications then start exploring the wealth of open source applications, tools and utilities available for Linux. • If you are interested in telephony then you should explore VoIP and other open source applications including open source mobile telephony. Most of your Linux skills can be developed using PCs, in- cluding older 80486 and Pentium II PCs. You might also consider installing Cygwin and Eclipse on your Windows XP, Vista or Windows 2000 PC or workstation and devel- op your skills here. Later you can install and set up cross- compilers for e.g. ARM or PowerPC targets. Sysgo sells a commercial Linux development system targeting e.g. ARM9 systems and running on Microsoft Windows called Elinos. You can also, of course, install cross-development tools on an Intel laptop or workstation running Linux. Moving it to embedded If you are planning to work professionally developing em- bedded Linux applications then, of course, I would rec- ommend undertaking some professional training, and this might include considering some kind of University degree course that covers Linux and embedded Linux program- ming in depth. For your initial foray into embedded Linux systems on a non Intel processor based platform, investing in a one of the Gumstix boards, and a few add-on boards is an excel- lent way to get started. There are many interesting Gumstix based projects out there including robotics applications, mobile telephony applications, and data acquisition ap- plications. Gumstix are sold directly over the web so as to avoid costs associated with resellers and distributors. There are discounts when purchasing multiple boards, hence it is useful to group together with some likeminded people and purchase your Gumstix as a group. Linux builds for Gumstix boards can be downloaded from the Gumstix web site and there are also many useful examples of how to write device drivers and build applications that are either available or that can be tracked down starting from the Gumstix web site. Gumstix also sells bundles containing a base board and a selection of add on boards. Gumstix also has devel- oped a sensor rich Atmel AVR board, the Robostix board, that can be connected to the ARM base boards. A setup based on an ARM9 Gumstix board and the Atmel AVR based Robostix board can provide a very good introduction to implementing distributed multi-processor applications in which a central processor communicates with a number of small microcontroller based systems Gumstix in practice Here are just a few Gumstix based projects to whet your appetite. PersonalSoundtrack — developed by Greg Elliot at the University of California, Irvine, uses Gumstix to implement a tiny wearable computer that detects the wearer's walking or running speed and plays songs from his/her music library that match the wearer's pace. Refinements include instantly adjusting the song speed to match small variations in your gait, and changing songs in response to a deliberate pace change (e.g. from walking to jogging). Figure 2. Robot Fish resembles a 50-cm long) common carp, mimics the undulating motions of a real fish swimming and turning. Three Robo-fish swim in a tank in the London aquarium alongside their living counterparts. (courtesy Professor Huosheng Hu, Computer Science Deportment, Essex University) ENIPS — a project at the State University of Arizona, which involves developing a robust, secure, easily config- urable manageable intrusion detection and prevention sys- tem, all in a small mobile phone sized box. Flightstix — a project from the Aerial Robotics Club at North Carolina which is developing a UAV autopilot module for the GumStix as part of a system to compete in the AUVSI international aerial robotics competition (Figure 1). The various sensors used include • 1 0-channel independent servo-type • PWM input and output • 3-axis gyroscope • 3-axis accelerometer • 3-axis magnetometer • ultrasonic altimeter • GPS • two differential-pressure transducers (for pitot/static and barometric altitude) Robo-fish — a project from Professor Hu at the University of Essex, London, which involved the design of a robotic fish swimming in the London Aquarium (Figure 2). Sailing robots — Aberystwyth University is using Gumstix in various sailing boats which will be used in oceanograph- ic research, and also entered into Microtransat Challenge, a transatlantic autonomous boat race. 3/2008 - elektor 15 INFO & MARKET EMBEDDED LINUX Figure 3. The Pegasus payload. (courtesy James Coxon) Mrtii HIQ 3 l points ildiiWjyi ■GPS SjtLvy P*ih ‘SjiriTi:-. ntUfy Fuel Figure 4. Image of stratosphere taken by Pegasus. (courtesy James Coxon) Pegasus High Altitude Balloon Project [2] — an am- ateur & student project involving sending payloads to 'near space' (60,000 to 325,000 ft) by use of helium weather balloons which are designed to burst at a certain height (Figures 3, 4). The Gumstix payload returns to earth via parachute. Some of the interesting features of this project include • GPS (serial, compact flash and onboard); • interfacing with mobile phones (gnokii); • interfacing with radio (Aerocomm 868 MHz radio mo- dems and 434 MHz beacons); • using GPIOs to trigger camera shutters & cutdown circuits. As Elektor readers these projects should inspire your imagi- nation and your curiosity. FTT uses Gumstix in some of its embedded Linux training courses. For further information please visit http://www.ftt.co.uk. ( 071106 - 1 ) Web Links [1] http://www.gumstix.com [2] http://www.pegasushabproject.org.uk Advertisement 0 PCBjiisoldering .co.uk Supplier- e of PGB Soldering Equipment & Rework Stations i_u_ NEW IN STOCK rrt 328 Working Platform /££| $17+ 45W Solde ri n cj Station I Ra nge OF Took & Accessaries s U Vi a V m n 3 a X Kn Hui Aa-Gun (5 r Ah hkautri .rnwVQMf-riPglrnn ltflh Furnc i'U»oibcr Sakkvlng rwi Tip wr.h Mcvr ng Element Eui !■■)'! '"fn. Pad E Rerncfti.il Tod 2xCHfc«HFd| Infrared Wei ding Station $5(3 5 MO Hot Tweezers & Station Online Price £44 95 Online Price £7 50,00 Test-pins.co.uk S&pfrfi&t af Tfi rf.pta. Reratort’a i For Teaf-pins & Probe s Visit Www, text* pins, to, ufc coda a so appie& www.pcb-soldering.co.uk Allflndilfi ElflCtrJk Pindar ^Dta.^cddcidon. HcrSfai-ElsKirc.EMl &FF F *44 4507 3 1 E s-nls-i^pcb-LoVltrvng ta.uk 16 elektor - 3/2008 » Mr Ilf • T | ] p gj y a "f ^ ■ M * 1 r* i ■ - * *> ■ i »— UfliftytMi L ,B 1 nv ' “H" w LU ££ LLf PicoScope 5000 Series The No Compromise PC Oscilloscopes 250 MHi bandwidth 1 G5/s real-time sample rate 128 megasampt-e record length With class-leading bandwidth, sampling rate, memory depth and an array of advanced h*gh-end features, Che PicoScope 5000 PC Oscilloscopes give you the features and performance you need without any compromise. Advanced triggers In add-on U the standard trigger the FkoScapc S00C series -comes as Standard v yi*h pulsr- width. windc-w, dropciuE. delay, mef lesgk IrvH irjggerli^g, 250 MHz Spectrum Analyser High-Speed USB 2.0 Connec ts tan Automatic Measurements Arbitrary Waveform Generator Define your ^wn wdvtfflrms yr ?.t ,: ecl fr'om $ predefined signal? w th the 12 bit. : ?. 5- MS/s arbitrary waveform generator. Waveform Playb ac k Tooi BAi P i LuIi'LO sc soft ware now jll&wj yuu Ey Lut,*:. review. W and analyse up to 1 000 Captures & within its waveform playback tool. Technology The PkoScOpe 3000 Serits of oscilloscope-! frewn f'ico Technology iradudes general purpose and h^h resolution models: Witn 12 bit rcsnSuEiyn -md I ■ accuracy, the Ft* p' 5 tope 3 ; 42* is able to detect cnanjjes as sma*l as 0,024% {24 4 ppm) - making It Ihe ideal 4-channel ■WCHIy^epe h?r 4nJo& mu ■ truly, i, Ttw hijj.li! r speed 8 h\t vvkhMi i« the FV ok i^i e 3000 M-T IE'S U' I i l vimpli -I r . JOfsMS «. ;md up re? i MS/s rec-or'd icaiHjin hIM fcir -jJE'rn I'al py.1 ptisi- .ir'iil |i(:rr, li:i* .IppliC.ITipnS, . The RcoScope 2000 series osetitacofRS offer single and dual channel umts thas oFFcr highly ^ pOr'iabk/I^W c.-i i% 1 itjUfliarrv Sej gi^ncp.il purple filling. Thi 1 award w nn ng 2 5MHz handheld F^coScope 2^05 Ills ctwnlijrtBbfy imo the palm oF your hand yet still includes * ih^ powerful fMiuirs fourtrf in larger GKilloKeper www.picotech.com/scope459 to check out our full line of PC -based instruments or call 01480 396 395 for information and a product catalogue INFO & MARKET OPEN SOURCE HARDWARE Etnernut and the Ki or how to build a business with Open Source Dr. Thomas Scherer Talk to any business advisor about a new product you have in mind and the chances are that the first bit of advice you will get is to protect your idea with copyright and patent. Hi tech entrepreneurs would not consider a business plan based on an Open Source product as a good investment but then again they haven't met Harald Kipp. Be warned, as Harald found out, success can have a big effect on family life... Harald Kipp was leading a life of con- tentment as the head of his small soft- ware company in a small town in Ger- many on the banks of the Ruhr when he first became interested in Open Source software and in those early days he was happy to look on it as a hobby in- terest rather than serious work. Thanks to the arrival of the Internet towards the end of the 1990s Harald found that he was not alone in his hobby. In fact the potential of networked communi- cation became the source of inspira- tion for the project that was to go on to change his life. He could have just carried on with his successful software business, but with a mixture of hap- penstance and dogged determination together with support from the Open Source community he was able to turn a concept that began as a hobby into a sizeable business. Microcontroller meets Internet Towards the end of the last century op- timism in the future of dot-com compa- nies was reaching a peak and microe- lectronics had pervaded almost every item of electrical equipment. Practi- cally every washing machine was now equipped with a microprocessor, mo- bile phones were becoming ever small- er while still managing to pack in more 18 Figure 1. The egnite team on the company roof garden in Castrop-Rauxe, Germany. Harald Kipp is on the left next to his family and co-workers. elektor - 3/2008 pp Family products and more features. Peripheral equip- ment for PCs became integrated into single chip solutions. New 8-bit micro- controllers were appearing which were more efficient and more powerful than their predecessors and which certainly could put the old IBM PC -XT workhorse of the eighties in the shade. Many en- gineers and designers were keen to exploit the power of these new micro- controllers in networked configurations and handling Internet protocols. By the year 2000 at least two Open Source projects had been produced to real- ise this goal: ‘lwIP’ was the work of Adam Dunkel from SICS (Swedish In- stitute of Computer Science) and ‘Liq- uorice’ which was a high performance (network orientated) operating system written by Dave Hudson. By chance Harald stumbled upon Dave’s work while surfing the Web and he was surprised to discover that there was no dedicated hardware design for the project. Using an STK-200 kit from At- mel (based on the ATmegal03) togeth- er with additional memory and an ISA Ethernet card Harald was able to get the complete system running although he was not as yet entirely happy with the stability of the platform. The birth of Ethernut Following on from this early suc- cess Harold set out to design a dedi- cated PCB for the project, managing to squeeze an ATmegal03, an RT- L8010AS-Ethernet controller and 32 kB of RAM neatly onto a single, half-Eu- rocard sized board which he half-jok- ingly christened ‘Ethernut’. The addi- tional RAM was essential because the microcontroller is equipped with just 4 kB of RAM and 3 kB of this would be taken up by the send and receive data buffers of a single Ethernet frame. With the remaining 1 kB of memory even the most gifted software engineer would be hard pressed to write any Internet software to do anything at all useful. In the meantime Dave Hudson had moved to the company Ubicom who market a compet- ing Operating System so work on liquorice was halted and the soft- ware was incorporated into the Ethernut project and re- named Nut/OS to allow further soft- ware development. By the middle of 2001 Ethernut had been registered with SourceForge as a combined hard and software Open Source project. From this point on the community showed much interest in the project and surprisingly were ask- ing where they could purchase the fin- ished Ethernut board. Up until this point Harald had been busy with his own company ‘egnite Software GmbH’ which as you can guess from the title had concentrated on software development. It seemed a risky venture to take the company into the unknown territory of supplying both hardware and software products but with advice and support from an- other start-up company ‘optiCom- po Electronics’ (who were already established in the field) he was Figure 2. The first version of the Ethernut board (1.3) is still in production and enjoys a good following. able to make the decision to go ahead. Initially the two-layer Ethernut board was assembled in-house by hand. However the first sizeable order from Japan for 50 units certainly put a strain on the modest production capability of the Kipp family assembly line! MP3 down the line As word got around so orders for Eth- ernut increased steadily until produc- tion of the boards overtook all other activity at the company. At first the or- ders were from private users, schools and Universities, but small companies and other industrial concerns were also finding interesting applications for the product. He was approached by one Figure 3. Ethernut 2.1 includes additional memory and a faster Ethernet interface. 3/2008 - elektor 19 INFO & MARKET OPEN SOURCE HARDWARE buyer from a chain of retail stores who was interested in installing web-con- nected listening booths in their shops. The idea was that by just scanning the EAN barcode on a music CD the cus- tomer would cause the tracks in MP3 format to be streamed to the listening booth using TCP/IP from a server. It would no longer be necessary to break the seal on a new CD case just to listen to some tracks before deciding wheth- er to buy an album. With good foresight the Ethernut board (Figure 2) had been designed with an expansion connector so it was a rela- tively simple job to devise a small plug- in expansion board containing an MP3 player chip type VS 100 IK. With the ad- dition of some software the MP3 Stream- ing-Client was finished. Jesper Hansen made a significant contribution to this last part; he had already established a good reputation in the field with his Open Source project YAMPP [3]. The Ethernut Family Transfer of MP3 streams over the in- ternet suggested another application: Internet-Radio. There are any number of radio stations ‘transmitting’ on the Internet, no matter where in the world you may be if you have Internet access then you are just a mouse click away from even the most obscure ‘local’ ra- dio programme. The broadcasts take the form of MP3 format files sent as SHOUTcast digital audio streams us- ing TCP packets. To ensure continuous play it is necessary to store the pack- ets in a relatively large memory buffer otherwise reception drop-outs occur. The relatively small Ethernut memory capacity was insufficient for this appli- cation and called for a redesign. The result was Ethernut 2 (Figure 3) which has a 100-Mbit Ethernet and 512 kB RAM. The processor can only directly address 64 kB of memory so a bank-switching technique is employed to access the entire on-board memory. The prototype used a few logic gates to implement the bank switching but af- ter some intensive and helpful discus- sions with members of the user-group it was decided to replace the gates with a CPLD (Complex Programmable Logic Device). By 2004 Ethernut 2 was introduced to the world and a Dutch company was one of the first to tap into its poten- tial by incorporating it into a web radio device. The radio offers MP3 streamed church service programmes in the home for people who through disability are unable to attend church. The equip- ment is completely self contained and requires no PC expertise on the part of the user. Details of two companies using Ethernut based web radios are given in [6]. The need for more processing power led to the third incarnation of the board Table 1. Technical specification of the Ethernut series. Specification \ Board Ethernut 1.3 G Ethernut 2.1 B Ethernut 3.0 E Ethernut 5 (preliminary) CPU ATmegal 28 ATmegal 28 ATmega2561 AT91 R40008 (ARM7) AT91 SAM9260 (ARM9) Clock speed 14.7456 MHz 14.7456 MHz 73.728 MHz 180 MHz RAM 32 kB 51 2 kB as 32 kB + 30 banks of 1 6 KB 256 kBytes 64 Mbytes Non volatile memory 128 kB Flash 4 KB EEPROM 128/256 l optical sensor system ► integration M logic circuitry flexible micro battery T keyboard T OLED display T Figure 7. A demonstration of plastic electronics: a board game. (Photograph: OE-A/ Concept Company) tion. Electronic devices are becoming more and more wide- spread throughout the world. In every corner there is a (pos- sibly hidden) electronic circuit with some function. Mostly they gather information and transmit it to some other device, often without drawing attention to themselves. Reminiscent of '1984'? In that book Big Brother gathered information over cables connecting hidden monitoring microphones. To- day we use radio communications, Bluetooth, ZigBee and the like, which are much harder to see. Are we heading towards a world where every tiniest device is connected to a global network? ( 070999 - 1 ) Web Links [1 ] http://en.wikipedia.Org/wiki/PEDOT:PSS [2] http://www.polyic.com [3] http://wl .siemens.com/innovation/en/news_events/ i nnovation news/in novation news_articles/lighting/wafer_ thin_color_displays_for_packaging.htm [4] http://www.oe-a.org [5] http://www.plasticlogic.com [6] http://www.plastic-electronic.com/index. php?article_id = 1 &clang = 1 [7] http://www.printed-systems.de/index. php?id = 1 7&L= 1 [8] http://www.izm.fhg.de/EN/programme/Elektronikauf- groflchigenSubstraten.jsp 3/2008 - elektor 25 DATA ACQUISITION We have had the pleasure of proposing various data acquisition units over the last few years. The one we describe here is a nice exercise in product development. It actually utilises an SD card as the media for data storage. The hardware design is compact and that makes the firmware and software features even more interesting. LoTc Marty This data logger is used to save the values of four analogue channels sup- plying any voltage ranging from 0 to 5 V onto a standard memory card (SD - Secure Digital). Elektor has a long history when it comes to publishing data acquisition systems and loggers — the most re- cent project [1] proved very popular. The data logger we are proposing here is unique due to its simplicity and com- pact size; a microcontroller and a hand- ful of common components are all it takes for hardware. Our data acquisition unit has several operating modes available: 1. Triggering on the fly (internal trig- ger)... in other words, press the pushbutton! 2. Triggering from an external signal; this may come, for example, from a sensor operating at 12 or 24 V (say, a proximity detector); the signal in- put is protected by a 5.1 V zener diode. 3. Saving data at 10-second intervals. 4. Saving data at 1 -minute intervals (e.g. temperature sensor). 5. Saving data when a signal exceeds a certain maximum value; in this case, analogue channel 3 defines the refer- ence level. The electronics As the schematic in Figure 1 shows, there is nothing special or too com- plicated as far as the electronics are involved. The core of the setup is IC4, a top-level 18F452 PIC micro [2], set to maximum speed in HS mode, i.e. 20 MHz. It in- corporates different peripherals put to good use here: A/D converters, an SPI port (to communicate with the SD card) and an RS-232 port (for possible future software extensions). This PIC device, the top-of-the-line in the 18Fxx2 family (32 kB of Flash mem- ory, 1,536 bytes of RAM and 256 bytes of EEPROM) also has an I 2 C port. Al- though this uses the same pins as the SPI port, it proved necessary to use two other pins for communication with the real-time clock (RTC) device, IC5. Here, this takes the physical form of a PCF8583 [3], an IC that’s very simple to configure. Some of its key data are listed separately in the inset. Note the presence of a CR2032 3-V lithium bat- tery; this is used to save the time and date information if the normal supply voltage disappears. D2 and D3, a pair of low forward-bias (Schottky) diodes make it possible to power the RTC permanently. Note the presence of a trimmer capacitor, C14, used to cor- rect possible frequency drift in crystal XI, which is used as a clock (not very critical). The RTC has an open-drain interrupt output with a pull-up resis- tor, R23, allowing for an excellent 1 Hz timebase, simplifying time manage- ment by the 18F452. LCD1, a large display with 4 lines x 16 characters driven in 4-bit mode, makes it possible to visualise the various data: date, hour, recording file number, as well as the value of the analogue chan- nel ANO (0 to 1024, given that the A/D converter has a resolution of 10 bits). Three pushbuttons, SI, S2 and S3, are used to select the operating mode. Also note the presence of the RS-232 port, which may be implemented here. Future changes to the firmware might need this port in combination 26 elektor - 3/2008 EWms Technical specif icatio • 5 data recording modes - on the fly (button press) - external trigger - timed: every 1 0 s, every 60 s - on exceeding a preset level • Data saved in .txt file format • Max. 99 files • Direct reading of SD card in PC word processing program • Formats FAT1 6 SD cards • RTC circuit to timestamp the files • Available as a kit from Elektor Shop ) "u - VI f w 1 l— JL. with a bootloader to load the PIC ex- ecutable code. The SD card requires a 3.3 V supply; this voltage comes from a TS2950-3.3 low drop-out regulator that only re- quires a small voltage difference to supply the necessary voltage (from 5 to 3.3 V). This device is capable of withstanding the (relatively) large peak current consumption of an SD card starting up. The PIC-to-SD card communication is in SPI format with 5 V on the PIC side and 3.3 V on the memory card side. By contrast, in the direction PIC-to-card direction, resistors R5-R10 are used to obtain the required voltage level at the card inputs (CS, DATA IN, CLK); in the other direction, DATA OUT (D PIC, the 3.3 V level is sufficient for the PIC to recognize valid logic states. One note concerning the analogue and external trigger inputs (the sig- nal which triggers the recording of the values in ‘External trigger’ operating mode): these lines may be protected by 5.1 V zener diodes, D4-D7, but these should only be fitted if you know how to handle the inherent voltage drop they will cause. Since they offset the measurement, it follows that you will need to adapt the input stage accord- ing to your application — using a po- tential divider, for example, to measure variations above 5 V. Note that a jumper can be fitted on connector JP1 to supply a fixed voltage (adjusted by the 10 kQ potentiometer P2) to input RA3; this jumper should be fitted when the maximum signal val- ue mode is being used (on ANO only). This is very easy to adjust in practice: it defines the threshold above which the voltage peak is taken into account. It is worth noting that this project was originally designed with this prospect in mind. The PCB The project may be purchased a s a kit of parts # 070745-71 from the Ele- ktor Shop. Figure 2 shows the compo- nent overlay. If you want to make your own board, you can download the copper track pattern from the Elektor website. Given the (small) number of com- ponents involved and the size of the printed board, fitting the components should not pose any problems. Remem- ber to adjust the LCD contrast using the 10 kQ preset PI. Construction is easy, since the compo- nents are common and readily obtain- able, like the PIC18F452. The display is a 4 line/ 16 character model in standard green; it is mounted using four plastic 10-mm pillars. The electrical connec- tion is made via a 16- way male header soldered onto the PCB; a strip of female contacts will be soldered onto the dis- play side. Doing this makes assembly / disassembly much easier. Note that we have made provision for an RS-232 section which makes the setup even more flexible. The RS-232 port makes it possible to employ the bootloader option (see the inset with screenshots devoted to this topic). Since it is difficult to obtain SD card connectors as spares, you can use one cannibalized from a PC external card reader (bash the cheapest one you can find!). The pins for the Lock/Unlock contact on the SD card are not soldered (like pins 8 & 9); the PIC program in fact ignores the data they carry. If the hardware part is simple, that of- ten means that the software is hugely complex, as is the case here. 3/2008 - elektor 27 DATA ACQUISITION 0+5V +5V O SI K3 C7 16 KJ- 6 , ► 14 2 7 7 13 3 8 8 4 9 15 ru 5 “■U — lOu CM c =1 c vcc " C1 + IC3 Cl- TIOUT T1 IN T20UT T2IN RUN R10UT R2IN R20UT C2+ MAX232 GND L u C2- L LI > IC2 TS2950-3.3 +5V +5V O R16 12 9 I C6 lOu 12 V\_ 10 ^C10 Tci2 ToOn^lOOu K4 ± cs W-P 11 01 CO Ivssi DE 1 VDD RSV CLK RSV. 1 XVSS9 DO SD Card Holder j£ T* CM CO o O > RC6/TX/CK RC7/RX/DT o. CL DC _1 O o o > RB5/PGM RB6/PGC RB7/PGD IC4 RD2/PSP2 RD3/PSP3 RB0/INT0 RB1/INT1 RB2/INT2 RD4/PSP4 RD5/PSP5 RD6/PSP6 RD7/PSP7 PIC18F452 RC2/CCP1 RC5/SD0 RC3/SCK/SCL RC4/SDI/SDA RB4 RB3/CCP2 co § CO CO > o RA3/AN3/VREF+ RA2/AN2/VREF- RA1/AN1 RA0/AN0 CM O CO CO CO o > CM CO C11 X2 lill 20MHz C13 22 ^ ^22p 39 40 21 22 38 0+3V3 LCD 10 27 11 28 12 29 13 30 14 070745-11 Figure 1. At the heart of the circuit, the PIC18F452, surrounded by (clockwise) LC display, SD card connector, the PCF8583 RTC, and the MAX232 level converter. Keywords LC Display - LC displays (LCDs) have replaced cumbersome, power-hungry, inflexible LED displays. There are many types, with characters (x lines of x characters) or graphic symbols. The present project employs an LCD with 4 lines of 1 6 characters. I2C Bus - Inter-Integrated-Circuit bus. Developed by Philips in the early 80s for home automation and interconnectable home electronics applications. The l 2 C bus comprises 3 lines: SDA (Serial Data) for the data, SCL (Serial CLock) for the clock, and a ground line. EEPROM - Electrically Erasable Programmable Read Only Memory. This type of rewritable memory has the ad- vantage of not losing the data it contains during power loss. FAT (16 or 32) - Even before Windows existed, Microsoft developed and patented (in part) an operating system for files, for floppy disks as well as for removable optical media called FAT (File Allocation Table). For more information, see Wiki sites. IDE - Integrated Development Environment. More and more complex software sets propose a centralized environment from which one can access different programs. 28 elektor - 3/2008 The software The source code listing runs into 500+ lines and cannot possibly be printed in this article; you can download it from the Elektor website (www.elektor.com) under the filename 070745-11. zip. This archive file also includes the .hex file you will need to program into the PIC18F452 if you have the means to program the controller yourself. Note that the device is also available ready- programmed from the Elektor Shop as item 070745-41. There’s a special inset to explain the programming procedure using the bootloader. The program was written in C (a first for this author) and compiled using MikroC, the excellent compiler from Mikro Elektronika (very good tech- nical support). The source code is fairly intuitive, even for those who do not know this language very well (in C, you start off with the function main ( ) ) There is a free version of this compiler; it supports code of less than 2 k words. For this project, which uses a lot of memory due to file manage- ment in FAT mode, you need to use the full version. The price is fair, con- sidering the technical capacities of the compiler: IDE included, and espe- cially the use of the built-in features. These were indispensable and put to good use for managing the files in FAT, their attributes (date/hour, etc.), as well as to manage communica- tion with the RTC in implemented I 2 C mode. The author encourages you to discover this surprising and powerful compiler — see the link at the end of the article. Mikro Elektronika are also valued advertisers in Elektor. The LCD screen messages mostly speak for themselves, using estab- lished terms like Sample, Value and Save. The bootloader The PIC18F452 microcontroller used in this project can be programmed in the usual manner using the .HEX file [logger.hex]. To make it easier to develop and especially debug the application, the author has included a bootloader in the firmware. The principle is simpler than it might appear at first. The bootloader is a tiny program that is ex- ecuted whenever the microcontroller is reset. It scans the serial connection looking for a response (here, an V) to the message (here, a 'g') it sends. If it receives the agreed response within the time allotted (here, 5 s), it goes into firmware update mode (in other words, it flashes the part of the memory assigned to the firmware with the data carried by the serial connection, avoiding crash- ing). Otherwise, it sets the pointer to the firmware address, which then takes over control. In this way, it is possible to reload software into the microcontroller at each start-up, as long as the serial connection is correctly set up (57,600 bps / 1 stop / 8 bits / no parity / software flow control) and the PC host software is ready to communicate. Now we will see how to take advantage of this function. First the PIC must be programmed with the bootloader in the usual way, in order to have software for bootloading. Next, just execute the software [mikroBootloader] available in the menu [Tools] in [mikroC]. Be careful to configure the serial connection correctly. Connect the data logger and click on [connect] before the 5 second time delay elapses. Then you can relax: now the .HEX file must be loaded from the data logger firmware with [Open HEX file] and click on [Start bootloader] to flash the PIC. Once this operation is over, just disconnect and reconnect the data logger power supply [Hard Reset], wait 5 seconds and the software should run. Do not forget to insert your SD before starting up again, reset takes place right at the start, otherwise you will need to reset again from off in order to use your module. The screenshots shown here demonstrate the sequence of operations using the bootloader to update the soft- ware, from the first step to ...suc- cess (obviously!). hfattautabw Ns$ Wartry htTRfjami InHrtPiC CprtJ r » I2L $t*jp Fw. t — SsauM *!* — l I SWI Lmfluafci I • * * DSmwtf Tx Rj [. tvs Utahn j I rfCIIMI j ** sfc WVry *'.<» irpmm IrwPC Opvtti r 4Bh™««i:^J0GQER j-jkj SlAioP'orf Tpnnd'MM'i-i ft* 11 **"* I — ^ - - 'j — ~ • O * Tx Rs [111118111111111111111111111111 D WkVJX T xc-x 1 J7ijrff tea MikroC - C compiler intended for PIC1 2, PIC1 6 and PIC1 8. A demo version is available for download, its only limitation being the 2 l i • USB communication by virtual com port i i • Self-powered at 5 V via USB port i i • PIC programmed in C (CCS compiler) i i • Windows man/machine interface in i 1 C++ Builder V5 (Borland) 1 If the traffic on the bus is too slow, push-button S2 (DISPLAY) lets us purge the memory to the PC so as to display the result without having to wait until the buffer is completely full. Communication with the PC is achieved by means of the now-stand- ard FT232 IC from FTDI, which uses the USB in the CDC (Communication Device Class) mode. There are just a very few components around this IC, principally a 6 MHz crystal and its two colleagues C7 and C8, and the type B 4-pin USB socket. A pair of red and green LEDs are asso- vcc 9 | R2 I C2 Hhrl In 1 RCX CX TL > 1 > IC2.A R SDA 6 START 3 SCL Figure 2. A monostable triggered by a falling edge. 3/2008 - elektor 33 MICROCONTROLLERS dated with the events STOP (Dl) and START (D2) respectively. Two 27 Q resistors protect the Data+ and Data- lines. The FT232BM IC switches +5 V to resistor R16, indicat- ing two things to the host USB (PC): first of all, presence of the peripheral, and secondly recognition of the Full Speed mode, since R16 is connected to Data+. One interesting component is induc- tor LI, a ferrite bead intended to sup- press high-frequency interference. Its impedance goes from 0.15 Q at dc to 70 Q at 100 MHz, thereby dissipat- ing any electromagnetic interference (EMI) as heat. In addition, it acts as a fuse if you have the misguided idea of short-circuiting our circuit’s +5 V sup- (+) vcc vcc © ^C12 11 32 © © MCLR/VPP RB7/PGD RB6/PGC IU3 RA0/AN0 RB5 RA1/AN1 RB4 RA2/AN2/VREF- RB3/PGM RA3/AN3/VREF+ RA4/T0CKI RC6/TX/CK RA5/AN4/SS RC7/RX/DT RE0/RD/AN5 RE1/WR/AN6 R D0/PS P0 RE2/CS/AN7 RD1/PSP1 RD2/PSP2 RD3/PSP3 RC0/T1OSO/T1CKI RD4/PSP4 RC1/T10SI/CCP2 RD5/PSP5 RC2/CCP1 RD6/PSP6 RC3/SCK/SCL RD7/PSP7 PIC18F4520 RC4/SDI/SDA RB2 RC5/SDO RBI R B0/I NT _L OSC1 OSC2 J_ VCC © K1 40 39 38 37 36 ISP ICD TP5 pTx 25 26 19 20 21 22 27 28 29 30 35 pRx TP4 VCC ? | R1 1 | R 34 33 S2 H DISPLAY 6 6 y S3 N SCAN VCC © vcc © R13 vcc © 13 2 _ 1 _ 11_ 12 15 24 25 26 © © VCCIO AVCC RESET USBDM EEDATA EESK |Q4 USBDP RXLED TSLED RSTOUT PWREN DCD DSR RXD RTS TXD CTS DTR FT232BM EECS Rl 30 JP1 LI CIO ^ToOn TP3 R14 H 27Q I— i n i C9 lOn K2 R15 R16 H 1k5 H - \ 27 < > | 1 " O +5V O D- O D+ O GND USB VCC 2N7000 070600-11 VCC Figure 4. The circuit electronics don't amount to very much: a PIC/USB chip double-act surrounded by a handful of connectors of all types... 34 elektor - 3/2008 Figure 5. Component overlay for the l 2 C bus analyser. ply, thereby protecting the power sup- ply from the PC. In connection with this, note the presence of a header + jumper JP1, which makes it possible to disconnect the PC supply. PCB It goes without saying that such a cir- cuit merits a PCB. The screen-print- ed component overlay is shown in Figure 5. The first step, and also the trickiest, consists of fitting IC4, the only SMD IC used in this project. As always with SMDs, soldering it requires a bit of care and a steady hand. The pads of IC4’s LQFP-32 pinout have been lengthened to make it easier to solder this device using a solder- ing iron. Start by getting the orienta- tion correct (pin 1 is the one immedi- ately to the left of the round indent). On the component overlay, the posi- tion of pin 1 is identified by a small ‘1’. Start by soldering the two diago- nally opposite legs. If the remaining legs line up properly with the remain- ing solder pads, they can be soldered quickly using a fine-tipped soldering iron and fine-gauge solder. Use a mag- nifying glass to check the quality of the soldered joints and that there are no shorts here. You can then go on to fit the remaining SMD components, in 1206 packages, followed by the small solder-through components, resistors, crystal, capacitors, LEDs and transis- tors (paying attention to polarities). Then you can fit the sockets (good quality ones!) for IC1, IC2, and IC3, and finish by installing the various sockets, RJ-11 for Kl, K3, K4, and K5, and USB type B for K2. All that then remains will be to fit push-buttons S2 and S3, and the re- set button (SI). Important: if you are powering the circuit via the analyser’s USB port, which is the usual case, you need to fit the jumper in the ‘on’ position on header JP1. After one last glance at the project to ensure there are no errors or shorts, now comes the moment to connect the board to the PC via a USB cable, to check for the presence of supply volts at the appropriate points on the sock- ets, with the aid of a multimeter. If everything is OK, you can disconnect the analyser and then fit the last ICs, IC1-IC3, watching out for their polar- ity. The board includes a number of test points (TP1-TP8 on the compo- nent overlay, test points TP1, TP2, TP4 and TP5 corresponding to the SCL, SDA, Rx, and Tx lines respectively), which can if desired be fitted with pins, as in our prototype. COMPONENTS LIST Resistors R1,R2 = 8kQ2 R3,R4 = 1MD5 R5,R6 = 330D R7,R13 = 470D R8 = 4kD7 R9,R10 = 1 OkD R1 1 ,R1 2 = lkQ R1 4,R1 5 = 27D R16 = lkD5 Capacitors Cl ,C2 = InF C3 / C4 / C1 0 = lOOnF C5-C8 = 22pF C9 = lOnF Cl 1,C12 = 33nF Semiconductors D1 = LED, 3mm, red D2 = LED, 3 mm, green T1,T2 = 2N7000 For testing, the circuit can be powered at 5 V from the I 2 C bus connector or by wires soldered directly to the board. Trouble-shooting the hardware part is made easier because the monosta- bles are independent of the software: when the circuit is connected to an IC1 ,IC2 = 4538 IC3 = PIC18F4520, programmed, Elektor shop item # 070600-41 IC4 = FT232BM (FTDI) Miscellaneous Kl = 6-way RJ-1 1 socket (vertical) K3,K4,K5 = 6-way RJ-1 1 socket (horizontal) K2 = USB socket, male, type B LI = ferrite bead XI = 20MHz quartz crystal, HC 49/4H case X2 = 6 MHz quartz crystal, HC 49/4H case SI = miniature pushbutton S2,S3 = 'D6' pushbutton (red and black) JP1 = 3-way SIL pinheader with jumper PCB, item # 070600-1 PCB artwork, free download from www. elektor.com Project software (PC executable and .hex file), item # 070600-1 1 , free download from www.elektor.com 3/2008 - elektor 35 MICROCONTROLLERS j - I2C Frame Analyser L>e ^onm»£4t«n jtk»s LFfc _ciii(Ky LU'Sa-_ 1-' •: jy 05> ;t /i- bo a i a j a * 04 83 so v JOlXJS >1 IDUimiMDOmUDUKK! S4il OF P 5 TO on- R7 as Sfl 8A SR Sr SD flF BFOOI 1 3000531 gt oooo oo oo co oooooo :c r :io or r JJUQDBI gj 9:1 94 »> B& 0f 9B 93 3A F JO OOailSMXfOSJOOOOUO 000000 F .■; kj i ci v S Tfi (X> SR AC (3D W !5F AO At A3 A3 A4 F 70 00S7inR0000f500000000000 P 540 I t P : 30 OO A5 A6 A3 AS A9 AA AD AC AO AC P JUUOS Jl AXJUOLKXJOOWUUUOUU ' F 540 I J F 5 A)m AF IF J Kl KJ lid I'M H 1 ) Kfi H.f H8 F 3000*71 AFOOOO 00 fJO 00 000000 P HO 13 P 3 30 OO Q9 DA DD DC DD DC Or OO- Cl OP 30 CO 5 31 B9OOOOO000 0O0O0OCda P 540 14 F a JO 00 Li 04 03 C(r C7 Uf C0 CA L'ti CO F 70 00 5 71 03 000000 00 00 00-0000 P 340 IS P i 30 OO CD CC Cr DO D1 D3 03 D4 OS D* P 30 00 531 CDOOOOOOOOOOOOOOOCi >: P 540 IS P a JU OLt Y>i OS L79 DA DH UC DO Ufc OF tU F jo oo a ji o/ uo oo oo uoouwuooo r 340 I 7 P 5 7000 FI F3 F3 F4 F5 Ffl F7 FB F3 FA P 30 00 5 31 Cl CO 03 00 00(300000 00 X P 340 IS P .. Ready to Sr: tin [D^Wnil li- i n |n’ lm|i|i:i OBtfR] Mil i It C0M$Owfl Eraatwi --SOO aVJ* ,»WM >*1 1 >07? >VSO JW'S-L >Wt2 >V§3 >¥S5 >V$4 .iPOO >£H> >V2X) >VOO *$00 >V2J >V7 D Figure 6. Screen dump of Monitor I2C program. existing I 2 C bus, the four monostables ought to react to the arrival of a Start and a Stop by lighting the green and red LEDs respectively. Then the PIC can be programmed. Software The microcontroller source program is written in C and compiled with the help of cross-compiler PCH compiler V4.010 from CCS (Custom Computer Services). This compiler tolerates a certain flexibility in the academic C language, and so is very well suit- ed to programming by electronics technicians. Development is carried out under MPLAB V.7.62. The program, which runs under Windows, is written in C + + Builder V5 (Borland). The soft- ware for Windows can also compile under CodeGear 11, the latest IDE from Borland, available in 30-day evaluation version. And there you have it all. An ISP connector Kl is fitted in the middle of the circuit to allow debug- ging (ICD = In-Circuit Debugging) and in situ programming (ISP = In System Programming) of the microcontroller. A quick glance at the software Though the electronics are simple, the program loaded into the microcontrol- ler needs to be all the more powerful. You can download it from our web- site (www.elektor.com) as archive file 070600-11. zip. Let’s take a look at a few of its practical aspects. The man/machine interface: installation This application, written in C + + Builder V5.0, runs under Windows and is easy to install by copying the executable monitor_I2C.exe. This application requires prior installation of drivers on the PC. To do this, it’s worth consulting the FTDI [3] web- site and the previous Elektor articles on this subject. RS-232 configuration At start-up, an initial dialogue box lets you select the Virtual Com Port via which the USB link is going to receive the data sent by the PIC in the form of a standard asynchronous serial link (transfer speed 128,000 baud). Then the status bar indicates that the serial port has been opened properly. Displaying the results Scanning is started by operating push- button S3 (SCAN). The I 2 C events are then recorded by the circuit and ap- pear according to a colour code cor- responding to the I 2 C event. Screen dump Figure 6 shows the main screen when acquisition is finished; in it you will be able to recognize the STARTs in green, the STOPs in red, the ad- dresses in ultramarine blue, and the data in royal blue. However, this dis- play will be modified by the value of the acknowledge bit: if it is present, we see these two in blue, but if it is absent, they will be greyed out. The status bar also shows the format of the codes transmitted on the serial link between the circuit and the PC (ASCII coding). Example: Tek | 400U< wVT/UVhJWVW +\n ULJUUVUVUV t 0+ J1TOW| i " "i 1 — 1 r— i 41 IMMji PI > » i m k* r j » Aft AHUM WW W jMMh Tr 1 5 Mt n* p W p f 1 * * ( nata: 22 ! — &■ • - Figure 7. Scope trigger screen dump 36 elektor - 3/2008 r n The secrets of l 2 C and its bus sda / 1 Lxi 1 1 1 1 1 1 SCL n r 1 1 data line i i 1 change | 1 stable; 1 of data | 1 data valid 1 allowed | x A The l 2 C (Inter Integrated Circuit) bus was dreamt up by Philips, at the time when they were one of the leading manufacturers of audio equip- ment. Its major fields of application were home automation and home electronics in the early 80s. Microprocessors were putting in an ap- pearance in TVs, and they needed to find a cheap, easy technique for interconnecting the various electronic sub-assemblies in such devices. The l 2 C bus is a synchronous serial bus with just 3 lines: Data, (SDA), Clock (SCL), and ground (used as a reference). Operation of the bus is based on the concept of master (the peripheral that manages the communication, generates the clock, and transmits the data) and slave (the peripheral that receives the data and confirms reception by an 'acknowledge' signal). But don't let's be deceived: despite its rustic simplicity, this bus can handle several microcontrollers without conflicts, as long as certain rules are properly obeyed. The four most important situations in this protocol are illustrated below. 1 ) Transfer of a bit onto the l 2 C bus (Figure A). The clock doesn't really have the 'form' of a real clock, since it can have variable mark/space ratios (within constraints). 2) START and STOP conditions (Figure B). At the start of communication, the SDA line goes to '0' while the SCL lines is at '1 '. This is the StartBit. At the end of communication, when SDA tv SCL r~x~irr~i r^ r ~r~x~ir"K~ir r _ pl MSB acknowledgement signal from slave byte complete, interrupt within slave acknowledgement signal from receiver i Li r J clock line held low while interrupts are serviced A A / 3 - 8 \ A / ¥ Sr or ACK ACK Lf J START or repeated START condition c STOP or repeated START condition L the SDA line has gone back to '1 ' and the SCL line is also at '1 ', we have the StopBit. 3) Transfer of data onto the l 2 C bus (Figure C). This condition having been defined, the master places the MSB on the SDA line. It validates the data by briefly forcing the SCL line 'high'. It continues in the same way for the various bits right down to the LSB. The transmission over, the slave forces the SDA line low, this is the... 4) Acknowledge signal on the l 2 C bus (Figure D). The slave component issues this signal to indicate reception of all the data. If everything is OK, it forces the line to 'O'. Despite its simplicity, the l 2 C bus allows handling of relatively complex operations. The various scope traces given in the article illustrate this operation very well. It's worth noting that a master-component can also receive data from a slave (master-receiver). If you want to find out more, all is explained in the l 2 C bus specifica- tions from January 2000: http://www.nxp.com/acrobat_download/literature/9398/3934001 1 . pdf (Illustrations: Philips Semiconductors) j ->S00 for the START ->V20 for an acknowledged byte with a value of 20 (HEX) ->v20 for an unacknowledged byte with a value of 20 (HEX) -> POO for the STOP Oscilloscope synchronization function This utility lets us configure the set- up with a synchronization byte, which when it is present in the frame trig- gers a synchronization pulse on the SCOPE_TRIGGER pin to synchro- nize a scope in external trigger mode. This makes it possible to display the shapes of the SDA and SCL signals just at that instant. For example, the screen dump in Figure 7 represents the SCOPE TRIGGER signal for the sync byte 21 (HEX). The top part of the trace clearly shows how each time this byte occurs, the signal toggles for the duration of the next byte. The central section shows the magnified portion with a zoom factor of 10 and reveals the transition of the SCOPE_ TRIGGER signal at the moment of the ninth SCL clock pulse. This instant, which normally corresponds to the reply from the receiver, enables us to read a ‘1’ on SDA, indicating that there has been no acknowledgment: from that moment on, the I 2 C circuit with the address 10 (HEX) for which data bytes 21 22 23 were intended is considered as absent from the bus or defective. 3/2008 - elektor 37 MICROCONTROLLERS Delay function Another utility function makes it pos- sible to delay the start of recording of a certain number of events; in this case they are replaced on the display by a dot. I 2 C summary A built-in help page includes a brief summary of a few definitions of events present on an I 2 C bus. In addition, it shows the recording of real signals. To transmit data over the I 2 C bus, it is necessary to monitor two specific con- ditions: Start and Stop. The Start con- dition corresponds to a falling edge on SDA while SCL is high. The Stop condition corresponds to a rising edge on SDA while SCL is high. Then, eight pulses supplied by the clock allow sampling of the eight bits of the byte, starting with the MSB. The ninth clock pulse allows a re- sponse, an acknowledgement by the receiving component of the preced- ing byte. If the component is present, then it acknowledges by taking the SDA line low. This is the principle of ‘handshaking’. If not, the line remains high, and the transmitter of the byte may react. And what else? Not a lot! All you have to do is connect an application’s I 2 C bus to the PC bus analyser, connect the latter to a PC, start the monitor_I2C.exe program, press the SCAN button, followed a few moments later by a press on S2, DISPLAY, and wait for the first data to appear on the screen. Conclusion This simple-to-use circuit using stand- ard components (CMOS logic ICs, PIC microcontroller, USB interface) makes it possible to analyse the signals present on an PC bus. One further de- velopment of the circuit might be to fit a PIC with a USB stack (PIC18F4550). This solution would simplify the hard- ware (by eliminating the USB interface IC and the 6 MHz crystal) and improve speed, as the PIC 18F4550 uses a PLL to generate a clock at 48 MHz. The dis- advantage would be in the increased complexity of the software. Libraries provided by the publishers of C cross- compilers do exist and provide numer- ous source files (MPLABC18Compiler, CCS) but overall debugging is likely to be trickier. This practical tool will let you to see what’s happening on the bus of the datalogger project described else- where in this issue, as it too has an PC bus interconnecting the real-time clock to the rest of the system. Happy hunting! ( 070600 - 1 ) r — — — — — — — — — — — — — — — — — — — n ! The author 1 1 The author studied as an engineer at the INSA in Lyons and then moved into teach- ing, passing the competitive examination for National Education. Teaching electronics to students in the BTS (Higher Technician's Certificate) section for many years, he has experienced and passed on the fantastic evolution in tech- nology: discrete components (2N2646 unijunction transistor!), memories, micro- processors, mainframes, then the arrival of personal computing. Training has also evolved, nowadays rely- ing on an understanding of complex elec- tronic systems: installation, configuration, and troubleshooting. And sometimes even now, faced with a successful project, he still feels that good old maxim: What a fine profession it is to be a teacher! Etienne Boyer Web Links and bibliography [1] FT232BM Data Sheet: www.ftdichip.com/Documents/DataSheets/ ds232bl 8.pdf [2] PIC18F4520 Data Sheet: wwl .microchip.com/downloads/en/ DeviceDoc/3963 1 a. pdf [3] FTDI website: www.ftdichip.com [4] CCS compiler: www.ccsinfo.com Photo of the prototype. Note that component designations have been changed in the final version. 38 elektor - 3/2008 SERVICING YD U R CDMPLETE PRDTDTYPE NEEDS 1 EUROCARD (160x 100 mm) + Tooling + Photoplots + VAT Price example Any size and contour possible! Optional: • Soldermask • Fast-turnaround • Silkscreen • 4-Layer Multilayer • 6-Layer Multilayer FUB tAYQUT smwAM* Freephone Q) 0800-3898560 fJKSl m»rP £ FUi 1 ,!' ,: ’ l!4,i EKE Simply send your files and order ONLINE: PC8~POOL.COM tel. 01298 70012 J fax. 01298 70046 www.peakelec.co.uk urawfunituBj- sales@peakelec.co.uk Handheld Test Gear - Cool, Smart. Atlas DCA' Atlas DCA Model DCA55 Semiconductor Analyser Identifies type and pinout! Atlas LCR Atlas ESR Model ESR60 ESR and Capacitance Meter Resolution of 0.01 ohms! Atlas SCR Atlas LCR Model LCR40 Atlas SCR Model SCR1 00 Inductor, Capacitor, Resistor Analyser Triac and Thyristor Analyser Automatic part identification. Auto gate test current up to 100mA UK: Please add £1.00 p&p to your order. Prices include UK VAT. Please see website for overseas pricing. Embedded Linux Boards IFOXLX832 MCU: Axis ETRAX 100 LX 100 MHz sm Flash 32MB RAM Full Linux v2. 4. 31 (default) or 2.6. 15 Two USB host interface Two 40 pins sockets tor expansion Dimensions: 66 x 72 mm GSM / GPS Module add on Create CGI using C language Apcohe^ RHP a no SQLite R5S Reader and LCD deino 5AM9-L9260 MCU: Atm el AT91SAM9260 ARM 9 tSDMHz operation 64 MB SDRAM 512MB HAND Flash [seen in Linux as silicon drive) Us 3 host and USB device connectors R5232 interface and drivers SD/MMC card connector Single power supply: 5V DC Expansion header Dimensions: 100 x 30 min MCU: Cirrus EP9302 ARM920T 2 00 MHz SDRAM 32MB (16MB xl&bitj Flash 16MB (8MB xlfiblt) ETHERNET 10/100 PHY CSG952 2 x R5232 drivers and connectors 2 x USB host connectors SD/MMC card IrDA trarisciever cn board JTAG Interface ADC extension pod: Power supply plug in jack Linux 2.4, Linux 2.6 and NetBSD Dimensions: 110x90 rnm Secure online ordering www.skpang.co.uk sales@skpang.co.uk ARM7 boards and JTAG programmers are also available 3/2008 - elektor 39 Gert Baars, g.baarsl3@chello.nl Changing your voice into that of a robot is a task that is perfectly suitable for a microcontroller. This circuit shows how this can be performed by a simple setup built around a small ATtiny45 microcontroller. A voice changer that emulates a so- called Cylon voice can be implement- ed with the help of a small microcon- troller. Those of you who have watched the (recent or older) TV series of Battle- star Galactica will immediately know what we’re talking about. For the non- SF fans amongst you, this is a metallic sounding robot voice. The circuit can be used as a gadget, but was originally designed to show how a simple digital circuit could be used for audio processing. Hardware The hardware (Figure 1) consists of a pre-amplifier built round opamp IC2, which has a gain of about 70. This is sufficient to amplify microphone sig- nals. R1 and K1 can be used to sup- ply the microphone with a DC voltage, which is required by electret types. The pre-amplifier feeds the amplified signal to the ADC input of the ATtiny45 controller, which then processes it. Since the clock for the controller doesn’t have to be very accurate the internal RC oscillator has been used as the clock generator. It has an out- put with a frequency of about 8 MHz, Figure 1. The voice changer consists of a pre-amp, a microcontroller and a power amp. 40 elektor - 3/2008 which is doubled to 16 MHz by an in- ternal PLL. This method ensures that two inputs remain free on the 8-pin controller for connecting the two po- tentiometers. These are used to set the required ‘Cylon’ effect. If two other ADC channels were used for reading the two potentiometers it would mean that the audio input would be interrupted by the inter- nal MUX whilst reading those inputs, which would be detrimental to the au- dio quality. It is therefore preferable to read the potentiometers by timing the charging of an external capacitor. The ‘Cylon’ software reads in the audio signal with a sampling frequency of about 10 kHz. According to the Nyquist Sampling Theorem the sampling fre- quency has to be at least twice that of the highest frequency in the input sig- nal. From this it follows that the maxi- mum input frequency is 5 kHz. As the ‘Cylon’ circuit is meant for speech sig- nals, this is more than sufficient. The Nyquist Theorem isn’t that difficult to understand if we first consider what sampling does in the frequency do- main. During the sampling period the input signal can be thought of as mul- tiplied by ‘1’ and during the remaining period by ‘O’. This is in principle the same as 100% AM modulation with a square wave, which results in an AM spectrum as shown in Figures 2a and 2b. From these you can clearly see that overlapping occurs when the sampling frequency is less than twice the high- est input frequency, which leads to distortion. This goes to show how im- portant a good input filter is before the ADC. This so-called anti-aliasing filter blocks components that are higher in frequency than half the sampling fre- quency. Since the ‘Cylon’ circuit usu- ally operates with speech signals, which are mostly below 3 kHz, there is no need for an elaborate filter when sampling at 10 kHz. After reading each sample the control- ler software carries out certain proc- esses to obtain the ‘Cylon’ effect. The result is then fed to the PWM output of the controller. This generates a square wave with a variable duty cycle at output PB4 of the ATtiny45. After inte- grating this through an RC filter (R14 to R16, C15, C16, C18) the audio signal reappears. This signal is then fed to audio amplifi- er IC4, which makes the sound audible via a loudspeaker. Setting the jumper on header K2 to the other position by- passes the power stage, so that the signal can be fed to the line input of, for example, a computer. Figure 2. This shows that overlapping occurs when the sampling frequency is less than twice the highest component of the input signal. 3/2008 - elektor 41 VOICE CHANGER Figure 3. Graphical representation of the FIFO register, configured here as a ring-buffer. Software The software has to carry out a number of tasks. The main one is the reading, processing and outputting of the audio signal, but there are also two potenti- ometers that have to be read. As the ADC is fully occupied with reading the audio signal, an internal counter and comparator are used to read in the po- tentiometer values. First of all, Cl is discharged. Then an internal counter is started and Cl is charged via the po- tentiometer to a certain voltage, when the counter is stopped. The resulting counter value is then dependant on the resistance of the potentiometer. To put it simply, the ‘Cylon’ effect is ob- tained by mixing a delayed version of the input signal with the direct input signal, and delaying the resulting sig- nal again, and so on. The same principle can be used to ob- tain an echo effect, but then the delay of the input signal needs to be at least 100 ms, whereas in the ‘Cylon’ version the delay is much smaller. The inter- nal FIFO buffer used for obtaining the delay is 200 bytes long, so with a sam- pling frequency of about 10 kHz the maximum delay can only be 200/10 kHz = 20 ms. In Figure 3 you can see a graphical representation of this method. The wheel ‘turns’ anti-clockwise with one revolution every 20 ms and represents the FIFO buffer, configured as a ring- buffer. The input signal is mixed with the delayed output signal (shown here using a potentiometer), creating a new output signal that is fed back again to the start of the ring-buffer. The same effect can also be achieved mechanically with the use of magnet- ic tape and separate record and play heads, with the latter having a variable position to set the delay time. The software is in effect a simulation of this method, where the memory is the equivalent of the magnetic tape, a store instruction is the record head, and a load instruction is the play head. The amount of delay is set using PI. The position of PI is used by the soft- ware to set the position of the tap in the ring-buffer. P2 is used to set the strength of the delayed feedback sig- nal. With a larger feedback signal the decay becomes less resulting in a stronger effect. PI is used to set the tap to positions between 1 and 200 in the ring-buffer. The delay is therefore variable from 100 \is to 20 ms. Since the delayed sig- nal is fed back in a loop the damped resonances will become noticeable when the damping is small enough. This is the so-called 'Cylon' effect. The frequency of these resonances is 1/de- lay-time and can therefore be set be- tween 50 Hz and 10 kHz. A setting near 250 Hz sounds about the same as the original 'Cylon' robots. Construction Figure 4 shows the board layout for the voice changer. Populating the board should be simplicity itself, with all components clearly laid out. The controller can be obtained ready-pro- grammed from Elektor Shop as item 070859-41. If you prefer, you could program it yourself (software 070859- 11, but make sure you use the correct settings for programming the chip, as shown in the inset). If you use an electret microphone you’ll need to place a jumper across Kl. The jumper on K2 selects the type of output signal (pins 2-3 uses the output ampli- fier, pins 1-2 for a line output signal). Figure 4. A small PCB has been designed for the voice changer, which makes the construction very easy. COMPONENTS LIST Resistors R18 = 10D R9 = 33D R14 = 220D R5 = 47 0Q R1 3,R1 5 = IkQ R1 2,R1 6 = 4I< QJ R1 = lOkD R10 = 27kD R4 = 220kD R2 = 330kD R3, R1 1 = 470kD PI ,P2 = 500I> 1) ; while ( ( (nl - n) > 1) | | ( (n-nl) > 1) ) { n = nl ; nl = ( ( (n) + (number) / (n) ) >> 1) ; } while ( (nl*nl ) > number) { nl -= 1; } return nl; } In our test firmware, we have the processor calculate the square root of a number 500,000 times. First we had the ASP (which is the result produced by the CHC compiler) per- form this calculation, and we measured the elapsed time. After this, we had the software version of our square root calculation routine do the job 500,000 times and again measured the elapsed time. The routine we used is shown in Listing 1 . The first part of the routine uses a clever method to guess the result. The al- gorithm of this guess is written such that the result is always slightly too large. This value is then used to check whether the result is correct. If it is not, the predicted result is decre- mented by 1 . This procedure is repeated until the correct result is obtained. The nice thing about this algorithm is that it uses two loops: shift instructions and multiply instructions. This means it con- tains a nice mix of commonly used operations. 3/2008 - elektor 51 TECHNOLOGY SOFTWARE BUILDS HARDWARE te Altium Designer &£ - D:\Proiecten\07xxxx\070986 C2W\,AKkim\firTnware\mainjc * - C2H_firmware.PrjEmb. Licensed to Segment BV Special Interest Media Figure 2. It could hardly be easier! H DXP File Edit View Project Tools Debug J ^ A 9 4 j O 0* Project* Workeoacal.DenWrk C2H firmware. PrjE mb o He View Structure tdt.or ▼ at x » Workspace Hiosocl C2H_07098G.PijFpy U L_i Source Documents $CHEMATIC_070886 SchDoc (1) [♦I Cl Getting* BBl— i Generated (CvcJone HW GuiarFXl ; r.7H_rmmwwmr PijFmli - _l Source Documents slEHU] 3 ] hardware. h(2J cl] t«rrwwic(3) Tj] lejnrwvJ h (4) SLJ Generated R »__i Trod Diiuinis ] C2H firmworc.bl _] C2H_liim»<*r tim(j _) LJH_lrmworc_mcm W Utoranes 1 Protects Messages Clacc _j (Nu Repul] Window Help £ uevcee men c ’ _J soitUATK; o;ovt» scnuoc ♦include ♦include ♦define CTO CLK 250000(10 Debug U3 (Device 0) - O’ D:\Projecten\07xxw', 070966 C2H\A ’ Q • • ^ a? i j* 4 ■* -sl> * 1 ) Document C 2 H_f« hum Souice unsigned int dan 1 10241 (kUT - [.SI 7] ; long tiacr_low,tiBcr_f.: long long tlier.tlieri, at (OxulOOOOOO); unsigned lnt lagrttlnt r.uap signed int. n — 1 ; signed int nl - (Mn) ♦ < •I { inner)/ |n) J » 1); vnilcmm D| > Dlldn &l) > 1)) { n « nl; nl - (((n) t ) » 1 ); 1 uhi In | (nl *nl ) > ntrrher) { nl — 1 ; ) return nl; unsigned int lsqr signed int. n • signed int nl * vmieHini n) n = ul; uhile((nl*n 1 ) > nl — 1 ; ) return nl; Message Rei*jiJ Sucvrmfd 0 Tuyylr Rirakpmti! v/ Add Watch i “ F5 Ctrl*F5 Push And Export From Hardware Puth Tn 1 lantwurr Toggle Bookmarks » Goto Bookmarks ) Add To-Do Item ... Open Document Under Cursor Time 153905 Mask Date 16-1-2006 e ▼ i9 x No. 1 Exporting to hardware We used this routine (called isqrt_sw) to measure the time required for performing this calculation. To test the CHC compiler, we made an identical copy of this routine. We named it isqrt. The next step was to use the development environment to cause this routine to be converted to hardware by the CHC compiler. This is a very simple process. First you place the cursor on the name of the routine. If you right- click the mouse, a small menu appears. Select Tush and export hardware' in this menu (see Figure 2). This caus- es the CHC compiler to implement the selected routine in hardware. In addition, this action causes every call to the firmware of this routine to be replaced by a call to the ASP. All of this takes only one mouse click. Results After compilation and programming of the FPGA, the termi- nal emulator causes the output to be displayed on the PC (Figure 5). Here you can see that the hardware version takes slightly more than half a second to perform the square Figure 3. Test results. 52 elektor - 3/2008 root calculation 500,000 times. The software version takes nearly 1 3 times as long in this case. The nicest thing about all this is that with this example we (intentionally) did not write even a single line of VHDL. This technology lets programmers take advantage of the potential of FPGAs without having to leave their familiar C environments. Applications The ASP can be regarded as a sort of DIY coprocessor. The ASP can be adapted to individual applications, which means that hardware acceleration can be used in almost any imaginable application. It is also possible to access the memory from the ASP. This makes it possible to develop applications such as a video accelerator. In this case the speed of the routines for draw- ing lines, circles and areas could be accelerated by imple- menting them in an ASP. The dynamic current consumption of the FPGA decreases in direct proportion to the reduction in the clock rate. The result is thus lower power consumption. This is primarily im- portant in portable equipment and environmentally friendly products. Final remarks The new developments in Gto-H compilers make FPGAs ac- cessible to programmers who do not have experience with FPGAs, VHDL and related matters. The reduced develop- ment time and the possibility of reusing existing, trusted rou- tines in FPGAs also represent a major step forward in the acceptance of FPGA technology in the engineering world. In combination with the technological progress in FPGA fabrication, this means that FPGAs will become even more competitive alternatives to conventional embedded microcontrollers. ( 070986 - 1 ) It is even possible to have routines in the ASP run in parallel with routines in software. However, this does require modi- fications to the software. The advantage of this approach is that it further boosts the processing power. The previously mentioned example of a video accelerator is a suitable candidate for this approach. The processor does not have to wait until the video accelerator has drawn the line, circle or other object, and in between it can spend its time on other tasks. Low power A less obvious advantage is that power consumption can be reduced by using an ASP. The clock frequency can be reduced by using an ASP to increase the processing power. The speed gain obtained from using the ASP can be traded off either partially or entirely for a lower clock rate. C-to-H for PCs? FPGAs are already being used in a few supercomputers in order to assist processor ICs in performing demanding com- putational tasks. It is certainly conceivable that in the future, FPGAs could also find a place on the motherboards of standard PCs. For this to be possible, it is necessary to have a standard that speci- fies how the processor communicates with the FPGA. Even more important is to have a standard technology for convert- ing software routines into hardware versions that are suitable for implementation in FPGAs. The new C to H compilers are a step in this direction. Who knows what speed improve- ments this technology could offer for future PCs? 3/2008 - elektor 53 OPERATING SYSTEM up i-\ Jljjjjj usnnn HH luf Dipl. Ing. (FH) Dirk Kramer The 'ARMee' board described in the March and April 2005 issues of Elektor was a pioneering publication in that it opened the way to 32-bit ARM programming on a shoestring using the NXP LPC2106 processor. ARMs are complex things but now there's LAOS to make them more accessible in terms of programming. New microcontrollers are like a good stew where the recipe reads: “best if left to simmer for a while”. In this case, the stew on today’s menu is called Ad- vanced RISC Machines Seven (ARM7) and it was left to simmer for about two years (with some stirring and without getting burnt). Lest we forget, RISC stands for Reduced Instruction Set Computer. To make the entry into the world of the ARM7 based LPC2106 microcon- troller ‘beast’ a bit easier, the author developed a compact operating sys- tem framework for the Elektor ARMee board [1]. Aims The operating system framework was dubbed LAOS for ‘little applications operating system’ to indicate the size of the applications it is capable of re- alizing for you, newbie to ARM7 or old hand lurking in internet newsgroups, slashdot, sourceforge and microcon- troller forums. This article is for you. ‘Little applications’ is a slightly affec- tionate way of identifying not just PLC- like programmable processes of all kinds, but also digital test and meas- urement instruments, communication gateways, data loggers, mobile robots and so on. Yes, to an ARM processor that’s’ ‘a little light work’. One of the main requirements for the framework was to create a comfort- able yet simple application interface while ensuring the ‘portability’ of the entire application. All source code files belonging to the framework are freely available (from the Elektor website) to enable everyone to extend and improve them as they like. Layered thinking An ARM application based on LAOS has a layered structure as illustrated in Figure 1 . The application layer is capable of, and allowed to, get direct access to any of the layers beneath it, except the hardware. This is called the quasi-consistent layer model. The application only employs the service routines offered by the relevant layer interfaces. The main part of LAOS is the Object execution Layer (OXL). While the oth- er layers form just a pile of extremely useful methods, OXL contains huge functionality. It all depends on the case whether or not an application em- ploys methods pulled from the Device Driver Layer (DDL), the Protocol Layer (PL) or the Hardware Abstraction Lay- er (HAL). However, every application based on LAOS does use the essential methods of the OXL. Broadly speaking the OXL is a non- preemptive operating system capable of storing asynchronous events in a queue and allocating relevant event handling routines to the processor on a FCFS (first come first serve) ba- sis. Thanks to the enormous through- put of the LPC2106, all application tasks appear to be handled in parallel. Compared to a preemptive system, a non-preemptive system has the disad- vantage of being unable to meet non- negotiable realtime requirements. This is caused by the event handler routines being run to completion without excep- tion. Only interrupts can cause short interruptions. Ideally, however, in an interrupt, only new events should be reported to the OXL. The upshot: don’t use LAOS to implement airbag sensor processing. 54 elektor - 3/2008 Application Layer (AL) Object execution Layer (OXL) Device Driver Layer (DDL) Protocol Layer (PL) Hardware Abstraction Layer (HAL) Hardware (Elektor ARMee Board) Figure 1. Layer model of an application based on LAOS. Programming a LAOS application The basic method is to define differ- ent objects capable of generating or processing asynchronous events only. The OXL layer will act as a mediator between objects. To guarantee unique referencing to objects, OXL issues a one-time ObjectHandle for each object reported. Each object is able to proc- ess certain events and for this, unique eventIDs are issued by the application developer. Using these two pieces of information the OXL allows an object to get in contact with another object without direct knowledge of it. The above is summarized and illustrated in Figure 2. More tasks for the OXL Apart from the inter-process commu- nication, the OXL also manages the in- ternal timers and message memories, a runtime selfcheck and the calculation of runtime statistics. A look at a practi- cal example may help to discover why and when these functions are individu- ally required. First, the function o x 1 init ( , , ) has to be called. The first parameter copied along, pSystemTime, is a pointer to a system variable that has to be incremented by a microcontrol- ler hardware timer at millisecond rate. All internal timing services of the OXL operate relative to this system time. Alternatives to the proposed clock- ing method are also possible, but ill advised here because of unnecessary conversions. Using TRUE or FALSE indicated with the second parameter bRuntimeSupervision it is possible to decide whether or not the consist- ency of the event queue is to be guar- anteed. The third parameter, pEr- rorHandler, allows you to point to a function that’s summoned up in the case of a critical exception error dis- covered by the OXL. Next, you report all application objects required to the OXL, using the method oxl_registerOb j ect ( , ) . OXL will respond by returning the ObjectHandle mentioned above. The parameters are function pointers. The function stored as pEvent Handler is called by the OXL if an event relevant to the object is found in the queue. The function reported as plnitializer is called once before the actual start of the OXL and is intended for any object spe- cific initialization routines you might require. Next, the object execution is started by calling oxl_start (void) . Everything else takes place within the Figure 2. The OXL basic model. ^ ObjactHandtes M Event-1 Ds Object 1 l 1 0bject2 *< u y3» T T * OXL ObjectHandlo-Assipimem EveniHandier.Ca* backs Initialcer-Calbacks Listing 1. Example of an OXL Initialisation phase. int main (void) { // initialise the target InitTarget ( ) ; pl_ascii_sendString ( "Target initialized. . . \r\n" ) ; // initialise the OXL oxl_init ( &SystemTime , TRUE, oxl_errorHandler) ; pl_ascii_sendString ( "OXL initialized. . . \r\n") ; // register the objects and get for each object an unique Handle ButtonHandle = oxl_registerOb j ect (ButtonEventHandler , Buttonlnitializer) ; DiglnHandle = oxl_registerOb j ect (DiglnEventHandler , Diglnlnit ializer ) ; LcdHandle = oxl_registerOb j ect (LcdEventHandler , Lcdlnitializer) ; LedHandle = oxl_registerOb j ect (LedEventHandler , Ledlnit ializer ) ; SerHandle = oxl_registerOb j ect ( SerEventHandler , Serlnit ializer ) ; sprintf (StringBuffer, "%d object (s) registered ... \r\n" , ( int) SerHandle) ; pl_ascii_sendString (StringBuffer) ; pl_ascii_sendString ( "About to start the OXL . . . \r\n" ) ; // OXL shall start its work oxl_start ( ) ; return (0) ; 3/2008 - elektor 55 OPERATING SYSTEM endless loop implemented inside it. An example of such an initialisation phase is shown in Listing 1. Generating Events In order for things to really start hap- pening, objects have to generate events addressed to themselves or to other objects. Four methods are avail- able to do so. The two methods oxl_ genEvent ( , , , ) and oxl_genFastEvent ( , , , ) only differ in the first one adding the event to the queue, and the second bypassing the queue (bad bad at bus stops and checkouts) allowing the EventHandler of the target object to be called straight away. The first two parameters brought along, and enable you to address a very specific service within the application. Using the oth- er two optional parameters and you can transfer data that’s copied by the OXL and stored in its own list. This method obviates the need for global data, and source data does not have to be valid any- more after the transfer. When it’s nec- essary to generate an event within an interrupt service routine, the method oxl_genEventIsr ( , , , ) is ready and waiting for you. Discern- ing it is required, because it may hap- pen that an interrupt also wants to call oxl_genEvent ( ) while the ap- plication is in the middle of calling the same. This could lead to inconsistent data being sent to the queue and dis- rupting the program flow. The fourth method of generating an event comprises the method oxl_g enTimeoutEvent ( , , ) . Calling it causes an OXL timer to be activated. When the period defined by is over, the Event is generated that’s addressed by the first of the two parameters. Listing 2 shows what it might look like in an application. Conclusion LAOS is a free download from the Ele- ktor website. The archive file 070990- 11. zip on the project pager at www. elektor.com contains all building ma- terials and the full source code file of the example. Despite its name LAOS still allows fairly complex applications to be implemented for the ARM7 proc- essor, with a minimum of effort. The author may have additional informa- tion available on his own homepage, which is being set up at the time of writing [2]. ( 070990 - 1 ) Web Links and References [1] LPC210x ARMee' Development Board, Elektor Electronics March & April 2005. [2] www.dk-embedded.info Listing 2. Example of an event generating process. void LedEventHandler ( tU32 EventID, tU8* pData, tU32 DataLen) { static tU8 BlinkState = 0; static tU8 LastBlinkState; static tBOOL Lif eLedToggle = FALSE; // calm down the compiler pData = pData; DataLen = DataLen; switch (EventID) { case evLedUpdateBlinkPattern : // update the blinking pattern hal_clrBytePort (LED_PORT, LED_OFFSET, LastBlinkState) ; hal_setBytePort (LED_PORT, LED_OFFSET, ++BlinkState) ; // memorise the current blinking pattern LastBlinkState = BlinkState; / / check for overrun BlinkState %= MAX_LED_VALUE ; // execute this event in 50ms again oxl_genTimeoutEvent (LedHandle , evLedUpdateBlinkPattern, 50); break; case evLedToggleLif eLed : if (Lif eLedToggle) hal_setPortpin (LED_OK) ; else hal_clrPortpin (LED_OK) ; Lif eLedToggle = -Lif eLedToggle ; // execute this event in 500ms again oxl_genTimeoutEvent (LedHandle , evLedToggleLif eLed, 500); break; } } 56 elektor - 3/2008 FRONT PANELS & HOUSINGS Cost-effective single units and small production runs Customized front panels can be designed effortlessly with the Front Panel Designer. The Front Panel Designer is available free on the Internet or on CD. • automatic price calculation • delivery in 5-8 days • 24- Hour-Service if required f rrrr r:r ; v Sample price: 32,50 € plus VAT/shipping Schaeffer AG • Hohentwielsteig 6a • D-14163 Berlin • Tel +49 (0)30 8058695-0 Fax +49 (0)30 805 8695-33 • Web info@schaeffer-ag.de • www.schaeffer-ag.de Professional PCB Supplier lift I ■ URL: WWW.IZPCB.com Email: sa1es@ezpct>.cqin TeJ: +30 109 1005 1704 HOI Up To 50 Layers 2.5mil T/C. O.linfn Hole Size Olhei Products’ Spends, Keypads, Frontpanels. Flex FC6, Enclosures. Turnkey Services PIC Microcontrollers Silent alarm, RGB fader, poetry box, nighf btfzzet ahd fnore! This hands-on book covers a series of exciting and fun projects with PIC microcontrollers. You can built more than 50 projects for your own use. The clear explanations, schematics, and pictures of each project on a breadboard make this a fun activity. You can also use it as a study guide. The technical background information in each project explains why the project is set up the way it is, including the use of datasheets. All software used in this book can be downloaded for free, including all of the source code, a program editor, and the JAL open source programming language. Order quickly and safe through WWW.elektor.COIn/shop 3/2008 - elektor 57 MODDING & TWEAKING DIY LED Projector DLP projector with power LEDs Jeroen Domburg Although an evening at the cinema can be a nice experience, there are a few drawbacks as well. You can't just pause the film if you need to nip to the toilet, and the seating isn't always that comfortable. If you're really unlucky you could find yourself sharing the place with a horde of noisy kids who can't keep still. A home projector provides a good alternative: a nice big display, you can pause it when you want and you can choose your own company. It's a pity that the projector lamp wears out so quickly though... There are certainly many advantages watching films at home. Invite a few friends round, grab a few drinks and you’re bound to have an enjoyable time. The main difference of course is that whereas you have a huge screen in the cinema, most people only have a (relatively small) TV at home. And although those large LCD and plas- ma screens are becoming more afford- able, the larges ones are still outside the budget of most people. Another appliance that can produce a large display in the home is the projec- tor. Point it at a white wall or projector screen, connect it to a laptop or DVD player and there it is: a high-quality display well over a metre in size. Costs Projectors aren’t very expensive to buy. You can easily get a second-hand one for under a few hundred pounds and new ones no longer cost the earth. But, and this is sometimes overlooked, they can be quite expensive to maintain. The internal lamp has a lifespan of only a few thousand hours and can cost up to £300 to replace. This does turn it into an expensive pastime when you often watch a film. It makes you think twice before you turn the projector on to watch the news or play a computer game on the big screen. A recent development is the use of LEDs instead of a lamp in some new projectors. These last a lot longer and have the added advantage that they don’t run as hot so are likely to have less noisy fans for cooling the lamp. The disadvantage of these projectors is that not many of them are produced yet, and they are still quite expen- sive. You won’t find one for under £500 (€ 350) at the moment. In the last few years many improve- ments have been made in LED tech- nology. This has also been realised by many electronics hobbyists. Some electronics shops and web stores stock LEDs that leave incandescent lamps in the shade. Would it be possible to ac- quire an old projector and replace the lamp with a set of ultra-bright LEDs? This gives us all the advantages: a projector that is quiet, doesn’t cost too much and doesn’t need a replacement lamp at regular intervals. A little bit of theory Before we get started on the project we need to go over some theory first. How does the average consumer DLP projector work? A DLP projector is built round a Digital Mirror Device (DMD), which is a chip with thousands of mi- croscopically small, electronically ac- tivated mirrors on its surface. Each mirror corresponds to one pixel. By ro- tating these mirrors an incident beam of light can be passed on or blocked. This does mean that pixels can only be This is the projector we'll modify. It is a fairly compact model, which unfortunately doesn't have much spare room for our own circuits. The removed, much too expensive, lamp that needs replacing at the drop of a hat. This is where the lamp goes. At the bottom you can see one of the three fans that cool the lamp. The large circular opening goes to the colour wheel and light tunnel. 58 elektor - 3/2008 Figure 1. The circuit is built around a juC, as is often the case. This controller also takes care of the boost conversion. turned ‘on’ or ‘off’. The control electron- ics can generate intermediate levels of brightness by driving the mirrors tens of thousands of times per second. But you need more than just a DMD to make a projector. A large number of other components are also required. Normally, the light required for the display is generated by an expensive gas-discharge lamp. The light first goes through a colour wheel. This is a wheel with a number of colour filters, usually red, green and blue. The filters are put in front of the light source at a very high rate. Often this wheel turns at 100 revolutions per second. After the colour wheel come a light tunnel, which consists of four mirrors stuck together, creating a type of rec- tangular ‘tunnel’ of mirrors. This con- verges and homogenises the light. The light then goes through a lens that focuses the coloured light onto the DMD. The electronics controlling the DMD keep track of the position of the colour wheel and adjust the positions of the mirrors accordingly. The reflected light leaves the projector via a set of lenses that focus the image onto the screen. This method has the disadvantage that it causes the so-called ‘rainbow effect’. This effect can be seen when you quickly look across the project- ed image. Along the sides of the im- age you’ll be able to see the primary colours. It is of course perfectly possible to re- place the gas-discharge lamp with a set of white LEDs, but there is a better solution. If white LEDs are used, you would on average only use one third of the generated light. Each segment of the colour wheel lets through light for just one of the three primary colours. This is rather impractical since LEDs are already less bright than a 150-W gas-discharge lamp. The light travels from the lamp through the colour wheel (behind the small green PCB), through the light tunnel to the lenses and mirrors in the black parts. The gold coloured DMD chip is at the top right. The colour wheel. As can be seen, it consists of red, green and blue segments, plus a white segment for the brightness. At the top right is the position detection PCB. The detection PCB. The infrared LED and photodiode can't be told apart. However, the normally invisible infrared light from the LED is picked up by the camera, so you can quickly see which is which. 3/2008 - elektor 59 MODDING & TWEAKING The Luxeon LEDs aren't very big, as you can see. That comes in handy since we need a small but intense light source. However, it does make the soldering trickier. Fortunately we can get round this. We can simulate the colour wheel through the use of separate red, green and blue LEDs. In this way the light expected by the DMD can be generated directly by LEDs. You may now think that we need three times as many LEDs for the same light intensity, but this isn’t true. Because the LEDs are on for only one third of the time it is possible to in- crease the current through them by a factor of three. This method only works for DLP projectors; there is no colour wheel inside LCD projectors so this method wouldn’t work. The project is now beginning to take shape: open the projector, take out the lamp, take out the colour wheel, put in the LEDs, program the microcontrol- ler with a colour wheel emulator and that’s it. This begs the question: can it really be this simple? There is only one way to find out and that is to try it. Requirements To get this project going we first need a projector. After looking on the Inter- net we found a nice DLP projector: the iPaq MP3800 made by Compaq, (now part of HP). This projector has the ad- vantage that it is very small and has a resolution of 1024x786 pixels, which results in a very sharp picture. The critics found this projector too noisy and they weren’t too happy with the lifespan of the lamp either, which could be as little as 500 hours. In our case this doesn’t matter. When the projector is converted for use with LEDs as the light source, these problems are effec- tively overcome. Whilst we’re ordering things on the Internet we may as well get the oth- er parts. The LEDs required are (red green and blue) Luxeon Rebels. These SMD LEDs, which have an area similar to a matchstick head, can draw up to The cooling for the LEDs. The heat-spreader has been removed, exposing the Peltier element. This is where the LEDs will be mounted. 700 mA at which point they’ll produce 100 lumens of light. They’re not too expensive either. A set of 24 of these devices can be obtained for about £ 70 ( 55) that’s a total of 2400 lumens of raw LED power. Since these LEDs are power devices they will generate much more heat than the usual 5 mm red indicator LEDs. Worse still, if you don’t want the light output of the LEDs to drop they need to be cooled. As we didn’t know exactly how much heat they’ll gener- ate and every degree warmer reduces the lifespan by a few hundred hours we decided on a solution that may be considered overkill. From the overclock world in computing we’ve obtained a heatsink-fan-Peltier combination that is meant for a Pentium 4 processor. This device can cool its surface below freez- ing point and can dissipate up to 130 Watts of heat. Because they are mass- produced they’re not that expensive. They shouldn’t cost more than about £ 20 ( 14) and you’ll also get a con- trol panel with a (reusable!) blue LCD display. And as we’re buying overclock prod- ucts we’ll also buy two tubes of ‘ther- mal adhesive’. This is a two-part glue that is good at conducting heat. It is meant for sticking heatsinks onto chips, but we’ll use it to stick the LEDs onto the heatsink. Now we begin How can we turn all these parts into something that works? First we have to find out if we can make the LEDs pro- duce the thousands of lumens they’re rated at. The LEDs have to be mounted on a heatsink, otherwise they would overheat. We immediately see that could be a problem: the LEDs come in The LEDs have now bean stuck neatly to the Peltier element using heat-conducting glue. SMD packages, which have the con- nections on the underside. If they were mounted on a metal heatsink it would obviously produce short circuits. Fortunately there is a simple solution. When the metal plate of the heatsink is unscrewed we expose the Peltier element. On the outside this is made from a non-conducting ceramic mate- rial, which won’t cause short circuits. However, with the LEDs stuck down it does mean that we can no longer get at the connections. Luckily there are also two ‘tracks’ on the top of the LEDs. When the silicone protection layer is scratched away they are eas- ily soldered to. Now for the connections. It is of course possible to connect a current-limiting resistor to each individual LED, but this would require 24 resistors, which would all consume power and gener- ate heat. A better solution is to connect all LEDs of the same colour in series. This obviously requires a higher volt- age, but the current needs to be lim- ited in one place only. The LED chains are made by soldering thin wires onto the top of the LEDs. For testing the LEDs all chains are con- nected to a bench power supply via a current limiting resistor. Take care when switching them on, since two thousand lumens is very bright! Reverse engineering Now that we’ve taken care of the light- ing we’ll have a closer look at the pro- jector. With the side panel removed all parts can be seen clearly: the remov- able lamp, the colour wheel, the light tunnel and the rest are easily distin- guishable. It is noticeable that the lamp has to be cooled by three fans. What do you mean, ‘noisy’? To check that our idea works we have 60 elektor - 3/2008 The first half of the LEDs has been connected together using thin kynar wire. Never use superglue to hold the wiring in place. Any repairs to loose wiring will then be made extremely difficult. to remove the colour wheel and emu- late it in some way. The colour wheel is typical of those found in projectors. The motor used for turning the wheel round is a stepper motor, although the feedback for determining the position of the wheel is done optically. There is a black mark on the wheel that is de- tected with an IR LED and a phototran- sistor. This comes in very useful! When we take the colour wheel out, all we need to do is emulate the signal that is normally generated by the phototran- sistor and feed it to the DMD electron- ics. A quick look on the ’scope shows that this is a 100 Hz signal, which means that the colour wheel makes a revolution every 10 ms. It is very easy to program the colour wheel emulation in a microcontroller. Here we’ve made use of an ATMega88. Three MOSFETs are added to turn the chains of LEDs on and off. Looking at the colour wheel you can see that the first 2 / 7 is blue, then 2 / 7 red, then 2 / 7 green and finally V 7 white. It is a simple matter to write a program that emulates this. Only one half of the LEDs is connected and the camera can only just cope with the light intensity. The first test is successful! To free up some space for the heat- sink and LEDs we have to remove the fans. That immediately gives us an- other problem. Broken (or absent) fans mean that a non-modified projector could overheat and as such the pro- jector will refuse to work. It is fortu- nately quite easy to fool the projector into thinking that the fans are present and working. All fans have a yellow wire that is pulled to ground when the fans are turning. All that needs to be done is to ground that connection on the projector PCB and the electronics will be happy. The projector has another protection mechanism. Should the logic that drives the lamp not indicate within a few seconds that the lamp is lit proper- ly, the electronics refuses to work. This signal can also be easily found. In this projector the driver board for the lamp is galvanically isolated from the rest of the projector using two opto-couplers. One indicates that the lamp should be turned on and the other returns the lamp status. These opto-couplers can be removed (desoldered). The first is The first test set-up: all LEDs are connected and a few quick-and-dirty supplies have been added. The cover prevents unwanted light leakage. replaced with an LED so we can see when the logic wants to turn on the lamp. The second is replaced with a (normally closed) push button so we can manually simulate the ‘all-clear’ from the lamp logic. It’s now just a matter of connecting everything up and see if the concept is valid. The heatsink with LEDs is put inside the projector, the light tunnel, which has been removed together with the fans and colour wheel, is replaced with our own tin light tunnel. Connect it up, turn on the projector and... Wow, a picture! The firmware needed a few tweaks be- fore all the colours came out correct- ly, but we had a picture. It wasn’t as bright as with the original lamp, but that was to be expected. Now for the other parts. Power supply Apart from the 12V for the fan and 5V for the Peltier element, the projector also required a supply for the LEDs, which was provided by a bench power supply. This would obviously need to Advertisement AwQH-t: S-^MQThSE't. IJ A M E £3 TA i'l u tst Luwv HrEf'-EF'^-STEi- Hanv tet Oli'ulj oj m jiq worn CA«r coMiEsurj D«Jty - i!nspirwj t* ihe , L" j% WQ/sm. Sind* ZX SpWtaim. App-ta II A. CtwnrFpwkpifi 64 ! ■ J|L ; mrtnmps- s «***?* /*'&’ :*> Jtt P. .ilfcviHhn hn i, IR’IHImJ TAL rC HH www.XEameStation.com ■ Pm: S 1 E.JJfr fc.a 3 S S | aurK3fci-@HLifcvElHCf Tel: 01 63.3 40347 Nir-.vliury EJurlmiki:::-; Uri Fm: DIG® 36143 Fare Pj pH cod H-lhIiuv Eeiks-Rdlflacfi 2 rfidliclrnultiAnnsitury.trban.nn.LJlk v.T.m.rniAhnr^nctminlns.n^.iik 3/2008 - elektor 61 MODDING & TWEAKING This is what the inside of the projector finally looks like: the lamp, fans, colour wheel and light tunnel have been replaced by the LEDs and associated parts. be replaced by a decent power supply when the projector was put into nor- mal use outside the lab. In our case it would also increase the brightness of the projector. The bench power supply should provide 60 watts just for the LEDs, which was more than what ours could deliver. To keep everything fairly portable we added a powerful boost converter to the circuit (see Figure 1), which converts the 12-V supply into a 2.1 A current source for the LEDs. It has even been implemented as a double boost convert- er. L2 and L3 are alternately ‘charged’ via T1 and T2. D2 and D3 pass the cur- rent on to the capacitor bank, made by C6 to C8. The ATMega88 measures the voltage across shunt resistor Rll to control the voltage across and current through the LEDs. And this is what the completed project looks like. It does give an untidy impression and the use of an ATX power supply hasn't helped to keep the size down. But it can be considered as a successful proof of concept, and if everything is mounted in a larger case nobody can see it. The capacitor bank may look a bit strange at first. The reason for using three capacitors with smaller values is because of the Equivalent Series Resist- ance (ESR). A capacitor has an internal resistance that ‘normally’ doesn’t have much of an effect. But in this circuit the capacitors in the bank are charged and discharged tens of thousands of times a second with high currents. And then the ESR certainly counts. A single ca- pacitor would have to be scraped off the ceiling after a short while, as the author knows from bitter experience, despite the fact that we’ve never ex- ceeded the voltage limit for the capac- itors. Connecting three capacitors in parallel spreads the load and reduces the total series resistance. The total value of the capacitor bank shouldn’t be too large either. When you switch between different coloured LEDs with lower forward voltage drops you don’t want the capacitor bank to dump the excess voltage into the LEDs from a high capacitive source. This could even cause something or other to blow up. A smaller bank has the dis- advantage that it produces some ripple on the supply, but this is at a frequency of several tens of kHz and won’t matter when driving LEDs. The supply voltage for the microcon- troller is set to 5.6 V using a 7805 and a diode. This is 0.1 V above the recom- mended maximum supply voltage, but in practice it won’t be a problem. The advantage of the slightly higher supply voltage is that the gates of the MOS- FETs can be driven a little bit harder. This way we can be certain that they are either hard on or hard off. With the level of currents that flow in this cir- cuit you’ll find that a partially conduct- ing MOSFET will quickly produce some smoke from the circuit. This is also the reason for the extra resistors from the gates of the de MOSFETs to ground. Without them, a problem that caused the microcontroller to put its outputs into tri-state mode, could well cause the silicon of the MOSFETs to sponta- neously turn into its gaseous state. The LED driver circuit still requires about 100W. Added to this is the sup- ply for the Peltier element. A cheap op- tion is a standard ATX PC power sup- ply. This can usually supply over 10 A at 12 V, whilst the 5 V output is suit- able for the Peltier element. LI and Cl have been added to protect the supply from interference caused by the peak currents drawn by the boost convert- er. LI is a suppression choke from the junk box and Cl is a large electrolytic capacitor. The large currents and losses in the various components used in the boost converter mean that they have to be chosen with care. Both the MOSFETs and the coils have to be able to cope with very large currents. Luckily it’s fairly easy to find high-current MOS- FETs. The IRFZ48V does the job well and is widely available. Coils L2 and L3 are more difficult to find. For the pro- totype the author took two coils from an old P4 motherboard. They consist of three parallel windings of 1 mm 2 c.s.a. wire that has been wound round the toroidal core four times. For D2 and D3 in the prototype the au- thor used CTG24S ultra fast recovery diodes made by Sanken. They came from an old power supply and come in a TO-220 package, which means they are easily mounted on a heatsink. But ordinary power Schottky diodes should also be suitable. And while we’re talking about heat- sinks, we would recommend that the MOSFETs are also provided with small heatsinks. The end result Is the idea viable and does it all work? According to the author it does. This LED modification is perfect for convert- ing an old projector into a cheap ‘film- viewer’. The area where you’re pro- jecting does have to be quite dark, but you’ll then have a good viewing expe- rience. To build this into a brand new projector is something we wouldn’t recommend though. Is there room for improvement? Possi- bly. New developments are still made in the world of LEDs. And every extra lumen that can be extracted from the LEDs gives a brighter picture. Furthermore, the optical system in the experimental projector isn’t per- fect. Not all of the light from the LEDs reaches the DMD via the light tunnel. Improving this isn’t easy, however. When the light is focussed too much you’ll end up with coloured spots on the display. And optical components are less easily obtainable than elec- tronic parts. The firmware can be downloaded from the Elektor website, and may be modi- fied if you need to. ( 070690 - 1 ) Web Link http://www.elektor.com 62 elektor - 3/2008 QUASAR electronics Quasar Electronics Limit PO Box 6935, Bishops Stc CM23 4WP, Tel: 0870 241 United Kingdp 6 1826 ed rtford m Fax: 0870 460 1045 E-mail: sales@quasarele Web: www.QuasarElectro ctronics.com nics.com 08717 Postag^ 3-7 Day Europe SOrder We acc to Quas Call no project4 95 & Packing Op Delivery - £3. (EU) -£6.95; R4 online for reduc opt all major cr ar Electronics, for our FREE modules and w ions (Up to 0.5 UK Mainland st of World - £! ed price UK P4 edit/debit cards Prices include CATALOGUE publications. : UK Standard jery - £8.95; I) (r assembled ^nd ready for use (AS prefix). 8-Ch Serial Isolated I/O Relay Module Computer controlled 8- channel relay board. 5A mains rated relay out- puts. 4 isolated digital inputs. Useful in a vari- ety of control and sens- ing applications. Controlled via serial port for programming (using our new Windows inter- face, terminal emulator or batch files). In- cludes plastic case 130x100x30mm. Power Supply: 12Vdc/500mA. Kit Order Code: 3108KT - £54.95 Assembled Order Code: AS3108 - £64.95 Computer Temperature Data Logger 4-channel temperature log- ger for serial port. °C or °F. Continuously logs up to 4 separate sensors located ^ 200m+ from board. Wide range ot tree software applications for stor- ing/using data. PCB just 45x45mm. Powered by PC. Includes one DS1820 sensor. Kit Order Code: 3145KT - £17.95 Assembled Order Code: AS3145 - £24.95 Additional DS1820 Sensors - £3.95 each Rolling Code 4-Channel UHF Remote State-of-the-Art. High security. 4 channels. Momentary or latching relay output. Range up to 40m. Up to 15 Tx’s can be learnt by one Rx (kit in- cludes one Tx but more avail- able separately). 4 indicator LED ’s. Rx: PCB 77x85mm, 12Vdc/6mA (standby). Two and Ten channel versions also available. Kit Order Code: 3180KT - £44.95 Assembled Order Code: AS3180 - £54.95 DTMF Telephone Relay Switcher Call your phone num- ber using a DTMF phone from anywhere in the world and re- motely turn on/off any of the 4 relays as de- sired. User settable Security Password, Anti- Tamper, Rings to Answer, Auto Hang-up and Lockout. Includes plastic case. Not BT ap- proved. 130x110x30mm. Power: 12Vdc. Kit Order Code: 3140KT - £54.95 Assembled Order Code: AS3140 - £69.95 Infrared RC Relay Board Individually control 12 on- board relays with included infrared remote control unit. Toggle or momentary. 15m+ range. 112x122mm. Supply: 12Vdc/0.5A Kit Order Code: 3142KT - £47.95 Assembled Order Code: AS3142 - £59.95 PIC & ATM EL Programmers We have a wide flange of low ATMEL Programmers. Comply documentation available from Programmer Ac 40-pin Wide ZIF 18Vac Power su Leads: Parallel (LDC441)£3.95 cessortes: socket (ZIF40W) £14.95 pply (PSU010) £18.95 (ILDC136) £395 /Serial / USB (LDC644) £2.95 (tost PIC and te range anc| bur web site. NEW! USB & Serial Port PIC Programmer USB/Serial connection. Header cable for ICSP. Free Windows XP software. Wide range of ;upported PICs - see website for complete listing. ZIF Socket/USB lead not included. Supply: 16-18Vdc. Kit Order Code: 3149EKT - £39.95 Assembled Order Code: AS3149E - £49.95 NEW! USB 'All-Flash' PIC Programmer USB PIC programmer for all ‘Flash’ devices. No external power supply making it truly portable. Supplied with box and Windows Software. ZIF Socket and USB lead not included. Assembled Order Code: AS3128 - £44.95 “PICALL” PIC Programmer “PICALL” will program virtu- ally all 8 to 40 pin serial- mode AND parallel-mode (PIC16C5x family) pro- grammed PIC micro control- lers. Free fully functional software. Blank chip auto detect for super fast bulk programming. Parallel port connection. Supply: 16-18Vdc. Assembled Order Code: AS31 17 - £24.95 ATMEL 89xxxx Programmer Uses serial port and any standard terminal comms program. Program/ Read/ Verify Code Data, Write Fuse/Lock Bits, Erase and Blank Check. 4 LED’s display the status. ZIF sockets not included. Supply: 16-18Vdc. Kit Order Code: 3123KT - £24.95 Assembled Order Code: AS3123 - £34.95 \ ■ w jjjjNI jl Qi uasarElectronics '..cor n Secure Online O rdering Facilit ies • Full Proc luct Listing, D escriptions & Photos • Kit [ )ocumentatioi ^ & Software C downloads 3/2008 - elektor 63 PROGRAMMABLE LOGIC CONTROL Cheap, DIY and with CAN! Ben Rowland (Matrix Multimedia) & Luc Lemmens (Elektor Labs) Here's the first real-life application of ECIO modules introduced in the October 2007 issue of Elektor. An ECIO acts as the brains of a PLC board that has relays, opto-isolators, CAN (!) connectivity and an LCD. All this I/O capacity together with Flowcode allows the board to act as a versatile, powerful PLC for quite complex control and automation projects. The LCD module is used to display ASCII characters to the user as a means of troubleshooting during the software development stage or for monitoring the system. ECIO PLC Features • CAN bus connection • 4 optically isolated inputs • 4 relay driven outputs • 2x1 6 character alphanumeric LCD • Flowcode-programmed but will also take PIC1 8 hex files • Free Flowcode for ECIO • USB connectivity for programming A full PLC application board comprising isolated outputs, in- puts, LC display and CAN bus connectivity... sounds good! But you'd also like to hear that it's low cost, based on an ECIO module and easy to program using Flowcode, the all graphics method of mastering PICs (and other micros, too). PLC A PLC (programmable logic control) is a device typically used as the central, intelligent, control element in a flow- chart-designed industrial process, usually for mass manu- facturing or quality checking and goods sorting. Conveyor belt controls will typically be PLCs. PLCs exist commercially and their (high level) programming languages have been standardized to a wide extent. Unfor- tunately the price tag of almost any commercial PLC puts it well out of reach of enthusiasts. A pity, because many Elek- tor readers have affinity with industrial control systems. PLC command sequences are in a way like computer pro- grams — they follow a predefined sequence of events with all the options for conditional loops, event timers, logic conditions, event counters, analogue values (temperature; liquid level; pressure) and simple result logs. If you have a slightly complex process you'd like to con- trol using electronics on a machine, then a PLC is a good choice because of its (electrical) robustness and flexibility when it comes to connecting the real world through relays and optocouplers. To be able to program a PLC (i.e. define the sequence of events to happen in a process) you need to write a pro- gram. Once debugged and simulated on a PC, you can download the program to the PLC and from then on it's fingers crossed. PLC programs can be edited, debugged, extended, opti- mized and of course stored and retrieved. Right, just like any PC or microcontroller program! Circuit description The circuit diagram of the ECIO PLC is shown in Figure 1 . The circuit comprises a number of distinct elements which we'll discuss below. ECIO The ECIO module is the brain of the board. It is used to con- trol all of the peripheral devices on the board. ECIO mod- ules, introduced in the October 2007 issue of Elektor [1], represent an ultra low-cost way of entering the world of PIC microcontroller programming. EClOs are available from the Elektor Shop with good discounts for volume orders. Here we use the 40-pin version called ECIO-40P. Relays The relays the PLC is using to switch electrical devices on and off are controlled via ECIO pins RB4-RB7. Outputting a logic Low to these pins will switch off the corresponding relay and outputting a logic High will switch on the corre- sponding relay coil. If a relay is enabled then the LED next to that particular relay will light to give a visual on/off rep- resentation. The relays are used to provide electrical isola- tion between the ECIO module and the external switched voltage (which could be the 230 V mains). This means that power devices running from high voltages like 48 VDC or 64 elektor - 3/2008 Figure 1. Circuit diagram of the ECIO PLC board. Minimal hardware — great potential in terms of I/O. 230 VAC can be controlled safely via the ECIO module. Each set of relay contacts (NO and NC) is brought out to three pins of a PCB mount screw termina block — the cen- tre pin (C) is the pole. Opto-isolators The opto-isolated inputs are special in not having a plus (+) and a minus (-) input terminal. Inside IC1 , the two diodes on each input are in fact LEDs so the polarity of the control voltage you wish to apply to ECIO PLC does not matter! The opto-isolator outputs are connected to ECIO pins RA0-RA3. These input pins will be at logic zero for no input voltage and at logic one for a voltage of 3.5 V or more. The opto- isolators are used to provide an isolation layer from input voltages. This means that relatively high voltages can be used to safely control the ECIO module. The signals you want to process in the ECIO PLC are applied to the circuit through PCB mounted 2-way screw terminal blocks. LEDs D1-D4 show the logic status of the opto-isolator inputs. 3/2008 - elektor 65 PROGRAMMABLE LOGIC CONTROL Figure 2. The unstuffed ECIO PLC board is available from Elektor. COMPONENTS LIST Resistors R1 = 8-pin SIL array 4 x 4k£27* R2 = 8-pin SIL array 4 x 1 Ok£l* R3 = 8-pin SIL array 4 x 330^* R4,R5 = 8-pin SIL array 4 x 220£2* R6 = 220£2 R7 = 390£2 R8 = 1 20Q R9 = 8-pin SIL array 4 x 2k£22* R1 0 = 8-pin SIL array 4 x 1 \ PORT 11/ *l) LOfip \ ) ("end') + X A3 A2 At AO -jv -rt- — fr- M. *1*1 B7 Be B5 B1 + *1 E 1 ij k t a 1 ECIO PLC boa r d Component connected to FOR7D v 1.5 * 1 Shift Tn hiqhnrtiits inputs -inputs .. J DD Output Lu ryl ays Q CAN on. The display will show: 'Elektor ECIO PLC board 7 (no? adjust that LCD contrast!). Neither family members nor PIC geeks may be too impressed but if this works then a whole lot of PIC code is being executed and you can safely as- sume that all hardware is functioning as it should. The CAN test utility discussed in the inset is also included in the free software download for this project. The two test programs provided are educational and certainly worth looking at even if you do not actually build the project (hint: use the free Flowcode version to begin with). The archive file number is 070786-1 l.zip. PLC programming All ECIO PLC programming bears great resemblance to E- blocks and Flowcode so if you have any experience with these you're in luck. If not, there's a mass of information out there on the Internet [1], in previous issues of Elektor and in the Flowcode package itself. Best of all, Flowcode for ECIO is free [1 ]. Writing a process control program for the ECIO PLC under- scores what Flowcode is all about: rather than worrying about syntax and PIC assembly code you are working at a fairly high level, setting up a full-blown flowchart of the program and let Flowcode arrange all the compiling, ini- tializing, error tracking and code downloading to the ECIO module. Of course you can simulate your PLC program so there's a good chance of instant success when the ECIO PLC board is connected up to the real world. More advanced users may want to rely on their own meth- ods of producing PIC1 8 code using C++ compilers or simi- lar. The ECIO even accepts straight hex code from all you assembly code diehards out there. Simply use the free USB I/O drivers to connect ECIO to your PC. (070786-1) r — — — — — — — — — — — — — — — — — — — — — — — — — — — n ! GAN interface testing i CAN is essentially good for sending complex message struc- i i tures between a number of ECUs (microcontrollers). The test i program written for Flowcode simply looks for an echo of the outgoing CAN message. This could be used to see how i many nodes are on the network or used to calculate the dis- i i tance between nodes based on echo time, etc. i i Basically the ECIO test program is sending out a specific i i CAN message with an standard ID of 12. When the Multi- i programmer receives a CAN message it checks the ID and if it is equal to 1 2 then it resends the message ID 1 2. The i ECIO continues to send out this message ID until it receives i i a CAN message back. Once it has received a message back i it checks the ID and then confirms or denies if the echo was successful. For this test you will need another ECIO PLC board or an E-blocks Multiprogrammer connected to an E-blocks CAN i module. One ECIO PLC board will send several messages i i over the CAN bus. The other one will 'listen' until a prede- i fined message appears and then replies to the ECIO. When the CAN transmitter is started the display reads 'Startup', i followed by 'Done' a bit later once the CAN controller is initi- i i alized. If the CAN connection is okay the display shows 'Me s- i sage returned', if not, you'll see 'Message failed'. JLUJtA. tjj 1 5 M.II | Fw< MeYYdye jprr“ LCDC F "Ts T7TJT *i I Q CAN vl.3 Startup CAN W~ Mb :jl I U[Jt AH ! 3 h-u 1 1 tfj 1 jsnpWr * X Pfr* 5 'j iDefo 9 Message Failed 1 1 CiMUfXHWrt cwnwtsd lo PORTD vl.5 Pm LCD im Si |Whir nnthmQ hint hr CD Sti CAM ID rim I AH Dft’ft Send W~ IP... Check lw tTcarwigm.. Whir nrsihmg hiu hr J Get Low Bvts d inco. PTH HID LSLH I Get H i Byte of ream CAM mr ID IEI- - 3 -sz_'. c t * a ''-■ffl’.p&s ) » a > v . r •J,'. A Q 1 » ■ J- 1 AS 1 | * * 1 "Hi MCI -MPP | t. » 1 -JiM T V 1 ■> i -.’Vi a aa 1 ■ ■> ■ * ■ ' ' v. i- ■■■ I s «! 1 ^ v. as : f.-iv ■L-J& E id It a HCMtx9r4U> vC C ii ad “t c i? & B a ' | ■a a ■ ■- — r | ii jj a ’-.—-'v- s»: | n X: J wt ’ n iA ;n p is-nrwc | it u 1 ■' »- J . ■ Q m ;1 p A(4u40nJ** = ' ■ n n! ■ - p ao ji! li Ihr ID Mhitf ra 19 Incaiect Vm ID Cm reel CO L J Web Link and reference [1 ] http://www.matrixmultimedia.com/ECIO-X.php [2] EasyControl I/O, Elektor October 2007. 68 elektor - 3/2008 NEWS & NEW PRODUCTS INFO & MARKET Elektor Volume 2007 CD-ROM Harry Baggen Coinciding with this March 2007 issue we release the new Elektor 2007 CD-ROM containing all editorial articles of the past year in pdf format. Compared to the 2006 edition, the new version is much faster, working happily under Windows, Linux and Mac-OS. It also includes an index function for all published articles since 1998. Elektor year volume CD-ROMs are established as extremely popular products. It's not surprising, as these discs are a handy way of locating a published article and viewing it on a PC display. Last year, the structure of the Elek- tor annual CD was overhauled. The archive program used till then had to make way for a Webserver-driv- en application. Nice, in principle, but in practice the new program was causing problems within some computer configurations. The prob- lems were investigated and the out- come was a totally new structure using only an Internet browser with either an ActiveX or a Java set in- stalled on the PC. To be able to use the CD 2007, you need to have ActiveX or Java available and ac- tivated in your browser. At the request of several readers, an index function for older year volume CDs has been reinstated. This was sadly missing from the 2006 version. The index allows you to copy all article pdf files on older Elektor year volume CDs (from 1998 onwards) to the hard disk and retrieve them instantly from the overview page. The new CD has Autorun imple- mented for MS Windows PCs. If autorun does not work, or if you have a non-Windows PC, look for the file 'index.html' in the root of the CD, and double-click on it. Your default browser will open the in- dex file and display the start page. Start by selecting English from the menu. By first ticking the box at the bottom of the page, your selection is stored as a 'cookie' and the pro- gram will automatically load the English language index/da- tabase the next time you run it. If you want to change the language, click on the Elektor logo to return to the start page. The possibilities and the use of the 2007 CD-ROM are largely identi- cal to those of the previous version and do not need further detailing here. We do, however, take this opportunity to explain a bit more about running the complete Elektor article database from hard disk. From hard disk Start by creating a new folder on your hard disk and give it a suit- able name like C:\Elektor. Copy the entire contents of the Elektor CD into that folder. The folder \Elektor should now contain five sub-folders. Click on the one with the desired language, in this case \uk for English. The sub-folders that now appear all have a folder \orticles. These are further nested with sub-fold- ers named 1998, / 999, etcetera, through 2007. The folder 2007 is already filled with all editorial ar- ticles of Elektor magazine volume 2007. Now, if you have older Elektor year volume CDs available, simply copy the pdf files on those CDs into the sub-folders with the relevant year name. For example, for the Elektor 2005 CD, browse to the sub-fold- AIJ 2007 articles on CD-ROM A lie Artikel von 2007 auf CD-ROM Tous les articles de 2007 sur CD-ROM Alle art Helen van 2007 ap CD-ROM ■k Annual Jahrgang Annee Jaargang The mtemoliond electronics magazine Die interna Monde lie k t ran I k-Ma natszeit s th rift Le magazine men sue! d "electron ique international Ret interna Monde elektranka-m u a ndblad er ar- ticles and then on to the sub-folder E. Select all files with the extension .pdf in that folder, and drag them to the folder C: \Elektor\uk\articles \2005. You will be prompted for a decision to replace all files already present. Confirm with Yes to All. This is necessary because all year volume folders contain a kind of dummy pdfs that need to be replaced at this point by real pdfs. The simple 'drag the folder content' operations allows you to integrate all Elektor volumes from 1998 on- wards into the system. If the results of a search for older articles returns one you do not actu- ally have because you do not have the relevant CD-ROM, you will see a link that takes you to the Elektor website where the article pdf can be downloaded against payment (usually 10 E-credits). This system works back to year volume 2000 (to be expanded further back in time to 1 998). Remarks, problems and sugges- tions for improvements may be reported and shared with other readers in the topic Elektor 2007 CD-ROM specially created on our online Forum. ( 080023 - 1 ) Elektor k de HI b U O img 0 Q nl □ U uk ) articles Lit 199S b 1999 O 2000 b 2001 (b 2002 lb 2003 (b 2004 (b 2005 Gb 2006 (Q 2007 b CSS data lib img b ses_ocx j Spr_uAssets 3/2008 - elektor 69 PROJECTS MINI PROJECT Pimp your Shoes Trendy shoe adornment VI Ton Giesberts - Based on an idea by Antoine Authier Shoes that light up? No problem, these days you can buy (almost) anything. But it is of course much more fun and challenging to enhance a pair of shoes yourself with these trendy lights, using a clever little circuit and some LEDs. The idea behind this mini project is to provide your shoes with a string of LEDs. The well-known firm Nike sells several types of shoe with lights in the heels that react when you hit the ground hard enough with your shoe. There are several video clips on YouTube made by proud owners of such shoes (for example www.youtube.com/watch? v— m46jJupXEic and www.youtube. com/watch?v= _z-VHNWyxOQ) . An on/off switch isn’t included on the board since it’s unlikely that it would be accessible from the side of the shoe. You will have to think of an alternative method to add this. Circuit diagram It isn’t exactly an easy task to turn nor- mal shoes into Christmas lights, but we’ve assumed that Elektor Electron- ics readers have enough ideas to im- plement this is in some way (e.g. cut out part of the heel, put the PCB inside and let the LEDs ‘look’ out through small holes in the sides). The circuit described here provides a running light with 18 LEDs. We’ve even designed a small (double-sided) PCB, with all components as SMD de- vices (apart from the LEDs and the bat- tery), but this is intended to be built by more experienced constructors. The soldering of these small surface mount devices isn’t very easy. The PCB is small enough to fit inside the heel. For the battery a button cell is used, which can be stuck to the sol- der side of the board and connected to the circuit via a short length of wire. The circuit consists of a few stand- ard ICs from the well-known 4000 se- ries. The advantage of these ICs is that the circuit can be easily adapt- ed for use with different supply volt- ages in the range from 3 to 15 V (R4 is the only component that needs to be changed). For running lights us- ing LEDs the 4017 (a decade counter with 10 outputs) is just perfect. The ten outputs go momentarily high one after the other, at the rate of the clock input. To expand the running lights (i.e. have more than 10 LEDs) we’ve added a second 4017 in series. How- ever, this requires some extra logic and a clock signal. For this we’ve used a 74HC132, which has 4 NAND gates with Schmitt-trigger inputs. A simple RC oscillator was made with one NAND gate (IC1D). The other three are used to control the counters. In fact we need two AND gates for this. These were created here using three NAND gates and a discrete in- verter made with a transistor (Tl, a BC547, or a BC847 in SMD packaging) and two resistors. The operation of the circuit is fairly r * * LJ m . 17 . 7 / . A P 5 w. mm straightforward. When the power is turned on IC1C and IC1B pass on the clock pulses generated by IC1D to the first counter (IC2). When the tenth output (pin 11) in the first counter goes high it results in clock pulses being passed through NAND gate IC1A to the second counter. The second output of the second counter then goes high. The first output of the second counter goes low and thereby stops the clock signal reaching the first counter via IC1C. It’s only when the second counter has completed a full cy- cle and the first output goes high that the first counter receives clock puls- es again; the tenth output of the first counter is low again and the whole process starts from the beginning. We have also added a flashing effect to the circuit. The flashing is implement- ed by connecting the common connec- tion of the LEDs via R4 to the clock signal. The flashing makes the LEDs even more conspicuous and as a bonus halves the current consumption. The oscillator has been designed to have an adjustable frequency from 2 Hz to 42 Hz. Everybody should be able to find a frequency to their lik- ing within this range. You’ll find that at higher speeds of the running lights the flashing of the LEDs becomes al- most unnoticeable. 70 elektor - 3/2008 Practical issues In the photo you can see the proto- type that we built onto a piece of strip- board. In this version we used yellow LEDs. At 3 V the current consumption was about 2.3 mA. When R4 has a val- ue of 220 Q the current through a yel- low LED is about 3.5 mA. It is there- fore essential that you use low-cur- rent versions for the LEDs. If a CR2032 type battery is used, which normally has a capacity of about 220 mAh, then the expected life span of the battery is four days (with continuous use). That is quite a long time, but we’d still rec- ommend that you fit a switch in the shoe that turns off the running lights when the shoes aren’t worn. (070851-1) +3VO +3V O n <01 Cl 470n +3V O © C2 lOOn IC1 = 74HC132 10 IC1C JT& IC1B JT& C3 lOOn 14 13 n 15 © CTRDIV10/ DEC & IC2 4017 CT=0 0 1 2 3 4 5 6 7 8 9 CT>5 CO 10 11 .12 +3 VO CO IC1A T1 JT&. R2 KD BC847 C4 lOOn 14 13 N 15 & © CTRDIV10/ 0 DEC 1 IC3 3 4 5 6 4017 7 8 CT=0 9 CT>5 10 11 .12 070851 -11 At M D1 .ft, H D2 * |t*|D4 7-M U\ D5 D6 At w A A D7 D8 D9 At H A 1 t. D10 Dll r-H“ J |1?|D13 r“H 7-M U\ D14 D15 At w A A D16 D17 D18 R4 "20R Figure 1 The circuit diagram for the 18-channel running lights: three ICs, a transistor and a few passive components. COMPONENTS LIST Resistors R1 = 47kQ (SMD 0805) R2,R3 = lOkQ (SMD 0805) R4 = 220D (SMD 0805) PI = 1 MQ preset Capacitors Cl = 470nF (SMD 0805) C2 / C3 / C4 = lOOnF (SMD 0805) Semiconductors D1-D18 = low-current LED * T1 = BC847 (SMD) IC1 = 74HC(T)1 32 (SMD SOU) IC2JC3 = 74HC401 7 (SMD SOI 6) Miscellaneous BT1 = 3V Lithium button cell * PCB, ref. 070851 -1 , free artwork download from www.elektor.com * see text Figure 2 The whole circuit fits on this double-sided PCB, using SMD components. Some experience required here! 3/2008 - elektor 71 INFO & MARKET REVIEW Paul Goossens (Elektor Labs) Chip manufacturer Atmel has built a good reputation for itself in the microcontroller market with its AVR controllers. It is less well known that this chip manufacturer also produces powerful 32-bit controllers that go by the name of AVR32. These are clearly different from the 8-bit AVR controllers. The Gateway Reference Design Kit from Atmel uses one of these new controllers. Reason enough for us to take a closer look at it. Well spill the beans right away: The NGW1 00 ('Network Gateway reference Design Kit') from Atmel costs about $ 70. For this money you get a small box that contains an assembled and programmed circuit board. No power sup- ply, no USB cable, no CD, nothing. Pure hardware for the enthusiast who will have a mains adapter (between 9 and 15 VDC preferably) plus some cables lying around some- where. Software and manuals are available via the internet at no cost. This way you are ensured to receive the latest version for this kit. A speedy internet connection is very use- ful however, since the complete download involves several hundred megabytes. This will likely not be a problem for those people to whom this board appeals. Reference Design vs. Development Board As supplied, the flash memory is already program- med, U-Boot has been installed as the bootloader. The main task of the bootloader is to load and start Li- nux (which is also programmed in flash memory). In ad- dition to Linux you can obviously also install other software and start it with the aid of U-Boot. A very useful option in U-Boot is the possibility of passing parameters to Linux when starting up. In this way, for in- stance, it is very easy using 'environment-parameters' to set an IP-address or define the speed of the serial port. The installed version of Linux is v2.6 plus the well-known busy-box as command shell. This combination provides for a powerful system without taking up too much flash me- mory. There is still plenty of space in the flash memory for your own applications. We usually talk in these reviews about development boards. The big difference between a 'Reference Design' and a 'De- velopment Board' is that an RD is designed for one specific purpose, while a DB is usually provided with a plethora of peripherals, that are at the disposal of the user for one or more applications. In the case of the NGW100, the board has a specific ap- plication: a gateway. This is comparable to a router, but has some additional functionality. The usefulness of this kit fortunately goes a lot further than that. All the important signals in this system are available on two expansion connectors. This allows you to add hardware to your heart's content, but for the board itself you will have to make do with the limited amount of I/O available. The controller is, as already mentioned, an AVR32 control- ler. The AT32AP7000 to be exact. This controller is amply provided with peripherals (refer to the inset). Striking is the fact that a pixel-coprocessor is included. This arithmetic unit can be used to carry out certain computationally intensive algorithms very quickly. Atmel indicates that this coproces- sor can be used for, among other things, speeding up con- versions between colour spaces or MPEG decoding. Also present is an interface that enables direct communica- tion with an image sensor. As a consequence this controller is eminently suitable for the development of multimedia devi- ces. We refer you to the sidebar for further information. Software The hardware is liberally provided with memory. For the RAM there is 32 MB of SDRAM and there is 1 6 MB of flash memory on board. Development Anyone who buys this kit will use it to develop their own code. This development can be done using a Windows 2000/XP system, but it is recommended to also use Linux on the development PC. Note that there is no development environment for Windows Vista yet. It is quite likely that with a few tricks it is possible to coerce the development system to work in Vista, but as at the time of writing it does not work 'out-of-the-box'. Drivers are available or on the way for the peripherals in the controller. Using these drivers it is, for example, very easy to use the built-in LCD interface, or to control the AC97 interface (audio) or GPIO connections from within your user- space program. There is no need to do much low-level programming, but you are obviously still allowed! This will, incidentally, be necessary if you want to use the timers, for example, from within Linux. There are at the moment no drivers available for these. Support The support for this kit is via a few websites, such as the AVR32 wiki on the AVR freaks website and avr32linux.org. Flere you find, among other things, all the necessary docu- mentation and the various tutorials & howto's to get you star- ted quickly with this design kit. This is all with the open-sour- ce philosophy, just like the underlying operating system. A little bit of familiarity with Linux would be useful, but thanks to the extensive documentation taking your first steps is quite easy. 72 elektor - 3/2008 Verdict This kit is recommended for anyone who, for a small amount of money, would like to get started with the development of their own embedded project based on Linux. The choice in this market segment has increased significantly in recent times and an evening of searching on the internet can easily result in a long list of available development boards. This kit is very attractive, particularly because of its price. On the other hand, the number of I/O options that are available as standard is limited. Certainly considering the capabilities of this controller in the multimedia area a built- in LCD would have been nice, but you cannot really expect that at this price of course. Atmel has another development board based on the AT32AP7000 in their line-up, which, among other things, contains a QVGA LCD. The price for this kit is five times higher however! For anyone who would like to have a go with this new controller from Atmel or would like to play around with an embedded Linux device this kit is most certainly recommended! ( 070853 - 1 ) Web Links U-Boot: http://sourceforge.net/projects/u-boot AVR32 wiki: http://www.avrfreaks.net/wiki/index.php/Documentation: AVR32_General AVR32 Linux wiki: http://www.avr32linux.org/twiki/bin/view/Main/LinuxPatches Datasheet AT32AP7000: http://www.atmel.com/dyn/resources/prod_documents/ doc32003.pdf AVR32 family The Network Gateway Reference Design has been designed around an AT32AP7000 controller. This is a controller from the AVR32 family. According to the manufacturer the AVR32 family is better and faster than an ARM7 controller, which are not that different in chip size. A large difference between these two families is that the AVR32 controllers have a MMU (Memory Management Unit). This unit divides the memory into several sections and is a ne- cessary part if you want to keep several processes separated from each other, such as is the case with Linux, for example. This is also the reason that a normal (but nonetheless slightly adapted) version of Linux can be used. The ARM7 controllers must use /jC Linux because there is no MMU. Another nice 'detail' is that these AVR32 controllers have a DSP-unit which needs only one clock cycle for multiply and accumulate. All this with a 'saturation' memory so that the adverse effects of an overflow are kept to a minimum. This makes the controller immediately suitable for multimedia applications. In addition, the hardware Java Virtual Machine is worth men- tioning. This little piece of hardware ensures that Java byte- code, that is, applications written in Java, can be executed very efficiently. AT32AP7000 Important characteristics: • 210 MIPS at 150 MHz • 32 l 070193-11 Figure 1: A few additional components are required to use a GoldCap to back-up the DS1307. Rainer Reusch There is currently a good range of real-time clock chips available for use in microcontroller sys- tems. One interesting, low-cost example is the DS1307 from Dallas Semiconductor which has a built-in serial l 2 C interface. The chip provides connections for a 3 V lithium button cell to ensure that the correct time and date are maintained in the event of a pow- er failure. In applications where the system runs continuously the battery back-up should provide many years of service but will eventually need to be replaced. In these situations a better (low- er-maintenance) alternative to the battery is a high capacity (Gold- Cap) capacitor. The simplest way to implement such a circuit would be to connect a GoldCap capacitor (a value of around 0.1 Farad should do) in place of the battery and arrange for it to be charged from the 5 V supply via a resistor (100 Q). A diode in series with the GoldCap would prevent the capacitor dis- charging when the supply volt- age fails. Unfortunately with the DS1307 this simple solution was not successful; once the GoldCap reached its maximum charge the l 2 C interface stopped talking. A closer look at the data sheet indi- cated that a 'no communication' mode is initiated when the supply voltage is below a level equiva- lent to 1 .25 x V BAT . This mode is intended to prevent any possible overwriting and corruption of data in the clock chip by a sys- tem controller which is undergo- ing a power-down or brown-out whilst attempting communication with the DS1307. As the supply voltage continues to fall below the battery voltage V BAT the DS1 307 switches into low-current mode. With these constraints in mind the circuit shown in Fig ure 1 was produced. Resistor R1 draws current through diodes D1 and D2 which together produce a voltage drop of around 1 .2 V. With a supply of 5 V the voltage at V BAT is approximately 3.85 V. D3 prevents the GoldCap being discharged when the supply volt- age falls and R2 limits the charg- ing current (and discharge cur- rent when jumper JP1 is used to discharge Cl , this process takes a few minutes). The maximum back-up time pro- duced by the circuit depends on the capacity of the GoldCap and to some extent the operating tem- perature which will have an influ- ence on both supply and leakage currents. You can expect the cir- cuit to provide back-up for many hours or maybe even a whole day which should be sufficient for most applications. ( 070193 - 1 ) 3/2008 - elektor 75 INFOTAINMENT RETRONICS The 'Dekatron' decimal counter valve Jean Herman These valves were developed in the 50s and lasted right up to the end of 1 970. They were used as up/down decade counters in applications like calculating machines, counters of all types, and especially in the nuclear industry as particle counters. Even quite recently I've had dig- ital voltmeters using Dekatrons in for repair. The whole meas- urement cycle was controlled by a cycling Dekatron: zeroing, measurement, range-changing, display, printout, zeroing, and so on. Operation The Dekatron consists (see Fig- ure 1 ) of a central circular anode (a) and ten cathodes (k), num- bered from 0-9. Between adja- cent cathodes are two transfer electrodes, guides (A) and (B). A voltage applied between the anode (a) and the cathodes causes ionization of just one of the cathodes. To move on to the next cathode, a short negative pulse is applied to the next cath- ode. To drive a Dekatron takes a minimum of one triode or one transistor or a transformer, together with a differentiator cir- cuit followed by an integrator. In the 60s, transistor circuits were developed for this purpose. Note that the Dekatron shown in Figure 1 has a different pinout from the one in the circuit diagram. They are two quite dif- ferent devices. Application I found a stray GS10D Dekatron in my drawer, and for old times' sake, I thought it would be interesting to get this valve working again. So I built an instruc- tional counter module (circuit in Figure 2) like those used back in the 50s. Power supply This valve operates with an anode voltage of 475 V @ 1 mA (mini- mum, at an ambient temperature of 20 °C! ! !), as it's not always easy to get them to ionize cold. It also has to be said that it is 50 years old, so it's will come as no sur- prise if it's a bit cantankerous! A cannibalized transformer will do the trick. A first rectifier to give 250 V, followed by a volt- age multiplier to give a no-load 600 V. The valves are recovered 6J6 double triodes, with their 6.3 V/0.4 A heaters all in series across the 40 V winding. Luck- ily, this multi-tapped transformer made it easy to play around with the voltages. Guide voltage generator This is a 6J6 valve arranged as a highly asymmetrical astable multivibrator (250 kQ/500 pF/ 500 kQ and 250 kQ/0.1 pF/ 10 MQ). The output frequency on anode 1 is 5 Hz, so as to be able to follow the move- ment of the ionization in the Dekatron with the eye. This fre- quency could be up to 10 kHz. Quiescent, the guides are pulled up to +51 V, which is the nor- mal voltage of the ionized cath- odes. When anode 1 switches negative, guide A receives the negative-going spike first via the 0.1 pF and 51 kQ; guide B (0.1 p F/51 kQ/ 1 0 nF cir- cuit) receives the negative spike delayed by the 51 kQ/1 0 nF RC network. In this way, the jump from cathode n to cathode n+1 is achieved. By reversing the drives to guides A and B, the set-up will also work as a down-counter. The GS10D valve displays the count directly, but when the valve is shut away inside a rack, a sep- arate display has to be added. For this instructional circuit, I've chosen the large ZM1040 valve with 31 mm high figures (mag- nificent!). The ZM1040 is pow- ered at 1 70 V and draws a cur- rent of 4.5 mA, limited by the 22 kQ resistor. Obviously, the GS10D Dekatron can't control the ZM1040 display directly. One triode per digit is required, i.e. five 6J6 double triode valves. The cathodes of the Dekatron are taken to ground via 47 kQ resistors, generating a poten- tial of 40 V when ionized (and hence cathode current is flowing). The cath- odes of all the 6J6s are returned to a 24 V zener diode, and their grids are connected to the counter tube cath- odes via 1 MQ resis- tors. In this way, the 6J6 grids are hard driven: -24 V valve Off, + 1 5 V valve On (with respect to the +24 V on their cathodes). The ZM1040 valve ioniza- tion voltage is 1 40 V. Valve current: 250 V - (140 V + 24 V) = 81 V/22 kQ = 4 mA. And all this just to cre- 76 elektor - 3/2008 ate one decade of counting - imagine the amount of hard- ware needed for even six digits, as well as the power consump- tion (25 W just for this circuit)! There have been several brands and lots of models of Dekatrons on the market. For example: - Philips: Z502S (4 kHz), Z504S (5 kHz), and Z505S (50 kHz) - Hivac: GS1 0D (10 kHz), GCA10G (5 kHz), and GS10H (5 kHz) - Elesta: ECT100 (100 kHz), EZ10B (100 kHz) -Cerberus: the GZ22 which can drive the GA1 1 and GA21 displays - Beeston: the type VS1 OK tro- chotron (200 kHz) and its GR1 OH display P.S. I'm on the lookout for Deka- trons to build a digital voltmeter for instructional purposes. If any readers have any I'd be very glad to hear from them. Thanks in advance! ( 070861 - 1 ) Web Links http://nixietube.info/Nixie.html http://www.wps.com/projects/de- cima I -tubes/index, html Ed: the original spelling is Dekatron (a trademark of Ericsson) Retronics is a monthly column covering vintage electronics including legendary Elektor designs. Contributions, suggestions and requests are welcomed; please send an email to editor@elektor.com Advertisement Your price conscious RGB supplier Verified CIRCUITS Online price calculation Online ordering Online order tracking Online 24/24H end 7 /7a Interested? Contact us: + 44 2088 167 005 E-mail; euro@eurodrcyits.com www.eurocircuits.com pooling for standard boards up to 6 layers from 1 to 1000 pieces from $ working days onwards - pooling with more options - op to 3 layers - from 1 to 1000 pieces - from 2 working days onwards your board, our challenge up to 16 layers from 1 piece onwards from 3 working days onwards 3/2008 - elektor 77 ELEKTOR SHOWCASE To book your showcase space contact Huson International Media Tel. 0044 (0) 1932 564999 Fax 0044 (0) 1 932 564998 ATC SEMITEC LTD www.atcsemitec.co.uk Thermal and current-sensitive components for temperature control and circuit protection; • NTC Thermistors • Current Diodes • Thermostats • Re-settable Fuses • Thermal Fuses • Temperature Sensors Call today for free samples and pricing Tel: 01 606 871 680 Fax: 01 606 872938 AVIT RESEARCH www.avitresearch.co.uk USB has never been so simple... with our USB to Microcontroller Interface cable. Appears just like a serial port to both PC and Microcontroller, for really easy USB connection to your projects, or replacement of existing RS232 interfaces. See our webpage for more details. From £10.00. BETA LAYOUT www.pcb-pool.com Beta layout Ltd Award- winning site in both English and German offers prototype PCBs at a fraction of the cost of the usual manufacturer’s prices. m w . - ' I ilfltl JUilTai ’ ■1 35 BOWOOD ELECTRONICS LTD www. bowood-electronics.co.uk Suppliers of Electronic Components • Semiconductors • Opto Electronics • Passives • Enclosures • Switches • Stripboard • PCB Materials • Popular Special Offer Packs Online Store, all major cards Same day despatch upto 3.00pm Personal Service sales@bowood-electronics.co.uk BYVAC ELECTRONICS www.byvac.co.uk 32Bit ARM Microcontroller, USB, built in RTC with itis own operating system, no complex tools, just a terminal emulator, start writing programs in 20 minutes. Complete with CD-ROM, Software and 100 Page Foundation book DECIBIT CO.LTD. www.decibit.com Smallest 2.4 GHz ISM band MCU embedded transceiver modules. Complete tiny solution, ready to transmit RF data by only attaching as example a CR2032 coin cell to it. DESIGNER SYSTEMS http://www.designersystems.co.uk Professional product development services. • Marine (Security, Tracking, Monitoring & control) • Automotive (AV, Tracking, Gadget, Monitoring & control) • Industrial (Safety systems, Monitoring over Ethernet) • Telecoms (PSTN handsets, GSM/GPRS) • Audiovisual ((HD)DVD accessories & controllers) Tel: +44 (0)1872 223306 EasyDAQ www.easydaq.biz We design & supply low cost USB/RS232 based data acquisition, automation & control products: • USB connected & powered, 8 opto isolated voltage inputs chans, 4DI0 & 4 onboard relays capable of switching 240V@10A. With Labview, VC & VB examples - £60 EASYSYNC http://www.easysync.co.uk EasySync Ltd sells a wide range of single and multi- port USB to RS232/RS422 and RS485 converters at competitive prices. ELNEC www.elnec.com • 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 • reliable HW • once a months new SW release • three years warranty for most programmers YOUR ELECTRONICS OPEN SOURCE W http://dev.emcelettronica.com Website full of Projects and Resources for Electronics Engineers and DIY. • Tutorial • Hardware (Schematic & Gerber) • Firmware (Asm & C) • Reference Design Everyone can submit a story as a useful source! 'Share for life' fhst Tethnaieyy Transfer ltd. FIRST TECHNOLOGY TRANSFER LTD. http://www.ftt.co.uk/PICProTrng.html Microchip Professional C and Assembly Programming Courses. The future is embedded. Microchip Consultant /Training Partner developed courses: • Distance learning / instructor led • Assembly / C-Programming of PIC1 6, PIC1 8, PIC24, dsPIC microcontrollers • Foundation / Intermediate FLEXIPANEL LTD www.flexipanel.com TEAclippers - the smallest PIC programmers in the world, from £20 each: • Per-copy firmware sales • Firmware programming & archiving • In-the-field firmware updates • Protection from design theft by subcontractors FUTURE TECHNOLOGY DEVICES http://www.ftdichip.com FTDI designs and sells USB-UART and USB-FIFO interface i.c.’s. Complete with PC drivers, these devices simplify the task of designing or upgrading peripherals to USB FUTURLEC http://www.futurlec.com Save up to 60% on • Electronic Components • Microcontrollers, PIC, Atmel • Development Boards, Programmers Huge range of products available on-line for immediate delivery, at very competitive prices. ILP ELECTRONICS LTD www.ilpelectronics.com Tel +441233750481 Fax +441 233750578 ILP have been manufacturing audio modules since 1 971 and apart from our standard range we also offer a custom design service for the OEM market. LONDON ELECTRONICS COLLEGE http://www.lec.org.uk Vocational training and education for national qualifications in Electronics Engineering and Information Technology (BTEC First National, Higher National NVQs, GCSEs and GCEs). Also Technical Management and Languages. lie 78 elektor - 3/2008 products and services directory MARCHAND ELECTRONICS INC. www.marchandelec.com • power amplifier modules • electronic crossovers solid state / valve / passive • valve amplifiers • phono preamps • handheld sinewave generator • kits or assembled • software electronic instruments • custom design services MQP ELECTRONICS www.mqp.com • Low cost USB Bus Analysers • High, Full or Low speed captures • Graphical analysis and filtering • Automatic speed detection • Bus powered from high speed PC • Capture buttons and feature connector • Optional analysis classes NEW WAVE CONCEPTS www.new-wave-concepts.com Software for Hobbyists: • Livewire - circuit simulation software, only £34.99 • PCB Wizard - PCB design software, only £34.99 • Circuit Wizard - circuit, PCB and breadboard design software, only £59.99 Available from all Maplin Electronics stores and www.maplin.co.uk RADIOMETRIX www.radiometrix.com The leading global developer of ISM band, low power radio modules for wireless data transmission: • Transmitters • Receivers • Transceivers • RF modems • Evaluation Kits ROBOT ELECTRONICS http://www.robot-electronics.co.uk Advanced Sensors and Electronics for Robotics • Ultrasonic Range Finders • Compass modules • Infra-Red Thermal sensors • Motor Controllers • Vision Systems • Wireless Telemetry Links • Embedded Controllers ROBOTIQ http://www.robotiq.co.uk Build your own Robot! Fun for the whole family! • MeccanoTM Compatible • Computer Control • Radio Control •Tank Treads • Hydraulics Internet Technical Bookshop, 1-3 Fairlands House, North Street, Carshalton, Surrey SM5 2HW email: sales@robotiq.co.uk Tel: 020 8669 0769 © 5SLa COMPONENTBIN.COM www.componentbin.com Kickstart your development with modules and parts from componentbin.com • ARM7 modules • Ethernet modules • Superb Graphic LCD displays (all with example software) and much much more... Online ordering and great prices! ill trsl ecfe* a. i>. ULTRALEDS http://www.ultraleds.co.uk tel: 0871 7110413/01625 576778 Large range of low cost Ultra bright leds and Led related lighting products. Major credit cards taken online with same day depatch. usbTnsTrumenTs http://www.usb-instruments.com USB Instruments specialises in PC based instrumentation products and software such as Oscilloscopes, Data Loggers, Logic Analaysers which interface to your PC via USB. VIRTINS TECHNOLOGY www.virtins.com PC and Pocket PC based virtual instrument such as sound card real time oscilloscope, spectrum analyzer, signal generator, multimeter, sound meter, distortion analyzer, LCR meter. Free to download and try. SHOWCASE YOUR COMPANY HERE Elektor Electronics has a feature to help customers promote their business, Showcase - a permanent feature of the magazine where you will be able to showcase your products and services. For just £220 + VAT (£20 per issue for eleven issues) Elektor will publish your company name, website address and a 30- word description For £330 + VAT for the year (£30 per issue for eleven issues) we will publish the above plus run a 3cm deep full colour image - e.g. a product shot, a screen shot from your site, a company logo - your choice Places are limited and spaces will go on a strictly first come, first served basis. So-please fax back your order today! _ I wish to promote my company, please book my space: • Text insertion only for £220 + VAT • Text and photo for £330 + VAT NAME: ORGANISATION: JOB TITLE: ADDRESS: TEL: PLEASE COMPLETE COUPON BELOW AND FAX BACK TO 00-44-(0)1932 564998 COMPANY NAME WEB ADDRESS 30- WORD DESCRIPTION 3/2008 - elektor 79 BOOKS, CD-ROMs, KITS & MODULES Cursus in 9 lessen ns - enr9 capitulos* Kursus in 9 Lektionen Course in 9 chapters' Going Strong A world of electronics from a single shop! — » l4 h* itl <3, 1 r- r* ; - Tr, . . ; , - 7t: : T x r u ClCttR Modern technology for everyone FPGA Course in 9 chapters FPGAs have established a firm position in the modern electronics designer's toolkit. Until recently, these 'super components' were practically reserved for specialists in high-tech com- panies. That's all changed now, also because of the Elektor FPGA module. The combination of the module and the prototyping board is the perfect introduction to FPGAs. The nine lessons on the courseware CD-ROM are a step by step guide to the world of Field Programmable Gate Array technology. Subjects covered include not just digital logic and bus systems but also building an FPGA Webserver, a 4-channel multimeter and a USB controller. The CD also contains PCB layout files in pdf format, a Quartus manual, project software and various supplementary instructions. All articles published in 2007 Elektor 2007 Year volume CD-ROMs are among the most popular items in Elektor's product range. This CD-ROM contains all edi- torial articles published in Elektor Vol- ume 2007. Using the supplied Acrobat Reader program, articles are presented in the same layout as originally found in the magazine. An extensive search ma- chine is available to locate keywords in any article. 978-90-5381-218-1 • £16.90 • US$33.80 More than 68,000 components Elektor's Components Database 4 The program package consists of eight databanks covering ICs, germanium and silicon transistors, FETs, diodes, thyristors, triacs and optocouplers. A further eleven applications cover the calculation of, for example, LED series droppers, zener diode series resistors, voltage regulators and AMVs. A col- our band decoder is included for de- termining resistor and inductor values. ECD 4 gives instant access to data on more than 68,000 components. All databank applications are fully in- teractive, allowing the user to add, edit and complete component data. This CD-ROM is a must-have for all electronics enthusiasts. ISBN 978-90-5381-225-9 • £14.50 • US$ 29.00 ISBN 978-90-5381-159-7 • £15.90 • US$ 31.80 Prices and item descriptions subject to change. E. & O.E 80 elektor - 03/2008 PI C Microcontroller* fcO ^s'.irfdi tof llr^j-nrn nf •? F^'fr Visual Basic 5.® iD m HT 1444 Hr eirci routes Engine eriEicp AppllcaitoBS 5.0, 6.0, VBA, .NET, 2005 Visual Basic for Electronics Engineering Applications This book is targeted towards those peo- ple that want to control existing or self- built hardware from their computer. After familiarizing yourself with Visual Basic, its development environment and the tool- set it offers are discussed in detail. Each topic is accompanied by clear, ready to run code, and where necessary, sche- matics are provided that will get your projects up to speed in no time. 476 pages • ISBN 978-0-905705-68-2 £29.00 • US$ 58.00 309 CIRCUITS JT tm Fully elaborated electronics projects 309 Circuits The present tenth edition of the popular '30x Circuits' series of books once again contains a comprehensive variety of cir- cuits, sub-circuits, tips and tricks and de- sign ideas for electronics. Among many other inspiring topics, the following cate- gories are well presented in this book: test & measurement; RF (radio); com- puters and peripherals; audio & video; hobby and modelling; microcontrollers; home & garden; power supplies & bat- tery chargers; etcetera. 432 pages • ISBN 978-0-905705-69-9 £19.95 -US$39.95 Silent alarm, poetry box, night buzzer and more! PIC Microcontrollers Surround Light (February 2008) This hands-on book covers a series of exciting and fun projects with PIC micro- controllers. You can built more than 50 projects for your own use. The clear ex- planations, schematics, and pictures of each project on a breadboard make this a fun activity. You can also use it as a study guide. The technical background infor- mation in each project explains why the project is set up the way it is, including the use of datasheets. This way you'll learn a lot about the project and the microcon- troller being used. Even after you've built all the projects it will still be a valuable reference guide to keep next to your PC. 446 pages • ISBN 978-0-905705-70-5 £27.00 • US$ 54.00 In 2004 Philips launched the Ambilight system for its television sets. Unfortunately this system is not available with other TV brands, let alone computer displays. This circuit, a complete analogue design, allows you to retrofit an image-controlled background light to your PC display. This generates a more intense experience, creates a visual point of reference, and produces refined mood lighting. PCB, portly populated with SMDs (including ports and enclosure) Art.# 070491-91 • £121.90 • US$245.00 v y More information on the Elektor Website: www.elektor.com Elektor Regus Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 Email: sales@elektor.com r^lektor LZ3 shop Carbon dioxide (C02) is not just a threat to the environment, it is also an impor- tant and often ignored factor in deter- mining air quality in the office and at home. Too high a concentration of C02 leads to feelings of tiredness, disturbs concentration, and causes headaches. The Elektor C02 meter makes it easy to determine the concentration of carbon dioxide in the air. A microcontroller monitors the measured value and can trigger an alarm or start up a ventila- tion system when a preset threshold is exceeded. Kit of parts, PCB , Sensor PCB, ATtiny26 and display Art.# 070802-71 • £107.50 • US$215.00 v. (January 2008) 03/2008 - elektor 81 PRODUCT SHORTLIST, BESTSELLERS '\ March 2008 (No. 375) £ Data Logger "deLuxe" 070745-1 PCB, bare 16.30 070745-41 ....Programmed controller 19.90 070745-71 .... Kit of parts (PCB, programmed controller and display) ....71 .75 The Secrets of I2C 070600-1 PCB, bare 13.60 070600-41 ....Programmed controller 19.90 Cylon Voice 070859-41 ....Programmed controller 4.70 ECIO PLC 070786-1 PCB, bare 16.30 70786-71 Kit of parts (PCB, EClO-module, all other components) ....76.00 US$ ..32.60 ..39.80 143.50 ..32.60 ..39.80 ....9.40 ..32.60 152.00 February 2008 (No. 374) LEDBUS System 070459-1 PCB, power module 070459-2 PCB, central 070459-41 .... PIC12F638-I/SN, programmed (power module) 070459-42 .... ATmega32-l 6PC, programmed (central) RGB LED IVIood Lighting 070892-1 PCB, bare 070892-2 PCB, bare 070892-3 PCB, bare Surround Light for PC Monitor 070491-1 PCB, bare 070491-2 PCB, bare 070491 -91 .... PCB, partly populated with SMDs LED Ringflash 070612-1 PCB, bare 070612-41 .... PIC1 6F628, programmed 070612-81 ....Software on CD-ROM TV Surround Light 070487-1 PCB, bare 070487-41 ....Programmed controller 070487-42 .... Programmed controller 070487-81 ....Software on CD-ROM CAN Explorer 060201 -1 PCB, MCP2515 and MCP2551 SN 060201 -W Testing & Error Sources Manual Thermometer / Thermostat 070852-11 ....Software www.thePCBshop.com www.thePCBshop.com 3.10... 6.20 13.80... 27.60 www.thePCBshop.com www.thePCBshop.com www.thePCBshop.com 21.50... 43.00 5.00... 10.00 121.90... ...245.00 www.thePCBshop.com 10.50... 21.00 5.20... 10.40 21.50... 43.00 12.70... 25.40 10.50... 21.00 5.20... 10.40 www.thePCBshop.com www.elektor.com www.elektor.com January 2008 (No. 373) C0 2 Measurement 070802-1 PCB, bare 14.40. 070802-41 ....Programmed controller ATtiny26 7.20. 070802-71 .... Kit of parts, PCB, Sensor PCB, ATtiny26 and display 107.50. 070802-81 Software on CD-ROM 5.20. Anti-Standby Switch 070797-1 PCB, bare 14.40. 070797-41 .... ATtiny25, programmed 5.20. Control for Energy-saving Lamps 070638-71 ....PCB, FAN7710N and 2.5mH coil 14.40. Versatile DC Power Meter 070559-1 PCB, bare 9.30. 070559-41 .... Programmed controller ATmega8-l 6P 9.00. .28.80 .14.40 .215.00 ...10.40 .28.80 .10.40 .28.80 .18.60 .18.00 December 2007 (No. 372) Reflow Solder Controller 060234-91 ....Populated PCB with enclosure 171,80 343,60 AVR Web Server 060257-1 Printed circuit board 9,60 1 9,20 060257-41 ....ATmega644, programmed 13,80 27,60 Craft Drill Controller 060291 -1 Printed circuit board www.thePCBshop.com Christmas Flasher 010032-91 ....Kit of parts 3,60 7,20 Prices and item descriptions subject to change. E. & O.E Bestsellers o od i/) 1 PIC Microcontrollers ISBN 978-0-905705-70-5 £27.00. USS 54.00 2 E VlSUal BaSIC for Electronics Engineering Applications ISBN 978-0-905705-68-2 £29.00. US$ 58.00 3 309 Circuits ISBN 978-0-905705-69-9 £19.95. USS 39.95 4 E Microcontroller Basics ISBN 978-0-905705-67-5 £19.50. US$ 39.00 5 5 1 2 3 4 5 PC Interfaces under Windows ISBN 978-0-905705-65-1 £27.25. US$ 54.50 iQ Elektor 2007 ISBN 978-90-5381-218-1 ...£16.90... ..US$33.80 2 ECD4 ISBN 978-90-5381-159-7 ...£15.90... ..US$31.80 30 Ethernet Toolbox ISBN 978-90-538 1-21 4-3 ...£18.90... ..US$37.90 4 Home Automation ISBN 978-90-5381-195-5 ...£13.90... ..US$ 27.80 USB Toolbox ISBN 978-90-538 1 -2 1 2-9 £1 9.90. US$ 39.80 C0 2 Measurement Art.# 070802-71 £1 07.50 US$ 215.00 USB Flash Board Art. #070125-71 £36.20 US$ 72.40 Surround Light Art. # 070491-91 E121.90...USS 245.00 Reflow Solder Controller Art. # 060234-91 £1 71.80...USS 343.60 Stand Alone OBD-2 Analyser Art. # 070038-72 E55.20...USS 1 10.40 Order quickly and safe through www.elektor.com/shop or use the Order Form near the end of the magazine! Elektor Regus Brentford 1 000 Great West Road Brentford TW8 9HH * United Kingdom Tel. +44 20 8261 4509 Fax +44 20 8261 4447 Email: sales@elektor.com 82 elektor - 03/2008 MAY! WE YOU save: Subscription PLUS coq no 10 magazines S ' 80 1 double issue (July/August) •; Is rsssrr _ £ 47.20 your saving .lekto!; The Elektor PLUS subscription * III • leKt .If!*** Keep £ 47.2 in your pocket! a a 1 1 x Elektor PLUS: Cheaper than 1 1 issues from the newsstand Subscribers get up to 40% discount on special Elektor products As a welcome gift you get a free 1 GB MP3 player worth £34.50 No queues, travelling, parking fees or “sold out” Elektor is supplied to your doorstep every month Always up to date - read your copy before everyone else www.elektor.com/subs Tel. +44 (0) 20 8261 4509 Or use the subscription order form near the end of the magazine. r3lektor ' ^ electronics worldwide INFO & MARKET SNEAK PREVIEW Home Automation Server This project employs a Freescale Coldfire micro and associated PC software that allows remote switching of electrical loads across networks including the biggest network of all - the Internet. The ingredients from the Freescale/Elektor kitchen: 32-bit embedded technology, free software, a low-cost kit for the hardware and all tools to expand the functionality of the server to your own liking. In the first instalment we describe the general structure of the server and the optional Turbo BDM programmer for Coldfire devices. paX, an audio amplifier with error correction Most audio power amplifiers employ strong overall feedback circuitry to keep distortion and output impedance as low as possible. In the audio world, the method is not beyond reproach as strong feedback is said to compromise sound fidelity. Next month we describe an amplifier with a radically different approach called error correction. Although the concept dates back to Malcolm Hawksford's pub- lications in 1 984, it was never realised in practice. The amplifier presented in the next issues of Elektor is not only remarkable for its fine specifications, but is also for stability compared to design with overall feedback. USB-to-S/PDIF converter A proper D/A converter is still among the highest ranking options if you are after zero-compromise reproduction of digital sound sources via the computer. Unfortunately, proper sounding DACs are rarely used on PC sound cards or motherboards and the alternative is to 'go external'. Our interface allows the input of a high-end DAC to be driven by an S/PDIF signal, using an USB connection on the PC. RESERVE YOUR COPY NOW! The April 2008 issue goes on sale on Thursday 27 March 2008 (UK distribution only). UK mainland subscribers will receive the magazine between 22 and 25 March 2008. Article titles and magazine contents subject to change, please check www.elektor.com. NEWSAGENTS ORDER FORM SHOP SAVE / HOME DELIVERY Please save / deliver one copy of Elektor magazine for me each month Name: Address: Post code: Telephone: Date: Signature: Please cut out or photocopy this form, complete details and hand to your newsagent. Elektor is published on the third Thursday of each month, except in July. Distribution S.O.R. by Seymour (NS). w.elektor.com www.elektor.com www.elektor.com www.elektor.com www.elektor. Elektor on the web All magazine articles back to volume 2000 are available online in pdf format. The article summary and parts list (if applicable) can be instantly viewed to help you positively identify an article. Article related items are also shown, including software down- be downloaded. Vf V/ 1 ■ V Vf 1 1 v-f 1 1 VI 1 1 VI issues may also e electronic, worldwide l onttioi f Get B tr5rkn6w Elektor Home New* Mngnrme S fvop Subtcnbe now forum Service In the Elektor Shop you'll find all other products sold by the publishers, like CD-ROMs, kits and books. A powerful search function allows you to search for items and references across the entire website. Also on the Elektor website: • Electronics news and Elektor announcements • Readers Forum • PCB, software and e-magazine downloads • Surveys and polls • FAQ, Author Guidelines and Contact ■ Choot* »n option ▼ Informative article. V Projects w Book. W CO-Kont* v«t>k Module* W (-block. v PCD* v Controller. V Megarine* w 0**er* M Elektor Crept. W Trial tuMOVdor* ’« © TTT panel, arc compec&e with Wide KG* i4gk-po««r pr module support. 2>gBee PCIe peripheral controller provide, flexible COnnoctivity option* Taw .no Ma.iwraman* Product Guide (lottery Fuel CnuQC Download Elektor . Elektor February 2008 Elektor'. 2008 February Issue can be downloaded' The downloadable version not only save, you time and money but alio offer. f y i text March opbon*. [^P*P Construction prop •r K-venti Vie it CKine Elektor >s organising a study trip to China on 12-2! April of this year and you're welcome to join ual Pic.te enter your email adore..; Hot © Beforo mbmiumg Qua wens please review our r*Q sector' R8C. • uplarar .8: • !-«plorrr-lh rpGA H»ll»n$ diftchirtt from e kit Jk 84 elektor - 3/2008 Description Price each Qty. Total Order Code PIC Microcontrollers (233 £ 27,00 CD-ROM FPGA Course (223 £ 14.50 CD-ROM Elektor 2007 (233 £ 16.90 CD-ROM ECD 4 (233 £ 15.90 Free Elektor Catalogue 2008 Sub-total Prices and item descriptions subject to change. The publishers reserve the right to change prices p&P without prior notification. Prices and item descriptions r “ r shown here supersede those in previous issues. E. & O.E. Total paid Name METHOD OF PAYMENT (see reverse before ticking as appropriate) □ □ □ □ Bank transfer Cheque (UK-resident customers ONLY) Giro transfer VISA Expiry date: Verification code: Please send this order form to* (see reverse for conditions) Elektor Regus Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom Address + Post code Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 www.elektor.com sales@elektor.com Tel. Email Date - - Signature EL03 Yes, I am taking out an annual subscription to Elektor and receive a free 1GB MP3 player. I would like: I I Standard Subscription (11 issues) Subscription-Plus (11 issues plus the Elektor Volume 2007 CD-ROM) * Offer available to Subscribers who have not held a subscription to Elektor during the last 12 months. Offer subject to availability. See reverse for rates and conditions. Name Address + Post code Tel. Email Date - - Signature * cross out what is not applicable EL03 *USA and Canada residents may (but are not obliged to) use $ prices, and send the order form to: Old Colony Sound Lab P.0. Box 876, Peterborough NH 03458-0876. Tel. (603) 924-6371, 924-6526, Fax: (603) 924-9467 Email: custserv@audioXpress.com METHOD OF PAYMENT (see reverse before ticking as appropriate) □ □ □ □ Bank transfer Cheque (UK-resident customers ONLY) Giro transfer MasfBffrfit Expiry date: Verification code: Please send this order form to Elektor Regus Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 www.elektor.com subscriptions@elektor.com ORDERING INSTRUCTIONS, P&P CHARGES Except in the USA and Canada, all orders, except for subscriptions (for which see below), must be sent BY POST or FAX to our Brentford address using the Order Form overleaf. Online ordering: www.elektor.com/shop Readers in the USA and Canada may (but are not obliged to) send orders, except for subscriptions (for which see below), to the USA address given on the order form. Please apply to Old Colony Sound for applicable P&P charges. Please allow 4-6 weeks for delivery. Orders placed on our Brentford office must include P&P charges (Priority or Standard) as follows: Europe: £6.00 (Standard) or £7.00 (Priority) Outside Europe: £9.00 (Standard) or £11.00 (Priority) HOWTO PAY All orders must be accompanied by the full payment, including postage and packing charges as stated above or advised by Customer Services staff. Bank transfer into account no. 40209520 held by Elektor Electronics with ABN-AMRO Bank, London. IBAN: GB35 ABNA 4050 3040 2095 20. BIC: ABNAGB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics. We can only accept sterling cheques and bank drafts from UK-resident customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. Giro transfer into account no. 34-152-3801, held by Elektor Electronics. Please do not send giro transfer/deposit forms directly to us, but instead use the National Giro postage paid envelope and send it to your National Giro Centre. Credit card VISA and MasterCard can be processed by mail, email, web, fax and telephone. Online ordering through our website is SSL-protected for your security. COMPONENTS Components for projects appearing in Elektor are usually available from certain advertisers in this magazine. If difficulties in the supply of components are envisaged, a source will normally be advised in the article. Note, however, that the source(s) given is (are) not exclusive. TERMS OF BUSINESS Delivery Although every effort will be made to dispatch your order within 2-3 weeks from receipt of your instructions, we can not guarantee this time scale for all orders. Returns Faulty goods or goods sent in error may be returned for replacement or refund, but not before obtaining our consent. All goods returned should be packed securely in a padded bag or box, enclosing a covering letter stating the dispatch note number. If the goods are returned because of a mistake on our part, we will refund the return postage. Damaged goods Claims for damaged goods must be received at our Brentford office within 10-days (UK); 14-days (Europe) or 21 -days (all other countries). Cancelled orders All cancelled orders will be subject to a 10% handling charge with a minimum charge of £5.00. Patents Patent protection may exist in respect of circuits, devices, components, and so on, described in our books and magazines. Elektor does not accept responsibility or liability for failing to identify such patent or other protection. Copyright All drawings, photographs, articles, printed circuit boards, programmed integrated circuits, diskettes and software carriers published in our books and magazines (other than in third-party advertisements) are copyright and may not be reproduced or transmitted in any form or by any means, including photocopying and recording, in whole or in part, without the prior permission of Elektor in writing. Such written permission must also be obtained before any part of these publications is stored in a retrieval system of any nature. Notwithstanding the above, printed-circuit boards may be produced for private and personal use without prior permission. Limitation of liability Elektor shall not be liable in contract, tort, or otherwise, for any loss or damage suffered by the purchaser whatsoever or howsoever arising out of, or in connexion with, the supply of goods or services by Elektor other than to supply goods as described or, at the option of Elektor, to refund the purchaser any money paid in respect of the goods. Law Any question relating to the supply of goods and services by Elektor shall be determined in all respects by the laws of England. September 2007 SUBSCRIPTION RATES FOR ANNUAL SUBSCRIPTION Standard Plus United Kingdom £42.00 £49.00 Surface Mail Rest of the World £56.00 £63.00 Airmail Rest of the World £71 .00 £78.00 USA & Canada For US$-p rices please check www.elektor.com HOWTO PAY Bank transfer into account no. 40209520 held by Elektor Electronics, with ABN-AMRO Bank, London. IBAN: GB35 ABNA 4050 3040 2095 20. BIC: ABNAGB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics. We can only accept sterling cheques and bank drafts from UK-resident customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. Giro transfer into account no. 34-152-3801, held by Elektor Electronics Please do not send giro transfer/deposit forms directly to us, but instead use the National Giro postage paid envelope and send it to your National Giro Centre. Credit card VISA and MasterCard can be processed by mail, email, web, fax and telephone. Online ordering through our website is SSL- protected for your security. SUBSCRIPTION CONDITIONS The standard subscription order period is twelve months. If a perma- nent change of address during the subscription period means that copies have to be despatched by a more expensive service, no extra charge will be made. Conversely, no refund will be made, nor expiry date extended, if a change of address allows the use of a cheaper service. Student applications, which qualify for a 20% (twenty per cent) reduction in current rates, must be supported by evidence of student- ship signed by the head of the college, school or university faculty. A standard Student Subscription costs £33.60, a Student Subscription- Plus costs £39.20 (UK only). Please note that new subscriptions take about four weeks from receipt of order to become effective. Cancelled subscriptions will be subject to a charge of 25% (twenty- five per cent) of the full subscription price or £7.50, whichever is the higher, plus the cost of any issues already dispatched. Subsciptions cannot be cancelled after they have run for six months or more. January 2008 Formula Flowcode Buggy • A complete solution: robot + software + curriculum • Line following and maze solving • High-tech specifications • Also programmable with C or ASM • E-blocks compatible • Motivating for education and hobby Ready to use only £85.00 • US$ 169.00 Order now using the Order Form in the Readers Services section in this issue. Elektor Reg us Brentford • 1000 Great West Road Brentford TW8 9HH United Kingdom Tel. +44 20 8261 4509 lektor SHOP USB-programmable robot vehicle Order quickly and safe through WWW.elektor.com/shop Index of Advertisers Allendale Electronics Ltd www.pcb-soldering.co.uk 16 ATC Semitec Ltd, Showcase www.atcsemitec.co.uk 78 Avit Research, Showcase www.avitresearch.co.uk 78 Beijing Draco www.ezpcb.com 57 Beta Layout, Showcase www.pcb-pool.com 39, 78 Bitscope Designs www.bitscope.com 3 Bowood Electronics Ltd, Showcase www.bowood-electronics.co.uk 78 Byvac Electronics, Showcase www.byvac.co.uk 78 Decibit Co. Ltd, Showcase www.decibit.com 78 Designer Systems, Showcase www.designersystems.co.uk 78 EasyDAQ, Showcase www.easydaq.biz 78 Easysync, Showcase www.easysync.co.uk 78 Elnec, Showcase www.elnec.com 78 EMCelettronica Sri, Showcase www.emcelettronica.com 78 Eurocircuits www.eurocircuits.com 77 First Technology Transfer Ltd, Showcase . . www.ftt.co.uk 78 FlexiPanel Ltd, Showcase www.flexipanel.com 78 FLYPCB www.flypcb.com 9 Future Technology Devices, Showcase. . . . www.ftdichip.com 78 Futurlec, Showcase www.futurlec.com 78 ILP Electronics Ltd, Showcase www.ilpelectronics.com 78 Jaycar Electronics www.jaycarelectronics.co.uk 2 Labcenter www.labcenter.com 88 London Electronics College, Showcase . . . www.lec.org.uk 78 Marchand Electronics Inc, Showcase www.marchandelec.com 79 MikroElektronika MQP Electronics, Showcase. . . . New Wave Concepts, Showcase Newbury Electronics Nurve Networks Paltronix SK Pang Electronics Peak Electronic Design Pico Quasar Electronics Radiometrix, Showcase Robot Electronics, Showcase. . . Robotiq, Showcase Schaeffer AG Showcase Tsien (UK) Ltd, Showcase Ultraleds, Showcase USB Instruments, Showcase . . . Virtins Technology, Showcase . . www.mikroe.com www.mqp.com www.new-wave-concepts.com . . www.newburyelectronics.co.uk . . www.xgamestation.com www.paltronix.com www.skpang.co.uk www.peakelec.co.uk www.picotech.com www.quasarelectronics.com . . . . www.radiometrix.com www.robot-electronics.co.uk. . . . www.robotiq.co.uk www.schaeffer-ag.de www.componentbin.com . www.ultraleds.co.uk www. usb-instruments. com www.virtins.com . . . 11 . . .79 . . .79 . . .61 . . .61 . . .43 . . .39 . . .39 . . .17 . . .63 . . .79 . . .79 . . .79 . . .57 78, 79 . . .79 . . .79 . . .79 . . .79 Advertising space for the issue of 21 April 2008 may be reserved not later than 25 March 2008 with Fluson International Media - Cambridge House - Gogmore Lane - Chertsey, Surrey KT 1 6 9AP - England - Telephone 01 932 564 999 - Fax 01 932 564998 - e-mail: aerrvb@husonmedia.com to whom all correspondence, copy instructions and artwork should be addressed. 3/2008 - elektor 87 DESIGN SUITE com>uT£i^ mvBV pbs/gn gHttA tKSV A [/ R ?ou£f|ul/ E^svf i© Use Sc^wxAiic C^piurc ivtiefAC.iiv^ H*Vc4i Mtxte STlCF Simula *£»©« U«Ve Mitfoton-troller C 0 -Si«^l*tie« ««d t>eW 3 ,« 3 FuUvf Fe*iure4i TC4h ttesi^w *«dl SD viewer i4©rUs First Sc.^c^iic. US& Si^wulfetio* TftxiuC't Hi C©*^ple4e 6M4m££riM SoWtiom K^pii Dcvdiepw^Cni SnvirowwxCni H*yi"*W»** KetMfW ©w IwvCstw^Cwt Foster Ti»^e to H^ftet « WINTER SPECIAL OFFER 20% off all new orders for the Proteus Design Suite when you spend £400 or more. Electronic Design from Concept To Completion LABCEIMTER ELECTRONICS LTD A technology Pioneer in the EDA industry since 1988. Technical support direct from the program authors. Flexible packages and pricing tailored to customer requirements. CONTACT US NOW to discuss your requirements or request a FREE evaluation copy. I abcenter A A A www.labcenter.com E I c t r a n i c TEL: +44 (OJ1756 753440 FAX: +44 (OJ1756 752857 Email: info @labcenter. com Labcenter Electronics Ltd., 53-55 Main Street, Grassington North Yorks, BD23 5AA. Registered in England 4692454