,iH October 2010 AUS$ 13*90 - NZ$ 16.90 - SAR 99.95 £465 + S-FSK Powerline Communication + Quartus/Altera FPGA Design Simulation + 80 Candles for the Pentode + Satnav with Propeller 1 20 AC/DC clamp meters on the test bench MAX IONIA CAT IV MOV catiutmov U1213A lomAAcmcTnumMs N mbed DESIGN CHALLENGE it TECHNOLOGY ■ m m m The mhed Microcontroller, based on the NXP LPC1768, lets you work with an ARM Cortex-M3 in a O.T' DIP form-factor Combined with the http:/ / mbed.org website, featuring the mbed Cloud Compiler, it is an ideal platform for rapid prototyping with microcontrollers. SET FREE NXP and ARM/mbed challenge you to revolutionize the way people build prototypes! Build a reusable library, component interface, reference design or product prototype that can be shared on http://mbed.org to help others build their prototypes even faster, and you could be walking away with part of a prize pool worth $10,000! Deadline for entries is February 28, 201 1 . Join the Challenge by registering at www.circuitcellar.com/nxpmbeddesignchallenge! Apply for a free NXP sponsored mbed Microcontroller kit while supplies last.* NXP mbed Design Challenge empowered by: CRCWI CELLAR mbed 'No purchase necessary. See website for details. Integrate Touch Sensing Quickly and Easily With Microchip's Range of Low Power, Low Cost Solutions 1 *■ — “ - Solutions « Microchip's mTouch™ Sensing Solutions allow designers to integrate touch sensing with application code in a single microcontroller, reducing total system cost Microchip offers a broad portfolio of low power, low cost & flexible solutions for keys/sliders and touch screen controllers. Get to market faster using our easy GUI-based tools, free source code and low-cost development tools. Touch Sensing for Keys and Sliders • mTouch Capacitive Sensing technology - Longer battery life with extreme Low Power MQJs; Capacitive Sensing in less than 5 (jA - High noise immunity and low emissions - Ho external components * mTouch Inductive Sensing technology - Use polished or brushed metal surfaces including stainless steel and aluminum - Sense through gloves - Create water-proof designs - Deploy Braille-friendly interfaces ■ Broad portfolio of MQJs lowers system cost: 8 '6 i 32-bit PIC MCUs for Capacitive and Inductive Touch - Integrated USB, Graphics, LCD, IrDA, CAN Touch Screen Controllers • Fully processed touch coordinates ■ Projected Capacitive technology - Multi-touch enabling gestures - Low cost MCU implementation - Wide operating voltage: L8-5.5V - Low operating current 15 mA at 5V typical - Analog Resistive technology - Lowest system cost, easy integration - Universal 4, 5 & 8-wire solution with on-chip calibration - PC™, 5PI, UART or USB interfaces - Low power "touch to wake-up" feature GET STARTED IN 3 EASY STEPS - Learn moreatwww.microchipxom/mtouch - Download App Notes & royalty-free source code - Order a development too! Enhanced mTouch Capacitive Evaluation Kit - DM183026-2 (For keys & sliders) r Projected Capacitive Development Kit - DM 16 02 11 Analog Resistive Touch Screen Development Kii-DVWn POEM* Inductive Touch Development Kit - DM183027 (for keys m metal surfaces} Intelligent Electronics start with Microchip microchip www. microchi k? direct .com elektor 10-2010 www.microchip.com/mtouch & Microchip The Microchip nil me and logo. the Microchip logo .md PtC 3*e registered trademarks and inTauch i* a trademark of Microchip Technology fOCor pouted in She U.5A „md other countries. All other trademarks, mentioned tierCift are (MOUtr ty oT 6 lien respective companies 2010. Microchip Technology Incorporated, All RiqtitS fleservod ME25VEnq.'[!3.1Q Microcontrollers Digital Signal Analog Memory Controllers The reader/advertiser promise If you are not in the electronics indus- try, or without a format qualification in the field, it may be good to realise that electronics as a pastime would be non-existent without the wide diversity of manufacturers, distributors and sup- pliers of equipment, tools, components and CAD software — the friendly ones of course. Although some readers have expressed a desire to see a version of Elektor without any advertising pages, short discussions on the phone or by email are usually sufficient to agree that their wish is unrealistic- For one thing, our advertisers make up for a good part of our income, the other main pillars being subscribers, newsstand sales and product sales. On the other hand, from a reader viewpoint, advertisers are the gateway to services and products (including components and tools) that are essential to enjoy electronics as a pastime, or pursue it at any level in education. Sure, old hands with a fully loaded elec- tronics workshop may object to seeing basically the same advertisers for years on end. But then, when 1 was learn- ing about electronics at a young age, l believe I got as much information and fun out of browsing adverts, comparing component prices and seeing the big names in industry, than from actually reading articles, trying to understand it all and building circuits in front of me, I am happy to say that Elektor is attract- ing an increasing number of companies, big and small, advertiser or not, wishing to run projects with us. Recently, 'pro- jects 1 has taken on a wider meaning in also covering reader offers and contests. Together with our American colleagues at Circuit Cellar, we're officially launch- ing the NXPmbed Design Challenge at Embedded Systems Conference in Boston, USA on September 20-23. Invariably, reader offers and contests take a lot of time and effort to arrange exclusively for you — or should 1 say "for your pleasure”. More is in the pipeline. Jan Suiting, Editor (and celebrating 25 years with Elektor this month) 6 Colophon Who's who at Elektor magazine. 8 News & New Products A monthly roundup of all the latest in electronics land, 14 The 5532 OpAmplifier (1) The ME5532 Is a great audio opamp — been there, done that! But if you connect enough of them in parallel you suddenly have high-end power amplifier. Here we discuss the technicalities of doing just that, 20 LabView Embedded for ARM pCs If you think that LabVIEW can only be used for producing attractive man/machine interfaces for esoteric applications, then this article is for you. 22 Measure that Current! Ask an electronics enthusiast whether he or she has a clamp meter, and youll hear that they're more suitable for electrical installers and service technicians. Nevertheless, in many cases a clamp meter can be just as useful as a multimeter. 30 FPCA Design Simulation A primer on using Quartus Web Edition and ModelSim Altera Edition. 36 CL-3 Digital Rotary Combination Lock A long time ago the CL-3 was 5 piece of 'black box' electronics. Today it's been redesigned as an open source project. 40 One-button Data Entry Here’s how to double the function of a pushbutton in a user interface. 43 Discover the STM32! Development kits are a wonderful way to get started with microcontrollers, and cheap tool 44 Electrolytic capacitors in audio circuits Things to keep in mind when designing electrolyses into audio signal paths. 4 10-2010 elektor CONTENTS Volume 36 October 2010 no. 406 14 The 5532 OpAmplifier (1) ], Clarkson: “The (NE)5532 is audio's most popular dual opamp in the wor/d". j. May: "An interesting power amplifier can be made by connecting enough 5532s in parallel, how about 32 for a start?” R. Hammond: "This may sound like a radical course of action, but it actually results in a very simple amplifier with high-end performance." 22 Measure that Current! As opposed to multimeters, current damp meters aren't limited to currents of a few amperes. They also don't need to cost much more than a multimeter. Here we examine the features of twenty clamp meters suitable for measuring AC and DC current, i n price classes from a few dozen pounds to several h un d red pounds. 30 FPGA Design Simulation As soon as you add complex digital logic to give your circuit: a bit of intelligence, most conventional simulators are no longer up to the task. In such cases, it's neces- sary to use an emulator to mimic the behaviour of the logic system. 48 GPS ft. Propeller A more versatile GPS receiver for in_■ : E _ :*■, Street, iondon ECiA, England Telephone -44 2 ; “ 4^9 4073 Mgson internaoona Y^Pra. Cambridge House, Gogmare Lane, Chertsev, Surrey KTt 6 gAP, England. Telephone: -44 1932 564999. Fax: -44 1932 564998 Emai f ; r.el gar@huson me dia .com Internet: www.husonmedid.com 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 carriers and article texts published in our books and magazines (other than third-party advertisements) are copyright Elektor international Media b.v, and may not be reproduced or transmit- ted in any form or by any means, including photocopying, scan- ning an recording, in whole or in part without prior written per- mission from the Publisher. Such written permission must also be obtained before any part of thrs publication is stored in a retrieval system of any nature. Patent protection may exist in respect of circuits, devices, components etc. described in this magazine. The Publisher does not accept responsibility for failing to identify such patents) or other protection. The submission of designs or articles implies permission to the Publisher to alter the text and design, and to use the contents in other Elektor International Media publications and activities, the Publisher cannot guaran- tee to return any material submitted to them. Dis l id 1 r'ri l j i Prices and descriptions of publication-related items subject to change. Errors and omissions excluded. '■ Elektor i ntcr nat loti d Media b.v. 2010 Prinled in the Net hsrtands elektor 10-2010 7 NEWS & NEW PRODUCTS Enhanced range of USB 2.0 to serial UART converter cables Future Technology Devices International Limited (FTDI) have announced the avail- ability of their TTL-232RG family of USB to TTL serial UART converter cables. The TTL- 232RG cables build upon the existing FTDI family of USB to TTL cables, by offering new versions to support an extended variety of voltage I/O levels. The cables feature a USB to serial converter PCB encapsulated within a standard type TV USB connector with a wire-ended asynchronous UART output. The cables are aimed at providing USB connec- tivity within applications with serial UART ports. The cables provide a fast and simple method for enabling USB connectivity in such applications, with minimal changes to existing user software. A range of cables are available to for a vari- ety of voltage I/O levels including +1.8 V T +3,3 V, +5.0 V or at user specified levefs t to provide UART interfacing to devices such as MCUs, CPUs or FPCAs at a range of voltage levels. The cables derive power from the USB interface and have integrated voltage regulators removing the need for designers to provide external power or have voltage level shifters on their boards. Further, the cables can be used to provide an optional power output ranging between +1 .8 V and +5.0 V for powering external circuitry. The TTL-232RC cables feature the FTDI FT232R USB 2.0 to UART converter 1C with associated circuitry integrated within the cable USB connector. The FT232R man- ages the complete USB protocol within the device — meaning that no user knowledge of USB Is required. The UART interface sup- ports data transfers at up to 3 Mbps. Using the FTDI’s Virtual COM Port (VCP) drivers, users can easily access the UART interface as a (virtual) COM port with existing software applications, removing the need for any redesign. The FTDI D2XX drivers are also available to support application develop- ment using high-level software languages. FTDI’s royalty free drivers include Micro- soft WHQL certified drivers for Window based operating systems, as well as drivers for Linux and Mac 05 operating systems. All drivers are freely available for download from www.ftdichip.com/FTDrivers.htm. All cables are FCC/CE compliant. The range of USB to UART cables includes: TTI-232RG-VSW3V3-WE: USB cable with wire-ended UART connections at +3.3V voltage levels and +3.3 V / 50 mA rated power output. Available now. Pricing $21 .07 for single quantity. TTL-232RG -VREC3 V3-WE: USB cable with wire-ended UART connections at +3.3V voltage levels and +3,3 V / 250mA rated power output. Available now. Pricing $24.64 for single quantity. TTL-232RG-VREG 1 V8-WE: USB cable with wire-ended UART connections at +1.8 V voltage levels and +1,8 V / 100 mA rated power output. Available now. Pricing $24.64 for single quantity. TTL-23-2RG-VSW5V-WE: USB cable with wire-ended UART connections at +5 V voltage levels and +5 V / 450 mA rated power output. Quantities available in August. TTD232RG-VIP-WE: USB cable with wire- ended UART output connections at user supplied voltage levels. Available now. Pricing $19.45 for single quantity. www.ftdichip.com (100554-VIII) Silabs: wireless remote control on a chip Silicon Laboratories Inc, have introduced an EZRadio® wireless 1C solution designed to reduce the cost and complexity of one-way wireless links used in a wide range of con- sumer, Industrial and automotive systems. The new Si4O10 system-on-chip (SoC) RF transmitter enables developers to optimize remote keyless entry (RKE), garage door opener, remote control, building automa- tion and security device designs for the low- est system cost and highest performance while ensuring one-way link integrity. The Si401 0 RF transmitter is the industry’s first single-chip remote control 1C requir- ing onfy one external bypass capacitor, a printed circuit board, battery and externa! case with pushbuttons to create a complete wireless remote control. Based on a pat- ented crystal-less architecture, the 51401 0 achieves ±1 50 ppm carrier frequency accu- racy over the commercial temperature range and ±250 ppm over the Industrial temperature range — twice the accuracy of traditional surface acoustical wave (SAW)- based transmitters — without using an external crystal. Sjogb- r J]jjp yy]fs? V'jnifvi JD The SS4010 transmitter SoC is best paired with Silicon Labs 5 new Si43 1 x RF receivers to enable a transmitter/receiver solution that substantially reduces the total bill of mate- rials (BOM) and saves valuable board space for one-way link systems operating in the sub-GHz range (from 27 to 960 MHz). The 51431 x receivers 1 state-of-the-art integra- tion requires only two external antenna- matching components, a crystal and a bypass capacitor while eliminating the need for costly RF SAW a nd i F cera mi c fi Iters. The Si40 1 0 is the first SoC transmitter with automatic antenna tuning, featuring a pat- ented tuning circuit that automatically fine tunes the antenna for optimum transmit efficiency and constant output power. Vari- ations in transmit frequency due to PCB loop antenna manufacturing tolerances and environmental variations can lead to sig- nificant antenna inefficiencies and wasted power. The Si 40 10 s antenna tuning circuit continuously maximizes antenna efficiency by adjusting an on-chip variable capacitor to resonate with the antenna's inductance. The Si4010 supports programmable edge rate control for on-off keying (OGK) mode to reduce harmonic emissions and comply with governmental RF regulations. It also outperforms competing discrete solutions, offering +10 dBm output power, excep- tional range and robust links. The 5i401Q contains an embedded 8051 -compatible MCU core with 4 kB of RAM. 8 kB of one-time programma- ble (OTP) non-volatile memory, a 128-bit EEPROM and 1 2 kB of ROM for library func- tions. These ROM-based functions enable developers to easily implement complex 8 10-2010 elektor NEWS & NEW PRODUCTS f Xbee SIP adapter Parallax's new XBee SIP Adapter (#32402; $24.99) is fully-assembled, small-footprint solution for inter- facing the most commonly-used XBee module fea- tures with your 3.3 V or 5 V microcontrollers. With many XBee adapters on the market, Parallax gave this design very careful consideration to the specification to customize the product for educational and hobby uses* The 2x5 dual SIP header makes a sturdy connection to your breadboard or through- liole board, and brings the basic connections to your prototyping area without taking up a lot of space* The more advanced XBee features are still accessible, through addi- tional headers on the module. Features: Onboard 3.3 V regulator 5 V to 3.3 V logic translator buffers common I/O pins Six status indicator LEDs for Power, Tx, Rx, RSSI, Associate and mode (Sleep/ON) Small footprint dual SIP header provides support and allows easy Interfacing to DOUT (TX), DIN (RX), RTS, 5 V supply and ground 5-pin female header connections provides interfacing to other XBee pins such as sleep, reset and associate A row of 1 0 plated through-holes with 0.1 " spacing allows the option of soldering jumper wires or a header (not included) for access to the remaining XBee pins In advanced applications An additional plated through-hole gives access to 3.3 V output for ADC reference (VREF) when required Adapter board is pre-assembled — no soldering required for using most common XBee features Compatible with all Parallax microcontrollers, including the 5 V BASIC Stamp mod- ules and 3.3 V Propeller PSX32A www.parallax.com (100639!) features such as security encryption into their remote controls by using proven code to reduce risk and development time. The MCU's on-chip digital peripherals include , wake-on-touch general-purpose I/Os (GPIOs), a patented 20-bit EEPROM coun- ter providing one million cycles of read / write endurance, an LED driver, sleep tim- ers, a debugger and a high-speed 128-bit Advanced Encryption Standard (AES) accel- erator for secure one-way links* To accelerate the development of one-way link products, Silicon labs offers a rich set of hardware and software tools including the 4O10-DASKF_434 evaluation kit to dem- onstrate RKE fob functionality, the 4010- DAAKF_434 evaluation kit to demonstrate AES encryption functionality in RKE fobs, and the 401 0-DKKF_434 development kit providing a comprehensive Si40 1 0 software development environment. www.silabs.com/pr/wireless. (100554-XII) Well kitted amplifier Piccolo is a new 50 watt amplifier kitset from Italian kitset specialist APRS! using the famous LM3886 amplifier chip to create a great sounding, easy to build amplifier. Fea- tures that make the piccolo great sounding and easy to build include low negative feed- back; most of the existing gainclone' kit- sets “borrow” from the design of the almost mythical Japanese ’47 Lab f amplifiers which used the LM3875, While using roughly the same circuit, the Piccolo uses less negative feedback which makes it unconditionally stable. This contributes to its sound having a great sense of ’ease'* Vet retaining low dis- tortion (0.03%) and generous bandwidth. The Piccolo's power supply is integrated in each 90x90mm (approx* 4*' sq) mono -block module. As the power supply of any ampli- r er is actually part of the circuit, integral- t can have large benefits in keeping the : t short and noise to a minimum. Small pOAc - supply capacitors are paralleled to q'r. e r r::er performance than single large ones. ~ mese modules can be built in to the Gee :a:e: ez Power™ chassis to form a ste- reo amp wer. they are ideal for active loud- speakers and their small size is great for quality multi channel systems. The amplifier design cuts down on the wir- ing and possibility for mistakes. Piccolo manages to provide excellent performance with remarkably few components* The only extra electrical component you need is a transformer* The build is made even easier as the PCB slots straight into the 50 mm high ezPower™ heatsink chassis from New Zea- land company Design Build Listen who also distribute the Idts, meaning no metal work- ing is needed. www.desig nbuildlisten.com http://home. teletu .Et/APPSI/APPSI web. html (100639-11) elektor 10-2010 9 NEWS & NEW PRODUCTS New function image supports IMXDIMB design CML Microcircuits has announced the release * of a new Function Image for the CMX7 1 3 1 and CMX7141 Its sup- porting the develop- ment of NXDN compat- ible digital voice radio equipment. Called NXDN, its com- mon air interface (CA1) is a result of a joint development between Kenwood Corporation and ICOM incorporated* NXDN digital radio equipment supports commercial Private Land Mobile Radio (PLMR/LMR) to serve light commercial, more demanding business and industry, and public safety applications, even on 6.25 kHz channels. The technology sat- isfies the US Federal Communications Commission (FCC) Part 90 ■narrowbanding 1 requirements; as of December 2009, 70,000 RF channel licenses were approved for NXDN operation. CML is com- mitted to the promotion, support and development of this exciting new radio technology. TheCMX7131 andCMX7141 are digital PMR processors built on CML’s proprietary FirmASIC technology and are suitable for use in a number of digital radio systems now including NXDN, FirmA- SIC component technology enables on-chip sub-systems to be configured by a Function Image, a data fife that is uploaded during device initialisation that defines the device's function and feature set* This technofogy provides the flexibility for the CMX7131 and CMX7141 to support dPMR, DCR and NXDN radios as well as ana- logue two-way radios. The new Function Image developed by CIVIL provides a number of features very important to NXDN design, including; a high per- formance 4FSK data pump supporting soft-decision coding mode (which improves the reliability of the data link) and integrated RRC filters; a high performance, autonomous AFSD that greatly simplifies host microcontroller development and risk, differentiating between frame sync cases, which can also reduce an NXDN receiver's aver- age Rx power consumption; a voice codec (ADC and DACj for micro- phone/speaker paths to complement an external AMBE-3GG0 voco- der device and integrated auxiliary functions that reduce total BOM cost and size. As an aside, the Chairman of the NXDN Forum recently announced that the NXDN Forum and the dPMR MoU have agreed to collabo- rate on issues of common interest in the promotion of 6.25 kHz FDMA technology. CML has made available, on it's website, a down- loadable brochure describing ETSI's role in Digital Private Mobile Radio (dPMR) available in English, French, Italian and Spanish. www.cmlrmcro.com www.nxdn-forum.com (i 00639-!' V) Mobile lighting controller The AS3676 from austriamfcrosystems is a highly Integrated Light- ing Management Unit (LMU) with Ambient Light Sensing (AL5) and Dynamic Luminance Scaling (DLS). The chip integrates 1 3 current sinks, a high-efficiency step-up DC-DC converter and high-power nurve neTtuarKs llc S lF BitMainPCBBoaffir amepad Controller, y Page Printed Manual:— ^ lel AVR ISP MKM Programmer, V Power Supply Si A/V Cable, 'C Serial Port to XGS Converter. PC DVD-ROM , 1GB Micro SD Card + Adapter Sonus: eBooks on Hardware, Ga me Console Design, and More ji w w w . elektor. com charge-pump, an analog-to-digital converter (ADC) and a pro- grammable low drop-out regulator (LDO), all incorporated with advanced algorithms for high-efficiency display and keypad back- light, funlight, smartlight and other advanced portable illumination and indication effects. The integration of the main illumination features facilitates con- trolling all mobile lighting with a single chip. This simplifies hard- ware and software development time and shortens time to mar- ket, The features and flexibility of the AS3676 make it well suited for a number of portable consumer electronic products, includ- ing mobile phones, mobile TV's, mobile DVD players, mobile GPS devices, and MP3 players. With both ALS and DLS supported by the AS3676, power conservation through automatic adjustment of back- lighting and other LED functions is greatly simplified. In addition, built-in fea- tures like automatic dimming, pattern generation and audio sync fu nction enable eye catching visua I effects with minimum load on the baseband processor. The AS3676 is available in a CS-WLP3G, 3x2,5 mm package. It oper- ates over a wide 3, G to 5.5 V supply range, and over a temperature range of -30 to +85 °C. www. a u st ria m j c rosy s te ms.com/ LM U/ A S3 67 6 (100639-111) 10 10-2010 elektor VISA Electron Motor Drivers/Controllers Hk* JA 4 A‘ y ». A 4 j^V\T<7v A-V ■«*. -+4 • '• -•* *.•• * Aj* * ••*■*.+ «*■ •!-'■* ►Si-y % r •* ■»■ • . . ■ ■; ■■ . •- ►_+- r + ^ ^ | ■ j +4. j 4 ^ ^ 4. j, T » . .-. * J'. .4 ^K.' n -1 _ tj ^-r ^ * -— - , * , . Here are jus l a few of our controller and driver modules for AC DC, Unipolar/Bipolar stepper motors and servo motel's. See website for full range and details. New! 4-Channel Serial Port Temperature Monitor & Controller Relay Board 4 channel computer serial port temperature monitor and relay con- troller with four inputs for Dallas DS18S20 or DS18B20 digital ther- mometer sensors (£3.95 each). Four 5 A rated relay channels provide output control Relays are independent of sensor channels, allowing flexibility to setup the linkage in any way you choose. Commands for reading temperature and relay control sent via the RS232 interface using simple text strings. Control using a simple terminal i comms program (Windows HyperTerminal) or our f ree W i ndow s a pp I i catio n sof twa re . Kit Order Code: 3190KT - £69.95 PIC & ATMEL Programmers We have a wide range oflow cost PIC and ATMEL Programmers. Complete range and documentation available from our web site* Programmer Accessories: 40-pin Wide ZIP socket (ZIF40W) £14.95 levdc Rower supply (PSU120) £19,95 Leads: Serial (LDC441) £3.95 / USB (LDC644) £2.95 Most items are available in kit form (KT suffix) or assembled and ready for use (AS prefix). N0.1 SOTS Postage & Packing Options (Up to 0 5Kg gross weight) UK Standard 3 7 Day Delivery - £4 95, UK Mainland Next Day Delivery - £1 1 95 Europe (EU) - El 1 95 Rest of World - £12.95 (up lo 0 5Kg) [Order online for reduced price UK Postage! We accept all major credit/ deb it cards. Make cheques/POs payable to Quasar Electronics. Prices include 17.5% VAT Please visit our online shop now for details of over 500 kits, projects, modules and publications. Discounts for bulk quantities. © SOLO 8-Ch Serial Isolated I/O Relay Module Computer controlled 8- channel relay board. 5A mains rated relay outputs. 4 isolated digital inputs Useful in a variety of control and m sensing applications, Con- trolled via serial port for programming (using our new Windows interface, terminal emula- tor or batch files). Includes plastic case 130x100x30mm, Power Supply: 12Vdc/50QmA. Kit Order Code: 3108KT - £69.95 Assembled Order Code: AS3108 - £84.95 Computer Temperature Data Logger 4-channel temperature log- ger for serial port. °C or °F. Vn Tp? 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 DS182G sensor Kit Order Code: 3145KT - £19.95 Assembled Order Code: AS3145 - £26.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, l2Vdc/6mA (standby). Two and Ten channel versions also available. Kit Order Code: 31 8QKT - £49.95 Assembled Order Code: AS318Q - £59,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 - £74,95 Assembled Order Code: AS3140 - £89.95 QUASAR electronics |T^ f faefronfc KTJ Spec/crt/sfe Since 1993 Computer Controlled / Standalone Unipo- lar Stepper Motor Driver Drives any 5-35Vdc 5, 6 or 8-lead unipolar stepper motor rated up to 6 Amps. Provides speed and direc- tion control, Operates in stand-alone or PC- controlled mode for CNC use. Connect up to six 31 79 driver boards to a single parallel port. Board supply: 9Vdc. PCB: 8Gx50rnm. Kit Order Code: 3179KT -£15,95 Assembled Order Code: AS3179 - £22.95 Computer Controlled Bi-Polar Stepper Motor Driver Drive any 5-50Vdc, 5 Amp bi-polar stepper motor us- ing externally supplied 5V levels for STEP and DI- RECTION control. Opto- isolated inputs make it ideal for CNC applica- tions using a PC running suitable software. Board supply: 8-3GVdc. PCB: 75x85mm, Kit Order Code: 3158KT - £23.95 Assembled Order Code: AS3158 - £33,95 Bi-Directional DC Motor Controller (v2) Controls the speed of most common DC motors (rated up to 32 Vdc, 10A) in both the forward and re- verse direction The range of control is from fully OFF to fully ON in both directions. The direction and speed are controlled using a single potentiometer. Screw terminal block for connections. Kit Order Code: 3166v2KT - £22.95 Assembled Order Code: AS3l66v2 - £32.95 DC Motor Speed Controller (100V/7.5A) Control the speed of almost any common DC motor rated up to 100V/7.5A Pulse width modulation output for maximum motor torque -■ - ~sds. Supply: 5-15Vdc Box supplied. ~ e ^ (mm): 6OWx1O0Lx6QH, - : Code 3Q67KT -£18,95 i : T “ : ec Order Code: AS3Q67 - £26,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/G.5A Kit Order Code: 3142KT - £59.95 Assembled Order Code: AS3142 - £69.95 USB & Serial Port PIC Programmer USB/Serial connection. Header cable for ICSP Free Windows XP software. Wide range of supported PICs - see website for complete listing. ZIF Socket/USB lead not included. Supply: l6-18Vdc. Kit Order Code: 3149EKT - £49.95 Assembled Order Code AS3149E - £59.95 USB ■All-Flash 1 PtC 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 - £49.95 See website for full range of PIC & ATMEL Programmers and development tools. Quasar Electronics Limited PO Box 6935, Bishops Stanford CM23 4WP, United Kingdom Teh 01279 467799 Fax: 01279 267799 E-mail; sales@quasarelectronics.com Web: www.quasarelectronics.com | t I J n jr j ^ 1 1 ft tlltlT* j .Jit * tjtH * ** H M . I ^ J - > t \ a A | ^ Jf, p mm Jfi ■ iA : : i : : nr uii fijdimii&j \ ' i-mJJ f i_vvPnv u ij Secure Online Ordering Facilities * Full Product Listing, Descriptions & Photos • Kit Documentation A Software Downloads Controllers & Loggers Here are just a few of the controller and data acquisition and control units we have. See website for full details. Suitable PSU for all units: Order Code PSU445 £7.95 NEWS & NEW PRODUCTS Handheld spectrum analyzer with frequency coverage up to 43 GHz Anritsu Company introduces the MS272xC Spectrum Master series that provides the broadest frequency range ever available in a handheld spectrum analyzer. Providing fre- quency coverage up to 43 GHz in an instrument that weighs less than 8 lbs., the M5272xC series is also designed with an assortment of applications to test the RF physical layer, making it easier than ever for field technicians, monitoring agencies and engineers to monitor over-fhe-air signals, locate interferers, and detect hid- den transmitters. The MS272xC Spectrum Master is a vastly superior product com- pared to existing handheld and benchtop spectrum analyzers. To further lighten the load, the MS272xC Spectrum Master is inte- grated with a spectrum analyzer, and can be ordered with a chan- nel scanner and interference anaJyzerto conduct all common field measurements, eliminating the need for multiple instruments. A number of 3G/4G options can be easily incorporated into the hand- held spectrum analyzers to measure LTE, HSPA+, W-CDMA, CDMA/EV-DO, G5M/EDCE. TD-SCDMA/HSDPA, and WiMAX signals. Users can monitor and measure the spectrum quickly, as the MS2726C Spectrum Master has a fast sweep time of 27 seconds for a 43 GHz span with a 30 kHz RBW. Accuracy is not sacrificed for speed, however, as the MS2726C delivers excellent phase noise of -1 00 dBc/Hz at 1 0 kHz offset at 1 GHz and dynamic range of 1 04 dB* The MS272xC series utilizes the field- proven Spectrum Master design, A rugged housing can withstand the day-to-day operations associated with field use and its light weight makes it easy to carry the M5272xC analyzer up towers. It has a field- replaceable long-life battery and wide operating temperature of -10 to +55 degrees celdus. A large daylight viewable display makes it easy for users to see results in any environment. Display modes include a red night vision mode a black and white mode as well as two full color modes. www. anritsu. com (to 063 g -V I) “See us at Hamfest! D pAl( ® ^ ^ - and meet the designers. ” ■.if lv* Tel. 01298 70012 www.peakelec.co.uk sales@peakelec.co.uk elBCtfOniC d65iQfl ltd 1st -2nd October 2010, 10am to 4pm at the Newark Showground www.nationalham fes t. org. uk Personalisation Service! For your existing or new Peak Allas product (LCR. DC A or ESR). Just bring il along and have any name or callsign programmed in to your unit Repair, Upgrade and Calibration, Special Offers We know that you rely on your Peak Come to our stand to instrument so bring it over for a check out our compteie overhaul, or maybe just special deals on a fresh calibration combined instrument Prices are very economical, even packs, refurb units for major repair work and other special New fascia s f new probes, offers. new firmware, new anything! You need to be there ALL DONE AT THE SHOW! to snap them up! See the whole range - Try out the whole range. Sometimes you just want to try oul the equipment before you decide what suits you best, Thai’s great, wo ve got all our instruments and accessories for you lo play wilh. Bring your own components to lest too! Atlas ESR Pius -Model ESR70 Measure capacitance arid ESR to find troublesome capacitors. Great for short-tracing too ESR measurement resolution down to 0 01 ohms. NEW! Auto analysis-start! Peak Electronic Design Ltd. West Road House. Buxton, Derbyshire, SKI 7 6HF New Probes and Accessories Check out the new retnforced compact single instrument carry case complete with distinctive Peak branding Our LCR and ESR s now feature our universal 2mm plug connectors You can securely connect a very wide range of probes, hooks, crocs, sharp prods, tweezers Von can even upgrade your existing unit, book online or see us at Hamfest . r MC Af/as DCA * Model DCA55 The famous Peak Alias now c - premium probes Just connect any way round to sen * me type of semiconductor pinout and lots of parameters too Complete with battery user guide and probes Darlingtons MOSFETs Diodes Tra nsistors LEDs and more... Adas LCR - Model LCR40 Passive component analyser. Automatically identify and measure inductors, capacitors and resistors. Auto frequency selection for analysing at DC, 1 kHz, 1 5kHz or 200kHz. NEW Universal 2mm probe connectors Supplied with hook-probe$ T fitted battery and illustrated user guide. inductance: luH- 10H Capacitance: IpF - IO.OOOuF Resistance: 1 Ohms - 2M Basic Accuracy: Resistance )% Inductance and Capacitance 1 5% As featured in Elektor LCR Shootout! 12 10-2010 elektor From the makers of Elektor! 10 2010 IUSA] S 14,95 •AUS1S 29.90 JIVJZIS 36,00 (SARI 214.00 |UK £ 9,90 lontrol electronics and heat management or LED lighting .ED projector technology i/oltage converter with constant- current output : or Power LEDs y .ED power and control unit on a single chip f DIY projects: .mbiiight with Bluetooth udget LED dimmer omputerised LED Christmas light rogrammable LED lamp ecial Project 772044 70B0O Order now at www.elektor.com and get free P&P! 100124-1 v3- 0 OELEKTOR K4 3 > <3 *£$ ' a X Ti •. Fuji j y psT^'j 1 Jfegll Kj-jJ r f V. 4 si \ £ 1 i t vft 1 < * t l Ihi By Douglas Self (UK) . . t I _ i „l J _ £ _ , . J _ / fc 1 rV puiar di j 3 1 0 t primp i 1 n I he wo flu of auo fo IS til 0 f IM 1 1 ie by connec 1 1 no 6 ■nough 5532s in paral let , how about 32 for a Start 7 This mav sou nd 1 Wise* r -v ft i r n 1 1 1 Kv cl 1 cllllLdl 1 of action u til : it a dually works vt >ry well. maki no it poss ible t le ai nplifier t hat tains not only the excellent linear! ty but a Iso th 10 power-s uppl v re ectton ^ n o tne i n bi lilt overload protection of the 5532, which reduce While not exactly a brand-new design, the type (IM£)5532 dual operational amplifier (opamp) is a very capable device giving low distortion with good load-driving capabilities, and a remarkably good noise performance. It is only quite recently that better opamps for audio work have become available. While these can give truly outstanding results, the cheapest of them costs ten times more than the 5532, which is available at a remarkably low price — in fact it is one of the cheapest opamps, because it is so widely used in audio applications. It should be mentioned at once that the obvious limitation with using opamps to drive loudspeakers is that the output voltage swing is limited compared with a conventional power amplifier, and using a single-ended array of 5532s will give about 1 5 W, rm into 8 Q. This output ca n be g reatly extended by using two such amplifiers in bridge mode; one amplifier is driven with an inverted input signal so the voltage difference between the two amplifier outputs will be doubled, and the power output is quadrupled to about 60 W rms into 8 IT This should be enough for most domestic hifl situations. The other unalterable limit set by the opamps is the maximum output current, set by the internal overload protection. A single 5532 section (one half of the dual package) T4 10-2010 elektor Specification — per channel, 8 ohm load Supply voltage Input sensitivity Input impedance Output power, sinewave Output power bandwidth Slew rate Rise time Signal/noise ratio ±183 V - unbalanced * balanced - unbalanced - balanced -0.1 %THD - 1 %THD (1 W ref.} -1G8dB(B = 22Hz-22 kHz li 840 mV (16 W. 1 % THD) 833 mV (16 W. 1 % THD) 38.8 kn 93.6 kn 16 W 16,8 W 13 Hz - 275 kHz 5 V/ps 4 ps 1 1 0 dBA r/ unweighted) Harmonic distortion + noise - 0,0005% (B - 22 kHz, 1 kHz, 1 W) - 0.0009% (B = 80 kHz, 1 kHz, 1 W) - 0.0004% (B = 22 kHz, 1 kHz, 8 W) - 0.0005% (B - 80 kHz, 1 kHz, 8 W) - 0.003 % (B = 80 kHz, 20 kHz, 8 W) Intermodulation distortion -0.001 2% (1 W) - (50 Hz : 7 kHz = 4:1) 0,001 5% (8 W) Dynamic IM distortion Damping factor DC-protection Quiescent current - 0.0011% (1 W) - (3, 1 5 kHz square wave + 1 5 kHz sine wave) 0,0035% {8 W) -194(1 kHz) - 1 1 1 (20 kHz) ±1 ,5 V 300 mA will drive 500 Q to the full voltage output, though it is advisable to keep the loading lighter than this to maintain low distortion at high levels. If 4 O operation is required, twice as many opamps must be used to supply the doubled current demand. This also applies to bridged operation into 8 Q. The system is designed so that either single- ended or bridged operation can be used; the basic design described here gives a working stereo amplifier with just three PCBs. The amplifier cards can be paralleled without problems, and facilities are provided to connect more PCBs in parallel for driving low-impedance speakers. Overload protection is inherent in the : Damps, but output relays are used for on/ muting and to protect loudspeakers against a DC fault A tour of the design The schematic in Figure 1 shows one channel of the complete amplifier, which consists of unbalanced and balanced line inputs, and the power amplifier itself, which is divided into a +22.7 dB gain stage and an array of paralleled output opamps configured as voltage-followers, giving the maximum amount of negative feedback around them to minimise distortion. Let's have a look at the various sections of the circuit. The unbalanced input This consists simply of RF filter R1 , Cl and DC-drain R2, which are directly connected to the gain stage when JP1 is in the 'unbalanced' position. The balanced input This amplifier is an innovative design that gives very low noise. The conventional balanced input stage built with four 1 0 kQ resistors and a 5532 opamp has a far worse noise performance than a simple unbalanced input, and is also much noisier than most power amplifiers; output noise is approximately -104 dBu. This balanced amplifier here solves this problem partly by the use of a dual balanced stage (IC5A, IC5B) amplifier that partially cancels the un correlated noise from each amplifier, giving a 3 dB noise reduction, and in a similar way improves the GV1RR; it also uses much lower resistor values than usual (820 Q instead of 1 0 kQ) which produces less Johnson noise in the first place. This is only possible because it is driven by unity-gain buffers IC4A, IC4B, which also allow the input impedances to be much higher than usual, preventing loading of external equipment and further improving the CMRR, The noise output is less than -1 12 dBu, an 8 dB improvement over conventional technology. The gain stage The main input amplifier is another innovative design that achieves very low distortion by spreading the gain required over three stages. +22.7 dB could easily be obtained with one opamp but 5532s are not elektoj - 10-2010 3 +iav ici , l fl IDfhrt ■ 1«n ! Lr J _ <1 +10V to 1»n -13V -10V [Cl, IC2, iC3 = NE5532 -18V R16 K4 circuit diagram of the basic NE5532 audio amplifier (one channel shown). 16 102010 elektor elektor 10-2010 V +23V 1M124-12 Figure 2, The symmetrical power supply is dimensioned for the 2x1 5-watt, 8 ohm basic version of the amplifier. completely distortion-free, and the THD would be significant. The first stage (IC1A, IC1B) gives +10.7 dB of gain; the two outputs are combined by R8, R9 to give a 3 dB noise advantage, as in the balanced amplifier. The second stage JC2A gives +6 dB of gain. The gain is less to maximise negative feedback because the signal level is now higher. 3C2B is a unity* gain buffer which prevents the 1 k Q input impedance of final gain stage IC3B from loading the output of 3C2A and causing distortion. IC2B is less vulnerable to loading because it has maximal negative-feedback. IC3B gives the final +6 dB of gain; it is used in shunt-feedback mode to avoid the common-mode distortion which would otherwise result from the high signal levels here* it has a 'zero -impedance 1 output, with HF feedback via C8 but IF feedback via R13, so crosstalk is kept to a minimum while maintaining stability with load capacitance. The output at K3 is phase-inverted and can be used for bridging. 1C3A is a unity-gain inverting stage which corrects the signal phase. The output is also of the ‘zero-impedance’ type. The power amplifier The power amplifier consists of thirty-two 5532 dual opamps (i.e. 64 opamp sections) working as voltage-followers, with their outputs joined by 1 Q current-sharing resistors. These combining resistors are outside the 5532 negative-feedback loops, and you might wonder what effect they will have on the output impedance of the amplifier. A low output impedance is always a good thing, but not because of the so-called ‘damping factor’ which is largely meaningless as the speaker coil resistance always dominates the circuit resistance. ‘Damping factor* is defined as load impedance divided by output impedance; we have 64 times 1 Q resistors in parallel, giving an overall output impedance of 0,01 56 f 1 . This gives a theoretical damping factor of 8 / 0,0 1 56 = 51 2, very good by any standards. The wiring to the loudspeaker sockets will have more resistance than this! The output opamps may be directly soldered into the board to save cost and give better conduction of heat from the opamp package to the copper tracks. However, on the prototype built in the Elektor labs, high quality sockets were used. Having a lot of opamps in parallel could make fault-finding difficult — if there is one bad opamp out of 32 then you are likely to have to do a lot of unsoldering (or 1C unplugging) to find it. The opamp array is therefore split up into four sections of eight opamps, which are joined together by jumpers K5-K12, so on average you would only need to unsolder (or pull out) four opamps to find a defective one. In my many years of experience with it the 5532 has proven a very reliable opamp, and I think such failures will be very rare indeed. There is an output choke LI for stability into capacitive loads, and catching diodes D1-D2 to prevent damage from voltage transients when current-limiting into reactive loads. The output relay and its control The output mute relay RE 1 protects the loudspeakers against a DC offset fault and gives a slow-on, fast-off action so no transients are passed to the loudspeakers at power-up or power-down. The relay is controlled from the power supply board. With reference to Figure 2, at power-up R17 charges C24 slowly to give a turn-on delay. In operation C21 is charged and 18 10-2010 elektor AUDIO & VIDEO 13 is on; when the AC power is removed C21 discharges rapidly, T3 turns off, and DS turns on T4-T5, which discharge C24 and cause the output relay contacts to be opened immediately. Even a brief AC power interruption gives the full turn-on delay. Normally T4 and T5 are off and D15 non- conducting, but if a DC offset fault applies either a positive or negative voltage via R13 or R14, T4-T5 turn on and the relays are opened at once to protect the loudspeakers. Power supply Again referring to the circuit diagram of the power supply unit in Figure 2, the ±18 V symmetrical supply is regulated by two type LT1083 T03-P positive regulators. When a 5532 sees one supply rail disappear, this opamp can get into an abnormal state in which it draws excessive current. This could obviously be catastrophic with this design, so the PSU incorporates a mutual -shutdown facility which shuts off each supply rail if the other has collapsed due to short-circuiting or any other cause. If the positive rail collapses, T2 turns on and disables the negative supply. If the negative rail collapses, T1 turns on and disables the positive supply. Cost This project uses quite a lot of 5532s; 37 in each channel, but that does not mean the cost is excessive. In Great Britain, 5532s can be had from Rapid Id for 24 p each at 100-off (Rapid are prepared to deal with anyone who has a credit card) This means that the cost of all the opamps would be about £18.00. To be continued Next month's closing instalment will cover approaches to constructing the amplifier on circuit boards, some performance figures obtained from our high-end test equipment, and an outline of challenges to those of you wishing to modify the amplifier for higher output powers and/or lower output impedance. Meanwhile this month's f-tafrs /ns/de section has a page or so on issues with electrolytic capacitors encountered while the first prototype of the amplifier was tested, (100124) Internet Link 1 . www.rapidonline.com PROGRAM PIC 1 cv wtrmm - ■ HNICAL WIDE-RANGE OF HARDWARE AND SOFTWARE LIBR< NUMEROUS READY TO USE PRACTICAL EXAMPLES : ■ . E LOPMENT TOOLS I COMPILERS I BOOKS „ , P 1An GET IT NOW www.mikroe.com elektor 10-2010 19 DEVELOPMENT SYSTEMS LabVIEW Embedded for ARM uCs Clemens Valens (Elektor France) If you think LabVIEW can only be used for producing attractive man/machine interfaces for esoteric applications, then this article is for you. If you are interested in easy programming for powerful microcontrollers, then you should read on too. And even if you haven't the least idea what LabVIEW is, don’t just turn the page, for it’s well worth taking a look at this took LabVIEW is flagship product from National Instruments, Originally designed as a too! for driving measuring benches and displaying data, LabVIEW has evolved a great deal in twenty-odd years and has become a powerful, unique graphic programming language. It’s the only tool on the market that makes it possible to develop an application on a computer, FPGA, or microcontroller using the same language and the same programming methods. It's what is known as a multipfatform language. A program 'written' In LabVIEW Embedded for ARM looks just like any other application written in LabVIEW, with a user interface and a diagram. In the case of an embedded application, the front panel may represent the board's peripherals, like a switch or an LED, but also debugging elements like variables. In LabVIEW Embedded, the user interface is only used for simulating and debugging the application. To give you an idea just what a LabVIEW for ARM program looks like, take a look at the screen snapshots illustrating this article. It’s a very simple application that compares twice the voltage (com- ing from the potentiometer on the board) with a threshold value. If the value is above this threshold, an LED lights up. The doubled voltage Is also sent to the analogue output (don't forget to remove the loudspeaker jumper). The magenta blocks (Figure 1 ) are the elementary I/Os correspond- ing to one pin of the microcontroller. LabVIEW offers a number of predefined ones, like the LEDs, but you can add your own — for example, for a relay. The green LED in the diagram is an element that appears on the front panel (Figure 2 ), it mirrors LED 1 on the board. On the front panel there are also the “threshold 1 and 'output' boxes. These are program variables that are not accessible on the board, but which can be modified or displayed during debugging. The ‘ 2 1 and 1 1 00 1 boxes are constants, and the triangles are math- ematical or logic operations. The large grey rectangle represents a loop (note the arrow' at the bottom right-hand corner). Everything within the rectangle is What’s in the kit? * DVD-ROM with LabVIEW and the LabVIEW Embedded for ARM module: these are Nl tools that let you program an ARM microcontroller board in a graphical fashion, * Kell ^Vision RealVIew microcontroller development kit: this is a standard integrated development environment (IDE) for programming a microcontroller in C/C++, assembler, etc. The IDE is called ^Vision, the toolchain is RealVIew. * U LIN 1(2 USB-jTAC adaptor for programming the microcontroller and debugging the application. * ARM microcontroller evaluation board. There are two models: the MCB2370U from Keil based on the LPC237S (ARM7TDMI-S) from NXP, and the EK-LM^SSgSa (Cortex-M3), a Texas Instruments thoroughbred, * instructions and two USB cables. Price of the kit as shown: € 8,949 For more details: www.ni.com/arm LabVIEW Embedded also exists for PSD and for 3 2 -bit microprocessors. 20 10-2010 elektor DEVELOPMENT SYSTEMS LabVIEW, u Vision & RTM Li Vision RealView can be implemented without LabVIEW and makes it possible to develop applications for other boards or your own hard- ware using an ARM fiC in the ‘traditional’ way. At the time of writ- . i rig . RealView supported over 260 processors with ARM7, ARM9, or Cortex- M3 cores. The kit includes a time-unlimited licence with one year's technical support from KeN (renewable), LabVIEW Embedded for ARM. on the other hand, requires use of pViston (supplied with the kit), except in simulation mode. The link repeated until the loop is ended. Here the loop never ends, since the stop condition (the red hexagon} is closed by the green box com taining the value ‘False' * where a value of ‘True’ is needed to exit the loop. The loop is clocked by the little metronome, which operates in such a way that it is run every 1 00 ms. LabVIEW is multitasking, which explains why the real-time operat- between LabVIEW for ARM andpVIsion Is RTM from Keil, a real-time operating system for microcontrollers. The program in LabVIEW is translated into a program in C which relies heavily on RTM. This is the program that is compiled by RealView into an executable for the microcontroller. Without the RTIVI libraries (or compatible ones, all you have to do is write them,..), it won t work. Note that the source codes for your LabVIEW program translated into C are accessible for inspection. tool (part of the GNU toolchain for ARM, not LabVIEW} gives a size of just over 34 KB, An application consisting of just an empty infi- nite loop produces a 14 KB executable and the compilation time Is just as long. Of course, LabVIEW Embedded’s real interest is for more com- am me do 1 00337 M ii« 10033? JvpfgfrtiOZMD Ftofwir ElJ*Kn AffKflSgt EtW ExftJWn F*f>f[re Ario EL ii ; 'Uo[tf fAt a? fflppi* «hon 5 3pts * * 1 100337 hy 01 FHCK 50 C < Figure 1 , Diagram for the test application. Figure 2, The test application user interface during debugging. ing system from Keil (see box) is needed to produce the executable for the microcontroller. To illustrate this multitasking aspect, a sec- ond loop has been added which continually interrogates the board’s push-button and which lights LED 2 when the button is pressed. The two loops run i ndependently of each other. Compiling this simple applica- : : n takes an astonishingly long : me — over a minute on the ;est computer (even though : 5 a fairly recent laptop: Intel Pentium T4200 @ 2 GHz, 4 GB RAM, Windows XP Pro SP3), This s due to the C compiler, which has a large number of files to pro- cess, The executable produced is in ELF format. The ‘arm-elf-size’ plex applications, A large number of functions (PSD, TCP/IP, serial port, maths, etc,) are available and ready to use. If you're short of a function, you can create it yourself or import it via a third- party DLL (your own, for exam- ple). LabVIEW Embedded can be adapted to your hardware; the evaluation board included in the kit is just one example. Once you've mastered Lab- VIEW Embedded, you have an extremely powerful too! at your disposal. However, do make sure you use a powerful computer, otherwise the time you've saved in programming will be wasted waiting for It to compile. (100337) Remember the riaht-click! The fact that LabVIEW is a graphical programming language doesn’t mean it is child’s play, even though N1 has gone to great lengths to explain everything properly. So do make sure you read the short instructions supplied in the kit, and don’t forget that a right-click can be helpful at all times. elektor 10-2010 21 CLAMP ME1 ERS Y*c*dc np meters test bench AGW CLAtfP McTER CAtlYfiMlf rnr m i nr.n i « ^ U1213A SO0 V CAT is TWOAtailCT, 5 “«VW4xJ By Harry Baggen (Elektor Netherlands Editorial) Everyone who has anything to do with electronics has at least a multimeter at home and on the work table. But what about a clamp meter? These instruments are often just as versatile as multimeters, and they aren’t limited to currents of a few amperes. They also don't need to cost much more than a multimeter. Here we examine the features of twenty clamp meters suitable for measuring AC and DC current, in price classes from a few dozen pounds to several hundred pounds. IF you ask an electronics enthusiast whether he or she has a damp meter, the usual response is that they're more suitable for electrical installers and service technicians* Nevertheless, in many cases a damp meter can be just as useful as a multimeter — and often even more useful. The current meas- uring range of most multimeters is limited to 1 0 A, which means you need to be care- ful that you don't exceed the maximum cur- rent rating and blow the fuse for the 1 0-A range or burn out the sense resistor. At the same time, we see more and more circuits that draw hefty currents, and this involves more than just measuring the input cur- rents of household appliances or other devices connected to the AC grid. Modern damp meters, which are also able to meas^ ure DC currents, open up a wealth of new possibilities. For example, you can measure the starter motor current in a car, measure how much current an electric motor in a model aeroplane draws From the battery, or measure how much current the CPU on the 22 lo-zoi □ elektor LAMP METERS motherboard of your computer guzzles. A multimeter is not really designed to handle a ny of these tasks, but a damp meter simply takes them in stride. Available products While looking through the catalogues of instrument suppliers, we quickly noticed that an enormous variety of damp meters is available. Some manufacturers have more damp meters than multimeters in their cat- alogues. This suggests that there is a large demand for these meters, the majority of which are most likely used in the electri- cal industry. However, as we already men- tioned, modern clamp meters are so ver- satile that they are also very attractive for all sorts of electronics applications. For instance, many modern damp meters can measure DC current in addition to AC cur- rent. and most of them can also make many other types of measurements. For example, the group of meters we examined includes models that can measure capacitance, fre- quency and temperature as well as volt- age and resistance. This makes them full- fledged substitutes for a multimeter. The main advantage is that they allow you to measure much larger currents, ranging from 1 00 to 1 000 A. so you don’t have to be constantly afraid of blowing a fuse or burn- ing out a resistor in your meter We did our best to select meters in various price classes from the enormous variety of available instruments. All of the selected meters can measure AC and DC current, and they are also suitable for measuring relatively small currents in the low ampere range. We also included a few clamp-on current probes (also with combined AC/ DC capability), which do not have their own display but can be connected to an existing mu Iti meter or to a n oscil loscope. upe ration The mechanical construction of a clamp meter is very similar to that of a power transformer. The jaws or yoke of the meter usually consist of a laminated metal core .'.ith a circular or elliptical shape, which is divided into two parts so the jaws can be opened and the conductor to be measured Figure 1 . Operating principle of a clamp meter: a transformer with primary and secondary windings (a). In most modern meters, the secondary winding is replaced by one or two Hall sensors (b). can be positioned inside the core. When a current flows through the conductor. It induces a magnetic field, and the laminated core conveys this field to a small measur- ing coil (with several turns) that is wound on the core (see Figure la). The strength of the cu rrent flow! ng through this secon d - ary winding can be read from a meter con- nected to the measuring coil. The amount of current flowing through the primary con- ductor can be determined from the winding ratio of the two coils. In most modern clamp meters, the measur- ing coil is replaced by a Hall sensor (a semi- conductor device that is sensitive to mag- Figure 2. A pair of Hall sensors are dearly visible in the air gaps between the jaws of this Fluke clamp meter. netic fields). Depending on the design and the accuracy of the meter, one or two Hall sensors are placed in the air gaps between the two parts of the laminated core (Fig- ure 1b). The voltage generated by the Hall sensor is directly proportional to the strength of the magnetic field produced by the current in the measured conductor. In this way, clamp meters provide a simple and safe means to measure relatively large currents. Furthermore, meters that use Hall sensors are able to measure both AC and DC currents, and the latter capability Is espe- cially interesting for electronics enthusiasts. Figure 4. Clamp meters are complex instruments with many adjustment points. We counted around 1 5 trimpots in this model. etektor ’> 0-2010 23 CLAMP METERS A large, professional clamp meter with jaws big enough for 2-inch cables. Many extra features, including frequency and duty cyde measurement, as well as simultane- ous read-out of AC and DC current or voltage on the dual display, which also has a bar scale. Many basic settings can be configured in a separate menu. Includes case and probes. Aooa 30 R Handy, robustly built small clamp meter with all the basic func- tions but no extras. Suitable for conduc- tors up to around 20 mm. The Peak/Hold button function must be selected before switch-on, which isn't very convenient. The ‘True RMS' designa- tion on the device does not match the description in the user guide, includes carrying case and probes. Benning CM2 Dark red, handy, robustly built small clamp meter with all the basic functions, but no extra functions other than voltage and resistance. The Peak/ Hold button function must be selected be- fore switch-on, which isn't very convenient Clearly written multi- lingual user guide. Supplied with carrying case and probes. ELV ST-97 00T Small clamp meter with relatively large jaws. With regard to the mechanical con- struction, we noticed that the display win- dow can be pressed in quite easily. The only damp meter in the g rou p witho ut a utora nging or auto shut-off. Sepa rate o n/off switch. Supplied with a temperature sensor, carrying case and probes. Hefty, bright orange meter with capped inputs. Many extra fea- tures, including capac- itance measurement, frequency measure- ment up to 100 MHz, and separate inputs for two type K ther- mocouples (included), Built-In voltage detector for AC power volt- age. Probes and carrying case included. This heavy-duty clamp meter, suitable for cur- rents up to 2000 A, is the benchmark device for this survey. The large dual display can show the frequency of the measured signal at the same time as the measured value. Built-in low- pass filter to eliminate HF interfer- ence, Extensive calibration report, case and probes included. 24 10-2010 elektor CLAMP METERS HT9021 Hefty, robustly built clamp meter with large jaws, from the Italian make HT. Clear display with a supple- ments ry bar sea le for monitoring voltage trends. Many meas- uring options plus a built-in contactless voltage detector. Suitable for voltages up to 1 000 V. Temperature sensor, carrying case and probes included. p“ " ” - ! 1 46 R Sturdy professional clamp meter with large jaws and many functions, including voltage, resistance, ca- pacitance, frequency and duty cycle. Large, dear display with a bar scale. Built-in contact- less voltage detector for AC grid voltage. Supplied with carrying case and probes. 0 Handy meter with fairly large jaws fitted to a well finished and sturdy housing (rela- tive to the low price). The display is fairly small but easy to read. and it has a bar scale for monitoring voltage trends. Pity that it doesn't have a Peak button. Carrying case and probes included. Meqqer DCM340 Sturdy meter with large jaws, fits nicely in the hand. Clear display with digital indicator and analogue scale. Unlike most of the other meters, this one has separate buttons for the extra func- tions, which is particularly convenient. Very succinct user guide. Supplied with case and probes* Metrix MX675 Hefty, robust profes- sional meter with large jaws, suitable for thick conductors. Large dual display, which can show current and volt- age, frequency and voltage, or current and frequency at the same time. Simultaneous temperature display in °C and °F. Tempera- ture sensor, carrying case and probes included. eektor 10-2010 25 CLAMP METERS x C Simple, handy meter with fairly small jaws ( 1.2 cm maximum), suitable for measuring relatively low currents up to 100 A. The low- est range is 10 A, so even low currents can be measured reason * ably well Analogue voltage output for displaying AC and DC cur- rent signals on an oscilloscope. Probes and carrying case included. 1615 Hefty clamp meter with large display and substantial jaws with enough mom for relatively large con- ductors. Many extra functions, including frequency, duty cycle and capacitance meas- urement Autoranging can be disabled. Unfortunately, there is no button for peak readings. Temperature sensor, carrying case and probes included. Peaktech 1 645 Handy; small clamp meter with reason- ably large jaws for conductors up to ap- proximately 1.5 cm. Operation somewhat clumsy with rotary knob and button. Sup- plementary bar scale on display for monitoring signal variations. Built-in pocket torch and voltage detector for AC power voltages. Supplied with probes and carrying case. DC Hefty damp meter with large display and substantial jaws suit- able for conductors up to 30 mm. Various extra functions, in- cluding frequency and capacitance measure- ment. Clear display with a supplementary bar scale for monitoring voltage trends. Plastic case, temperature sensor and probes included. eman DC Small, simple damp meter limited to measuring DC and AC currents up to 80 A; no autoranging. Can- not measure voltage or resistance. Built-in pocket torch and con- tactless AC power volt- age detector. Supplied with carrying case Small, handy Instru- mentfor hobby use; rotary switch does not feel especially sturdy. The least expensive clamp meter in this survey, with a large number of measuring functions including frequency, duty cycle and capacitance. Built-In voltage detector for AC power voltage. Carrying case, probes and temperature sen- sor included. 26 10-2010 elektor CLAMP METERS Practical test and lab test We tested all of the meters in a number of practical situations, such as measur- ing the current draw by an electric motor in a model aeroplane and the starter current of a car. These tests revealed that a peak func- tion is especially handy (see tables). We also compared the clamp meters with each other in a test setup that generated reference cur- rents of 1 0 A and 40 A. All damp meters are suitable for use with these current levels. The resolution of the meters at these current levels is 10 or 100 mA, whereby we must immedi- ately mention that residual magnetism in the measur- ing circuit can easily cause errors of the same order of magnitude with DC cur- rents. For this reason, it is important to zero the meter immediately before making each DC current measurement. Naturally, this problem does not arise with AC currents. For both DC and AC, the accuracy of all of the clamp meters at the current lev- els used in the tests (or the maximum current if the measuring range was smaller) was within the tolerance specified by the manufacturer (1 to 3%). We expected nothing less from the more expensive meters, such as the Agi- lent U1 213A, Fluke 355 and IVIetrix M675 ( and they were in fact well within their stated specs, but we /.ere pleasantly surprised a _ vni - O o ni * * < X X < X X LO > x X in > + X m O + X + O 0 X + t_ n O &4 O O rM kD 64 ID n kD in O rM bU CM 4F ■ 41 B- 41 x xi L/1 4 3$ +i a o kD o o F E ■p X E ro X X min X/X 51 ro in 1/1 U ‘gi X kD In" t rO _OJ n 3 U l/i : ro CO 0/ < X < X 4 O in 4 . X n 4 . 1 1 t t 1 1 1 n O 0 &4 rM OM bg 4t 4| 4 ^ X X 00 + 4—1 4-1 +-i < < X X > X X > X X a a + O 0 CO 0 0 rO ^ a X ° o ai CSl LU CJ uo % § 4 in m m ■c m U t* O' UD •«_ r r ^ o o o o o rM < o o 3S o o in 4 in +i X X in + e* n 41 o o o r\ \ < o a + a o 1 ^ rsi 41 CM 41 4— 1 X X O O o > o o kD 4 41 O O X X in 4 3S 41 CTi XI in 4 r\i 4i > o o o > o o kD + 64 41 o in x x m + 64 41 a o o TT X X fM + 64 ■ O 41 a o in v a o ro V a o in V e E o i~M E E o ID E E ro ro X X Jj J3 ro _GJ OJ i/i _0J Di ro u _QJ OJ L /1 X _GJ _Q 03 -l— i U QJ OJ luO F .E x E T o 51 I 1 X c E in >< X r, X X X o cm X^ X X 1/1 — X X rM I ro X 1/1 4-J 'x IsT X /i£ X X O X X \D ro" i' rO X i/i 4-1 ’gi x ro" i rO TN X c GJ cx O CJ ru U l/l rg CD OJ c u a/ u C C & .3 | - §_ 5 Cl ra fC m ^ £ 0 J 3 a _rG i n m L- L/l ro 0 Gj K/1 (J1 rj CL x , >, X ■B c X x^ i/i 4-1 X IN X S 3 3 CL U u E CD X 51 X X O O X X " =- CJ ^ ro ro | X c l - 1 U C rs u r% m U 4-J c 0J Gj E X aj c. •_ ro 3 L l/V a at < s. E □ *> P fN Zj fy oo LLl e ' UJ I h- tn < o o ID cn x + m 41 < O o kD □> X kD + ro 41 > O Q kD CTi X OO + > O o n rM 41 CT X rM + Ti a rsi a n rM V E E o ro X ro X T i i/i j-i 'gi X rN P ro CT X X — Pd r- < X < X > e ^ E. IL 0J w uj 0 0 ro no + 34 O a ro rsj 4 0 0 kD CO 41 41 cn x n + n 41 4—4 X 1 > a X rN 4 a a 0 E E 1 X d 41 51 t 0 kD tn B 0 n V CM CM 3 O X 1 O ro 41 1 i/i 'x X 51 ro" i ro j — j 4— * 1 4-1 4_* X X 1 L /1 ro CL O m in < 0 X X ro < O X X OM > O X n + > 0 X rsi 4 a a a E E l X E r— X >< 1 4-4 CT x CL < u 0 ro 4 34 O ro + 34 O kD & n 0 kD &4 in 0 n V oj rsi E 0 X 1 1- -H 41 41 0 41 ro ro" ■ ro £ + N O £ r-v fM ■p < £ p < o o o XI X n + oj 4! < O O O X X m + ^4 m 41 > o a o x x n + 41 > a o o x x rM + 41 r+Z O ^r a o CO ^r _OI X ra r X M _0J Gj L/1 X n X X X X X 51 i/i 4J X X 2L ■ ro rM ™ OJ .a 5 -G m 01 re D a CD •Cl u - u .ti >. w 4 i rn 3 CL Q ™ C a E E 3 /C ai E . u rc U u rz 03 0J < u < _U > u "1-. L/1 H3 U i/i kj CL < CD O CO < >. u rtl 3 LJ L/ rO u J LO rti SO > u Cl u E u UJ rc u "l/1 ro CD 0 X 3 H3 u 0/ U c ro i/i — j "l/1 Oj Ct6 l_ x < GJ O 4-F O 4-4 O U ra 3 3 c rc X u ra _CJ >■ _E CL L/1 ^ a 3 a/ E E 3 L/1 ro GJ X 0/ 3 Gj E Oj 3 iO TO GJ E 6- E .0J lun ro i_ _■ UJ elekter 10-2010 27 LAMP METERS pj [A a 0 3 E n > Q rg co F ED l- pj 0/ i4 JZ u .CD (A r™ ^j* 1.0 ra 7- OJ Cl kD kD Ln o L _ 1 CJ CJ > Q kD r~* 4-4 cn C 3 X X Cl < 0 < O > X > 0 + O -f 0 00 4 0 0 ^r LTi O ’Sf 33 LTl 0 kD 33 fN 0 kD rv) rv 41 -H -H Cl Cl X X < 00 < 00 0 00 + 0 0 + 33 1 1 1 oq 00 oq ni fN -H 41 4-1 4— 1 cn CT Cl < X GO < X 0 G > X 00 > 0 0 + 3 $ 0 0 + 33 O O + 33 O O oq W DC ID in kD fN IN *— ^ 41 4 ) 41 4 *> 44 < © o in d x co + 3S in fN +1 < o o rM cn X in + 35 O o kO d x 00 + 35 LO m 1 ‘ +1 > © O kD cn “a m + 35 in 4 +1 a o cn x rv + 35 oq o +t /'l vi o ^r cn X rv + +i S/I - ■ " w,i ' -s a E 1 . X yi rv 0 c 3 21 0 c 0 1 X E T T 1 X 0 rr — X v m 0 1 m rn x rn n» Vl Ln a O m v E E kO C m E E l a x X X I T = E X *T k/1 +-J X 'ct -L ^ ~P cn Pr j rn t ■ c E o rv X X X X X d E o x x x_ X X 1/1 V ■4-J N d X | s rn X X ~ X kD Ln CJ u c m 'u ro Cl. rc © _0j Tl u L/l ■_ rq CCi c ■OJ E a/ Li _ 3 t/i rc a j E _ 0 / M X 4/ " Q CJ u c m 4/ u ro Ct rc CJ c CD E E 3 1/1 rc CD E _QJ rc u Ln i_ ra CD J= u & LA JS S ro i- sj Q. m x uj < o o o cn X in + 35 rn +1 < o o o cn X in + 35 00 rv +1 > O o kD cn s > A c 00 kD + +i cn m + 35 UT A +1 a a o VT O o E E o rn JD _Q rc -i-j U JD CD 1/1 3 E m m >C "T x T T i _x T 3 m i m iv X a o a k/ c rc x a - u rc CL rc >ly C kJ t S' 4/1 3 Q >< 'C ^ in * o E ^ ■n U 5 + in rn UJ < o o ~a o + &Z nj +1 < o o cn ~u P > + in fN3 + 1 O o kD wi “ in + m + Tl > o o kD cn X) un + +t a o a o o E E fN E E o m X X x^ T T un ‘gi x ■sf X 1 _c rc c < < U S. U < x iA Jn ‘S’ cu x 2 S 41 4-i Cl cn 5 < X Ln < X Ln + O + 0 + O in O O 3? in 0 X 3^ rv rv 1— ■ 1 k4 J +i +i > o o o cn x in + o'? +f > O o ^r cn x nj a St 2 +1 .-“■J Vl in m V E E o ^r x .E X E x o >< X >< x^ "S’ N cn o x C, ^ X o X c rc O D _rg Cl X "rc C3 Q i_ o cn m cn ^ 5 ^ S Q 5 + m in o n a j < O o kD < o o < u < X in + 3^ in +i 600 A X un + 3S rv 4i A 009 cn X in 4 3S r— 41 ^ X 7 > rv 0 + 0 kD n- 0 41 4-1 4-1 Cl d 4—1 01 X X CD X < m > in > x on c + 0 + O *0 + 0 3$ 0 35 0 i 3? LD LO in LD ^ IN 4 - s 41 rv r “- + 1 41 +1 X >. >. sJ u u U fq rz 3 rq V . 4 t_ L _ 3 3 3 3 U U u U u 13 kJ kJ Tl <3 rc U < U > U > *y "l /1 rq k_> Vi 3 vJ 'i/i rq 1 j ^ X rq CD a CO < CD Q a a o a o o TT a o m v '—j V | o ST V tD cn c ro L _ OJ >-. % -5 rq ^ ■+-; i/i E E kD E E 00 rv i/i CD ct; rtJ >_ x a> l o ^ i - CD u =1 ZT x o u 4* X c o L/> OI 3 _0J kJ _a/ oj Lrt .= X E x o n X = X E T o no cn f 'En r~" fD c 4—1 3 < c 3 _C i/l 3 < X X X X I i GJ M rO a Cl. X O X rc >< L/l 2 Q N 1:71 ^ — O X o X s ^ X m >< Lfl -I — J x x on i rO u rq _3 >- _E Cl Vl 3 CD E CD u- 3 v rc CD E X O c CD E a/ 3 V rq CD e cx E l lOkft > 1 0 k a Max. conductor dra. 9 mm 19 mm Output sensitivity 100 mV/A 1 0 mV/A 100 mV/ A Special features 2 measuring ranges Available with banana plugs or BNC connector (5 version) The following suppliers and/or manufacturers kindly made products available for this article: Agilent: www.agilent.com, Appa: www.appatech.com, Velleman: Benning: www.benning.de, Peaktech: www.peaktech.de ELV: www.elv.de Extech: www.extech.com, Voltcraft: nr Fluke: fluke HT: www.htitalia.it Megger: www.megger.com Ky o r itsu ( Ke wtec h ) : w w w. ke w-ltd.co.jp/ en / Mastech: www.p-mastech.com Metrix, Multimetrix (www.chauvin-arnoux.com) v- :: iQ-2010 29 FPGA SIMULATION FPGA Design Simulation , i-.- rr«- "- 1 u-^- flj Jl Hi*’*- ' JO r> ‘ — " By Paul Goossens (The Netherlands) Simulations are an important part of circuit design. Circuits built with ‘ordinary* components can be simulated quite well with conventional simulation packages, but as soon as you add complex digital logic to give your circuit a bit of intelligence, most conventional simulators are no longer up to the task. In such cases, it's necessary to use an emulator to mimic the behaviour of the logic system. Whenever you use an FPGA in a design, you're dealing with more than just hardware. An FPGA needs an Interna f design in order to do something useful In a manner of speaking, you personally assemble the hardware inside the FPGA. You need special software to gener- ate the FPGA design; this software Is usually provided by the FPGA manufacturer Special software is also available for simulating the internal design. Many FPGA manufacturers offer a free version of their professional simulation program, which has certain minor limitations compared to the full version. For instance, there may be a limit on the maximum number of lines of code you can use, and in many cases the simula- tion is slower than usual The simulation software discussed in this article has a built-in limit of 10,000 lines of code. However, a design with more than 1 0,000 lines of code is a rather large design. Even with this restriction, you can still use the software if you split your design into several smaller parts. You can then test these parts one at a time. Software For the examples described in this article, we used software that is availablefree of charge on the Altera website: Quartos Web Edition and Model Sim Altera Edition, First well look at what you can do with Quartos. In addition to generating designs, this package allows you to simulate designs on a small scale. Incidentally, there are also other FPGA manufacturers that offer free simulation packages for their devices. For the truly demanding user, there is a broad selection of VHDl, Verilog and mixed HDL simula- tors available. 30 io-20io efektor FPGA SIMULATION Basic aspects A basic consideration with FPGA design simulation is that you are limited to digital simulation. With digital simulation, you have to con- nect your design to test code that provides the test signals for the design. You can view the output signals from the design under test in a window that strongly resembles a software logic analyser, but first you need to generate suitable input signals. With the simulator included in the Quartus package, you can use a graphic interface to draw the wave- forms of these signals. After all the signals have been defined, you can start the simulation, which causes the signals you just defined to be applied to the inputs of the design. You can choose from two options for running a simulation . The first option is a functional simulation, which ignores the propa- gation delays inside the FPCA. This yields dearly defined results with Ideal signal behaviour. The major advantage of this type of simulation is that it only requires compilation of the design, so you can ignore the place and route, optimisation and timing clo- sure functions. This saves a lot of time with relatively large designs. Figure 1 shows the results of a functional simulation, based on a design for a simple shift register with only one output. You can see that the signal level on the output and the state of the internal regis- ter both change on the rising edge of the dock signal This contrasts with Figure 2, which shows the results of simulating the same circuit with the second option: timing simulation. This type of simulation additionally takes the internal propagation delays of the FPGA into account You have to zoom in to a high magnification factor in order to see the difference. Then you can see that the delay between the rising edge of the clock signal and the time when the output signal changes state is 6.006 nanoseconds, is this fast or slow? The answer depends on how fast your design needs to be. Optimisation One of the first pitfalls you encounter with a timing simulation is that sometimes one or more signals are not visible in the simula- tion, even though they are visible in the functional simulation. Why do these signals disappear? This usually results from design opti- misation by the software. Remember that the design only needs to be compiled for a functional simulation, but several additional steps are performed with a timing simulation, with a large num- ber of design optimisations being made m the process. One of the consequences may be that a particular signal is no longer present in the FPGA. If you need this signal for your analysis, you can connect it to an additional output of your design. When you do this, the software will think that this signal must be physically present at an output pin, so the optimisation process will not eliminate the signal. How- ever, this may significantly alter the timing of the end result. It's nice to know that the optimisations never change the functional- ity of the design, so the design will not suddenly exhibit errors due to optimisation. However, it will take up less space in the FPGA. and it will most likely run a good deal faster. More oomph As already mentioned, the built-in simulator of Quartus is very easy to use. The downside of this is that it has only limited capabilities. If you need something more powerf ul, you can use ModelSim. The QvVI — ,1 - C/K.,' i I**, ■I*** 4B 1 : - !. ■* *.*i idK!' - ■ i*:" . . C: - I ' 1 , 1 . 1^1 t I '.',1 H,(Tl Lh 1 A * fk - ^ 1 , TH* b.. noqw ■ tt. "tan,- Uta Lrd I 4 D* A A ■ n ' b ^ u * Hi:-* «=,=** ny n, M”-. ■ □ I : y. bjl*lxm_x m r . *. r • — . Figure 1 . Results of a functional simulation of a simple shift register design with one output. ^ Qu*tui D - t.'Btlefa'frmLil3TTOn artKlc/junvI - iirraul - [Sifltullt'Dfl f*port - Jimmie »r, Wiveformi] imutoion W#vcfaW ;llt E'dJl i'P* loc^ rn&Sf TWig flSQDfti 11 * Porip 333 Irtennii -!073n: 5 ml Q pi End. IOOib A M A -* ft n tisme vi! e: EtfDSi* eK,Dnt eea^rw 6^,2 «• tit j »*« -ra ISrl * JJr: S -j — p x — m . v- -neeiTJ l - — i 1 w “’csiSi 1 — ‘ ■— xci- 1 ! ! — »q[?] V 1 — } T r fit i r • pi l~ : Fl I '-pr Help, pe — -.-a Figure 2. Results of a functional simulation of the same design as Figure 1 . e ektor 10-2010 3 1 FPGA SIMULATION I Listing! | Library IEEE; Use IEEE . std_logic_lI64 .all ( - Use lEEE.std logic text io , all ; Use STD . text io , all; I I I I entity test_simu2_f ile is end test_simu2_f ile ; architecture stimulus of test_simu2_f ile is file RESULTS; TEXT open WRITE MODE is "results.txt"; procedure WRITE_RESULTS { elk: std^logic; reset : std logic; datain : stdlogic; dataout : std_logic ) is variable lout : line; begin write (1 out, now, right, 15}; write (1 out, elk, right, 2); write ( l_out , reset, right, 2); write (lout, datain , right, 2); A write [1 out, dataout, right, 2); write line (RESULTS, lout) ; end procedure; component s imu2 port ( elk : in STD_LOGIC; reset ; in STD LOGIC; — datain: in STD_LOGIC; dataout : out STD_LOGIC l > ; end component; signal elk : stdlogic; signal reset : std_logic; signal datain : std_logic; signal dataout : std logic; begin DOT : s imu2 port map ( elk elk, reset => reset, datain => datain, dataout = > dataout ) ; CLOCKPROC : process begin elk < = % 1 1 ; wait for lOnS; elk <=' Q 1 ; wait for 10nS; end process; STIM : process begin wait until (elk' event and clks'O 1 ); -- wait for falling edge of elk reset<- * 0 J ; datain < = ' 0 ' ; wait until (dataout=' 0' } ; -- wait for falling edge of elk wait until (elk" event and clk-'O'J; -- wait for falling edge of elk datain <^'1'; wait; end process; WRITE RESULTS ( elk, reset, datain, dataout ) ; end architecture; free version of ModelSim can run simulations based on VHDL test- bench fries, which offer you the full range of VHDL functions. Here we can use the shift register design mentioned above as an example. The most important part of the testbench file is printed out in Listing 1. For the time being, we 1 !! ignore the lines shown in boldface. Two processes are described here. The first process implements a dock signal generator, A major difference between a VHDL file intended to be used for synthesis and a testbench file is the option of using ‘wait’ statements. The line ‘wait for 1 OnS‘ causes process execution to pause for 1 0 nanoseconds. This sort of statement in a design ultimately intended to be executed in an FPGA wiil cause an error during synthesis. FPGAs do not have any components that can be used to implement this statement directly, but it does not cause any problems in a simulation. This process is repeated indefinitely because there is no sensitivity list at the start of the process code. As soon as the process has finished executing, it starts again from the beginning. Interactive The biggest advantage of a testbench file is that it allows one or more of the outputs of the design under test to influence the input signals. In the 5T1M process, which is responsible for generating the ‘reset 1 and ‘datain’ signals, we use an internal signal together with an output signal from the design under test to modify the input signals. The line ‘wait until {elk’event and clk^O*);’ causes process execution 12 10-2010 elektor FPGA SIMULATION to pause until the ’elk' signal changes state and the new state ts "O’. In other words, it waits until the next falling edge of the dock sig- nal, The ‘reset’ and 'datain’ signals are set to l G' only after this fall- ing edge occurs. The initial state of all internal signals is ’U\ which stands for ‘unknown’. In the next line, the process waits until the ‘dataout' output of the design under test goes to 'O’. The ‘datain 1 signal is set to 4 V after the next falling edge. The final statement of this process is ‘wait’ without any time speci- fied, What is the purpose of this line? Without it, the process would normally repeat itself immediately after completing execution, since it does not have a sensitivity list. The ’wait' statement with- out any time specified causes an infinite delay and thus prevents the process from repeating. Figure 3 shows the results of this simulation. All testbench signals and all internal signals of the design under test (OUT) are visible here. All of these signals start with the state *U\ since the simula- tor cannot determine what the actual state should be. In reality, all of these signals must assume either the 1 1 ’ state or the ’O' state. From the simulation, you can see whether the design ensures that this happens, or whether the state of a signal is arbitrary. The initial state of a signal may change as a consequence of a different optimi- sation, so you should check that all signals have defined states after a certain point in time, such as after a reset. Testbench format A testbench file differs from a normal VHDL fie in several respects. Taking Listing 1 as an example, you can see that entities are declared in the usual manner. However, a remarkable feature of these decla- rations is that these entities do not have any input or output signals. A design usually has at least one input and one output, so that it can do something useful. After all, your design must be able to respond interactively to its surroundings. From this, we can conclude that a VHDL testbench fie is not a design that can be programmed in an FPGA, Uierri' 50 PIC Microcontroller projects A laser alarm, USB teasing mouse, soundswrtch and much more This book contains 50 fun and exciting projects for PIC microcontrollers such as a laser alarm, USB teasing mouse, eggfmer, youth repellent, soundswitch, capacitive liquid level gauge, "finger in the water" sensor, guarding a room using a camera, mains light dimmer (1 1 0-240 volts), talking microcontroller and much more. Several different techniques are discussed such as relay, alternating current control including mains, I2C, SPL RS232, USB, pulse width modulation, rotary encoder, interrupts, Infrared, analog-digital conversion (and the other way around). 7-segment display and even CAN bus. Three PIC microcontrollers are used in this book, the 16fS77A, 18F4455 and 18f4685. It is also discussed how you can migrate your project from one microcontroller to another - 1 5 types are supported - including two example projects. PIC Mien projects for : : r . p tektor 440 pages • ISBN 978-0*905705-88-0 £36,00 * US $58.10 Elektor Reg us Brentford 1 000 Great West Road Bren tford T W8 9 H H United Kingdom Tel +44 20 82614509 I elektor 10-2010 33 FPCA SIMULATION Figure 3. Simulation results from ModdSlm. All testbench signals and all internal signals of the design are visible here. The design under test is declared as a component; in this exam- ple it is declared as "simu? 1 . All necessary signals are also declared. The architecture section includes a component of type ‘simu2 T with the name 'DUT' (short for 'device under test’), although you're free to choose any name you wish. The input signals for the design are described in the two processes following the architecture section. Additional features You can also use files in a VHDL testbench. For example, you can automatically create a file during a simulation and use it to save all changes to signal states in plain text format. You can also read the contents of a file. listing 2 90 ns 100 ns 0 ns U U U U 110 ns 0 ns 1 U U U 120 ns 10 ns 0 U U U 130 ns 10 ns 0 0 0 U 140 ns 20 ns 1 0 0 U ISO ns 30 ns 0 0 0 U 16 0 ns 40 ns 1 0 0 IT 16 0 ns 50 ns 0 0 0 U 170 ns 60 ns 1 0 0 U 170 ns 70 ns 0 0 0 U 180 ns 80 ns 1 0 0 O 190 ns The final example shows how to save all the signal changes in a text file. The lines added to the file contents in Listing 1 are shown here in boldface. Listing 2 shows the contents of the resulting text file. The functions you need for using fifes are located in the ‘std Jogic_ textio' library, and you declare them in the usual manner. You also declare the file in the architecture section. The WRITE^RESULTS procedure is responsible for writing the data to the file. This procedure is self-explanatory except for one detail. We use a variable with the name 'now' in this procedure. This vari- able has a special function in VHDL: it holds the current time (in the contex t of the simulation). The procedure is called at the end of the listing. It is called whenever a 'wait T statement is executed in one of the processes or whenever a process completes execution. Conclusion FPCA simulations are especially important with relatively complex designs. VHDL testbenches have many more features than we can possibly describe here, but the features we have described are suf- ficient for quickly running large simulations. For students and novices, these simulation tools provide a good opportunity to experiment with digital electronics to your heart's content at minimum cost, with no need to touch even a single piece of hardware (other than your computer), (100370-1) The files for Quartos Web Edition and ModeiSim Aftera Edition used for the simulations described in this article are available on the El ektor website for downloading (item no. 100370-11). Internet Links www.altera.com/ products/ softwa re/qua rtus-ii/ web-edition/ qt5-we-index.html www.a 1 1 c ra . co m / p rod u cts/sof twa re/ q u a rtus - 1 i / m 0 de I s i m / q 1 s- m ode Is i m - i nd ex , h tm 1 0 0 u 200 ns 1 0 1 0 0 0 u 210 ns 0 0 1 0 0 0 u 220 ns 1 0 1 0 0 0 0 230 ns 0 0 1 0 0 0 u 240 ns 1 0 1 0 0 0 0 250 ns 0 0 1 0 0 0 u 260 ns 1 0 1 0 0 0 u 270 ns 0 0 1 0 0 0 0 280 ns 1 0 1 0 0 0 0 290 ns 0 0 1 0 0 1 0 300 ns 1 0 1 0 010 010 0 1 0 1 0 1 0 1 1 a 0 1 0 34 io-20io elektar A Python Programming and GUIs Get started quickly and proceed rapidly This book is aimed at people who want to interface PCs with hardware projects using graphic user interfaces. Desktop and web based applications are covered. The programming language used is Python, an object-oriented scripting language; a higher level language than, say, C. Obviously having fewer lines of code will be quicker to write but also fewer lines of code means fewer opportunities to make mistakes. Code will be more readable, and easier to modify at a later date. You can concentrate on the overall operation of the system you are making. This abstraction also applies when writing graphic user-interfaces. Writing low level code for graphics and mouse clicks and the like is something that you do not have to do. In Python all this is wrapped up in relatively simple functions. The book guides you through starting with Linux by way of a free downloadable, live bootable distribution that can be ported around different computers without requiring hard drive installation. Practical demonstration circuits and downloadable, full software examples are presented that can be the basis for fu rther projects. 224 pages - ISBN 978’0-905705-87-3 £29.50 • US S47.60 Elektor Reg us Brentford 1000 Great West Road Brentford TWS9HH United Kingdom Tel. +44 20 8261 4509 L Further information and ordering at www.elektor.com/shop 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. New Version 4.0 with new features, for example free contours for Linux, Windows and Mac OSX * automatic price calculation * delivery in 5-8 days * 24 -Hour-Service if required Sample price' 34,93€ plus VAT/sfiipping Schaeffer AG - Nahrnitzer Damnn 32 * D -12277 Berlin ■ Tel +49 (0)30 8058695-0 Fax -49 0)3C 3058695-33 ■ Web InfoOschaeffer- ag.de « www.schaeffer-a 9 .de THE ORIGINAL SINCE Specialising in Prototype PCBs Free Laser Stendl I PCB orders service Chemical Tin Finish (no extra cost) jf . nrf m* $ IH‘ I R5-174-X Q FULBOivi* elektor 10-2010 35 MICROPROCESSORS CL-3 Digital Rotary Combination By Dale Wheat (USA) The GL-3 got designed and built way back at the end of the 20 th century. It used an Atmei AVR AT90S1200 flash microcontroller with a rotary encoder to emulate a mechanical combination lock, triggering a relay when the correct combination was dialled. Back in those days, it was considered prudent to keep project development and design documents a closely guarded secret. Tin-lead solder was king and people were stockpiling food and weapons for the upcoming Y2K upheaval. Today we know better — open source is the way forward. The CT3 was a delight to design and build but very disappointing in the marketplace, 3 attribute this to my complete lack of mar- keting skills and not on the merits of the project itself* Phillip Torrone of Adafruit Industries encouraged me to have another go at it, this time as an open source project. So here we go, but not before mentioning that a story on the design history of CL-3 Is available as a free download from the Elektor website at hi. From the concept,,. As shown in Figure 1 the minimal CL-3 implementation uses a rotary encoder as input, emulating a mechanical combina- tion lock dial as used on vaults. The user gets feedback via a dual seven-segment LED display, indicating the current dial position. The final output is a logic level pin that rep- resents the locked 1 or ’unlocked" state* This level controls a relay that governs the open- ing of the “vault 1 door. There is also another pushbutton input that is used in conjunction with the dial to program the combination in the field. This pushbutton needs to be located in the secure region of the circuit* where the gen- eral public does not have access* In the normal mode of operation, the rotary encoder is the primary input. A quadra- ture output indicates movement as well as direction. You could also determine the Lock output 1Q0QZ6-11 Figure 1 . Functional diagram of the CL-3 electronic code lock. speed at which the dial is being turned, if you wanted to get fancy, by measuring the period between changes in the input. A state machine is used to keep track of the current quadrature input. Note that this is not the same as the virtual dial position* Once movement is detected, i.e*, the input has changed, two of the possible remain- ing three states are checked to determine if the motion is clockwise or anticlockwise. The information is used to update the vir- tual dial position in the range of 00 to 99. Just like a mechanical dial, the value should roll over from 99 back to zero as well as go from 00 to 99 in the opposite direction. To the schematic In terms of user interface, the CT3 circuit has two outputs, which are also apparent from the circuit diagram in Figure 2. The first is the LED display LD1 -LD2 and the sec- ond is the lock relay RET Everything runs under the tight control of microcontroller IC1. The current dial position is displayed on the multiplexed LED display, which is a separate unit connected to the microcon- troller via connector pair K2-K6. A lookup 36 10-2010 elektor MICROPROCESSORS * 6 digit operation (three 2 -digit numbers in CW-CCW-CW sequence) ■ ATtiny 23 i 3 microcontroller * Optical or mechanical rotary encoder ■ - Hidden /secure programming button ■ Free C code table in the controller's memory is copied to the lower registers and used to translate the decimal value to the appropriate segment aloes. Those segment values are written to the ATtiny’s output port, which is in turn connected to the LED segment leads via cur- rent limiting resistors R1 -R9. Once a short period of time has elapsed, the tens digit is blanked and the same process is repeated for the units digit. Rapidly alternating between the two digits gives the visual impression that both digits are illuminated at the same time, due to the persistence of vision effect in the human brain. Your eye isn't fooled but your brain is. The Atmel-recomm ended ATtiny23 1 3 is a good choice for this type of project and is even pin-compatible with the AT9OS12G0 in the original version of the CL-3. More on-board peripherals, memory, clocks and power-saving features are just begging to be used! The original AT90S1 200 had only one exter- nal interrupt and it was used for the pro- gramming pushbutton input. 1 moved one of the encoder inputs to INTO (PD2, pin 6). In the interrupt routine, the other encoder input is examined to determine the direc- tion of dial motion* The original CL-3 kit used a Panasonic mechanical rotary encoder that has also been discontinued. There is no direct replacement available from Panasonic, but any quadrature encoder should work. Mechanical encoders are much less expen- sive than optical devices, and for these in particular two small capacitors Cl -C2 are provided on each of the outputs to prevent contact noise. The relay driver is just one pnp transistor with a current limiter resistor in its base line. The power supply is dead conventional based around the 7805 voltage regulator with its usual flock of decoupling capacitors, solid (C5 and C7) and electrolytic (C4 and CG). Diode D2 affords protection against power supply reversal. Figure 2* Schematic of the new CL-3. The project consist of a controller section and a display/encoder section. firmware. On power up, If the unit was unlocked, the display revealed the last number of the combination for a few sec- onds. The new firmware corrects this, only a decade later. That's some kind of response time, eh? The source code file written for the new CL-3 is called “CL-3.c h and contains the C language version of the firmware. It can be downloaded free from l 1 !. For your amuse- ment the same archive file also contains the AT90S1200 assembly code for the old CL-3. Building it (them) The circuit board designs for the new CL-3 are shown in Figure 3. The artwork for The CL-3 software ! have corrected what could possibly have been a security issue in the original CL-3 Figure 3, Component mounting plans of controller board and display/encoder board. Either connect them via cables/wires or stack the display/encoder board on top of the controller board. Copper track layout files available free from our website. elektor 10-2010 37 MICROPROCESSORS A quadrature output consists of two alternating signals that are 90° out of phase. These two signals are traditionally referred to as A and The two signals don't have to he exactly 90 3 out of phase with each other, but it is important that they do not change state at the same time* Imagine a compass that only has a 'north or south' output and an “east or west 1 output. It will only tell you the approximate orientation of the compass. At any given moment* it can only report the ordinal (or intercardinal) direction (Le.. NE, NW. 5E or 5W). By periodically noting the reported direction, an external device can tell when the orientation changes by comparing the present reading with the previous reading. By analysing these changes over time, the absolute position, direction of motion and angular velocity can be determined. An fncrementaJ shaft encoder uses the same technique to report changes in the position of a rotating shaft or instrumentation dial. An ohso/ufe position is derived from the succession of changes reported by the sensor. The direction and velocity of the shafL (or dial) can also be derived. Expanding on the compass example, the two outputs A and B correspond to the "North/ South" and "East/West" outputs, respectively. Arbitrarily assigning the North and East con- ditions as “high", we get the following table: Ordinal direction North/ South East/ West Phase A Phase B Binary value Southwest Low Low Southeast Low High Northwest High 1 Low Northeast High High 0 0 0 Q | T I 't 1 | 0 I 2 1 1 3: There are four possible combinations For any given reading. It follows that there are four possible transitions between one reading and the next for each of the possible original combinations. For example, the four transitions from the “Southwest 1 state are: New reading Transition Value Southwest None 0 Southeast Anticlockwise -1 Northwest Clockwise +1 Northeast Error Unknown Note that the unexpected transition from “Southwest" to "Northeast" implies either a faulty reading or a missing transition through one of the other, expected readings. Your response to this condition depends entirely on your application. For trivial or noncritical applications {e.g.. a combination lock), these events can safely be ignored. The Value' column, except for errors, can then be added to a running accumulation of similar values to provide a virtual absolute position. these small boards is available free at Ml in the form of pdf files. The project should be simple to build as no SMD parts or special assembly techniques are required. Two boards are installed at a distance from each other, to ensure the 'vulnerable 1 section is not easily accessible. The same goes For the relay contacts (which are subject to tampering). If you can afford to keep the circuitry in one piece, the dis- play/encoder board can be stacked on top of the controller board by means of pin- header/socket pairs K6/K2 and K3/K7, Still, for security reasons, pushbutton SI should be mounted at the copper side of the con- troller board. Figure 4 provides a close look at the proto- type boards built by Elektor labs. Setting the combination Figure 4. Prototype boards The 3-number (6-digit) code that opens the lock is field -programmed using the physi- cally-secured programming pushbutton, 51 . All opening and programming commences when the encoder is turned clockwise (CW), To program a new combination, dial in the first number and then press the pro- gramming button. The display blanks once to confirm the new number Is stored in EEPRGIVL Dial the second number in coun- ter-clockwise (CCW) direction and press the button again. The display blinks twice. Repeat CW for the third number, with the predictable result. Only once all three num- bers have been entered does the firmware write the new combination to the non-vol- atile EEPROM memory. I encourage users to write down the combination first, then enter it into the device, then confirm the combination works. If you disallow subsequent identical num- bers (e.g, t 1-1-1 is not allowed)* there are 100 * 99 * 99 = 980,100 possible combinations. Opening the lock This is done just like prog ra mming th e lock , i,e. CW-CCW-CW hut obviously without 3 S 10-2010 eiektor MICROPROCESSORS v7 ; “3 SSjTTf; . built forthe project. A single numeric digit, based loosely on the Arabic numerals popular in Western languages, can be represented with as few as seven independent 'segments', traditionally labelled V through 'g\ See below. LEDs prearranged in lids pattern have been available for decades in various colours and sizes. To save pins, either the anodes or the cathodes are connected together and the other terminals brought out separately, thus the characterization ’common cathode' or ’common anode*. To directly drive the LED segments from a microcontroller, connect seven output lines (via current limiting resistors) to the LED display module. Connect the LED common pin to either V+ for common anode displays or ground for common cathode displays. If you have lots and lots of extra output pins available, you can connect a single output line to each LED segment for as many digits as your application requires. If not, you can multi- plex the outputs. This reduces the number of dedicated output lines. Generally speaking, you then give up the ability to illuminate all of the LED segments simultaneously. 1MW2&-15 Oneway to multiplex the LED display is to arrange them in a row and column array, where the rows correspond to segments and the columns to digits. All of the a' segments would be connected together, as would the ‘b’ segments, etc. Instead of connecting the common line from each display to either V+ or ground, the common lines are individually selected (or strobed) by more dedicated output lines. These "digit select lines' are almost always buffered using some sort of current-amplifying circuit, such as a common-emitter ampli- fier, consisting of a transistor and a resistor. Each digit is displayed for a very brief period of time, then the next one, etc. If this happens fast enough* the display appears to be uniformly illuminating all the digits at once. actuating SI and with no blinking of the dis- play. The lock opens when the 5 th and 6 lh digit also match the programmed code. The relay remains actuated until the encoder is turned again either CW or CCW. The state of the lock 1$ also stored in EEPROIV1, meaning that the relay is immediately actuated when the lock was open and the supply voltage gets switched off and on again. Using an Arduino Attaching the user interface panel to an Arduino is very simple. The firmware Is contained in CL_3.pde, which is also found in the software archive for this project Ml. I used a polling technique Instead of inter- rupts to make it simpler to understand. The same basic functionality is there. The logic lights up the built-in LED on the Arduino when the lock is unlocked. You could easily change the code to send a message via the serial port or take other appropriate action. Unlock the potential 1 really enjoyed working on this project* which allowed me to see ten years of pro- gress in microcontroller technology and programming. If you can, take a moment Resistors R1 i .R2,R3*R5 i R6 ( RS,R9= 1QQQ R4, R7 - 1 GkO Capacitors C1,C2 = 10nF C3,G5,C7 ■ lOGnF C4X6 = 100|iF25V radial Semiconductors 01 -1N414S 02 “ 1N4001 LD1 ,LP2 = 7 -segment LEO display, com- mon anode (CA), h-10mm,. Avago type BDSP-3 1 5t Tl = BC557 and let me know what you think about it, Ed really like to know. Now it*s time to turn It loose on the world. While the copyrights of this article remain the property of the Publishers (because writers gotta eat!), the CL- 3 software and PCB design are hereby placed in the pub- lic domain with no restrictions other than “commercial use prohibited". Go nuts! (100026) IC1 - At me! ATTi NY 231 3-20PU, pro- grammed, Elektor# 100026-41 |C2 - 7S05 Miscellaneous 51 = Tactile switch* 6mm, Multicomp type MC32830 52 = rotary encoder, Alps type EC1 1 El 52Q4aE K1 = 2-pin pinheader, 0.1 inch lead pitch. I<2,3<6 = 10-pin (2x5) pinheader 0.1 inch lead pitch K3'K4,K5,I<7 = 3-pin pinheader, 0,1 inch lead pitch RE1 = PCB mount relay, DPCO* 5VDC, Multi- comp type HRS2M-SDC5V PCB, see www.dek tor.com/ 10002G [ 1 1 www.elektor.com/ 1 0002 & elektor 10-2010 39 MICROPROCESSORS By Vladimir Mitrovic (Croatia) In microcontroller based projects you often need to set a bunch of parameters or initial values. If the project already has an alphanumeric or some other kind of display, even complex multiple-digit values can be effectively set with just one pushbutton that can serve For other purposes as well. Based on an ATtiny2313, the test circuit in Figure 1 is “general pur- pose 1 and could be part of just about any project requiring a user interface. Pushbuttons], together with an LC alphanumeric display, enables a form of interactive data entry. The trick is, of course, in the program, which is written in Bascom- AVR. The program will run on ail similar circuits based on AVR micro- controllers as well as on 805 1 micros if you do the necessary family- related adaptations. The idea is to monitor not only if, but also how long, SI is pressed. Two different cases can be distinguished: - the button is pressed briefly (shorter than 1 s): - the button is pressed for a long time (longer than 1 $), time, the program will enter data-entry mode. In this mode, the initial parameter value is displayed and the cursor is placed under the first digit (see Figure 2). Every short press on the SI will toggle the sign and/or increment the selected digit by 1- Pressing the button longer than one second again will move the cursor under the following digit, which can now be edited by short presses on the button. Pressing the button longer than one second while the cursor is under the lastdigit will terminate data-entry mode and the program will continue to execute code in the main loop. When the button is pressed for longer than one second for the first 1X01 LC DISPLAY 16 x 2 Figure. 1 . One button is all you need for an elegant and effective data /para meter entry (test circuit shown). Examples in order to explain how data-entry routines can be implemented in the real program, two example programs were written: EE_l_button_HEX.bas and EE_l_button_DECbas, Both pro- grams can be downloaded free of charge from the Elektor web- site PI. They perform a simple main task: increment a counter ('Cntr' variable) approximately ten times per second and display every new value. The programs differ visibly in the way the counter is displayed: the first program shows the counter value as a hexadecimal number, whereas the other one shows it as a signed decimal number. The real difference between the programs is in the way hexadecimal or decimal values are edited when the programs enter data-entry mode. After the counter value has been changed and the program control is returned to the main loop, both programs will continue to count from the value that has just been set. If you extract the counting/displaying part of example programs, the remaining code contains the structure and the routines that enable 1 -button data entry, which should be easy to “port 1 or “migrate* to other similar projects. Program concept The heart of any program that alters its behaviour depending on duration of some event is the time-measuring routine. In our pro- grams, in the *Check_tl 1 subroutine we check if, and how long, the 40 10-2010 elektor MICROPROCESSORS ; utton is pressed. Note that although the switch is labelled SI in the c agram, it's invariably *T1 1 in the software. 71 Alias Pind.O l Tl input pin rhecktl : Tl_time = 0 Debounce T1 , 0 , Tl_on return . _ on : Tl_time = i While T1 — 0 Wait ms 10 Incr Tltime If Tl_time > 100 Then Exit While End If Wend Return The ‘Debounce* statement checks if the pushbutton is pressed at all. If the check fails, program control returns to the main loop with T 1 _ time' variable set to 0. If the ‘Debounce* statement establishes that the button is pressed (11=0), the program branches to the 'Tl_on' routine and waits in While-Wend loop until the button is released or 1 second passes (whichever comes first) and then returns to the main program. If the button is released before 1 s passes, the Tl_ time’ variable will have any value from 1 to 1 00 (for time periods from approx. 10 ms to 1 s). If the 1 -second period lapses, the pro- gram will stop monitoring the button and will return to the main loop with T1„time“ 101. To enter the data-entry mode, you should periodically check in the main loop If the switch is pressed for longer than 1 s and if It is. call the data-entry subroutine: * ■ ■ ■ i ■ ■VP ■ in « ■ IPP ■■P iiibi ■ ■ i b id * * ■ ■■ V ■ ■■ ■9 * * P ■ MM. = * 1 1 9 ■ ■ IP ■ ■ ■ ■<■■■■ ■ *’ ■ ■ » ■ i ■Pi ■ * ■ p ■ 111 P R ill ill ■ Figure 2, Display in data-entry mode: hexadecimal and signed decimal input is possible. Do Gosub Check_tl 'check if T1 is pressed >ls If Tltime > 100 Then Gosub Edit_cntr 'if yes, 'enter editing mode End If ... 'else, do whatever Loop The data-entry subroutine consists of three parts: 1 . initialization, in which the initial value is converted to the appro- priate format for display: 2. loop, in which SI (T1 ) is periodically checked and the displayed value is edited as explained before and 3. finishing, in which the edited value is saved to become the new initial value. It is obvious that the program wil! not be able to execute the com- mands from the main loop while the data-entry subroutine is exe- cuted. interrupt routines, if there are any, will be executed normally. It is the programmer’s responsibility to ensure that such a condition does not affect the hardware controlled by the microcontroller in a destructive manner. We will not explain the data-entry subroutine in detail. However, several notes might be helpful in order to enable you to adjust it to your own needs. Prototype EURO M CIRCUITS PCB proto STANDARD pool ^ TECH pool IHS pool On demand PCB specialists dedicated prototype pwvke widest choice 1-81 100 pm technology metal -hacked PCBs all options up to 18 Call us: 020 8816 7005 Email: etiro@eurocircuit5.com New website - new services ALL SERVICES Instant online pricing Instant online ordering Low pooling prices Deliveries from 2 days No tooling charges Stencil service www.eurocircuits.com elektor 102010 41 MICROPROCESSORS EE__i_button_HEX description The initial value is stored in the 'Cntr’ variable (the name comes from its use in example programs and you may edit it as you please). The variable type can be Byte, Word, Integer or Long. To enable manipula- tion of individual digits, the variable is converted to the string f Edit_ string' which should be properly dimensioned to accept the "Cntr 1 variable {2B for Byte, 4B for Word /Integer and 8B for Long). Edit_cntr : Editstring = Hex (cntr) Cl s Led Edit_string The editing loop that extracts hexadecimal digits from the string is limited by the string length: For 1=1 To Len (edit string) Editx = Mid (edit_st ring ,1,1) Since BascomAVR has no function to increment the hexadecimal digit in the ‘Edit jc' variable, a simple assembler routine “lncr_hex* is written and called when a short press on the button is detected. Every edited digit is merged into the initial string and displayed before the next digit is selected: If Tl_t ime > 0 Then Go sub lncr_hex Mid (edit_string , I , 1} = Edit_x Led Editstring End If Next Near the end, after the last digit has been edited, the new value is converted back from the string into the numeric value and saved in the ‘Cntr* variable: Cntr = Hexval ( edit_string) Return EE_i_button_DEC description The initial value is stored in the , Cntr t variable (again, rename it as you please). The variable type can be Byte. Word, Integer (signed) or Long (signed). To enable manipulation of individual digits, the vari- able is converted to the string '£dit_string' which should be prop- erly dimensioned to accept the largest possible value in the ‘Cntr' variable. Allow for an extra byte for signed variables. Edit_cntr : Edit_string = Str(cntr) Edit_string = Format (editst ring , VOODOO") Cls Led £d.it_string Note that 'Edit_string' is formatted with the FormatQ function. This is necessary if you want to display the + sign and leading zeroes; only displayed digits can be edited! The + character at the beginning of the mask is necessary only for signed variables and should be omit- ted otherwise. The editing loop that extracts digits from the string is limited by the string length: For I = 1 To Leu {edit_string) Edit_x = Mid (edit_st ring ,1,1) Edit_9 - Val(editx) Every digit is extracted as a hexadecimal character ( [ Edit_x ) and a decimal number (‘ Edit J9 1 ), This is necessary as you have to manipu- late string (sign) and numeric (digits) values. What will happen if the short press on the button is detected depends on the character that is extracted. If it is a sign, it will toggle: If T1 time > 0 Then If Edit_x = V " Then Edit_x = El seif Edit_x = Then Editx = V" This part of the program may be deleted if the initial value is unsigned (i.e, if it is stored in the Byte or Word variable). If the extracted character is a number, it will be increased: Else Incr £dit_9 If Edit_9 > 9 Then Edit_9 = 0 Edit_x = Str(edit_9) End If Every edited digit is merged into the initial string and displayed before the next digit is selected: Mid ( edit_st ring , I , 1) = Edi t_x Led Edit^string End If Next Finally, after the last digit has been edited, the new value is con- verted back from the string into to the numeric value and saved in the 'Cntr' variable: Cntr = Val (edit_string) Return The data-entry routines are explained in a somewhat simplified manner; check the example programs m the free download Pi for the complete routines! (090636) Internet Link 1 . www. e 1 ek to r. c 0 m / 09 0636 42 10-2010 eiektor 1 1 bHin- ISCOV The hardware is divided into two areas; the main part contains the target controller together with a reset button, a user" but- ton and two LEDs, These allow you to run and interact with simple demo programs without the need for any additional hardware. The somewhat smaller upper area of the PCB Is fitted with a USB socket Power for the board is derived from the exter- nal computer via the USB cable. Underneath there is a second (more powerful) STM32 controller which f takes care of programming and debugging the tan 3 et processor* The functions of this debugger are compatible with the ST-LINK programmer/debug- ger tool. This means that free ST- f LINK software such as the ‘ST-LINK , ri 0 :$^* utility' I 2 ! also runs on the board to allow * e GO memory contents to be read* A nice feature also is that the -W programmer/debugger functions are not wf 'P’Yj&g? restricted to the on-board target controller; it can be hooked up to an external STM32 con- t roller using the 4-pin 5WD (Serial Wire Debug) connector. By Jens Nickel (Elektor Germany Editorial) Microcontroller evaluation kits are a wonderful resource* Those supplied by chip manufacturers are usually reasonably priced as development costs can be recouped in chip sales. For the engi- neer/student it’s a good opportunity to work hands-on with the devices and the software tools* From the manufacturers viewpoint the more people who become proficient with their devices the more chips they will sell* STMtcroelectronics has already had a positive response 4 to their low-cost 8-btt STM 85 Discovery Kit* At the ^ last Embedded World exhibition in Nuremberg they ^ . handed out 5,000 of these 8-bit evaluation boards ' free to visitors. The company is also about to J^r introduce a similar kit for their 32-bit family of > / J microcontrollers (STM32F)* The controller fa chosen for the STM32VL-Discovery kit is the STM32F100RBT6B, one of their low-cost ‘Value line*, based on an ARM Cortex-M3 ^ architecture with 128 KB Flash mem- ory and 8 KB RAM m. The kit is due §* ^ to be shipped mid September 2010 ^ 4 and will be stocked by a number ^ # of suppliers* Farnell already have :*■ % plenty on back-order, not sur- - ' prising considering the retail Y price of the kit is just £6.80 or $9.90 in the US* * IAR, Keil or Atollic to deal with the job of writing and P debugging firmware for the STM32* We chose the Tru- eSTUDlO for 5TM32' from Atolllc AB as the develop- _ = : 1 m e n t environment. The ; Lite version can be down- t ions than the piofessional „ y-TT ■ version. This powerful IDE j? pie to install and includes I YZY™ .'** ! a q on d s c I e c t i o i i o f p r oj ec t SSSSSS Srnm^r^^^ p it is not necessary to vs . \ concern yourself with gen- e rating your own make- files - c o- new project are described in the 'quick start guide’ of the development environment)* Selecting 1 ST M 3 2„ Disco very' as the evaluation board will load a small demo project to con- trol the two LEDs in response to user button presses. Although the newcomer may find the development environment a little daunting at first, they will soon get to know how the individ- ual project files hang together, what information is shown in the windows and where the most important debugger control panel is. To run your own programs in the Mite" version it is nec- essary to activate the debug process, the run procedure and 51 Microelectronics also supply a range of p Discovery is a much more ** economical introduction , Alt software is available for ' ' ^ ' wm^d download from the inter- net and a USB cable will be needed to connect the kit to a computer. Unlike EEG^KSEwISiZSsBBBB many other manufacturers of a large USB stick and are quite densely populated the STM32 Value Line Discovery has more board space and uses a rectangular board. Single rows of pin headers are fit- ted along the long side and at the lower end through which the processor pins have direct access to the outside world. Many other evaluation boards provide just a few solder pads for connecting external circuitry but the Discovery board is more versatile and can be used as a processor board with peripherals wired in the prototyping area or linked to an additional circuit board. elektor 10-2010 43 ELABs INSIDE generation of binaries is only possible in the professional ver- sion. In the ‘Build Configurations 1 menu {accessible from the main menu under ‘Project 1 ) make sure that ‘Set Active 1 has been selected in ‘Debug'. Otherwise new or modified programs will not be transferred to the controller for debugging. Now there's no reason why you can't start thinking up your own applications for this powerful system, A good starting point for those new to the environment is the examples posted on the ST M3 2-Discovery website l 4 L Running through these will quickly boost your confidence with the system. The download- able data describes the board in detail (circuit diagram, pinouts and jumpers), STMicroelectronics have indicated that the web- site will be active by the 1 5 th September at the latest. (100454) [1 ] www.stxom/m{:u/inchtml-pages-stm32.html [2] www.st.com/mcu/familiesdocs-1 10.html (the fast one in the list) [3] www.atollic,com/index.php/download/downloadstm32 [ 4 j www.st.com/stm32-discovery in audio circuits Analyser Analyser Analyser Analyser 100452-11 By Ton Giesberts (Elektor Labs) riot result in any dear differences between input and output of the test configuration. The various test configurations are Here at Elektor, for more than 20 years we've held the opinion shown in Figure 1 . that electrolytic ca padtors have the worst properties for audio We sta rted with the simplest measurement of a high- pass filter signal paths, possibly with the exception of ceramic capacitors* (Figure la)* Figure 2 shows the FFT analysis of the generator Our dielectric of preference is plastic film, with polyester/ tere- and the output of the network. The generator generates a sin- phtalate as a minimum. Even better are polypropylene and poly- ewave at 20 Hz with an amplitude of 5 V rfm . The graph shows styrene versions. Of course, there are ‘ultimate’ capacitors like the signal from the generator (cyan) and the voltage across R1 (green). There is therefore an increase in distortion, but the harmonics are below -120 dBJ In reality they are even lower, because they are only a little stronger than the harmonics from the generator, which are at -130 dB (2 nd and 3 rd harmonics). Expressed as a percentage the distortion increased from about 0*0001 7 % to 0.00023 The measurement was repeated for other types of 220-juF electrolytic capacitors. Next was a non- polarised electrolytic. It came as a surprise that the comparison with the generator signal shows practically no difference. This was followed by the two different types of electrolytic cap from the first measurement, this time connected in series in a bipo- lar manner (Figure 1 b}. There still was practically no difference to be seen between input and output. To find out whether the polarity made a difference, we turned the second electrolytic around {Figure 1c); the measurement across R1 now showed two harmonics which were a few dB larger than the measure- Electrolytic capacitors are commonly used as coupling devices in valve amplifiers, but we also frequently find them in solid- state amplifiers. The advantage of electrolytic capacitors is their large capacitance to volume ratio. In the original design of the ‘5532 Power Amplifier’ (first part of this edition), two electrolytic capacitors were used, which we eliminated in the final design; a DC control is added instead to compensate for any offset. In this way any discussion as to whether electrolytic capacitors have an audible effect on the sound, in whatever way, can be avoided. Nevertheless we were curious what the effect of the electrolytic capacitors would have been if we had left them in the signal path* We will show the results of the THD measurements, tests with MLS and standard IMD signals did 10-2010 elektor merit with one electrolytic We can therefore conclude that a bipolar configuration, with respect to distortion, is preferable over a single electrolytic. We assume that the non-linearities are cancelling each other. We followed this with measure- ments using other electrolytics {different manufacturers and rated voltages). The results gave different pictures, but always an increase in distortion. In all these situations a bipolar con- nection had a positive effect. After this we did tests with electrolytic capacitors that were 1 0 times smaller. The corner frequency is now at 7 Hz instead of 0.7 Hz with the 220 jjF device. There is now a greater voltage drop across the capacitor. The result of a measurement using the configuration of Figure la at 20 Hz (5 V rrm ) can be seen In Figure 3. There Is now considerably more distortion (about 0.005 %), and that is only due to the electrolytic! We also tried a bipolar connection, which gave a chart with a second harmonic that was about 1 7 dB lower, but the third was a little bigger. The rounded distortion figure remains the same. We had one remaining question. Does the DC voltage across an electrolytic capacitor have an effect on the distortion? That is why we carried out a measurement according to Fig lureld. We don’t have to show the result, because the two curves (with and without DC voltage} are practically on top of each other. To get a feel for the quality of standard plastic film capacitors (Siemens/Philips "MKT') we did two more tests with two ver- sions of the high-pass filter with a corner frequency of 20 Hz. The first version was a large 4,7 pF/250 V capacitor and a 1 .69- k£> resistor. The second version was a cheap 2.2 pF/1 00 V capac- itor (type without plastic case) and a 3.65-kQ resistor. The results of the measurements are shown in Figure 4. Both ver- sions gave pretty much the same result. Only the 2 ncl harmonic increased by 12 dB and the third remained practically identical From these tests we can conclude that when using electrolytic capacitors in the audio signal path it is desirable to locate the corner frequency well below the desired audio range. In cases where the impedances are low (kilo-ohms) there is no real alter- native to electrolytics for blocking potential DC voltages. The disadvantage of the large capacitance is that a change in DC voltage will still be partially allowed to pass, because of the long time constants involved. Switch-on phenomena also last longer. A consideration can be to increase the impedance (results in more noise), so that it is still possible to use a polyester (MKT) device. The advantage is then that the polyester cap can be dimensioned for the desired corner frequency. * From this we can conclude that when using electrolytic capaci- tors as coupling capacitors there is practically no measurable effect on the audio signal provided that the capacitor is consid- erably over-dimensioned. With these Too large' electrolytics it is also beneficial to use them in a bipolar connection. We have looked here at only one aspect (harmonic distortion). There are obviously many more characteristics of electrolytic capacitors that could have an 'audible* influence on the sound quality. Here is an overview of interesting publications If you would like more information about capacitors, ( 1 Q 0452 -I) Literature and Internet links Capacitors in A.F. Circuits, Elektor February 1 992 A real-time signal test for capacitor quality. The Audio Amateur, April 1985 Capacitor Sounds, Electronics World, July 2002 - January 2003 Picking Capacitors. Audio Magazine, February 1980 http://sound.westhost.com/artides/capadtors.htm http: //www. natlona t.com /rap/Appiication/0, 1 570,28,00. html 2d SO IDO m W Hr elektor 10-2010 45 ELABs INSIDE By Jens Nickel (Efektor Germany Editorial) Advances in high power LED technology has made it possible to shrink the size and price of LCD projectors. Makers of so-called pico-projectors boast that their devices will fit into your pocket and are ideal for projecting stills and videos from flash mem- ory video players, camcorders and portable DVD players onto a wall for everyone to see* Serious bit of kit or just a toy? With Conrad Electronic PI offering the l Aiptek Pocket Cinema T1 5' for 99 euros (some 80 pounds) we thought it was time for us to find out* site indicates it is possible to order the optical module type IPL- 51 2DG which was specially developed for the Pico projector l 2 l. The site News pages report that this module has also been integrated into a mobile phone to become the first phone with this feature* We also discovered that the mini display unit in the projector is a LCoS (Liquid Crystal on Silicon) unit This type of display simi- lar to an LCD is based on liquid crystal technology but works in a reflective rather than transmissive mode* The liquid crystals are applied to a mirrored substrate, as a liquid crystal pixel flips between on and off, light is either reflected from the mirror or blocked. This technology can produce high resolution images and is compact. We couldn't find an English website with infor- mation on the HX7009 chip which is supplied by Himax in Tai- wan PL The same company are also responsible for the HX8852 display driver chip which accepts digital video conforming to the ITU656 protocol HL Next to it is theTVPS l 50 AM 1 chip from Tl PI, this converts PAL input signals into ITU656 digital signals. The largest chip on the board is an 8-bit microcontroller type HT46R23 from Holtek 1*1. (100450) [ 1 ] www.conrad.de (Part No 3463 1 3) [2] http;//iview.apad*com.hk/en/products/products_details php?pageNo=l S-pid—1 1 [3] www,himaxdisplayxom [4] www.hlmaxdi5play*com/en/product/HX8852.asp [5] http://focus*ti*com/docs/prod/foiders/print/tvp5150am1. [6] www.holtek*com/english / news /pro ducts/ 02 270 1 .him 46 10-2010 elektor The Definitive UK Event for Electronic Design Innovation and 0 O 0 CD Q 03 CD 'co CD O u c O o _ C 5 o os CD tn cn fO o LU LJ CD ~a ■g ai .a g E CD — ' bC (J 0 cn X5 TD 0 C cn in 0 C E m 4*J -I—' 0 4 J 0 in B —_i O Q_ f— in CL -i— 1 i_ 0 =3 U) ■ s 5 _ cn u c= c in CD |r CD CD O ^ C LO CD cn c .E CD r" CD U w QJ — 1 T3 "S « -O u -a a> a ,-tL _a £ E E LU 0 — O CD U — ’ C CD CD 0 0 "a in — CD 0 cd *!£! in 0 o n ra xj L_ 0 ~n i rt ^ g ° r: 0 CD L_ L- I 0 n cd in c if) 0 o CL ^ 5 ° O 4= — j 1 O £Z ^ 0 o u XJ 0 0 0 0 0 0 0 u 0 0 5 >* in c 0 L- CL U) 0 0 C c; >> ■ u in CL C 0 CJ L_ if) O * to O E _c CD 0 0 in 0 I E u 0 =3 0 CL X 0 0 LL 10 0 LO ID C ce < 0 0 > 3 o o ai > 0 » “O 0 "a fl; *D ■O E ^ Q \fi > bcklght iff in bL ]n T h ± +5V -O +3V3 O C 12 100n CN 13 14 15 16 17 IB ri 1 Cl 3 10E)n a q d a 5 > pn pi P 2 P 3 P 4 PS PS P 7 PS P 9 PIS P 11 PI 2 PI 3 P 14 etc w w PIS « ifl Q O ■> :> |d5 x V ) UJ 39 3 S 37 IC1 P8X32A-D40 36 35 34 P 31 P30 P 29 P 26 P 27 P 26 P 25 P 24 P 23 P 22 P 21 P2D |24 PIS — P 1 B PI 7 PIG s 01 XI 4[]F 5MHi 40 33 23 27 26 25 23 22 21 +3V3 O PROP *LUG IC2 n T* CIS I00n SDA SCI (J a WP A 2 A 1 At) CS 24 LC 256' I/P o HE iQDn ■h 3 11 10 12 C61 100™ +3V3 O £ $ 3 a C1+ vcc 1C 3 Cl- 1 1LM T1QUT T2IN T20UT R10UT RUN R20UT R21N a* MAX3232CPE+ C2- ! u GNO > C 7 I — iH ISOn 16 14 7_ 13 a 15 +5V O — I K3 +3V3 — o— 1 J Cl 4 1S6n fo o o 090647 - 11 Figure 1 . The circuit comprises basically just a single Propeller chip (Id ) and an LCD for the graphics. K2 is for connecting a serial GPS mouse. elektor 10-2010 49 MICROCONTROLLERS L c G P V T G i 2 0 7 ■ 1 0 * T ] 1 M 0 0 0 1 K i A * 0 9 F R Write pointer "GPSPofafer" Rece i 1 ve Bu ffe r[Rece i ve Read P o i nte r] 09DS47 - 12 Figure 2 , Format of a CPS data set The parallel processes of the Cogs make interrupts superfluous, which as already mentioned is a significant advantage of the Parallax Propeller. In this GPS project you'll have the pleasure of programming five Cogs: t The main program GPS.Start requires one screen. As they require a relatively long processing time a dedicated Cog is provided. Let's now investigate the ReceiveDatas function of the fourth Cog in detail. With the library function FullDuplexSeriaL spin a character from the serial interface rs 1 1 L | 1 i -■1 \ compared with the write pointer Receive- WritePointer. If the pointers are unequal, then the Variable Receive Buffer[ReceiveWri tePointer] is read out and the read pointer is incremented by 1 . This process is repeated until the write pointer is the same as the read pointer. The CPS mouse delivers data using the NMEA-01 83 protocol into ASCII format, Each set of data begins with the character followed by a two-character long trans- mit indicator and a three-character data label. After this come the data sets, sepa- rated by commas. Finally the set is closed with an optional checksum and CR/LF. A set can contain up to 82 characters, in a format designated by the number of commas. The character determined by the read pointer is written into the array GPSBuffer. The start of a CPS data set is recognised by the T character, after which the write pointer CPSPointer is set to zero. The char- acter Linefeed (decimal 1 0) enables the end of a CPS string to be recognised. A GPS data set written to the GPSBuffer has the sample structure seen in Figure 2, In this example we are reading the CPS data sets SCPGCA, 5GPVTG and SCPRMC containing the fol- lowing CPS data: - SCPGCA includes Latitude, Longitude, Quality of the signal received, number of satellites received and height above sea level. - SCPVTG includes the speed. - SGPRMC includes clock time, date and direction of movement (effectively com- pass direction). Cog. From this main program the Cogs described next are called using the com- mand COGNEW(entry,..). 2. Cog for FullDuplexSerial.stai t. Reads in data from the CPS mouse over the serial interface. 3. Cog for KS01 08V1 OB.start. Drives CLCD with 128 x 64 pixels with KS107B/ KS108B-Controller, Preparation for text and graphic functions. 4. Cog for ReceiveDatas. Writes data from the RS-232 interface into a ring buffer (circular buffer). 5. Cog for Picture_Page_4_Cog. Graphi- cal functions are programmed on this is read in. The program waits in this line of programming for the period that the char- acter is read in. For this reason it is both logi- cal and necessary to start a dedicated pro- cess (Cog) (cognew ReceiveDatas). Every new character received is written into the ring buffer ReceiveBuffer {array[0..50]) by means of the write pointer ReceiveWrite- Pointer. The write pointer is incremented by 1 for each new character received. When the write pointer reaches a value of 51 , it is reset to zero. To generate a GPS string, the function ReadBuffer is read out from the ring buffer in the main program. To this end the read pointer ReceiveReadPointer is Practical matters To simplify construction a printed cir- cuit board (Figure 3} has been designed, on which all components (apart from the CLCD) are mounted on the top side. The CLCD is attached to the other side. The power supply voltage is connected to the multipin connector K1 ; a range between about 8 V and 1 8 V DC is permissible. The CPS mouse is plugged in at multipin con- nector K2. Power for the mouse is applied either to pin 5 (5 V) or pin 4 (3.3 V) and Pm 3 (supply return). Pin 1 is commoned with the transmit line (TxD) of the CPS mouse and pin 2 with the receive line (RxD). so 102010 elektor MICROCONTROLLERS A jumper on K4 switches on the background lighting of the CLCD. Brightness is preset with PI and contrast with P2. LED D2 indicates the state of the data received as follows; Steady light = Checksum and quality of received data in order Rapid flashing = Checksum error Slow flashing - Quality error The Parallax Propeller chip is programmed in-drcuit using the SPIN programming lan- guage, which can be downloaded free at the Parallax homepage and the 'Prop Plug' programming adapter from Parallax. Con- nection to the PC is by USB cable. On the CPS board the ’Prog Plug’ is plugged into the multipin connector K3 (Figure 4). Before operation you need to check whether the GPS mouse still needs to be configured with software that either came with it or else can be downloaded from the manufacturer's website. The serial interface of the CPS Mouse should be configured as follows: 9600X3,1. After powering up the CPS Propeller board the Receiver searches for the GPS mouse, first at 4800 baud. If a 9600 baud receiver is used, then the display will indicate only ran- dom characters initially. Afterwards the cor- rect presentation of received data at 9600 baud will appear (Figure 5). If after one second the data from a CPS mouse cannot be interpreted correctly the error message 'no GPS signal' is shown. A correct signal will produce an image with digital and analogue speed display (Figure 6). At lower left the maximum speed achieved previously is shown. Press button S2 can now switch between metric and imperial units (statute miles and feet). This setting is now valid for all subsequent displays and remains stored in the E EPROM even when power has been removed. Operating SI allows the following func- tional displays to be called up sequentially: Direction of movement display (Figure 7) similar to a compass (digital and analogue). History display (Figure 8) with graphical Figure 3. Inserting the components of the PCB developed for the GPS-Propdler. COMPONENT LIST Resistors D2 = LED (3mm) R1,R2,R3 = IQkQ 1C 1 = P8X32A-D40 (Propeller chip; Parallax) R4-1kn IC2 = 24LC256-I/P R5-5.6 Li [ O = MAX3232CPE+ PI = 2 5 0kQ. trim pot IC4 - 7805 P2 = 25k£3 trim pot tC5 = LM2937ET-3.3 Capacitors Miscellaneous Cl -C9,C1 2-C1 5 - 1 0GnF Xl - 5 MHz quartz crystal C9,C10 r tl 1 — IQpF 16V Inductor LI = TOjiH Semiconductors D1 = 1N4Q07 LCD 1 = graphic LCD 1 28 x 64, DEMI 28064 K1 ,K4 = 2 -pin pinheader K2 ’ 5-pin pinheader K3,K5 - 4-pin pinheader PCB ft 090647-1 (www.elektor.com/090647) Figure 4. Programming uses the USB programming adapter + Prog-Plug\ which Is plugged Into the PCB. elektor 10-2010 51 MICROCONTROLLERS — Sjnsp o h G P S 9600 Baud : PGGR ,113635 » 00 ,5100 -3877 ,N ,00550 .31?4 .E, 1 t 06 ,2 >83 ,00033 ,H 4 $47* ,M , ,+6fl H au u3 Cat jl - 1 1 . . 4 : button S2 ) - ICPGGfl .113258 .00 ,5100 .9784 ,N .00550.29^6 ,E i . Ut ,2 n . >68 ,00059 ,M 4 Check sun 1 66 H m .i tr. ra-i p r i < !- A 0 piph Is) C Reset : Button S2 ) RIti : 0ft Dir : 0 _ ' WJt f , VI- - ~ - ' *■ ,d . - T * p: j. .J ‘ —■ i i \ 1 1 J i>l - -'S V r'M ' / r k, r\ 7s 4 W- 5v.viri j3 K 5a r> s l n ■- AND 3USJNESS ' . - * r*’ 1 *■ /Tj > t+: ,♦ » ‘ * v + *s * ■ fcv ^‘!5ife w’ \ \e V ,V’- \^\ t ^ \ *■ ’ Vv * ,v * “ : T \\v \\«t . • • m i U v O s V ' s * v . \ - ;- U" V -V / V F ■ VV- * >y sr> ,\ - V -* I--*' 7/ * ’ ’ N* * 1 26,000 key decision makers. 20,000 new products. More than 130 countries. Four days. Make the deals that propel your business in the right direction. Register with priority code M2 by September 30 to sous the $100 registration fee. Exhibitors: Reach an international audience in one trip. Reserve space at Exhibit@CESweb.org. Register Now at CESweb.org I January 6-9, 2 011 i Las Vegas, Nevada 2011 International THE GLOBAL STAGE FQR INNOVATION I M ■ INFO & MARKET By Joe Lomako (TRaC) (UK) When it comes to applying ZigBee technology, the ideas people are coming up with are proving to be more and more elaborate and inventive. It is no surprise then that many (if not all) of the biggest names in wireless and microprocessor technology have shown considerable interest if not direct involvement. What’s humming out there? ZigBee is a specification which defines a high level communication protocol using low power digital radios using the IEEE 802.1 5.4 standard. The idea behind ZigBee is that It offers an infrastructure fora Wireless Personal Area Network (WPAN) which is highly adap- tive, simpler, less expensive and consumes less power than other WPANs, There are essentially three flavours of ZigBee: ZigBee, ZigBee PRO and ZigBee RF4CE which is a similar technology that is used for RF control of consumer electronics. The differences between the various technologies can be defined using a combination of the Network topologies, the security employed and the method of Network addressing. This can be shown in contrast in Table 1 . Let’s start networking... Each ZigBee network is essentially made up of a ‘coordinator’, Touter' and an L end device'. They canal! be fully functioning devices with an intrinsic function but will aiso perform ZigBee functionality. The coordinator forms and manages the network; the router can route messages as well as allow other devices to join the PAN router and the end device is just that. It can join a network but has no rout- ing capability. These devices are defined In Figure 1 . In essence the ZigBee network can be made up of two topologies: Tree/Star (Fig- ure 2) or Mesh (Figure 3). Table i.Zigbee basic versions and their capabilities ZigBee ZigBee PRO RF 4 CE Topology Star /Tree Mesh Tree Security Normal High Normal Network Addressing Distributed Stochastic Pairing 54 10-2010 elektor INFO & MARKET One of the strengths of ZigBee PRO is the meshing network topol- ogy which means that the networks can be extended over con- siderable geographical areas, such as in a large buildings or even an industrial pipeline. It has a ‘self healing 1 mechanism which means that if one of the components of a multibop route from one device to another leaves the network for any reason an altera- tive route using alternative adjacent devices will be identified and implemented. As for the end products, in simple terms, a ZigBee device is con- structed of a ZigBee compliant platform (a radio part and a ZigBee part) with the appropriate application (profile) sitting on top. The radio is based around the 802.1 5.4 standard (and comprises of a PHY and MAC layer) and the ZigBee ‘stack 5 sits on top. The abstract layer models in Figures 4 and 5 illustrates this, and then profiling The ZigBee platform becomes a so called functioning ZigBee device' when It has a ‘profile" placed on the top of it. A profile is a set of commands and attributes which are used to send specific messages over a ZigBee network. There are two types of profile; a Public Profile, which has been devel- oped by the ZigBee Alliance members and has specific command attributes. Anybody employing a Public Profile must adhere to the rules of that particular profile. Presently there are several Public Pro- files, which we will touch on later. There is also another type of pro- file, the Manufacturer Specific Profile (MSP), These are proprietary profiles which a manufacturer may develop because he wishes to use the ZigBee technology but not the Public Profiles. Public ZigBee profiles There are several profiles at present. These include ZSE, also known as Smart Energy; ZHA, also known as Home Automation; ZTS, also known as Telecoms Applications; ZHC, also known as Personal Healthcare; ZBA, also known as Construction and Building; ZRC, also known as Consumer Electronics. Each is discussed briefly below. Smart Energy Profile (ZSE) has been designed to be used in smart home area networks (HANs), to manage and improve the efficiency of energy consumption. There are many devices presently on the market from utility meters (gas, water and electric) to In-home displays, which can provide historical and real-time data Indicat- ing energy usage. Smart energy devices (Figure 6) are being ena- bled across the entire world from small households to entire governments. Home Automation (ZHA) — was one of the first profiles to reach maturity and has developed to become a very robust and ubiquitous tool in the ZigBee box. It enables the user to simplify the house- OZigBee Coordinator which is able to simulate the Windows 05 environment for many Windows programs. But where there's a will, there's a way. With the command-line pro- gram AVRdude, you can use the ATM 1 8 AVR board under Linux. Of course, this also works with MinimodiS, although 'direct* micro- controller programming is usually not necessary with this especially compact module because MinimodiS has a boot loader that can receive hex files via USB and store them in memory. If you "overhaul’ the Minimodi 8 with a programmer, the boot loader will be over- written and one of the key features of the module will be lost. In this case, the boot loadermust be downloaded into flash memory again to restore normal operation. The following instructions apply to a programmer compatible with AVRISP Mk ll } such as the Elektor AVRprog USB programmer designed by Benedikt Sauter [3]. If you use a different type of pro- grammer, see the inset for more information. The instructions are based on a Debian distribution of Linux, Installation Here we assume that you have a good basic understanding of how to install and use programs on a Linux system. In order to program the microcontroller of the Elektor ATM1 8 AVR board, you first need some software. As usual, you can use apt-get to meet this require- ment fairly simply (assuming the computer has a connection to the Internet). However, you must first log in as the root user by typing su or sudo (depending on the distribution) and your password imme- diately ahead of the apt-get command. Next, enter the following command after the prompt: apt -get install avrdude avrp gcc-avr avr-libc gdb-avr avra make udev Answer the question "Do you want to continue?’ with "Yes*. 5 & id -2010 elektor MICROCONTROLLERS The necessary packages will now be loaded and preconfigured. A few older packages may be de installed and replaced by other pack- ages or newer versions, ff you see a message reporting that the ker- nel does not support udev, you must update the kernel before udev or a new version of udev) can be loaded. Although it is possible to continue with the installation in this situation, you should not do so, since there is a risk of a system crash. A reliable kernel update is always the preferred solution. However, you can rest assured that Linux does not make it easy for foolhardy users to make mistakes of this sort. A particular file must be altered before Linux actually comes into danger. Before you update the kernel, it T s a good idea to quickly check whether the installation can actually run with the udev version already present; As the saying goes: nothing ventured, nothing gained! After the installation process has completed, you can connect the USB programmer to the USB port and use the Isusb command to determine the device ID: polel : /home/wolf # Isusb Bus 005 Device 003: ID 090c : 6300 Feiya Te c h n o 1 ogy Co r p . Bus 005 Device 001: ID ld6b:OOG2 Linux Foundation 2.0 root hub Bus 004 Device 002: ID 04 6d : c517 Logitech, Inc, LX710 Cordless Desktop Laser BUS 004 Device 001: ID ld6b:000l Linux Foundation 1.1 root hub Bus 003 Device 001: ID ld6b:OO01 Linux Foundation 1.1 root hub Bus 002 Device 001: ID ld6b:0001 Linux Foundation 1 1 root hub Bus 001 Device 004: ID 0al2:QQ01 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) Bus 001 Device 001: ID ld6b:G0Gl Linux Foundation 1.1 root hub Bus 001 Device 005: ID Q3eb:2l04 Elektor wolf ©polel : Figure 1 . Hey t it works under Linux too: microcontroller programming with the Elektor AVRprog USB programmer [3]. [ 5146.154083] usb 5-7. 4. 4: New USB device strings: Mfr=l, Product=2, SerialNumber=3 [ 5146.154083] usb 5-7. 4. 4: Product: AVRISP mk2 (CC2 ) [ 5146.154 083] usb 5 -7. 4. 4: Manufacturer: Elektor [ 5146.154083] usb 5-7. 4. 4: SerialNumber : 0000AQ0128255 wo 1 f @po 1 e 1 : ~ $ The most recently recognised device appears at the end of the (long) output list. With the Elektor programmer you will see idVendor=Q3eb, id Product-21 04. This gives you the assurance that the programmer has been recognised properly. If you don't like wading through the full dmesg output list, you can type dmesg [ tail to display only the tail of the list. Incidentally, the number in square brackets at the start of each line in the list is not significant: it is simply the elapsed operating time of the computer and it is not displayed by all versions of Linux, If you use a different programmer it will of course be reported with a different ID, If you can't find it in the device list, disconnect the programmer from the USB huh and enter the Isusb or dmesg com- mand again. Now you should be able to see what has changed in the command output (which device Is missing or has been added). The ID of our programmer is 03eh:2104. If you can’t read the ID with lush (sometimes new devices are not shown), you can use dmesg instead: [ 5145.834284] usb 5 -7, 4, 4: new full speed USB device using ehci_hcd and address 10 ( 5146,150088] usb 5-7. 4. 4: config 1 descriptor has 1 excess byte, ignoring [ 5146,150088] usb 5-7, 4. 4: configuration #1 chosen from 1 choice I 5146.154083] usb 5-7. 4, 4: New USB device found, idVendor~03eb, idProduct=2104 To avoid having to log in as the root user every time you use the pro- grammer, you can edit the permissions. rules file, which is accessed via path /etc/udev/rules.d/020. Near the end of this file, just before LABEL“”permissions_end”, there Is an entry containing the device ID you found above. You can use the vi editor (or any other suitable editor) to make the desired changes: vi /etc /udev / rule s , d/ 0 2 G_pe rmi s s ions . r ul e s # AVR ISP mkXI Atmega Programmer SUBSYSTEM^- "usb_device u , SYSFS { idVendor } == "03eb" , SYSFS ( idProduct } = = 1 '2104 ” , GROUP = "plugdev" , elektor 10-2010 59 MICROCONTROLLERS mmand Graphic front ends for AVRdude (which has a command line user interface) are available on the Web, although we haven't tested any of them. The fact that we restrict ourselves to the command line in- terface here should not be regarded as a value judgement; it simply reflects the notorious difference between Linux users and Windows users. If your distaste for command line interfaces is sufficiently large, you can try alternatives such as a Java GUI [6| ora KDE program called Kontrollerlab [7], although it appears that the later program is no longer being maintained. With the exception of the simulator, Kon- tmllerlab is certainly usable as a substitute for AVR Studio under Linux, Unlike AVR Studio, it supports AVRdude without plugins, so you can download program code to the ATmega directly from the IDE. Other programmers The AVRdude program has a large number of options. For example, you can use the -c option to select a different programmer. If you only have a programmer with a parallel (printer) port interface avail- able. you can use it this way. You can also ask AVRdude whether it recognises the connected programmer: avxdude -wv -c help If it doesn't recognise the connected programmer, it responds: avrdude; Can't find programmer id „help" Valid programmers are; dasa3 = serial port banging, reset=!dtr sck=rts mosi=txd miso=cts [/etc/ avrdude . conf ; 693] dasa = serial port banging, reset-rts sck=dtr mosi-txd miso=cts [/etc/avrdude , conf : 680] siprog = Lancos SI- Prog [/etc/avrdude . conf : 667] If you have a programmer of a completely unknown type or use a homemade programmer, you can view the AVRdude main page to see how to configure the pin assignments for the parallel port: Default Parallel port pin connections (these can be changed, see the -c option) Pin number Function 2-5 to MCU) 7 8 9 10 18-25 Vcc (optional power supply /RESET (to MCU) SCK (to MCU) MOSI (to MCU) MI SO (from MCU) GND MODE ^ "066 0'\ SYMLINK+ = " f OO w LABEL= " permi s s i ons _end " If you enter “piugdev” for CROUP= ( users without root privileges will also be able to use the programmer. If vi (the grandfather of all editors) isn’t your cup of tea, you can make the changes with any other editor that has root privileges. A good choice here is Midnight Commander, which is something of a Swiss army knife for Linux, The changes take effect only after the udev configuration has been reloaded as follows: udevcontrol reload rules Now you can query the programmer with the following command: avrdude -c avrispv2 -P usb -p mS8 It replies: avrdude; AVR device initialized and ready to accept instructions Reading | ############# I 100% 0,01s avrdude: Device signature - 0xle93 0a avrdude : safemode : Fuses OK avrdude done * Thank you . All of the above applies equally well to the Minimodi 8. Its boot loader simulates a programmer (more specifically, a USSasp pro- grammer) and can also communicate with AVRdude* tn this case, you must enter the parameter -c USBAsp instead of -c avrispv2 -P usb. You also have to enter -p m328p for the microcontroller, as other- 60 10-2010 elektor MICROCONTROLLERS vise AVRdude will complain that the signature is wrong, A hot topic: fuses This is not the place For playing around, since you can easily mess things up with the wrong fuse settings, or even make the micro- controller unusable. Whenever you need to change fuse settings, always engage your brain first and think things through twice before you do anything. Enter the following command to read the fuse settings: avrdude -p m88 -c avrispv2 -F usb -F -v -B 10 -U hfuse : rihigh.txt i i -U Ifuse : r : low, txt : i f— E BASCOM AVR IDE [1.1 1.9.! i [C: Wrb&inJIWttBASCOM AVHUW8e\Prfnl.b«] B0BI - Die §& Vwv* Program locfc Qptxjns tjelp . B X „ W, Efi . 6. . . -f v tt - ? fr~ » Sing1e_tcnfrtifcfcfii doob3f_tnsiiK Sub * Labtf * r- | Bat tost AT S F r - xi t A Sxcgi 1 1 u SorystcJ 1 3 1 BOO DO Cl 0 Hand $£00 Goto Testl TostI Do Print Vaitas 2CU0 Loup Test 2 Dik A is By t e Dn E Aw Tntftg^r Dim C As Single Do Print i uj. i ! i w < > 4 20 Medved Inwsi Figure 2. Whipping up a test program: BASCOM feels perfectly at home under Linux with the Windows API wrapper Wine. AVRdude responds with: avrdude: Version 5,10, compiled on Jan 19 2010 at 18:01:15 Copyright (c) 2000-20 G5 Brian Dean, http : //www . bdmxcra . com/ Copyright (c ) 2007-2009 Joerg Wunsch avrdude: AVR device initialized and ready to accept instructions Reading | ##########^########################## ############# | 100% 0,02s avrdude: Device signature = QxffOOff avrdude* Expected signature for ATMEGA83 is IE 93 OA avrdude: safemode: Ifuse reads as 62 avrdude : safemode : hfuse reads as DF avrdude: safemode: efuse reads as 7 avrdude: reading hfuse memory: Reading | ##################################### ############# | 100% 0.00s avrdude: writing output file "high, txt" avrdude: reading Ifuse memory: Reading | ############# | 100% 0.00s avrdude: writing output file " low. txt" avrdude done . Thank you . polel : /home /wolf# There’s not enough space here to print the full response ( AVRdude is a real blabbermouth). The two lines you’re interested in at this point are: avrdude: safemode: Ifuse reads as 62 avrdude: safemode: hfuse reads as DF This q ives you the fuse settings you need to know. At the sa me time, they are written to the files low.txt and high. txt as specified in the command. You can view the file contents with: cat low.txt.orig : 010 0 0 00 0 62 9D : 00 00 000 IFF and cat high . txt . orig ; 01000000DF20 : 000 0000 IFF if it’s necessary to change the fuse settings, there is a handy tool availableforcalculsting the hex values: Fusecalc [4], Of course, you can also calculate them by hand with the aid of the data sheet. How- even remember what we said: a single mistake could be fatal for the microcontroller. You can use AVRdude to write the fuse settings to the microcon- troller in the same way as you read them: avrdude - c avrispv2 -P usb -p m3 8 -U If use : W : 0x62 :m -U hf use ; w : OxDF : m Here we omit the response from AVRdude. which gets a bit boring after a while. The main thing to check is that there aren’t any error messages. If there are, first check the connecting cables and the supply voltage. If errors are indicated but you cannot find the cause, you can use the -f option to force AVRdede to try to write the set- tings to the microcontroller despite the error message(s). 6i elektor 10-2010 MICROCONTROLLERS Knuckle down, ATmega! The next thing you need is a program for the ATmega, You can write your own with gcc or BA5C0M (which runs nicely under Wine)* or you can use any desired program you already have available* such as the LED running-light display program from the first article In the ATM1 S AVR board series (which can be downloaded free of charge from the Elektor website |s l). In any case, you only need the hex file, which is designated main. hex here. Use the following command to download the hex file to the flash memory of the microcontroller: avrdude m88 -c avrispv2 -F usb -F -v - B 10 -F -U f lash : w : main . hex The response from AVRdude (only the final part is printed here) is: avrd-ude: AVR device initialized and ready to accept instructions Reading | ##################################### ############# | 100% Q.Ols avrdude: Device signature - 0xle930a avrdude: safemode ; lfuse reads as FF avrd-ude: safemode: hfuse reads as DF avrdude : safemode : efuse reads as 1 avrdude : NOTE: FLASH memory has been specified, an erase cycle will be performed To disable this feature, specify the “D option. avrdude: erasing chip avrdude : reading input file "main* hex" avrdude: input file main* hex auto detected as Intel Hex avrdude: writing flash (146 bytes): Writing || ##################################### ############# | 100% 0 * 14s avrdude: 146 bytes of flash written avrdude : verifying flash memory against main . hex : avrdude: load data flash data from input file main , hex : avrdude : input file main . hex auto detected as Intel Hex avrdude: input file main* hex contains 146 bytes avrdude: reading on-chip flash data: Reading | ##################################### ############# ] 100% 0,07S avrdude: verifying . ** avrdude: 146 bytes of flash verified avrdude : avrdude : avrdude : avrdude : safemode: lfuse reads as 62 safemode : hf use reads as DF safemode: efuse reads as 1 safemode : Fuses OK avrdude done* Thank you* Now the microcontroller has the new program code in its flash memory, and you can use the program. Don't forget to connect the appropriate I/O pins of the microcon- troller to the inputs of the ULN2GG3 on the ATM IS AVR board [5], so you can see the running-light pattern on the LEDs. You need a different program for the Mini modi 8* since it doesn’t have any LEDs on board (but it does have a display module). A pro- gram that outputs a simple message is adequate fortesting. As you can see* it’s not that difficult to use the ATM 18 AVR board or Minimodi 8 module with a Debian Linux distribution* if you use a different distribution* you will need to modify these instructions appropriately because program installation is slightly different and there are a few other differences in how things are done. We conclude our instructions in the friendly spirit of AVRdude: Elektor/cc2 done. Thank youJ Now you can start having fun with the ATM1 8 AVR board or Mini- modi 8 in your Linux environment! (100177-1) Internet links [ 1 1 www.atmel.CGm/dyn/product5/toota_card_mc u, asp?toa 1 Jd =2725 [2] viwv.winehq.org [3 1 www*dektor.com/080083 [ 4 \ http://frank H drcfeofcurrenl:*cQm/fusecalc/fusecalc.php [5 1 www.elektor.com/G71035 [6] http://avr8-bu rn-o-mat.aaabbb.de/ [7J h ttp :/ 1 so u rc efo rge.n et/ projects / ko n tro 1 1 e r la b / 62 10-2010 elektor f^cKtor MtiW THtflE L 5 EVEH M CND +SV Q Jci 12 11 Tion 6_ 5 GND 4 T « l_ pin 19 1 IS cm K3 O P® rt2 O inw7S r. Figure 4. Circuit diagram of the sensor RGB. Figure 5. The evaluation board ATMegaS processes both gear tooth sensor signals. 6 ? elektor 10-2010 MICROCONTROLLERS Figure 7, Mounting the sensor on the small PCB. Figure 8. Release the four bolts and carefully remove the casing which holds the stub axle and the Final drive gear wheel. *%*' 4 S Figure 9. The correct hole position from the casing edge. Table i. Connections between the ATMegaS PCB and the Wheelie main board ATMegaS signal processing board Connection to the Wheelie main board KiyPin 1 (GND) I<3/Pin5 (GND) | K1 /Pin 2 (+ 5 V) K2/Pin 2 (+5 V) Kl/Pin 3 (SDA) ICT/Pln 23 (SDA) Kl/Pin4(SCL) i |C7/Pin 22 (SCL) COMPONENT LIST Signal processor board with ATMegaS Resistors R1 t R2 = 4.7kn R3 = 10kQ Capacitors C1,C2 = 10nF CG t C 7 - 27 pF (or 22pF) C3.CS = IGOnF Semiconductors D1 = 1IM4148 1C 1 = ATMegaS- 16PI, programmed) Miscellaneous XI = IGMHz quartz crystal K1 = 4-pin pin header K3.K4 = 3-pin pinheader K2 = 6-pin (2x3) pinheader PCB no. 1 00479- V sensor is mounted from the other side of the board and soldered on the track side. The legs are first bent flat along the body of the sensor (Figure 1) and then pushed through the board and soldered to the pads on the track side. Note that a small gap should be left between the sensor and PCB (Figure 7). This allows the sensor to be fixed to the PCB using epoxy adhesive. The lead ends can now be cropped dose to the sol- der joints on the PCB. Finally a short length of heat shrink sleeving over the sensor will prevent any possibility of the leads shorting to the gearbox casing. Connections to the board can be made by soldering the three wires directly to the pads of K1 . This is more robust and removes any reliability issues of a connector at Kl. Construction The most time-consuming part of this mod- ification will be fitting the rotation sensors into the two motor gearboxes. The great- est challenge is drilling one hole in the gear- box aluminium casing — and get It right first time round! Firstly undo the four screws holding the gearbox cover En position then pull the cover off complete with the stub axle and larae gearwheel (Figure 8), The housing will be Filed with grease. The ball race housing con- tains a spring washer which will most likely adhere to the ball race as you pull it out of the housing. Keep this washer safe, you will need it later during reassembly. The position of the hole to take the sen- sor can now be marked on the casing, it is r A kit of parts containing signal process- ing board (100479 1), two sensor boards (100479-2) and all components is avail- able from the Eiektor Shop, order code 100479-71. Figure 6. The evaluation board is wired to both sensors and the Wheelie main board. 1 1 .5 mm (0.45 inch) away from the edge of the casing (Figure 9 and Figure 1 0). Use a centre punch to mark the point; It will pre- vent the drill from wandering. Before drill- ing it will be necessary to clean the grease away from the area where the hole will be drilled. Lay some paper kitchen towels or clean rags on the bench to catch any swarf. Debris which does Fnd its way into the cas- ing can be removed with a pair of tweezers (the more meticulous types out there will no doubt remove all the grease, flush out the housing after drilling and re-pack with grease). Once the position has been marked and double checked make a pilot hole through the casing using a 3 mm (1/8 inch) drill. Check the position of the hole again before drilling through with a 9 mm (3/8 inch) drill. The sensor PCB (with its cables attached) can now be permanently Fxed to the casing using two pack epoxy glue (with the sen- sor chip positioned into the hole). Be sure to degrease and abrade this area of the case before gluing. Once the glue has set the hole (Figure 1 1 ) will be completely sealed by the PCB (Figure 1 2) and the sensor will be close enough to the gear teeth to gener- ate impulses when the cog turns. Any debris remaining in the gearbox housing must be carefully removed before re-g teasing the gear wheels and reassembling the housing (don't forget the spring washer). Wiring Three-core cables are used to connect the sensor PCBs to the ATMegaS PCB. 70 10-2010 eiektor 11,5 mm i + ff± MY132CZ? LftfEV 2450(1 CM Q 60059 Figure 10. The motor before., * A four-way flat band cable connects to K1 of the ATMegaB PCB and to the points specified In Table 1 on the existing main board in the Wheelie. Software and Updates The firmware for the ATMegaS fitted to the evaluation board can be downloaded for free from the Elektor Website. The direct link is: www.elektor.com/ 100479. A commented source file Is included in the download folder for this article along with the Hexfile. The Elektor shop stocks the complete kit to convert the stand- ard Wheelie to the Wheelie GT including a pre-programmed ATMegaS. It will also be necessary to upgrade the existing ATMega32 main board firmware In the Wheelie so that it can handle data from the evaluation board. The new firmware (hex and source code) is avail- able for free download from www.eiektor.com/ 1 00479. Some hardware modifications will also necessary to the main board for Wheelies using the GT sensors: 1 . Replace the three 470 juF capacitors Cl , C2 and O with better spec 1 000 pF capacitors (use low E5R types e.g. the Panasonic FM series). 2 , Change R 1 4 to 47 l<£> and ad d a 1 00 n F capacitor between I C7 / Pin34 (ADC6) and ground (solder It between the correct leg of R14 and ground) The improvement in stability of the Wheelie GT version (especially in off-road situations) can be seen on one of the author’s YouTube videos: search for guenterl 604. (100479) Figure 1 1 , ,„and after fixing the sensor PCB Ti c h llnl ns AFFORDABLE EXPERTISE ‘HE PC OSCILLOSCOPE RANGE FROM PICO TECHNOLOGY !*■ ■)" v } j « ■ iii-' + rf E it Ell J ■ rf “ / 'i Ipi ji‘- ’! BANDWIDTH 20 MHz to 12 GHz SAMPLING RATES 50 MS/s to 5 GS/s MEMORY n 1 r * _ 4 t o kS to 1 < VJ J RESOLUTION n PRICES Latest Software Updates: \ 7 C 8i CAN bus decoding, mask limit testing, advanced triggers, digital low pass filtering, rapid triggering www.picotech.com/ stope2019 71 elektor 10-2010 DESIGN TIPS From Microphone to Line Input By A.J. Ribbink (The Netherlands) The requirements a microphone preamplifier is expected to meet are very different from those formulated for a line amplifier. For the first, a large gain and a low noise contribution are very important, while a line amplifier has to be able to handle a much larger signal without generating distortion, A microphone input has a sensitiv- ity of a few millivolts; a line input must be able to cope with several volts. In most cases a different type of circuit is used for each of these different types of input With the circuit described here it is how- ever possible to meet both requirements at the same time. Using only a single potentiometer, both the gain and the volume can be adjusted. A dead common (audio) amplifier is shown in Figure 1 . In this circuit the amplification (gain) A is determined by the ratio of the feedback resistor R to R1 as follows: A " (R+R1 )/Rl . Volume control R P is really nothing more than a voltage divider com- prising R3 and R2, where R2 + R3 = R P , Drawing it in a different way eter, both gain and volume can be controlled. R1 is still present in Figure 3, where its function is to limit the maxi- mum gain. The additional resistor R4 has two purposes: it prevents a potential (and undesired) short circuit of the amplifier output and forms the voltage divider for the volume control, together with the R3 part of the potentiometer. The circuit can be used with ICs as well as amplifiers built from dis- crete components. The value of R4 can be changed to the desired output impedance and the volume control curve. If control all that way down to zero volts at U OLIt is not required, then U 0 ut can also be taken directly from the output of the amplifier circuit. A bad contact in the wiper of the potentiometer will not result in too much of a cracking noise, because R1 +R P +R4 are connected in paral- lel with feedback resistor R. The gain is reduced in the event of poor wiper contact, which means that cracking noise remains limited. In most circuits R1 has a much smaller value than R2. For a smooth control, R1 should therefore change value much slower than R2, A ! reverse) logarithmic potentiometer is therefore recommended. With a normal logarithmic potentiometer the volume will reduce results in the schematic of Figure 2. The operation of the voltage divider can be expressed as; D = R2/(R2+R3). Gain factor A and division ratio D together determine the amplifica- tion of the overa II d rcu it as i n when the potentiometer is turned clockwise! A reverse-log poten- tiometer or a logarithmic slide potentiometer mounted upside down* gives a normal, familiar control. Suitable resistance values are, for example, 50 kO for Rp, 22 k Q for R, 56 Q for R1 and 220Qfor R4. Using these values the maximum and minimum amplification are about 360 and 1 .5, respectively. Uout = A X D X U\n* The output voltage is therefore adjustable by changing R1 and/or R2. Because of the opposite actions of R1 and R2 — a larger value of R1 results in a smaller output voltage, white a larger value of R2 increases the output voltage - these two resistors can be combined as illustrated in Figure 3. In this way, using only a single potentiom- At the lowest operating frequency the capacitors need to have a (much) smaller impedance than R 1 and R4. The input impedance of the circuit is mostly determined by resistor Ri n and can be adjusted to suit whatever signal sources are likely to be connected. Noise suppression filters and/or frequency dependent networks can be connected in front of this. Frequency dependent feedback is not rec- ommended for this circuit, because the the RC filter characteristic will change when the gain and volume are adjusted. (□90182!) I 2 10-2010 elektor Subscribe now to the leading US-based computer applications magazine specializing in embedded systems and design! tan* ■ ■ ■ 1 Q0Bt — Ttitt Looft. p. Itl I InmWn ft Pitu’^ &ES00L Select your personal subscription at www.cc-access.com/subs 12 editions per year for just Print: $63 Digital: $38 Print + Digital: $90 — CIRCUIT CELLAR THE MAGAZINE FOR COMPUTER APPLICATIONS RETRONICS XL 80 Candles for the Pentode figure 1. Eighty years back in time. Left to right: tubes type RES 1 64, 34,EF97 and 1j18b. By Andre Adrian, DL1ADR (Germany) The first transistor radio was called Regency TR-1 and appeared on the market in 1 954, at a time when radios with vacuum tubes had been around for decades. One of the most successful tubes is the pentode, a vacuum electron tube with five (Creek: pente) electrodes, A famous early pentode was the ‘RCA-34' (UX-234), it reached commercial use in the early 1930s and was announced as a ‘Super-Control R-F Amplifier Pentode', To celebrate the Pentode's 80 th birthday this article in the Retronics series describes the construction of a shortwave radio for the 49 m supply rail and the suppressor grid is tied to the negative terminal of the anode battery. The *34' pentode has a barium oxide coated filament. The filament requires 2 V at about 60 mA, The resulting 120 milliwatts cause the filament to heat up to 800 °C and to glow nearly invisibly. The Rus- sian subminiature pentode type 1 H41 8B ( 1 j 1 8b) requires even less heating power: 1 .2 V at 24 mA, in Figure 1 you see pictured, left to right: type RES1 64 pentode (ca. 1928), type 34 pentode (ta. 1930), miniature pentode type EF97 (1 957), and a subminiature pentode type 1 Hfl 86 . The (spectacularly) low-voltage type EF97 can work with just 6 volts on its 'plate', Basic operation of the Audion An Audion consists of an LC resonant circuit for setting the reception frequency, and an amplifier. To enable very high gain to be achieved, part of the amplified RF signal is fed back to the input. Consequently the Audion operates as an amplifier on the verge of self-oscillation. The radio frequency is amplified and demodulated simultaneously. Amplitude demodulation is achieved by the different response of the control grid to negative and positive voltages. The rectifier in the tube between control grid and filament is conductive for posi- tive voltages, but not for negative voltages. A grid leak' network of 1 IVtQin parallel with a ca pa citor of 68 pFatthe control grid sup- ports the grid rectifier. A simplified Audion radio Changes in the feedback cause changes in frequency. To keep this effect within limits, a radio ham called F.H. Schnell in the 1920s added an adjustable attenuator element in parallel with the feed- back winding. In the simple circuit shown in Figure 2, all compo- nents determining the receiving frequency and feedback are con- build a shortwave radio based on the ‘34* pentode and 41 m broadcast bands, based on the ‘34’ pentode or la ter types. With only one tube and a 1 ,5 m (5 ft.) wire antenna, reasonable reception at headphone volume levels is within reach. Depending on the tube used, the anode voltage is a safe 6 to 45 volts supplied by batteries. The radio can be built in 'classic' fashion using a flat coll and variable capacitor, or in modern guise using a ferrite core and a variable capacitancediode. The successor to the pentode, the field effect transistor (FET), can also be used, although its higher gain will make tuning the radio a real achievement In the beginning: tungsten The hot tungsten filament of an incandescent lamp emits electrons. This was observed by Thomas Alva Edison in 1883 as he installed an electrode next to a filament in the bulb. In vacuum, a current flows between filament and anode. In the course of the years more electrodes were 'inserted' between filament and anode. Beside the cathode and anode, the pentode has a control grid, a screen grid and a suppressor grid. The control grid can be said to correspond to the gate of a FET. The screen g rid is usually connected to the positive nected to ground (earth) at a single point. The LC resonant cir- cuit consists of variable capacitor Cl and a section of coil LI . The antenna and the control grid are connected to a tap on the reso- nant circuit. Coils LI A and LI B work as an autotransformer and adapt the low AC resistance of the antenna and control grid to the high-impedance resonant circuit. The feedback is via C2 onto feedback winding L 1 C with its parallel connected attenuator in the form of potentiometer R1 , which acts as the feedback control. L1C forms a second auto- transformer with the rest of LI , With the centre of LI grounded, a phase shift of 1 SO degrees is established between the feedback winding and the resonant circuit. The desired positive feedback is obtained in conjunction with the phase shift of the amplifier. High-frequency choke L2 separates the RF part of the Audion from the AF part. Every inductor has stray parallel capacitance — invis- ible but always present! For the RF choke we have about 1 0 pF. The stray capacitance of the primary winding of output transformer Tr 1 is much higher. Without L2, it would effectively short-circuit the high frequency signal. 74 10-2010 elektor RETRONICS XL 50 mm < > Figure 2. Schematfc of the simplified Audion "2070 style’. Output transformer Trl matches the high AC resistance of the tube to the low impedance of the Walkman-style headphones. The two 32 Q earpieces are connected in parallel The ‘A’ battery supplies heater power to the tube, the battery, the anode (plate) voltage. An AAsize NiMH battery is just fine as a Figure 3, The author’s simplified Audion constructed on breadboard. Ftgu re 4, Use th i s tem plate to make your own 4 1 -m m hold er fo r the spider web coil in the radio. filament power source. The anode battery consists of two series- connected 9 V batteries. Current consumption amounts to 24 mA from the A battery, and 2 mA from the B battery. Capacitor C3 short circuits any RF signal at the screen grid. The sec- ondary of Trl is intentionalfy not grounded. The front panel should consist of a grounded metal plate, or at least have some kind of metal foil (grou nded T of cou rse) on the inside. The a nten na con nec- tor should be located at the rear of the enclosure. All these meas- ures reduce the sensitivity of the circuit against the dreaded "hand effect’ — if the radio operator's hand is in the vicinity of the radio, the resonant circuit is detuned. The length of the antenna should be limited to 1 .5 m (5 ft.). A longer antenna is possible and allows you to pick up more stations but only if connected via a small capacitor of 4,7 pF to 33 pF, A proper antenna earth connection is essential to good reception. The GND connection of the circuit should be connected to conductive heat- ing pipe. Potentiometer R1 also adjusts the volume. If you turn it up too far you will hear a howling sound. Your Audion then works as a trans- mitter and may cause interference on other receivers. Remember, the Audion is a regenerative radio! Practicalities The parts list of the proposed receiver is given in the inset. The picture of the breadboarded prototype in Figure 3 shows the Retronics is a monthly column coveting vintage electronics including legendary Elektor designs. Contributions , suggestions and requests are welcomed: please send an email to editor@elektor.com elektor 10-2010 75 RETRONICS XL Audion Parts List Cl ~ 35pF tuning capacitor with reduction gear (vernier), or Philips 'beehive' style (Opperman Electronic, Germany) C2 = 1 nF ceramic multilayer capacitor C3 = 10nF ceramic multilayer capacitor LI = spider web coll 10+5+5 turns 0.3 mm {AWG #28) enamelled copper wire. L2 - 1 mH choke (Fastron SMCC) R1 = 47kQ potentiometer, linear St -SPST on/of switch Trl - 1 :10 miniature AF transformer, colour code: blue (Reinhdfer Electronic, Germany) VI = 1 j 1 8b tube (NOS on Ebay) 3.5mm stereo jack socket Battery holder for one 1 .5 V A A cell Clip-on leads for 9 V 6LR22 batteries beehive trimmer* the tube, the potentiometer* the output trans- former next to the jack socket and the earphones. The spider web coil is visible in the rear. The spider web coil support consists of 0.4 mm thick transparent PE plastic which is sold as sheets in the stationery trade (anyone remember late afternoon Powerpoint presentations using over- head projectors?). The template shown in Figure 4 is placed under the film and its outline is copied onto the sheet with a CD marker pen. The shape can be cut out using heavy duty paper scissors. To allow the slots to be cut easily 3 mm (1/8 in.) holes are drilled at the ends. For the complete winding you'll need 3.2 m (approx. 11 ft.) of 0.3 mm (AWG #28} enamelled copper wire* plus two pieces of about 1 0 cm (4 in.) for the taps. The wire should be wound tightly onto the former. After 1 0 turns, a wire loop is bent. Before you continue winding, solder the wire loop to the connection wire. The second tap is after another five turns. For more on tube radios* visit the author's website [] l (091047) Internet Link www.andreadrtan.de/sdr/ (in German) Production Prototype We add value to PCBs when others just sell it. Designing Service One Stop Manufacturing Service $10 ea. for 5pcs 4"x4" 2L Free Solder Mask & Silkscreen^ Free Component Assembly Components Pcbs Enclosules Fpcs Keypads www.EzPCB.com Email: sales@ezpcb.com Please Visit www.machinepier.com For Machining 76 10-2010 elektor INFOTAINMENT Hexadoku n this the Northern hemisphere leaves are starting to fall and temperatures have gradually dropped to evels where you might want to stay indoors. Ideal conditions we say for a new release of Elektor's famed & famous Hexadoku puzzle. Enter the right numbers in the puzzle, send the ones in the grey boxes to us and ■QU automatically enter the prize draw for four Elektor Shop vouchers. Have fun! The instructions for this puzzle are straightforward. Fully geared to electronics fans and programmers, the Hexadoku puzzle employs the hexadecimal range 0 through F. In the diagram composed of 1 6 x 1 6 boxes, enter numbers such that alJ hexadecimal numbers 0 through F (that h s 09 and A-F) occur once only in each row, once Solve Hexadoku and win! Correct solutions received from the entire Elektor readership automati- ally enter a prize draw for one Elektor Shop voucher worth £ 80.00 and three Elektor Shop Vouchers worth £ 40.00 each, which should encourage all Elektor readers to participate. in each column and In each of the 4*4 boxes (marked by the thicker black lines). A number of dues are given in the puzzle and these determine the start situation. Correct entries received enter a draw for a main prize and three lesser prizes. All you need to do is send us the numbers in the grey boxes. Participate! Before November 1. 2010, send your solution (the numbers in the grey boxes) by email, fax or post to Elektor Hexadoku - 1000, Great West Road - Brentford TW8 9HH United Kingdom. Fax (+44) 208 2614447 Email: hexadoku@elektor.com Prizewinners The solution of the July/ August 2010 Hexadocube Is: 2975EF. The Sceptre/Intersceptre kit worth £236 was won by: Simon Lehmayr (Germany). The £40.00 vouchers have been awarded to: Andy Wood (Australia), Per Troelsen (Denmark) and jean-Ctaude Carre (France). Congratulations everyone! B 4 C 0 1 3 F 8 D 6 E C 5 B 3 7 F 3 9 8 0 D C 6 2 A D 2 4 C 6 6 7 F 3 A 2 D B 1 C F 9 C 7 B 1 2 E D 5 8 A 0 4 0 B 6 3 1 8 B 1 5 6 6 A j3 0 4 2 F 7 E 2 C 9^ 4 3 0 1 6 2 4 6 E 9 D 7 2 4 C 8 3 0 9 4 1 0 2 C D 8 B 7 C F A 0 D 9 5 0 C 3 1 2 9 E (Cl Pm cunt A 7 B 5 F 1 E 8 0 2 4 3 c 6 9 D 6 4 9 F 2 C 7 D B 8 1 5 0 3 E A 0 C 8 D B 3 6 4 9 A 7 E 2 F 5 1 1 3 2 E 9 A 5 0 F D c 6 8 4 B 7 8 B 0 9 D 7 4 c 6 5 2 A F 1 3 E F D 4 6 E 5 0 A 1 B 3 7 9 C 2 8 2 5 C 7 3 F B 1 4 9 E 8 D 0 A 6 E 1 A 3 6 8 2 9 C F D 0 B 5 7 4 7 9 6 A 4 E 1 F 3 C 0 B 5 D 8 2 D 0 F C 7 9 8 2 E 4 5 1 3 A 6 B B E 3 4 C 6 A 5 D 7 8 2 1 9 0 F 5 2 1 8 0 B D 3 A 6 9 F 7 E 4 C 4 F 7 2 5 0 3 E 8 1 A D 6 B C 9 9 A 5 1 8 D C 6 i 2 0 B 4 E 7 F 3 C 8 E 0 1 4 F B 7 3 6 9 A 2 D 5 3 6 D B A 2 9 7 5 E F C 4 8 1 0 The competition h not open to employees of Elektor International Media, its business, partners and r 'nr assoria ted publishing house*. elektor 10-2010 77 EL KTOR SHOWCASE To book your showcase space contact Huson International Media Tel. (0) 1932 564999 ASTROBE V3.0 www.astrobe.com Windows Development System for LPC200G microcontrollers, • Develop high-and low-level software without C or assembler * Generate fast 32-bit native ARM code * Mo special programming hardware required • Personal, Standard and Professional Editions ATOMIC PROGRAMMING LTD wwvv, a to m i cp ro g ra m m In g . c om • AP-1 14 ISP/JTAG Programming System • JTAG Programming and Testing * Boundary Scan Testing * Universal In-System Programming * EEPROM and SPt Flash Out-of-Circuit Programming ^ • Generic GOB Proxy Server • Jennie JM5148 ZigBee Development Applications * Training Platform available yvac.com ByVac www.b • PIC32 With BASIC • ARM With Forth • USB to I2C • Serial Devices • VT1O0 LCD Displays CEDA www.ceda.in ceda@vsnl.com !( i 1 )/\ ' PADS | OfCAD | PCB layout Q learning $5 Hourly ^ A • PCB Layout @ $5 Hourly • Learn PCB Designing with Multimedia DVD in OrCAD, PADS & ALLEGRO • Self or e-learning with support by email phone & web-meeting 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, DESIGNER SYSTEMS http://www.deslgnersysteni5,co,uk Professional product development services. * Marine (Security, Tracking, Monitoring & control) * Automotive (AV Tracking, Gadget Monitoring Si control) * Industrial (Safety systems, Monitoring over Ethernet) * Telecoms (PSTM handsets. GSM/GPRS) * Audiovisual ((HD)DVD accessories & controllers) Tel: +44 (0) 845 5192306 «|P>ML 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. BLACK ROBOTICS i w . v blackrobotios.com Robot platforms and brains for research, hobby and education. • Make your robot talk! • TalkBotRrain is open-source • Free robot speech software • Robot humanisation technology • Mandibot Gripper Robot EASYSYNC h ftp :// w ww. easysy n exo , u k 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 Europe's leading device programmers manufacturer: • reliable HW: 3 years warranty for 'y most programmers • support over 56-000 devices * free SW updates • SW release: few times a week * excellent technical support: Algorithms On Request, On Demand SW * all products at stock / fast delivery EMBEDDED ADVENTURES www. eiii bed dedad ve n tu res. c on i From news and tutorials to modules, components and kits, we have everything for your next microcontroller based project. Your embedded adventure starts here. embedded adventures FIRST TECHNOLOGY TRANSFER LTD. http://www.ft1.co.uk • Trai ning and Consu Eli ng First for IT, Embedded and U|9 Technology Real Time Systems Transfer Lfa • Assembler, C, C++ (all levels) • 8, 16 and 32 bit microcontrollers • Microchip, ARM, Renesas. Tl, Freescale • CMX, uCOSII, FreeRTOS, Linux operating systems • Ethernet, CAM. USB, TCP/IP, Zigbee, Bluetooth programming 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.e.'s. Complete with PC drivers, these devices simplify the task of designing or upgrading peripherals to USB 0 Oscilloscopes 0 Power Supplies 0 Spectrum Analyzers 0 RF Instruments 0 Programmable Measuring Instruments Great Value in Test & Measurement www.hameg.com ,0-2010 elektor products and services directory HEXWAX LTD .vww.hexwax.com World leaders in Driver-Free USB ICs: * USB-UART/SPI/I2C bridges * TEAleaf-USB authentication dongles * expandlO-USB 3/0 USB expander * USB-FileSys flash drive with SP1 interface * USB-DAG data logging flash drive — — ■ ■“ 160 pages of tech audio articles U near Audio Se,f - Linkwic ' CorN Join the SKD8 Lite, the place to understand, discuss and experiment with magnetics, * Learn more about magnetics and electromagnetics * Participate in developer forums and discussion surrounding magnetics and related topics. For FREE access to SKDB Lite: https://kdb.steorn.com/ret25 USB INSTRUMENTS tip ;//www.usb4nst rumen ts.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.vlrtins.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 \\ here you will he able to showcase your products and services. IT, For just £242 + VAT (£22 per issue for eleven issues) Elektor will publish your company name, website address and a 30-word description For £363 + VAT for the year (£33 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 yot.tr site, a company logo - your choice Places are limited and spaces will go on a strictly first come, first served basis. So- pi ease fax back your order today! I wish to promote m\ company; please book my space: * Text insertion onlv for £242 + VAT * Text and photo for £363 -t* VAT NAME- ORG AN I S ATI ON- ■ 'i «. 1. ^ ifi I a a arai-iiaiii'iiaiain'iaiaiaiaiaiuiBinati.-iaiaiaiaiHariii'iiaiaraiaiaiaraiaraiaraiaiaiai'aiR-irirarariBar-ir-tBa — .1 % ■* 4 hi ’ -k %jp ill I ■ 'a ■ ■ a a ■ ■ a ■ r ■ a ■ ■ a ■ 1 . j ■ ■ ■ a i a i a ■ ■ JOB T1TEE a ii+tiiTliH a + B + a 4 a a- fi a a a a a- a a a a- a a Ba-a4-fi4-fii4fifi4-fi4-fi4-i4-«4-B4-fi4-fi4-ft4-B4-fi 4 ■ 4- 4 4- B 4- 9 4- ■ 4- B 4- I 4- fi 4- M Mr M ft B- ft + ft I P B * * ft 4- 4 I 4 ■ ft ■ + B + fi ft ■ 4 iiu itiirt itiiiiii an a a a a r a a r a a a i a a ■ a \ D O a. ■ a ■ + a + a a. a a a a a a a a aa a a a a aa i + M M M fi 4 "4 P4 ■ 4 >•*•*• + »» a a. a a a a. ■ 1 . ■ a ■ .a ■ .a 1 a. aa 1 a ■ a. 1 a. 1 a 1 ■ aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa a a a a aa a aa 1 a. ■ + fi 9- ft * P 4 P4P4 P4 P4 Ki fe 4 -a 4 r> mtm itm i T a a a a a a a a b a. 1 a 1 f ■ if a a. a - aa. aa aa - a. - - - a p , a . a a r , - ft ■t!4'i + ‘4'Bf Pi * ‘ -ftp TEL b a a a a. a a a a aa a 4 - a.a ■ a a a a + a 4 a 4 . a 4 a a a _ a a a 4 aa a * 4 4 M 4 4 MM - 4 H MM MM a a a 1 a. a 4 . pa a a. a a a a. a a a a. aa.aaaaaa.aa aa. aa a a. a a a a .a a a a. 1 a a. a. a a a a ft a .a a t. JL-J J 8 a 1 a a a a a a a a a a. a a a a a a -a a- a a ft a -ft a a a- a 4 . ft 4 - - , PLEASE COMPLETE COUPON BELOW AND FAX BACK TO 00-44 (0) 1 032 564998 COMPANY NAME ’J i'll JJLJ “ I h ~ J 1 1 Y I L_a ra aa a a r a aa aa aaea aa aa a a a aa a ■ ■ ir ( i ■ i b ir ■ # ■ iM M 8 T 6 4 H a4 itti ■ i B i iTiiri 4 ar n 4 4 -4 a riti Mt* + M it 9 4- ■ H + MMI + S4MM M t 4- ft » a 4 ft 9 ft B a i fc 4 ft 4 a a ■ wfr AnnfiF^ T T I ai J jTI J 1 % tLa# hj ■s-3' 4 4 4 -4 9 ft 4 i 4 4 4 4 1+ * ft 44 I 4 B + 9 4> 4 4 I 4 • f P 4 I 4 i 4 I 9 ■ ¥ M aa. aa a a. a ■ aa. aa. aa. aa aa. aa aa. aa a aa a a a aaaiaif a a aa a ai a a a ■ a ■ a iituiaiiii aa aa aa aa aa aa aa aa aa aa aa aa ■ t l J t^. l 3 i l.a S t. l\ j j" l l. (. 3 aaaa aa aa aaaa aa aaa aa a ■ aa aa aa aa aa aa a ■ aa aa an aa aa aa aa aa i a ■ a aa ra’ra iifififiTiia ra rara riTiiiivai aa aa a a rara aa aa aa aa a a -a a aa ■ ra 4 a a- a a aa aa ra-Ba ■ ■ a aa aa a-raa aa-aa i ft i 4i 4 Mft 4 14 4 4-44 44 MM*« - 44 44 44 tat>tMSMMt“ a 4 .a 4 aa.aa.aa.aa aaaa rara a a a a a a a a a a a fi a- fi 4 ft 4- fi 4 fi 4 fi ft fi 4 fi ft fi 4 4 4 fi 4- fi 4 fi i- i 4 ft fi ft i 4- 4 a a a 4 ft 4 ft i ft P ft 4 4- P 4- P 4- P ft “ ft ■ 4- ■ * “ 4- 4 4 - ■* P 9 4 4 " - J 4 a M- MMM-ffil-M MM»*MM4 - “ M tf m 4, MM‘ - t» + ■ a a aaaa a a ■ 1 - a 4 a 4- a -4 a a- p 't B + fi4-fi4-fi-4i4-44-fi4-fi-4a4 4 • M + ■ pa aa a a -a a -fi fi 4a aa ■ a a- a a- a 4- fi a- a a- a a> fi a- a a a a- p a- a 4- a MStMMMMM"4 + st 4 *MMMtnnsia + iiiJiaj,afi baa.a 1 ■ ftl 444 ■ 4 ■ -4 P ¥4 4 P « “■* ■* ■“ ■» aaaa. aa a elektor 10-2010 79 SHOP BOOKS, CD-ROMs, DVDs, KITS 8, MODULES A world of electronics from a single shop! New models and applications High-End Valve Amplifiers 2 Nobody has any doubt that valve amplifiers produce a remarkably beautiful sound. They have a lively, deep, clear, and expressive sound, and dynamically they do not appear to have any limita- tions. Menno van derVeen investigatesjn a systematic theoretical approach, the reasons for these beautiful properties. He develops new models for power valves and transformers, thus enabling the designer to determine the properties of the amplifier during the design process. You will notice in this book that theauthor not only writes aboutamplifiertechnlque, but tells about the way the development of valve amplifiers can have an influence on your daily life; even the usefulness of patents is discussed. Summarizing: new theories and solutions for perfect audio with valve a mpli- fiers. Not only the professional and the D1 Y-er but everyone who wants to u nderstand valve ampli- fiers will read this book with much pleasure. 420 pages * ISBN 97B-0-9Q5 705-90-3 * 07,00 * USSS9.70 For beginners and experts 50 PIC Microcontroller projects This book contains 50 projects for PIC mi- crocontrollers such as a laser alarm, USB teasing mouse, egg timer, guarding a room using a camera, mains light dimmer, talking microcontroller and much more. You can use this book to build the projects for your own use. but also as a studybook or refer- ence guide. Several different techniques are discussed such as relay, RS232, USB. pulse width modulation, rotary encoder, interrupts, infrared, analog-digital conver- sion (and the other way a round), 7-segment display and even CAN bus, 440 pages * ISBN 97 8- 0-905705-8 8 0 06,00 * US $58.10 Get started quickly and proceed rapidly Python Programming / mmJ -mJ and GUIs This book Is aimed at people who want to interface PCs with hardware projects using g ra ph ic u se r i nterf aces. T h e p rog ra m m i n g language used is Python, an object-orient- ed scripting language. The book guides you through starting with Linux byway of a free downloadable, live bootable distri- bution that can be ported around different computers without requiring hard drive in- stallation, 224 pages * ISBN 978-0-90S7 05-87-3 £29,50 ■ US S47.60 8 o Prices and item descriptions subject to change. £, & O.E 10-2010 elektor Principles, Application and Design Power Electronics in Motor Drives This book is aimed at people who want to understand how AC inverter drives work and how they are used in industry. The book is much more about the practical design and application of drives than about the mathematical principles behind them. The detailed electronics of DC and AC drive are explained, together with the theore- tical backg rou nd and the practical design issues such as cooling and protection. An important part of the book gives details of the features and functions often found in AC drives, and gives practical advice on how and where to use these. 24(1 pages * (SBN 978-0 905705 89-7 £29.50 * US $47-60 JCHH ALXWQITH. 0 Icktor ARM Microcontroller Interfacing — -*■ — HAnOWflnt AiND SUrtMUMC Use only free or open source software! ARM Microcontroller Interfacing Learn to interface and program hardware devices in a wide range of useful applica- tions, using ARM7 microcontrollers and the C programming language. Examples covered in full detail include a simple LED to a multi-megabyte SD card running the FAT file system. Interface to LEDs, transis- tors, Qptocouplers, relays, solenoids, switches, keypads, LCD displays, seven segment displays, DC motors, stepper motors, external analogue signals using the ADC, RS-232, RS-485, TW1, USB, SPI and SD memory cards. Also covered are methods to write programs to operate externally interfaced hardware devices, using timers and interrupts, porting FAT file system code for use with an SD memory card, programming the PWM to produce an audio sine wave, program- ming the PWM to speed control a DC motor and more. A chapter on more ad- vanced ARM microcontrollers is included with an overview of some of the newest ARM microcontrollers and their features. 250 pages * ISBN 978-0-905705 91-0 E29.50 * US 547.60 V Learn more about C- programming and ,MET C# 2008 and .NET programming This book is aimed at Engineers and Scien- tists who want to learn about the .NET en- viron ment and C# prog ra mm i ng or who have an interest in interfacing hardware to a PC. The book covers the Visual Studio 2008 development environment, the .NET framework and C# programming language fro m dat a t y p es a nd p rog ra m flow to m o re a d va need co ncepts i n cl u d i ng o bj ec t or i e n - ted programming. 240 pages - ISBN978-G-9Q5705-SM £29.50 • USS47.60 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 x A must-have for audiophiles End Valve Amplifiers In this Masterclass M en no van der Veen will examine the predictability and perceptibil- ity of the specifications of val ve amplifiers. The DVD represents3.5 hours of video ma- terial . Bonus elements on the DVD include the complete PowerPoint presentation (74 slides), scanned overhead sheets (22 pcs), AES Publications mentioned during the Masterclass. Not forgetting the bombshell: 25 Elektor publications about val ves. tSBN97S-0'9GS705-S6-6 £24.90 * U5 $40.20 75 Audio designs for home construction dvd The Audio Collection 3 A unique DVD for the true audio lover, containing more than 75 different audio circuits from the volumes 2002-2008 of Elektor, The articles on the DVD-ROM cover Amplifiers. Digital Audio, Loud- speakers, PC Audio, Test & Measurement and Valves. Highlights include the ClariTy 2x300 W Class-T amplifier, High-End Power Amp, Digital VU Meter, Valve Sound Converter, paX Power Amplifier, Active Loudspeaker System, MP3 preamp and much more. Using the included Adobe Reader you are able to browse the articles on your computer, as well as print texts, circuit diagrams and PCB layouts. IS BN 97 8 *90 - 53 8 1 -2 G3- 1 £17.90 * US $28.90 elektor 10-2010 8i SHOP BOOKS, CD-ROMs, DVDs, KITS & MODULES See the light on Solid State Lighting This DVD-ROM contains ca refu I ly- sorted comprehensive technical documentation about and around LEDs. For standard mod- els. and for a selection of LED modules, this Toolbox gathers together data sheets from all the manufacturers, application notes, design guides, white papers and so on. It of- fers several hundred drivers for powering and controlling LEDs in different configura- tions. along with ready-to-use modules (powersupply units, DMX controllers, dim- mers). In addition to optical systems, light detectors, hardware, etc,, this DVD also ad- dresses the main shortcoming of power LED s: heati ng . Th is DVD co ntai ns more th a n 1 00 articles on the subject of LEDs, ISBN 978-90-S381 -245-7 £28.50 * U5 S46.00 1 1 0 issues, more than 2.100 articles This DVD-ROM contains the full range of 1 990-1999 volumes (all 1 1 0 issues) of Elektor Electronics magazine (PDF), The more than 2,100 separate articles have been classified chronologically by their dates of publication (month/year), but are also listed alphabetically by topic. A comprehensive index enables you to search the entire DVD. ISSN 978-0-905705-76-7 £69.00 ■ US$100.00 (July /August 2010) Many radio amateurs in practice use two receivers, one portable and the other a fixed receiver with a PC control facility. The Elektor DSP radio can operate in ei- ther capacity, with a USB Interface giving the option of PC control. An additional feature of the USS interface is that it can be used as the source of power for the re- ceiver, theaudiooutputbeing connected to the PCs powered speakers. To allow portable 6 V battery operation the circuit also provides for an audio amplifier with one or two loudspeakers. PCS, assembled and tested 00126-91 (June 2010) Incur March issue, we introduced Sceptre, a fast prototyping system fitted with a 32- bit microcontroller. Even on its own, this board will let you produce some great re- sults. but if we add an extension board to make it easier to access all its peripherals, the Sceptre platform becomes downright powerful. What's more, if you fit this extension board into a suitable case, you'll be able right from the start to develop a prototype that you can use 'properly' in a installation, with no trailing wires or bits of sticky tape holding everything together. Now that's what you calf fast, convenient prototyping! Kit of parts, contains PCB and components dsPIC Control Board (May 2010} This control board has been designed for incorporation into typical industrial elec- tronics applications like controlling mo- tors or adjustment of static up- or down -converters. The objectives were to obtain a board with a largenumber ofpul- sewidth modulation (PWM) generators, which enables us to control several mo- tors and static converters at the same time. The cost of the control board nee- ded to be as low as possible too. In addi- tion, it must be possible to construct the board using a soldering iron, without re- quiring use of a reflow oven . PCB , populated and tested Reign with the Sceptre (March 2010) This open-source & open-hardware pro- ject aims to be more than just a little board with a big microcontroller and a few use- ful peripherals — it seeks to be a fast pro- totyping system. To justify this title, in addition to a very useful little board, we also need user-friendly development tools and libraries that allow fast implementa- tion of the board's peripherals. Ambitio- us? Maybe, but nothing should deter you from becoming Master of Embedded Sys- tems Universe with the help of the Elektor Sceptre. PCB,. populated and tested,, test software loaded (excluding Bluetooth module j v v. 82 Prices and item descriptions subject to change, E, & Q,E io- 20 io elektor t Shortlist r October 2010 (No, 406) ^ + + + Product Shortlist October : See www.elektorxom + + + September 20 1 0 (No. 405) El ektor Project Case 100500' 71 .... Predrilled Lexan sheets with standoffs 14,90 24,10 Digital Multi-Effects Unit 090835-31 .... EE PROM ^ 4 LC32 4 .00 6- 50 090035*41 .„..ATmega8-16PU 830 13,40 090835-42 ATttny23l3-20PLL.., 8,30 13,40 G90835-71 Kit of parts including PCBs, programmed controllers and E EPROM www.elektor.com Dual Voltage /Current Display 100166-71 .... Kit of parts inch PCB, item -41 r LCD. *.*,..*„ 62,00. ., J 00.00 july/Aug list 2010 (No. 403/404) The Elektor DSP radio 100126-41 .,,, ATmega16SPU fe + 9 r t - r t - Ni *4 ■ bj b i a b.bj aaa ■ lb ■ ii ■ I a bj a p 12.50 20.20 1 00126-9 1 PCS. assembled and tested 1 49.00. ...,240.40 Daggerboard Position Detector 080307-41 .... PIC1 6F628A-DJL- 1 8. programmed 8.00 12.90 PIC R] -45 Cable Tester 090643-41 .... PIC I6f 72, programmed * * 8,00 12,90 3D LED Pyramid 090940-41 * ATtl ny 23 13-205U, programmed 8.00 12.90 Digital Thumb wheel Switch 090538-41 .... ATtiny23 13 dip20, prog rammed* 8.00 12.90 Whistler, Electronic TrainerjCoach 1 QQ203 41 .. .* PIC 16F8 8 Dl P 1 8 , programmed .*<■*,.*. * 0.00*. .... * 1 2.90 Sol a r Cel I Battery Ch a rg er/ M o nito r 090544-41 .... PlCl 6F877A, programmed... .... 16. 50,. .....26.70 Universal Timer with Zero Standby Current 09053441 .... ATTiny 23 13. programmed 8,00 12,90 Tiny Timer 09 1 0444 1 .. ., AT tiny 23 1 3, p rogra mm ed *■ 8.00*. 12.90 Universal PWM Driver 090856-41 PIC1 6FG28-1/P, programmed.. 8.00 12.90 Binary Clock 0901 S741 „„ PIC 1 6SF877-20/P 0 1 P40 h programmed .....18.50,.. 29.90 USB Tilt Sensor 070829-41 .... ATmegaS-l 6AU (TQFP). programmed 8,00 .12 90 090G45-91 .... MM A7620 breakout board 8.50 .13,80 Bench PSUfor PC 090863-41 PIC16F61 6-lfP, programmed 8,00 12,90 Sailor's Battery Mseter 090117-41 .... PfCl 6F690 OJP, programmed 8-G(L„„- 1 2.90 Tiny Pulser 0 90444-4 1 ... . ATT I N Y 1 3-2 QP4 p progra m m ed . „ ....8.00,.., ... 1 2, 90 MicroMinimal Thermometer 090634-41,,.. ATT INY1 3(A)dip8, programmed,,, 8. 00 .12,90 Waterp roof Bath roo m Svu Etch 090 537-4 1 „*. AT tiny 1 3 A, prog ram med ♦. 8.00 12.90 Lights Control for Model Cars 090834-41 Pro gra mm ed controller ATtiny45 DIP-8 8.00 12,90 Modeller’s Clock 09002341 PICT 8LF1 320 J/P DILI 8. programmed 8,00 12,90 Astro lamp 090550 41 ,„.ATTiny45DlL8 h programmed 8.00 12,90 ATM 1 0-D IPATM 1 8-DI P 090896-1 Printed circuit board.,., 9.90 16,00 Underfloor heating controller 100318-41 .... ATtlny25-20p4DUO8. programmed. .*..*„*..*..* 8,00 .12,90 RGB Synchronizing Fireflies 10035841 .... ATT I NY 13(V), programmed * 8.00 12,90 Scope Text 10032741 .„.Attiny2313 DIL20, programmed... 8,00 12.90 1 ISBN 978-0-905705-91 0 .... £29.50 US$47.60 ( flfflil -> Power Electronics in Motor Drives ISBN 978-0-905705-89-7.... £29.50 US 547.60 1/1 o o co 50 PIC Microcontroller projects ISBN 978-0-905705-88-0.... £36.00 US 558.1 0 High-End Valve Amplifiers 2 ISBN 978-0-905705-90-3 .... £37.00 US 559.70 Python Programming and GUIs ISBN 978-0-905705-87-3 .... £29.50 US 547,60 1 DVD The Audio Collection 3 ISBN 978-90-5381-263-1.... £17.90 US 528.90 Masterclass DVD High-End Valve Amplifiers ISBN 978-0-905705-86-6.... £24.90.... US 540.20 DVD LED Toolbox ISBN 978-90-5381-245-7.... £28,50 US 546.00 4 5 DVD Elektor 1990 through 1999 ISBN 978-0-905705-76-7.... £69.00. ..US $100.00 DVD Elektor 2009 ISBN 373-90-5381-251-8.... £17.50 US$28.30 Elektor DSP radio Art. #100126-91 £149.00 US$240.40 Reign with the Sceptre Art. # 090559-91 £89.00 ...US $1 43.60 InterSceptre Art.# 1U0174-71 £116.00 „,US$187,10 OBD2 Mini Simulator Art. #080804-71 £84.00 US $1 35.50 dsPIC Control Board Art. #090073-91 £140.00 US$225.90/ r ^ Order quickly and securely through www.elektor.com/shop or use the Order Form near the end of the magazine! Elektor Regus Brentford 1000 Great West Road Brentford TW8 9HH » United Kingdom Tel, +44 20 8261 4509 Fax +44 20 82614447 Email: safest elektor.com elektor 10-2010 83 COMING ATTRACTIONS NEXT MONTH IN ELEKTOR PM /V o v> X o e O 4 ML Mi" 1 ' z£S 0 9 Li Mobile 0 2 Meter with MinimodiS Nicely complementing he CQ 2 Meter and Mob!eC0 2 Meter projects recently published in Elektor we rv^-v ■- esc zn 0 (oxygen) Meter For divers and cave r-^plomrs " ahso^t-F 4 essential to instantly know the current oxyger concentration in their air suppiy (Fron 1 1 > cylinder) or in the ambient air (deep underground*.? In this article we present suit i Off sensors for oxygen hevel measurements, the way sensor siq n are : Kc:e s seo and. be r >T a. I, an oxyge-; t> - base - on the renowned MinimodiS OLdro !h scnb.-d m i ■' ncic ed'iion. A \ i v Transducer UW l L Storage V, l T » J V,»»? Energy Harvesting Alternative energy sources art: all the rage lately, in this article we present a number of ideas foi powering circuits from soiar energy, even under poor sunlight conditions. How- ever. the less than constant and dramatically low voltages supplied by solar panels can be processed with the help of clever circuits, enabling voltages down to 200 mV to be used, and constant supply power to be guaranteed The 5532 OpAmplifier (2) Have you ordered your ^5532^ yet? They're cheaper by the hundred! In this the second and concluding Instalment on what's already known as "a remarkable audio amplifier” well be discussing the OpAmplifieds construction and performance, the latter to confirm fwith graphs from our Audio Precision analyse! ) that a top-notch design is on the table. For purists and other advanced audio boffins we also have guidance on configuring the amp for bridged operation and higher output powers. Article lilies and magazine (-aments Mityert fo change: please check the Magazine tab tin mvir. elektor . com Elektor UK/European edition: on safe September jjj. ’mo. ffefctor USA edition: puhlnho i ‘icptemtm jo. 2010. ktor.com www.elektor.com www.elektor.com www.elektor.com www.etektor.coi m \a 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 downloads, circuit boards, programmed ICs and corrections and updates if applicable. Complete magazine issues may also be downloaded. In the Elektcr Shop you’ 3 ! find all other products sold by the publishers, i kt CD-ROMs, DVDs, kits, modules, equipment, tools and book>, A powerful search function allows you to search o^ items and references across the entire website. Glekto kiso on the Elektor website: - Electronics news and Elektor announcements Readers Forum PCS, software and e-magazine downloads 1 ime limited offers FAQ, Author Guidelines and Contact 1 - TT T ■ i" t#t :v ■ H Cl ft "Mi'H V f-to it KSl it “igatr,! ISO; aiffl 'M f®GEEKSG© Aw- -1 nm J + LIl U Mar n>mg ■ntT. i£ ’*■.#* EZ-t* Iff *“111 iS'fl'tl VI J C+f T r,'(ji , P!t i&U? ^ '- 5 * S*cr - «iap, □*#* •! HWi I mdrnr 0 JiU'ht* UJ>ntn-;Cnun.* mi # ip*-*' ■"srotiuoir* p'«’ 1*0 f t70 . C Id d 1 Bcaiuhf i| H* 4 sdKWh«il B Ktt of parti ElflhtDfW it fit-alV Programming Eii-ikcd tied PlC MkfKonlf olltrs 1J : > O' ♦iiu 1 Qi fr"* 1 1 's^ i — ■ : z"*i ■ - PpmuH FtowBod# hnf Th 4 i tar Kfl jWMif frh" t»f- tfl k ( p«^s r (i >n 'able to S ubscribers who ho ve not held a subscrip tf on to Efektor during the last 12 months. Offer subject to availability . See reverse for rotes and conditions. Microcontroller Name Address ■* Post code fef. Email Date Signature ELIO 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 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: *44 20 8261 4447 www.elektor.com sa I es^'d ektor.com USA and Canada residents should use S prices, and send the order form to: Eteklar US PO Box 1 80 Vernon CT 06066 USA Phone: 860-375-2199 Fax: E-mail: 860-871 ‘041 1 salts - 1 elektor, com 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 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 subscript ions '" eiektor.com ORDERING INSTRUCTIONS, P&P CHARGES 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.elektoncom/shop Readers in the USA and Canada should send orders, except for subscriptions (for which see below), to the USA address given on the order form. Please apply to Elektor US 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 £1 1,00 (Priority) HOW TO PAY All orders must be accompanied by the full payment, including postage and packing charges as stated above or ad vised by Customer Services staff. Bank transfer into account no, 4027021 1 held by Elektor international Media BV with The Royal Bank of Scotland, London. IBAN: GB96 ABNA 4050 3040 2702 1 1. BlC: 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-1 52-3801 , held by Elektor International Media BV, 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 guaran- tee 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. Al! 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). Canceled 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 responsi- bility or liability for falling 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 adver- tisements) 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 Eiektor shall be determined in all respects by the laws of England. January 2010 SUBSCRIPTION RATES FOR ANNUAL SUBSCRIPTION Standard Plus United Kingdom & Ireland £49.00 £61 .50 Surface Mail Rest of the World £63*00 £75.50 Airmail Rest of the World £79.00 £91,50 USA £64,95 See vtfww,e1ektor.com[u$a Canada £75.95 for spedal offers HOW TO PAY Bank transfer into account no. 402702 1 1 held by Elektor International Media BV with The Royal Bank of Scotland, London. IBAN: GB96 ABNA 4050 3040 2702 1 1 . BIG: 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 cus- tomers 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 International Media BV. 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 SSUprotected for your security. SUBSCRIPTION CONDITIONS The standard subscription order period is twelve months. If a permanent 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 fora 20% (twenty per cent) reduction in current rates, must be supported by evidence of studentship signed by the head of the college, school or university faculty, A standard Student Subscription costs £39.20, a Student Subscription-Plus costs £51 .70 (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 2010 Order custom-designed boards from the Elektor PCB Service Ida advantages at a glance • Professional quality PCBs. • i'Jo film charges or start-up charges. • Mo minimum order quantity or charge for this service. • Available to private and commercial customers. • design check applied to all entries. We’ll let you know within 4 hours! ’ Two PCBs supplied - three produced. If the third ooard is also okay, you receive it as '"ell - free of charge! Quick, cheap and secure www.elektorpcbservice.com Astrobe. Showcase .www.astrobe.com Atomic Prag r amming Lid. Showcase www.atomicprogramming.com . . Avit Research Showcase www.avitresearch.co.uk. Beijing Draco Electronics Ltd .www.ezpcb.com ...... Beta Layout. Showcase www.pcb-pooi.com &Lac k Robotic s S r o case ww w. bl ac kroboti cs . com By Vac Showcase .www.byvac.com CEDA, ShOACcSr www.ceda.in CES wwwXESw?: r: - Designer Sy s ■ ^ 5 f ~ : : a se ...www.designersystems.co.uk — Easysync . 5n c a : i h ..... ww w. ea sy sy nc.co . u k Elnec. Showcase . . ,. www.einec.com. E m b added Ad . r : , ? : f _ : = $e . ww w. e mbe d d edad ventures . co m Embedded Live . www.embedded-live.com Euroclrc u its www.eurocircuits.com, First TechnoC: “ = 'vr i " : ■■■ www.ftt.cO.uk . — Index of Advertisers .78 ..78 . .76 ■ i t ■ a + + § ■ I .35.78 .,,.76 , , , . 78 ....78 — „ , 53 ..76 Mlkro E I ektroni ka MOP Electronics, Showcase Nurve Networks NXP Contest. Peak Electronic Design Pico Quasar Electronics , Robot Electronics. Showcase . . . Robots, Showcase , . .www.mikroe.com. 19, 57 .www.mqp.com .www.xgame station .corn. 10 . w w w.cirt u itcelf ar. co m nxpmbedde sig n cha lie ngei 2 .www.peakeiec.co.uk 0 . --12 .www*picotech,conVscope20l9 71 . ww w. qti asarelectronics com 11 .www.robot-eiecironics.co.uk — 79 .www.robotiq.co.uk 79 ...78 .,.78 , ..78 ,.,47 ...41 Schaeffer AG www.schaeffer-ag.de Showcase , Steorn SKDB Lite, Showcase www.kdb.steorn.com/ref25 . USB instruments. Showcase www.usb-instruments.com . Virlins Technology, Showcase www.virsins.com 35 78.79 79 70 - ■? 4- - - ■* ‘ *■ B J , 79 FiexiPare Ltd :m WWW, Future T*c — I t. E ‘ c a s e w ww Hamec 5 ^ : z i - WWW Hex Wax Ltd S as 7 WWW Labcenter. WWW. Linear Audio, S“ WWW. Microchip . WWW, flExipaneS.com ■ , , ... .78 ttdichip.com — 78 h a meg. corn. i hexwax.com .79 labcenter.com , , . . . - - 38 linearaudio.net, , , r 79 microchip.com/mtauch. , 3 Advertising space for ihe issue 18 November 2010 may be reserved not faler than 1 9 October 201 0 with Hu son international Media - Cambridge House - Gogmare Lane - Chertsey. Surrey KT16 9AP - England - Telephone 01932 564 999 - Fax 01932 564 99B - e-maii: ros.olgar@husonmedia.com to whom all correspondence, copy instructions and artwork should be addressed. elektor 10-2010 CHECK CHECK Power Planes Generated - CHECK t\lo Design Rule Violations • CHECK Design with Confidence: The latest version of the Proteus PCB Design Software provides a multi stage Pre-Production Check which will detect and prevent a variety of common mistakes prior to your boards being sent for manufacture. PROTEUS DESIGN SUITE Features Board Autoplacement & Gateswap Optimiser. Direct CADCAM, ODB++, IDF & PDF Output. Integrated 3D Viewer with 3DS and DXF export Mixed Mode SPICE Simulation Engine. Co-Simulation of PIC, AVR, 8051 and ARM7. Direct Technical Support at no additional cost. Hardware Accelerated Performance. Unique Thru-View™ Board Transparency. Over 35k Schematic & PCB library parts. Integrated Shape Based Auto-router. Flexible Design Rule Management. Polygonal and Split Power Plane Support All levels of the Proteus Design Suite include a world class, fully Integrated shape-based autorouter at no additional cost - prices start from just £150 exc. VAT & delivery Electronics Labcenter Electronics Ltd. 53-55 Main Street, Grassington, North Yorks. BD23 5AA, Registered in England 4692454 Tel: +44 (0)1756 753440, Email: info@labcenter.com