Home

EMBEDDED PROGRAMMING

image

Contents

1. CIRCUIT CELLAR e www circuitcellar com Ji 8 position RJ 45 jack 14 voc T ADDA O 2 DATA_AVL DATA_RCVD DATA O 7 Figure 2 This shows the 5 portion of the hub which is responsible for implementing a six port UART in software The MAX3083 chips handle the R5 485 level conversion the Zilog Z8 Encore and the Parallax SX chips The Zilog Z8 is an 8 bit chip that lets me code in C using a free IDE and compiler provided by Zilog The IDE and chips support hardware debugging at the C source or assembly language level The parts range from eight pin to 68 pin devices with EEPROM from 1 to 64 KB and up to 4 KB of RAM They come in through hole or surface mount parts and nominally run at 3 3 V while accepting a range from 3 to 3 6 V The Parallax SX is a more unique beast Running at speeds up to 75 MHz and up to 75 MIPS and featuring a jitter free deterministic interrupt scheme they are almost FPGA like in their abilities The interrupt system is where the power of this chip lies The SX chips have an 8 bit real time clock counter RTCC with prescaler that generates interrupts at pretty much any interval you desire Unlike pretty much every other CPU on the market the SX always takes three clock cycles to enter or exit the RTCC interrupt www circuitcellar com CIRCUIT CELLAR regardless of what instruction the processor is executing at the time Further there is an exit opcode which lets the
2. Systems We use our stuff Visit our TS 7800 powered website at www embeddedARM com by Jeff Bachiochi ROM THE BENCH Read Only Memories p ls D E a E k is i E A ES Audio Applications with a Playback IC If you want to bring useful audio recording capabilities to an embedded design try working with a playback integrated circuit It s easy once you resolve any memory issues associated with your design This article details how to use a microcontroller to access a playback IC and associated EEPROM to play prerecorded audio files et s start with a story I ll begin with the first part of the story now I ll wrap it up at the end of this article Once upon a time there was a king who was very sad Whenever he was away the chil dren of the realm could not get to sleep since they were so used to hearing his voice read them into slumber land every night So the king called on Merlin for help The wizard engineer had been experimenting with audio processing for some time but had been unable to find suitable playback circuitry But then one day Merlin was flipping through a new electronic parts catalog when he came upon a solution Merlin used the royal credit card and had parts delivered by express owl A recent Hallmark commercial got me thinking about a past project Over 30 years ago I picked up an interesting music playing birthday card at the Trenton Computer Fair Have yo
3. 561 1014 ND C MAX www c max time com Digi Key Corp distributor www digikey com 76 mm Seven segment blue common anode LED digits eBay Inc www ebay com Neutral density filters LEE Filters www leefiltersusa com PC10 Ultracapacitors Maxwell Technologies www maxwell com ultracapacitors products small cell pc 10 asp TLC5916 LED Driver Texas Instruments www ti com NEED TO KNOW INFO Knowledge is power In the computer applications industry informed engineers and programmers don t just survive they thrive and excel For more need to know information about topics covered in Ed Nisley s Issue 237 article the Circuit Cellar editorial staff highly recommends the fol lowing content Scheduler Template for Microcontrollers by Praveen Deshpande Circuit Cellar 194 2006 Praveen describes the process of writing a sched uler template for a single chip micro He used this technique to design a real time digital wall clock Now you can too Topics Single Chip Micro Clock Timing RTOS Scheduler Memory Go to www circuitcellar com magazine 194 html Antenna Basics by Robert Lacoste Circuit Cellar 211 2008 Are you ready to start working with antenna technology In this article Robert covers imped ance matching antenna simulation and more Topics Antenna Impedance Matching Simulation Reactance Microstrip Go to www circuitcellar com magazine 211 html CIRCUIT CELLAR e www circuitcellar
4. Common sample data consists of 8 to 16 bit values Obvi ously the higher the sampling rate and the more resolution for each sam ple the better the potential playback GND Digital audio processor Volume control Tone Control generator Clock 8 MHz Oscillator fidelity As a point of comparison the highest fidelity here would be 16 bit data at a 44 kHz rate consisting of a file size of 88 000 bytes per second of audio A PCM file at the lower quality end would consist of 8 bit data at an 8 kHz rate or a file size of 8 000 bytes per second The KX1400 s Play PCM command supports 12 bit data squeezed into each 16 bit Play PCM command and regurgitated at an 8 kHz rate Adaptive delta pulse code modula tion ADPCM is a compression method for taking a 16 bit 8 kHz PCM file and squeezing it into a much smaller size The compressed 4 bit data fits into each 8 bit Play ADPCM command and thus effec tively halves the storage space requirements The ADPCM data must be uncompressed by the KX1400 as it is processed without compromising the 8 kHz playback rate UMBILICAL CORD As you might expect getting an audio data file through an SPI connec tion requires a rapid transfer clock The minimum SPI clock speed for EEPROMs used here is 4 MHz You can find many manufacturers that have been producing compatible Class D Ss April 2010 Issue 237 N April 2010 Issue 237 E
5. Integrated Touch Screen LUA Scripting Language capable For stand alone embedded apps Memory 3 8 MB SD to 2G ezLCD s are alsOavailablein 7 1 5 6 6 4 8 05 10 43 doe reo piniezL B 103 Call for Custom Display Configurations www earthicd com X April 2010 Issue 237 Order online af www melabs com USB Programmer 89 95 for PIC MCUs as shown RoHS J a a rpc Sr Compliant RE Programs PIC MCUs including low voltage 3 3 devices Includes Software for Windows 98 With Accessories for 3179 95 Me 2k AXP Includes Programmer Sofware USB Cable and Programming Adapter for 8 to 40 pin DIF microinginecring Labs Qac Development Tools for PIC Microcontrollers LADA hte dan Boards Pre Assembled Boards a Available for 8 14 18 28 and 40 pin PIC MCUs 2 line 20 char LCD Module 9 pin Serial Port Sample Programs Full Schematic Diagram Pricing from 79 95 to 349 95 AS Double Sided with Plate Thru Holes aa Circuitry for Power Supply and Clock Phone 719 520 5323 Fax 719 520 1867 39 Colorado Springs CO 80960 BASIC Compilers for PICmicro Easy To Use BASIC Commands Windows HuMe2KXP Interface PICBASIC Compiler 99 95 BASIC Stamp 1 Compatible Supports most 14 bit Core PICs Built In Senal Comm Commands PICBASIC PRO Compiler 249 95 32 bit signed variables and math operations Supports Microchip PICTO PICT2 PICTA
6. amp paste Signal generator USB or Ethernet 4 or 8M samples storage 100 MHz sampling Dual 10 12 or 14 bit ADC Ext Trigger 8 Digital Inputs 1 MSa sec charting Embedded Systems Most embedded systems interact with the real world and include analog and digital interfaces State systems are often used for control and to determine the system response to varying stimuli Using Cleverscope s dual triggers you can capture a particular state and verify that the digital and analog outputs are as expected www cleverscope com www circuitcellar com CIRCUIT CELLAR ACK_OUT_PORT THIS_BITCACK_BIT Get state of ready line from SX Has the SX Data ready line changed state so tell SX we got the data PrevDataReady CurrDataReady Note state for next time repeats Since data flows unidirec tionally from the SX based UART to the Z8 the SX changes state on its output bit when it has a byte to transfer The Z8 sees the change reads the byte and then changes the state on its output bit This change from the Z8 lets the SX know it is safe to put a new value on the 8 bit transfer port as soon as one is ready Using some simplified test code I clocked the two processors sending data synchronously at 186 KB per second The code snippet in Listing 1 shows the C language code used by the Z8 Note the extensive use of macros Since talking to ports setting bit directions and other actions are ve
7. component C1 0 1uF L 1 Amateur electronic musician Joe Rhythm is planning a one man video concert that he plans to post on YouTube Controlling his array of instruments requires both hands and he wants to build a pressure sensitive tone generator that he can control with a free finger or even an elbow or foot Joe quickly whipped up a simple tone generator using parts from his bench stock Since there wasn t enough time to order a pressure sensor he improvised by making one from materials he had on hand What did he use Go to www Jameco com teaser to see if you are correct and while you are there ASE IS sign up for our free full color catalog JAMECO 1 800 831 4242 pa O April 2010 ssue 237 by Alexandre Ney Guimaraes 3mart Control An Innovative Approach to Reflow Soldering This new approach to reflow soldering incorporates a toaster with a controller built around an LM35102 The system features a simple graphical display and buttons for starting the cycle or years I successfully used a small toaster oven with infrared heaters as a reflow oven for prototyping and small production runs It worked as well as a large convec tion reflow oven except for its speed Temperature control is more complicated so I needed an oven with the correct power and proper heat distribution without any cold or hot spots I set out to build my own I d like to say that my main goal for this project w
8. to operate so I used a breaker in line with the power supply Oddly this was one of the trickier ele ments to find Most small panel breakers have a tiny face but are over 1 long Since I was trying to cram this project into a small case the typical breaker would collide with the power supply I finally found a small breaker made by E T A Circuit Breakers that was wide behind the panel but not deep The PCB layout was a bit tricky While the board needed to be the full 4 wide to fit in the slots of the extruded aluminum the length was another story The power supply took up 2 of the space inside the enclo sure while the switches breakers and power input took up almost another 1 leaving a maximum of about 1 75 for the length of the PCB Complicating things further was the fact that the RJ 45 jack required 0 69 of space on the PCB thus cutting my room for compo nents down to about 1 On the plus side I didn t have a ton of components On the negative side I didn t have a lot of room The solu tion Surface mount components and a generous use of both sides of the board for component layout Rather than the typical component side solder side style of board layout 1 put components on both sides of the board as needed 1 kept the top side populated with the through hole only devices such as the jacks and headers as well as the sur face mount processors and linear power regulator parts The bottom
9. www circuitcellar com CIRCUIT CELLAR EE A sgur no l ab O a gt Photo 2 Arduino SBCs have struck a chord with a new ge simple low cost SBCs with easier to use software tools Circuit Cellar 193 2006 a truly innovative chip that brings esoteric computing concepts down to earth The Propeller is a multicore chip that doesn t cost an arm and a leg and it doesn t mind getting its hands dirty As well I covered Hydra LaMothe s original Propeller based SBC in my article Game On Cir cuit Cellar 206 2007 Thus two of the three aforementioned Chameleon software development options are self apparent namely the standard AVR and Propeller tool chains Look closely at the board and you ll see it includes the standard debug pod connector for the AVR That means you can use any standard AVR toolchain a likely option being Atmel s own immensely popular being free helps GNU based AVRStudio The Propeller handles debugging via the USB port so you don t even need a debug pod to use the Parallax tool based on a language they created called SPIN While no language can make hard problems easy you can take advantage of a growing library of pre crafted objects Parallax maintains It s quite easy to port existing Propeller code written for the Parallax and Hydra SBCs to Chameleon with only minor changes to initialization code and pin assignment For your convenience
10. 239 Deadlines OAE Probe Amp and Intercom Part 1 System Planning and Design Space Close Apr 15 Material Close Apr 20 Portable Network Service Monitor Custom Interpreter Development An Innovative LED Movie Project The FreeSpace IMU A Quaternion Based Algorithm for Attitude Estimation Theme Home Automation for an Energy Efficient House Part 1 System Design and Server Software Communications LESSONS FROM THE TRENCHES Put C Language to the Test Part 2 Program Call Peter Wostrel Specifics P now to reserve your space FROM THE BENCH Machine Control Customize and Implement MCU Based Control 800 454 3741 or 978 281 7708 Circuitry i Oo e mail peter smmarketing us SILICON UPDATE IC Therefore IR Advances in Proximity Sensing ml April 2010 Issue 237 www circuitcellar com CIRCUIT CELLAR pril 2010 MERET RIORITY roer E by Steve Ciarcia Founder and Editorial Director Drive by Wire Roulette I you drive a late model car these days it is probably drive by wire What this means is that there is no cable linkage between the accelerator pedal and the carburetor or fuel injection system no unassisted fluid mechanics connecting the brake pedal directly to the master cylinder and no mechanical linkage between the shift lever and the automatic transmission Instead there are sensors under the pedals and switches under the shift lever that transmit force and position information t
11. 3 OBD2 Analyser NG The compact OBD2 Analyzer in the June 2007 issue was an enormous success not surpris ing for an affordable handheld onboard diag nostics device with automatic protocol recognition and error codes explained in plain language Now enhanced witha graph ical display Cortex M3 processor and an Open Source user interface the next genera tion of Elektor s standalone analyser sets new standards fora DIY OBD2 project The OBD2 Analyser NG is self contained and can plug into any OBD diagnostic port Kit of parts including DXM Module PCB SMD prefitted case mounting materials and cable Art 090451 71 135 50 Software Defined Radio SD radio receivers use a bare minimum of hardware relying instead on their software capabilities The Elektor SDR project by Burk hard Kainka demonstrates what s achie vable in this case a multi purpose receiver covering all bands from 150 kHz to 30 MHz It s been optimised for receiving DRM and AM broadcasts but is also suitable for listen ing in to the world of amateur transmissions The designer s aim for this project was to create a receiver displaying high linearity and phase accuracy Development was focussed on the characteristics that were most important for a top notch DRM recei ver and the end resultis a receiver with remar kable interference rejection characteristics Ready populated and tested board Art 070039 91 139 60 Ww 00 y SA a
12. AS ANS ES 2s ara A DAN Sy NAZI WARANA NA Par Ware Wins Mas asain e N TR KAVN i Mh iy NN o on gt s te N E a p E l As mo e in b T EE TA Y Y an A MNR i ARCOS AA eee Wi de CNO DSN WS Oy SMARTFUSION FPGA ARM Cortex M3 Programmable Analog Actel POWER MATTERS Visit us at ESC Silicon Valley Booth 930 ASK ANAGER New Development he Circuit Cellar staff has been looking forward to April for a while now and not just because reaching this month on the calendar means we ve made it through another long New England winter April 2010 is special for another reason color We re proud to announce that this is the first full color issue in the history of Circuit Cellar That s right we can run any photo any diagram or any advertisement in color Why is this a historic moment for Circuit Cellar Well it s obviously a huge perk to be able to see every image in all its brilliance But the greater significance is that the act of converting to full color highlights the strength of the rela tionship between Circuit Cellar and Elektor It s no coinci dence that only a few months after joining forces with Elektor we ve begun to pack more of an aesthetic punch on each page of the magazine as well as to its cover One of the earliest editorial discussions between Circuit Cellar and Elektor
13. CIRCUIT CELLAR What Nano class programmable logic controller comes with full functions built in Ethernet and lets you set up your own controller web page without writing any program ON IEG Firefox or Safari on iPhones The world s most powerful Nano class PLC combines unbelievable capability and cool AJAX Internet technology Designed to be Internet savvy it allows users to easily create their own web page from which they can control their equipment without writing a single line of Internet program Features Qty Remarks Ethernet Web Pages User customizable to Emails control VO amp data Modbus TCP 0 1 res up to 50KHz Another TR j LOGI PLC by www tri plc com cci htm TR 1 877 TRI PLCS jua N April 9010 Issue 237 WEBENCH ACCELERATES DESIGN OF POWER SUPPLIES The WEBENCH Designer tools have now been expanded with the introduction of WEBENCH Power Architect the industry s first design tool that allows engineers to rapidly create model and implement multiple output high performance DC DC power supplies for an entire system With WEBENCH Power Architect system designers can instantly optimize multiple power supplies across several performance parameters including topology intermediate voltage rails footprint efficiency component count and bill of materials cost WEBENCH Power Architect supports the new SIMPLE SWITCHER power modules They provide highly integrated and easy to use so
14. DFM engineers conduct thorough and 1 precise analyses Quick Turn Production Imagineering offers small volume production in 5 6 days and medium to large volume production in 2 3 weeks y r i A 1 7 p ad F Overseas 22 AS el a 1 f 7 Manufacturing ESO OOOO E h qu Se ry i a Y Jl FU aia d 4 z s TE E E A al Capabilities Up to 30 Layers A Blind Buried Vias 3 Di Electric Thickness Shipping Logistics With Imagineering there is no need to deal with multiple suppliers language barriers TA pa VEEIeCtric INICKNESS customs headaches and shipping CC EE A AG mpedance Controli iDR Tested logistics We do it all for you oe a i 3 eee eS ES los and deliver door to door ree ua EROS a Udit des Coder 6 mi Laser Wri 3 mil line width spacing Conductive Epoxy Fillea Wias ASES Els Significant Price Saving eI agin ee Ss al i AIQ Ally i l r e a ITAR ISO 9001 Our global buying powel with the capabilities of our overseas manufacturers translate into tremendous savings to our customers Over the past 5 years 70 000 proidtypes have been successfully delivered from overseas tQ Over 5000 customers TAa P ij hy a CEPAS NS www HG Bket com email sales PCBnet com 23 YEARS IN BUSINESS AND STILL GOING STRONG E Peg sh le Th IES F A ae pa gee E EN 27 Y hs oe SE nee E E A e 5 3 Ba El i J 35 j T i
15. ITA AS April 2010 Issue 237 by Peter Montgomery Serial Network Hub Part 2 Circuit Design and Usage You are well on your way to building a six port RS5 485 hub that can implement a network packet system Here you learn the details about the software and hardware as well as some hidden gotchas present in R5 485 chips n the first part of this article series 1 described my need for an RS 485 hub as part of the hardware run ning my yearly Halloween display A quick visit to my website www socalhalloween com will show you the level of sophistication in my computer controlled show which includes multiple animatronic figures having con versations as well as physical effects sound effects and more The system is run by a laptop connected to a series of daisy chained hardware nodes that communi cate via RS 485 Normal RS 485 network topolo gies run either half duplex with all transmitters and receivers connected to a single wire pair or full duplex with a master node transmitting to all slave nodes on one wire pair while listening to all slave nodes on a separate wire pair In either case only a single slave node can transmit at a time and some mechanism polling token passing etc must be implemented to prevent multiple slaves from transmitting simultaneously and destroying each other s packets I originally implemented a store and forward scheme on each slave node to allow slaves to transmit when e
16. MQ with a manual rotary switch and of course each resistor has its corresponding par allel capacitor to avoid oscillations A second op amp provides another 100x voltage gain as well as offset compen sation through a trimming resistor in C7 220n J2 IN 11 BAS416 Ca D1 2 100pA pasaie GS S402 Ji IN 7 Virtual GND 1u eN ue Les i R4 p lt T AD8638 7 Virtual GND 20nA_ 3 200nA_4 2 5V 10k SP200 200mV 320k 25V met R6 c3 Offset AREAS 33 100n 2 5V NS Virtual GND Figure 6 This is the full schematic of my small picoammeter There are very few components except the rotary switch and its different feedback resistors and compensating capacitors CIRCUIT CELLAR e www circuitcellar com AAA POESIA fo y Photo 1 Even if this is usually not a good idea for such low level signal designs built the ammeter on a standard prototyping board Far better results could be achieved with a proper printed circuit board used preci sion resistors everywhere to avoid the need to calibrate the device order to get a 200 mV full scale output For a display I simply hooked up at the output a standard 3 5 digit voltmeter module Lascar Electronics SP200 built around a MAX138 ADC Just take care to use a meter with true differential inputs like this one Lastly let s consider the power supply I don t recommend using anything other than a battery for your picoammeter
17. Mulators so you can make an educated decision loc ress ToolsXpress RTE att a ee 126418 MAND A MBE NOR Price 5 Everon evoe C Join the thousands of engineers worldwide who use Embedded Developer every day at these locations Evla Eve FIND COMPARE BUY 24 E E OZO OOO HH EA Devor DE FINDE VERGLEICHE KAUFE The Sites for Engineers with a Job to Do O 9 k ok N oo Pifo 00 N bh oO N N o E o bh O Down Across 1 Acommon s path 2 He built a picoammeter for 237 3 Quick surge of volts 4 Used in to find user info in Unix 5 Cu Ag Au 7 r two words 6 Extension BAT 10 Depicts decisions particularly software related decisions two words 8 For placing orders online 13 Phil Katz 2 100 to 400 nm 14 1 million 11 Needs a server s services 17 Trick a system 12 Product info document two words 18 Customized 15 Set of size O two words 19 Translated by a compiler into machine language two words 16 Reduce by 1 IA OOOTEB 20 Conducts one way 21 NIST radio station The answers will be available in the next issue and at www circuitcellar com crossword April 2010 Issue 237 A DEA BOX THE DIRECTORY OF PRODUCTS AND SERVICES AD FORMAT Advertisers must furnish digital files that meet our specifications www circuitcellar com advertise ALL TEXT AND OTHER ELEMENTS MUST FIT WITHIN
18. PICT6 PICT and PIC18 microcontrollers Direct Access to Internal Registers supports In Line Assembly Language Interrupts in PICBASIC and Assembly Built in USB l2C RS 232 and More S Large Prototype Area source Level Debugging Boards Available for Most PIC MCUs H Documentation and Schematic Serial LCDs 2 line x 16 39 95 4 line x 20 49 95 Quantity Discounts Available see our full range of products including books accessones and components at www melabs com Embedded Ethernet ONLY 98 E 10Base T Ethernet 186 Processor 40 MHz POR COMPUTER APPLICATIONS DOS w Flash File System 16 Digital I O 5V DC Console Debug Port 2 Serial Ports Hardware Clock Calendar e 2 16 bit Timers Socket for DiskOnChip Watchdog Timer 512K DRAM amp 512K Flash 3 75 x 2 50 picoFlash i Development Kit Includes 1 2 g picoFlash Controller Borland C C 4 52 Serial Driver Library AC Adapter and Cables Make sure you re signed up to receive Circuit Cellar s monthly electronic newsletter News Notes will keep you up to date on Circuit Cellar happenings Stay in the loop 3 Separate Buses DV 3V Simple ASCII Interface Cross Platform All OS Call 530 297 6073 Email sales jkmicro com On the web at www jkmicro com l Register now It s fast It s free www circuitcellar com newsletter www i2cchip com JK microsystems CROSSWORD ANSWERS fr
19. VCC during power failures the rest of the circuitry goes dark www circuitcellar com CIRCUIT CELLAR What Your Electronics Store Used To Be Receive a FREE Gift with orders over 100 00 1 800 957 6867 www Designiotes com USB Oscilloscope for 169 50 Logic and Spectrum Analyzers Generator www HobbyLab us OSD 232 RS 232 TTL controlled on screen composite video character and graphic overlay in a small 28 pin dip package mae o Gisdas Cay ABEDEFGHI JKLMNOP ott abcdetghi jk HOUUKUZX gt MAN pes annul Min tUi tive Circuits Intuitive Circuits www icircuits com 248 588 4400 April 2010 Issue 237 Q ml June 239 Communications Space Close April 13 ASE July 240 Internet amp Connectivity Space Close May 12 AA August 241 Embedded Development Space Close June 11 Bonus Distributions Hot Chips amp Flash Memory Summit April 2010 Issue 237 Nn 00 WWVB 09834909 Flags 0510 Valid 1 Set 09 349 20 09 59 9 Loc 3 Age 0 LY 0 LS 0 DST 0 Chg 0 UT1 1 Mon 12 DOM 15 UTC 09 349 22 44 00 9 Loc 5 Age 138 LY 0 LS 0 DST 0 Chg 0 UT1 1 Mon 12 DOM 15 WWVB 448B4909 Flags 0510 Valid 1 Drift Elapsed 8280 Offset 33 Correction 159 ICR1 39840 Set 09 349 22 44 59 9 Loc 5 Age 0 LY 0 LS 0 DST 0 Chg 0 UT1 1 Mon 12 DOM 15 UTC 09 350 00 59 00 9 Loc 7 Age 130 LY 0 LS 0 DST 0 Chg 0 UT1 1 Mon 12 DOM 16
20. and a 20 MHz clock for the 28 I wanted to run the Z8 around 20 MHz for maximum performance but if the SX ran at that speed it would have insuffi cient speed to run all six UARTS in soft ware I also wanted to keep power con sumption down where I could so I did n t want to run the SX at too high a speed After writing the code for the SX I could determine how many cycles the interrupt took Using this information I decided to run a 40 MHz master clock which feeds the SX directly but pass it through a simple divide by two flip flop circuit to give the Z8 a 20 MHz clock see Figure 4 The SX was the perfect chip for me to create a six port UART In my design I run the SX with an interrupt rate of 307 692 kHz When you re running the interrupt at over 300 kHz you know you re using a fast chip The interrupt code executes six software UARTs sequentially each with an 8 byte ring buffer and each operating at 4x over sampling to detect the start bit properly The main code running in the fore ground monitors the ring buffers When a buffer for a UART has added a byte to its ring buffer the foreground code sends it to the Z8 using an 8 bit wide parallel transfer using a lightweight handshake scheme The handshake scheme simply uses an input and output bit on each proces sor that is cross wired input to output between the two chips The scheme doesn t use the absolute value of the bits but instead whether a bit
21. capability for such a small board not to mention one that costs just 59 Refer back to Photo 1 to see the connections as I go through the list Along the bottom and right edge of the board are connectors that com prise signals the AVR contributes to the I O mix Most of these connect directly to the MCU the notable exception being two spare SPI select signals conveniently located near the prototyping area In the interest of compatibility the signal names and layout take their lead from the Arduino standard However the Chameleon form factor isn t exactly the same so you won t be able to plug in existing shields Arduino speak for piggyback I O boards directly although it would be easy enough to wire a connection At the top edge of the board are the Propeller media I O features that set Chameleon apart including from left to right VGA NTSC audio and keyboard mouse In addition there are 8 bits of extra Propeller I O brought to a header for easy access Chameleon supports various proto typing options with a break off breadboard area The kit comes with a small test strip that you can dou ble side tape to the board for solder less experimentation Or you can leave off the test strip and solder parts directly to the board for a more robust solution Or if you really don t need the extra space just snap it off YOU TALKING TO ME Now that we ve seen the pieces of the Chameleon puzzle i e AVR Pr
22. colleagues was about immediate deliv erables we could bring to readers Our goals were to a enhance readers overall Circuit Cellar experience and b signify the strength of the Circuit Cellar Elektor union Incorporating full color pages was quickly agreed upon Color is great you say But what s the big picture Well like any new partnership ours has been marked by enthusiastic conversations exciting brainstorming sessions and insightful idea swapping The result of these exchanges has been the invigoration of all staffers with a sense of repur pose Each month we shall deliver fresh need to know infor mation to engineers and more Our mission is to give you more content more color more topics and more fluid con nections between the magazine its website its authors its advertisers its contests its code and its other products This issue starts another season of innovative projects and novel embedded programs Let s get started Kicking off the issue Jeff Shoemaker tackles the topic of converter performance and presents tips for working with on chip ADCs p 18 Turn to page 26 to learn how Jeff Bachiochi brought audio recording capabilities to an embed ded design with a playback IC On page 38 Peter Montgomery finishes his series on building a serial network hub with details about the software hardware and network packet transmission In Smart Control Alexandre Guimaraes presents a useful D
23. com 301 262 0300 CIRCUIT CELLAR www circuitcellar com SHORTEN TIME TO MARKET REDUCE DEVELOPMENT COSTS AVOID DESIGN RISK ARM29 i MX27 LPC3250 LPC3180 ARM11 i MX35 i MX31 ARM7 LPC2294 XScale PXA270 Blackfin ADSP BF537 Coldfire MCF5485 x86 Z510 Z520 Z530 Atom Cortex A8 OMAP3530 AM3517 PowerPC MPC5554 MPC5567 MPC5200B MPC565 MPC555 PHYTEC embedded System On Module technology is your production ready hardware and software solution Combined with our design services your new ideas arrive to market in the most timely and cost efficient manner ware Wd EG Call today or visit us at ESC April 27 29 www phytec com 800 278 9913 AVR PSoC Pro CPU12 ARM MSP430 a Propeller NEW V8 IDE Dinkumware libraries Power and Simplicity Nu Full featured 45 day E demos on our website 7 WWW Imogecraft com 2 o Sima com Low Cost High Speed Analog Signal Grabber Upto UY SPs 16 DIAD and ob FIFO Turn your PC into a SPI 12C SMBus or GPIO Controller Affordable Test and Measurement Tools Bus Monitors Protocol Analyzers Host Adapters Multiplexers Battery Applications Software Tools Micro Computer Control I Cc ie trademark of P bilips Corporatio T Www mcc us com tart at 5149 User Programmable Sample Rate up to 10M SPS Configurable FIFO data size up to 8 MB Stackable multi units sharing Sync and Trigger Driven by 16 bit
24. costs 3 25 1 000 up FOB USA An evaluation kit is avail able to speed designs Maxim Integrated Products www maxim ic com Distributors of Low Power RF modules Zigbee Bluetooth WiFi GPS GSM GPRS AVAILABLE RIGHT NOW v High Performance v Serial Interface v LowPower vy Very Long Range 2 Watt Multi channel VHF Transceiver VHF Norrow Band e FM 2 Watt Multi channel transmitter 151 820 MHz 151 880 MHz 151 940 MHz 154 570 MHz 154 600 MHz imanutaciored By 7 www lemosint com 866 345 3667 sales lemosint com www circuitcellar com e CIRCUIT CELLAR J RADIOMETRIX RS 485 Fe E ae DWG FLASA 3ziMb AA ME PAO SEMO NAM ial 200 Mhz Arm9 CPU Digit tal V O We brought you the world s easiest to use DOS controllers and now we ve done it again with Linux The OmniFlash controller comes preloaded with Linux and our development kit includes all tools you need to get your project up and running fast Out of the box kernel support for USB mass storage and 802 11b wireless along with a fully integrated Clock Calendar puts the OmniFlash ahead of the competition Call 530 297 6073 Email sales jkmicro com www jkmicro com JK microsystems Inc ZZ MADE IM UBA M International Orders Welcome April 9010 Issue 237 j Q April 2010 Issue 237 ULTRA LOW POWER AUDIO DEVICE The WM8904 is a leading ultra low power CODEC with Class W h
25. determined and used to allow the compiler and assembler to access header files across directories and the linker to access the library files created by the library projects The Crossware ARM Development Suite runs on 32 and 64 bit Windows features an advanced C C compil er libraries wizards simulator and debugger and pro vides a complete and extremely user friendly develop ment environment for the ARM family of microprocessor cores Base package pricing starts at about 445 Crossware Products www crossware com PACKAGE ACCELERATES DESIGN OF REAL TIME CONTROL APPLICATIONS Responding to the demand for more intuitive easy to use software throughout every design stage Texas Instruments has announced the controlSUITE software package for its TMSS320C2000 microcontrollers Going beyond the simple demonstra tions common to free software portfolios controlSUITE software includes libraries and examples that are full open source proj ects serving as true development systems for applications such as motor control Additionally a new installer eliminates frus trations related to versioning and dependencies and gives developers access to the complete software offering in a centralized location Rey features and benefits of control5SUITE software include fundamental building blocks inside an intuitive system frame work to simplify device start up configuration tasking and peripheral configuration modular application level librari
26. for button presses The second sec tion includes the LCD control functions The third section includes the timer interrupts that control the heater s acti vation according to the parameters determined by the main loop By putting time critical procedures in the timer interrupt handlers the main program becomes much simpler and less time critical Once the inter rupts are debugged you can forget about how the heaters are controlled You just say how you want the tem perature to be in the main loop and it just gets done Debugging interrupt routines can be troublesome but in many projects like this one they make life much easier If you re a disci plined coder who remembers that any data that may be used inside interrupts needs to be handled in an atomic way and that operations inside an interrupt routine need to be fast paced it is not a big deal State machines are a great way to code algorithms inside interrupt routines I could have stored the temperature profile in an array but I just left it hard coded As far as I could see the only sit uation that could require a change in the profile parameters would involve using the same controller on a larger toaster and if that ever happens I can just recompile the program with new Listing 1 Simple software controls TRIAC driving KRKRKRKKKKKKKKKKKKKKKKKKK KKK KKKKK KKK KKK RR RRA AA KK RARA AA KK A ARA AA KK KARA AA AA KK RR KA
27. has changed state to indicate an event At start up each processor s output bit is set to a known state Each processor reads that initial state and stores it It then polls the bit and compares the cur rent state to the stored state When a processor changes the state of its output bit the other processor detects the CIRCUIT CELLAR www circuitcellar com change by comparing the new input state to the previously stored state This new state is then stored and the process Listing 1 This code for the 28 to 5X data transfer handshake scheme runs on the 28 It shows extensive use of macros to simplify code readability and ease of modification This macro generates a bitmask for the passed bit number ifndef THIS BIT define THIS BIT bit 1 lt lt bit endif THIS_BIT Port E bit 4 is data ready signal from the SX Hdefine DATA_RDY_IN_PORT PEIN Hdefine DATA_RDY_BIT 4 define DATA_RDY_FROM_SX DATA_RDY_IN_PORT 4 THIS_BIT DATA_RDY_BIT Port E bit 5 is the acknowledge output bit define ACK_OUT_PORT PEOUT define ACK_BIT 5 define ACK_TOGGLE char CurrDataReady Current state of data ready line from SX char PrevDataReady 0 Previous state of dtat ready line from SX while 1 4 CurrDataReady DATA_RDY_FROM_SX if CurrDataReady PrevDataReady ACK TOGGLE 7 7 Yes Two mixed signal triggers Protocol decoding Spectrum analysis Symbolic maths Custom units Copy
28. ideal for adding USB to sensors amp peripherals No drivers needed for Windows Mac Linux No microcontroller programming required Also check out our USB 232 USB to UART www hexwax com Buy from Mouser amp Famell Amazing PIC programmer Most devices supported ICSP SOTP amp copy limits t Digike Sante 32 Paria Actual size patents pending 000 basic overlay board BOB 4 Low cost video data overlay module Features Automatic text scroll and crawl TTL 232 and SPI control ports Any size for custom fonts Vector and bitmap graphics www decadenet com Ll DECADE ENGINEERING 503 743 3194 Turner OR USA Rowley CrossWorks ARM 7 ARM9 Cortex C C Compiler IDE Debugger and JTAG programming tools in a single professional package Board and CPU support for NXP STMicroelectronics Atmel Tl and many other microcontrollers Includes royalty free tasking library Come and see what we have Mention Circuit Cellar when you buy and we ll gladly send you a JTAG adapter for free RowleyAssociates com z April 2010 Issue 237 m April 2010 ssue 237 1 W Oo f TA CAN232 Features es Froe sample programs rs CANUSB Features E Manassa cd 17 Free Activex component i PC MAG amp Linux support Seon E ute tant 30 11423000 suppor 2 Receive FIFO Simplo CAN logger included Works up to 1Mbit CAN Free Threaded Windows DLL Simple AS
29. left side The C MAX WWVB receiver and bar antenna mount on the Minutes board and display drivers The small board on the ribbon cable is the C Max CMMR 6P 60 WWVB receiver also connected to its ferrite bar antenna The Minute board which I won t describe in detail consists of just two display drivers DIP configuration switches and a shielded area for the WWVB receiver You can see that the clock has an extremely simple hardware design Because I know who will be using this clock and we agreed on exactly what it should and should not do there s no need for buttons knobs and other user interface frippery A commercial clock requires those features this isn t a mass market design The firmware is considerably more complex It converts the WWVB receiver s output into pulse width measurements error checks the signal s format parses valid time codes into the Dis numeric values that determine the current UTC time and synchronizes its variables to that time code Those variables tick along under control of a timer driven by the microcon troller s clock oscillator with the firmware adjusting the D8 PWM11 PWM10 www circuitcellar com CIRCUIT CELLAR countdown ratio to correct the oscilla tor s frequency offset and drift The firmware converts UTC time from its variables to local time then to the LED segment patterns and sends those bits to the display drivers That s all there is to i
30. lot of time on this issue If you want to build this picoammeter I m sure you will be able to design a pretty PCB for it Don t forget the ground plane and remember to put it in a shielded enclosure for the best results You can also easily replace the 3 5 digit volt meter display with a microcontroller and a standard LCD Doing so will enable you to add zillions of interesting fea tures like software based auto zeroing very helpful averag ing helpful with noisy signals or even automatic range selection through reed relays or something similar Don t hesitate to share your design ideas with other Circuit Cellar readers Another interesting option would be to use a derivative form of the transimpedance amplifier where the feedback resistor is replaced by a capacitor This gives an integrator with an integration time proportional to the input current Dedicated chips like the IVC102 from Texas Instruments e g Burr Brown implement this concept and should be quite easy to interface with a microcontroller And their 100 fA yes femtoampere bias input current should result in impressive performances FIRST EXPERIMENT Before closing I want to describe my first experiment with my small picoammeter I connected a 9 V battery in series with the ammeter input and built an ohmmeter soldered a small two pin 1 cm wide header at the end of the wires and pushed this homemade sensing probe on several surfaces to measure their resis
31. of the board was for all the RS 485 inter face chips and terminating resistors So I had a finished PCB The result was tricky to lay out but worth it for the space savings it generated PCB LESSONS I have used the SX 28 chip in numer ous projects but it has always been the through hole DIP package When I decided to make this PCB an all surface mount design I checked the documen tation for the SX 28 to see if the pinout was the same for the DIP and surface mount packages In the documentation I read the pinout was identical for both the DIP and SOIC packages Simple I www circuitcellar com CIRCUIT CELLAR Why not try a different approach before you head to lunch Your first board is ready to test Your circuit design is done and you re ready to make a prototype Photo 1 The board in the middle is the MEAN WELL power supply while my PCB with a six port RJ 45 jack is on the right Note the attention to detail on the internal wiring Your second board is ready to test After afew tweaks you re ready to make your finished board Your finishad board is ready to go Nice Sor You just shaved weeks off your development schedule All in a day s work ProtoMat Benchtop PCB Prototyping Machine What would your day look like tomorrow If you could cut yourself free from the board house and produce true industrial quality PCBs right at your desk LPKF s ProtoMat benchtop prototy
32. resources are available for free download from ftp ftp propeller chip com PCMProp Order online orcall our Sales Department toll free See all the New Products at www parallax com y Al 7 888 512 1024 Monday Friday 7 a m 5 p m PDT d Prices subject to change without notice Propeller Parallax and the Parallax www parallax com logo are trademarks of Parallax Inc XBee is a trademark of Digi International Friendly microcontrollers legendary resources CIRCUIT CELLAR THE MAGAZINE FOR COMPUTER APPLICATIONS by Stefan Negru The Feellagged System An Arduino Based HCI Project With Arduino board some programming skills and a little imagination you can create some pretty futuristic HCI projects This article covers how to communicate human emotions on a 2 x 16 LCD n Arduino board is a great prototyping platform on the device The Arduino also sends the displayed mes Its easy to use software and hardware make it sage to the host computer where it is forwarded to a Twitter ideal for rapidly developing new devices and methods for account interacting with computers With this in mind I used an I initially used the potentiometer as a user input to set Arduino board in a research project concerned with find the intensity of the feelings But due to some stability ing new ways to facilitate interaction between humans issues I repurposed it for checking if the LEDs have the and computers My focus was on d
33. sampling memory 279 I2C Xpress USB12 480 500AG 2 Versatile USB 2 0 12C protocol exerciser and analyzer Wave Xpress Mini logger with built in temp hum pressure 3 axis accel sensors FTDI USB ICs USBI2CIO 111111 Popular UART and FIFO chips Upgrade Legacy designs to USB PoKeys55T No OS needed TCP IP offload ICs improve system performance Compact economical smart OLED with graphics drive from USB or RS232 unique electronics DS1000E 25MHz 2 ch 16 logic scope and logic analyzer 1195 104 PS2105 E Touch input 10 2 LCD 12V powered Windows PC LX800 512MB 4GB Ethernet 3xUSB SD PS Mephisto 100MHz Scope Spectrum Logic Analyzer and Signal Generator 1259 8 Amazing 7 in 1 Scope CircuitGear CGR 101 is a unique new low cost PC based instrument which provides the features of seven devices in one USB powered compact box 2 ch 10 bit 20MS sec 2MHz oscilloscope 2 ch spectrum analyzer 3MHz 8 bit arbitrary waveform standard function generator with 8 digital I O lines It also functions as a Network Analyzer a Noise Generator and a PWM Output source What s more its open source software runs with Windows Linux and 180 really like this scope adapter it s meant for teaching electronic experiments but it s ideal for engineers too www saelig com Alan Lowne microCAM Compact compressed serial output camera module for any host
34. see it can go a pretty long way with a little help from its friend the Propeller Data size is limited as well to the 2 KB of AVR on chip SRAM but that s enough for simple apps And don t forget the 1 MB SPI flash chip You can drive it with software to store low frequency or read only data e g constants strings look up tables calibration factors etc Ditto for the AVR on chip 1 KB EEPROM Meanwhile the Pro peller powers up and loads itself with the library of predefined serv ices stored in the 64 KB EEPROM chip and then waits for a command from the AVR The AVR and Propeller communicate via the SPI port and the protocol relies on fixed length 3 byte com mand data packets When the AVR issues a command the Propeller dis sects it and then passes it along to the core that handles the requested function One challenge for any multipro cessing scheme is making sure the overhead of interprocessor communi cation doesn t outweigh the gains For instance there is a command that allows the AVR to indirectly access the aforementioned Propeller 8 bit local port It s fine for lights and switches but needless to say it s rather pokey considering the over head of sending multi byte packets between the AVR and Propeller just to twiddle a single bit Multiprocessing works best when it just requires a little communication to trigger a lot of local processing And that s just the way it works wit
35. to ftp ftp circuitcellar com pub Circuit_Cellar 2010 237 SOURCES NFM 20 12 Power supply MEAN WELL Enterprises Co www meanwell com SX 28 Proto Board Parallax Inc www parallax com TLV1117 Linear power regulator Texas Instruments Inc www ti com Z8F4821 Microcontroller Zilog Inc www zilog com NEED TO KNOW INFO Knowledge is power In the computer applications industry informed engineers and programmers don t just survive they thrive and excel For more need to know information about topics covered in Peter Montgomery s Issue 237 article the Circuit Cellar editorial staff highly recom mends the following content Wireless Mobile Robotics by Scott Coppersmith Circuit Cellar 224 2009 Scott used an MCU an embedded Ethernet board and a wireless router in a robot control system A webcam can transmit real time pictures to a laptop Topics Robotics Wi Fi Webcam Motor Control Go to www circuitcellar com magazine 224 html MiniEmail A Compact MCU Based Mail Client by Alexander Mann Circuit Cellar 204 2007 This easy to build system uses an MCU and an Ethernet controller to monitor email When mail arrives you can respond via a standard keyboard Topics Network E mail WinAVR LCD GCC Go to www circuitcellar com magazine 204 html CIRCUIT CELLAR e www circuitcellar com Can You Guess the Missing Component R1 1K What is 4 or 8Q the missing SPKR
36. transient on the test bench that locked the processor into a 100 duty cycle on the 120 VAC coil can t remember which of us got to the fire extinguisher first but it was quick The reality was that we had designed a device that satisfied the customer s specification but we hadn t thought far enough to make sure what happens or doesn t happen when it only meets those specs Fortunately for us the microprocessor we used had a watch dog timer on it so a quick code change eliminated the chances of 100 duty cycle for more than a few tens of milliseconds Cars with dozens of networked processors are a bit more complicated and l m glad I m not the one responsible for making this mess work correctly Given all the sensor switch and electromagnetic device coordination can t help but feel that somewhere in a million lines of control code the likelinood that someone missed a biggie or two is better than even money Hence 100 gas pedal duty cycle The irony of all this is that car electronics is extremely sophisticated and drive by wire cars that are computer controlled to go should just as easily be computer controlled to stop Just like my cheap plastic bobbin that depended on having less than 20 duty cycle to stay safe many American and Japanese car manufacturers simply depend upon having brakes that can out power the motor and stop a runaway car rather than using more sophisticated costly options German cars like BMW simply have a couple more
37. you occasionally work with low currents you should have a picoammeter on your workbench With some perseverance and a little Know how you can build one in a couple of hours But first you need a good understanding of current measurement and transimpedance amplifiers elcome back to The Darker Side I think I got my first multi meter when I was 10 years old Well more pre cisely I took my father s multimeter and played with it so long that we soon both considered it mine The ohm meter feature was particularly fascinating I could put the two wires on any thing and then check the galvanometer to see if it was behaving more or less as a conductive surface Another interesting game involved tak ing a wire in each hand and tightening them between two fingers to get the lowest possible resistance I am a little older now but I am still playing with resistance and current measurements even though galvanometers have disappeared from our multimeters As you may have noticed energy saving is a hot topic and we can now find integrated circuits with standby currents in the tens of nanoamps range or even lower But measuring these currents is with low currents you don t need a top range accuracy because there are plenty other error and noise sources But a wide dynamic range is fundamental Moreover you ll probably use it only a few times per year so a homemade solu tion makes sense This month I ll begin by covering conce
38. 16 BIT MCUs WITH USB 2 0 FUNCTIONALITY Twelve new 16 bit all flash microcontrollers with built in USB 2 0 functionality and industry leading low power consumption are now available The new offering includes six 48 pin MCUs 78KOR KC3 L and six 64 pin MCUs 78KOR KE3 L with flash memory options ranging from 64 to 128 KB USB function drivers are available to handle device specific functionality and other related tasks Starter kits with USB evalu ation boards development environments sample software and documentation are also available Cer tified by the USB Implementers Forum USB IF the new devices offer manufacturers and consumers the assurance they will function in accordance with the specification and will interoperate with existing USB enabled devices on the market today Achieving a low standby power consumption of 1 2 UW the MCUs also enable a low active CPU operation power consumption of 20 mW at 20 MHz In addition to USB functionality the products come with a mix of advanced peripherals including 10 bit ADCs 16 bit timers a real time clock a watchdog timer a 16 bit PWM IC and VARTs Suggested distribution resale pricing for 10 000 unit quantities ranges from 3 40 to 4 55 depending on the memory size package and peripherals NEC Electronics Corp www necel com CIRCUIT CELLAR e www circuitcellar com ULTRA COMPACT 20 W AC DC POWER MODULE The RAC20 SB is a highly efficient power module in the
39. 2 microcontroller Data is displayed on a Nokia 3510 graphical display www circuitcellar com_ CIRCUIT CELLAR longer than a usual reflow profile as a safety measure The results were out standing and even better than some commercial reflow ovens that I ve seen with three reflow zones HARDWARE DEVELOPMENT Choosing a controller for this project was easy As you can see in Figure 1 I l PB7 TRST PCO TCK SWCLK a PC1 TMS SWDIO PC2 TDI PC3 TDO SWO PB3l2csDA PB2 20SCL VDD G PB1 32KH PBO CCP G VDD PA5 SSITX PA4 SSIRAx DSR RST SUSPEND SUSPEND Power out Neutral Hot MCP1700 3 3V went with a Texas Instruments Lumi nary Micro LM3S102 microcontroller because it was inexpensive C friendly for such a small CPU and came with free tools Most importantly it had plen ty of resources to help keep NRE costs to a minimum I consider the LM3S102 to be a great 8 bit killer especially for small to medium sized projects For the user interface I chose a Nokia 3310 graphical display because it was affordable readily available and easy to interface see Figure 2 I included but tons for starting the cycle Plus they will make the board more versatile for future projects or expansion I added a Silicon Labs CP2103 serial to USB inter face to make development and tempera ture profiling easier It was not needed after development and toaster characteri zation To simplify temperatu
40. 28 acting as a six receiver port UART Both parts will run on a 3 3 V supply so I didn t need both a 5 and a 3 3 V source The power is sup plied by a Texas Instruments TLV1117 linear power regulator in a SOT 223 surface mount package Extra PCB copper was used to provide heatsink ing This was especially important since the input voltage to it was 12 V which meant dissipating more power S April 2010 Issue 237 in the form of heat Signal conversion from logic to RS 485 levels was han dled by a pair of Maxim MAX3094 quad receivers and a MAX3070 trans ceiver A MAX3233 chip provided logic to RS 232 level conversion and required no outboard capacitors for the charge pump reducing component count see Figure 3 I spent a bit of time working out the best approach for clocking the two CPUs The SX can be run up to INVALID FORCEOFF FORCEON MAX3233 Figure 3 A MAX3255 provides conversion from R5 232 level to 5 5 V logic without requir ing external capacitors for the charge pump Fe bbb bb fb EE rs Pa Pa P3 P pa DOWNLOAD our free CAD software DESIGN your two or four layer PC board SEND us your design with just a click RECEIVE top quality boards in just days 4 expresspcb com 5 April 2010 Issue 237 75 MHz but the Z8 tops out at 20 MHz This is here just to provide known inputs to the unused flip flops Figure 4 The project needs a 40 MHz clock for the 5X
41. 68Hz 8Kxl6 384x8 256x842 4 v v 2 12 bix8 10 bit ETMx1 V 8 2 UART HT66FB50 16 bit STMx1 USB 2 HT66F60 10 bit CTMx2 SPI PC HT66FU6O 2 2V 5 5V 400KHz 20Mhz or 32768Hz 12Kx16 576x8 256x850 4 v v 4 12 bix12 10 bit ETMx 1 V 12 2 UART O HT66FB6O PA ee ee PO E ES E EPA ee ees a Program Data LCD Compa I HT68F20 2 2V 5 5V 400KHz 20Mhz or 32768Hz 1Kx14 64x8 32x8 18 T E SPI C HT68F30 ene SPI PC HT68FU30 2 2V S 5V 400KHz 20Mhz or 32768Hz 2Kx14 96x8 64x8 22 4 v v 2 n T V 4 2 UART HT68FB30 USB HT68F40 10 bit CTMx SPI I C HT68FU40 2 2V 5 5V 400KHz 20Mhz or 32768Hz 4Kx15 192x8 128x8 42 4 v v 2 10 bit ETMx1 v 8 2 UART HT68FB40 16 bit STMx1 USB HT68F50 10 bit CTMx2 SPI PC HT68FUSO 2 2V 5 5V 400KHz 20Mhz or 32768Hz 8Kxl6 384x8 256x8 42 4 v v 2 10 bit ETMx1 v 8 2 UART HT68FB50 62 STMX USB 2 HT68F60 10 bit CTMx2 E HT68FU60 2 2V 5 5V 400KHz 20Mhz or 32768Hz 12Kx16 576x8 256x8 50 4 V v 4 10 bit ETMx1 v 12 2 UART HT68FB60 16 bit STMxI USB Holtek Semiconductor USA Inc HOLTEK SEMICONDUCTOR INC 46729 Fremont Blvd Fremont CA 94538 E mail sales holtek com Tel 510 252 9880 Fax 510 252 9885 http www holtek com English default htm WWW holtek com o April 2010 Embedded Programming mi m A Y eee Hub Desian P G Reflow _ Solderina Controk A DG FROM THE BENCH Read Only Memories Audio Applications with a Playback IC Jeff Bachiochi gt A LESSONS FROM THE TRENCHES Totally Featureless Clock Part 2 Hardwar
42. 8 10 Bit A Ds 4 16 Bit Timer Counters e Graphic LCD Interface with 2D Acceleration mall 200 pin SODIMM form factor 2 66 x 2 38 The SoM 9G45 uses the same small SODIMM formefactor utilized by other EMAC SoM modules and is the ideal processor engine for your next design All of the ARMS processor core is included on this tiny board including Touchscreen Interface Flash Memory Serial Ports Ethernet 12S Audio Interface PWMs Timer Counters A D Digital I O lines and more Like other modules in EMAC s SoM product line the SoM 9G45 is designed to plug into a custom or off the shelf Carrier board containing all the connectors and any additional I O components that may be required The SoM approach provides the flexibility of a fully customized product al a greatly reduced cost Single unit pricing starts at 190 http www emacinc com som som9q45 htm OVER E A 25 YEARS OF 1 A y BOE SINGLE BOARD E Ai NONIE MONITOR AND CONTRO 2 6 KERNEL E SOLUTIONS A Phone 618 529 4525 e Fax 618 457 0110 Web www emacinc com CIRCUIT CELLAR www circuitcellar com and mode for reading the story And two the main routine only tests for three push buttons That s because the fourth button is tied to resetting the microcontroller Push ing it restarts the application brings it out of sleep It resets the mode to O and reads the instructions on using the buttons to choose a story Th
43. A 2 x 3 FORMAT E mail adcopy circuitcellar com with your file or send it to IDEA BOX Cir cuit Cellar PO Box 180 Vernon CT 06066 For current rates deadlines and more information contact Peter W ostrel at 800 454 3741 978 281 7708 or peter smmarketing us The Vendor Directory at www circuitcellar com vendor is your quide to a variety of engineering products and services PDQ Board A Fast 1 O Rich Single Board Sd Low cost 2 5 x4 C programmable computer 16 bit HCS12 processor clocked at 40 MHz 8 PWM 8 counter timer and 8 digital I O 16 10 bit A D inputs Dual RS232 485 ports SPI and IC ports 512K on chip Flash 512K RAM with Flash backup Plug in I O expansion including Ethernet Wi Fi GPS 24 bit data acquisition UART USB Compact Flash card relays and more poet A Tanda Electronic and Electro mechanical Devices Parts and Supplies Wall Transformers Alarms Fuses Relays Opto Electronics Knobs Video Accessories Sirens Solder Accessories Motors Heat Sinks Terminal Strips L E D S Displays Fans Solar Cells Buzzers Batteries Magnets Cameras Panel Meters Switches Speakers Peltier Devices and much more www allelectronics com Free 96 page catalog 1 800 826 5432 www circuitcella com gt CIRCUIT CELLAR A www flexipanel com Weather Instruments for PCs electr nica www aagelectronica com Revolutionary new eona USB chip f AID VO SPI I2C
44. AP Circuits 40 ExpressPCB 29 Keil Software 77 Phytec America LLC 3 Actel Corporation 49 ezPCB 77 Keterex Inc 28 PoLabs 75 All Electronics Corp 7 FTDI 43 LPKF Laser 8 Electronics 13 Pololu Corp 76 Apex Embedded Systems 75 FlexiPanel Ltd 56 Lakeview Research 17 R4 Systems Inc 33 CWAV 14 Front Panel Express LLC 76 Lawicel AB 76 Reach Technologies Inc 41 Cleverscope 48 Grid Connect Inc 9 LeCroy 31 Renesas Technology America 53 Comfile Technology Inc 57 HobbyLab LLC 15 Lemos International Co Inc 75 Rowley Associates 76 Custom Computer Services Inc 5 Holtek Semiconduction Inc 23 Linx Technologies Inc 59 Saelig Company 75 Decade Engineering 78 2CChip 77 MCC Micro Computer Control 77 Scidyne 57 DesignNotes 61 ICbank Inc 77 Maxbotix Inc 51 Sensors Expo amp Conf C3 Digi International 77 Imagecraft Creations Inc 78 microEngineering Labs Inc 21 Spark Fun Electronics 32 42 EMAC Inc 1 Imagineering Inc 75 Mosaic Industries Inc 2 TI DesignStellaris 2010 Contest 77 Earth Computer Technologies 57 Intuitive Circuits LLC 35 Mouser Electronics 24 25 Technologic Systems 36 37 Elektor 23 Ironwood Electronics C2 NetBurner 77 Tern Inc 67 Elektor 15 32 JKmicrosystems Inc 56 Nurve Networks LLC 76 Trace Systems Inc 42 Elprotronic 76 78 JKmicrosystems Inc 14 PCBCore 11 Triangle Research Int l Inc 16 Elsevier 45 Jameco 10 PCB Pool ATTENTION ADVERTISERS REVIEW May Issue 238 Theme Measurement amp Sensors June Issue
45. Build a Picoammeter Start Experimenting p 62 Put a Multidimensional SBC to Work p 68 CIRGUIT CELLAR THE MAGAZINE FOR COMPUTER APPLICATIONS 237 April 2010 ae PROGRAMMING P f ne A ap N 1 k a nn int a Ve a F i f re pa rj a ms to an n Embedded Design Tips tor Working with On Chip ADCs Mi con ES a RES i sie on _ a gt _ _ A gt E x tir _ E m m A AA a E pi a pa a s 28 j AA ode Hub Circuitry 3 ql T 74470 75349 0 5 95 U S 6 95 Canada z a 5 s La w i A E a z A _ na na i E 8 na y 3 pa i A i gt mM A E p ee e n e 5 gt pr a qa e ae al a z a a E mE E _ _ et q TS x TL H he AA A A A h A i a E gt s a i T wyww circuitgellar com SSH ENCRYPTED SERIAL TO ETHERNET E Tre Device P N SB70LC 100CR A Kit P N NNDK SB7OLC KIT 7 2 port serial to Ethernet server Qty 1000 p Device P N SB700 EX 100CR Kit P N NNDK SB700EX KIT SB700EX 129 2 port serial to Ethernet server Qty 1000 with RS 232 amp RS 485 422 support Device P N CB34 EX 100IR Kit P N NNDK CB34EX KIT 149 CB34EX industrial temperature grade Qty 1000 p J 2 port serial to Ethernet server with RS 232 am
46. CHAM AVR SYSTEM VOLO h gt include lt CHAM AVR TWI SPI DRY VOl10 h gt include lt CHAM AVR _NTSC_DRY_VO10 h gt void setup run once when the sketch starts SPI_Init SPI_DEFAULT_RATE _delay ms 2500 y end setup void loop NTSC_Term Print Hello World NTSC_Term_ Char OxD end loop run repeatedly Photo 3 The Arduino GUI is about as simple as it gets Although it uses the same GNU compiler technology as industrial strength tools the complexity is hidden behind a simple fa ade with none of the bloat and clutter of a traditional IDE software It s intended for artists designers hobbyists and anyone interested in creating interactive objects or environments It s natural to focus on the hard ware but the story goes way beyond the Arduino boards themselves see Photo 2 Frankly there s practically nothing to them beyond an AVR MCU and some connectors Rather what sets Arduino apart is a combi nation of openness community and easy to use software Arduino is said to be an open hardware project although your Google search will also turn up plen ty of debate over exactly what open means License fine print aside it s clear there s a vibrant ecosystem of users and third party suppliers who have latched on to the Arduino bandwagon And a big reason for the popularity is Arduino s simplified toolchain Under the hood are the familiar G
47. CII protocol Firmware upgradable via USB 8 arts RTR Framos Sample programs in C VB E Max 230Kbaud RS232 Delphi CS PureBasic etc 5 Free USB drivers 2 CE Approved i lt E A j kz k N E Ote i A SN gi Serial Commands Era i ma Touch Events Your Microcontroller Our Display Module Add a Touch Screen to Your Embedded Product e No special OS or Library Required e Programming GUI is Simple y e Development Kit Up and Running in Days Learn more at www reachtech com call 510 770 f417 or email info reachtech com S in booth 2330 ne fot Bm Solve complex signal acquisition pro pla positioning control g o environmental acceleration transients pressure vibration sonar e Lin Driver D Guaranteed in stock Many newly added features 16 bit analog inputs and outputs Million sample FIFO eliminates interrupts Wide analog input and output ranges e 40 C to 85 C Standard Gouge Order 24 7 fast and easy rn Goog www st 04 com Apex Embedded Systems help stx104 com 608 256 0767 x24 C Compiler EXCLUSIVE to Microchip PICeMGU The ONLY compiler with 307 PICMCU Specific Built in Funtions Get 10 0 off your next PIAR purchase Code MORE10 Wits More Stats at www ccsinfo com more PICOMCU and dsPICODSC are registered trademarks of Microchip Technology Inc CIRCUIT CELLAR Designer s Notification Network Circuit Cel
48. E Modern technology for everyone FPGA Course FPGAs have established a firm position in the modern electronics designer s toolkit Until recently these super components were practically reserved for specialists in high tech companies The nine lessons on this courseware CD ROM are a step by step guide to the world of Field Programmable Gate Ar ray technology Subjects covered include not just digital logic and bus systems but also building an FPGA webserver a 4 channel multimeter and a USB controller The CD also contains PCB layout files in pdf format a Quartus manual project software and vari ous supplementary instructions ISBN 978 90 5381 225 9 23 40 COMPLETE PRACTICAL MEASUREMENT SYSTEMS USING A PC ee ppan ee ul aaa lata e lektor Circuit design and programming Complete practical measurementsyst ems using a PC This book covers both hardware and software aspects of designing typical embedded sys tems based on personal computers running the Windows operating system With an em phasis on learning by doing readers are en couraged by examples to program with ease the book provides clear guidelines as to the appropriate programming techniques on the fly Complete and well documented source code is provided for all projects 292 pages ISBN 978 0 905705 79 8 46 00 PIC Cookbook for Virtual Instrumentation Several case studies included PIC Cookbook for Virtual Instru
49. EPROM 24 bit Address Command OXOFFFFF Phrase 0 Stop OXOFFFFE Phrase 0 Mute OXOFFFFD OxOFFFFC Phrase 0 Play PCM 0x000007 0x000006 Phrase 0 Play PCM 0x000005 0x000004 Phrase 0 Play PCM 0x000003 Phrase 0 Unmute 0x000002 0x000001 0x000000 Vector for phrase 0 Table 2 The external EEPROM is programmed by the evaluation kit or from an optional HEX file with the phrase table and phrase commands Here you see a single phrase O with one 24 bit jump vector at location O 1 and 2 pointing to address 0x0000053 Phrase O com mands might be 8 or 16 bits in length and often hold additional data like a PCM sample indicated here by a question mark devices up to about 1 Mb 131 072 bytes in size That equals an equiva lent time of 8 s in PCM mode and 16 s in ADPCM mode I can see some of you yawning out there but wait Some relatively new flash memory powerhouses have expanded their memory lines with larger devices up to 128 Mb 16 777 216 bytes These new parts extend the useful file sizes to more than 17 minutes and 34 minutes respectively Now we re talking about some useful audio times Still I can hear some of you out there saying Ya but these must cost a fortune Actually they Hie low cost mixed signal eel Oscilloscope Spectrum Analyzer Recorder Logic Analyzer Pattern Generator 2 5 Analog C
50. IY reflow soldering controller project p 46 Ed Nisley finishes his Totally Featureless Clock series on page 54 with a presentation of the overall design On page 62 Robert Lacoste explains how to build a picoammeter for your workbench Tom Cantrell completes the issue by presenting an exciting multidimensional SBC you ll find handy for future designs p 68 C Abi cj circuitcellar com A April 2010 Issue 237 PUBLISHER Hugo Vanhaecke ASSOCIATE PUBLISHER Shannon Barraclough CUSTOMER SERVICE Debbie Lavoie CONTROLLER Jeff Yanco ART DIRECTOR KC Prescott GRAPHIC DESIGNERS Grace Chen Carey Penney STAFF ENGINEER John Gorsky ADVERTISING 800 454 3741 978 281 7708 www circuitcellar com advertise ADVERTISING REPRESENTATIVE Peter Wostrel Strategic Media Marketing Inc 1187 Washington St Gloucester MA 01930 USA 800 454 3741 978 281 7708 peter smmarketing us www smmarketing us Fax 978 281 7706 ADVERTISING COORDINATOR Valerie Luster E mail val luster circuitcellar com Cover photography by Chris Rakoczy Rakoczy Photography www rakoczyphoto com PRINTED IN THE UNITED STATES CONTACTS SUBSCRIPTIONS Information www circuitcellar com subscribe E mail subscribe Ocircuitcellar com Subscribe 800 269 6301 www circuitcellar com subscribe Circuit Cellar Subscriptions P O Box 5650 Hanover NH 03755 5650 Address Changes Problems E mail subscribe Ocir
51. KA A KR The interrupt handler for the timer interrupt that controls triac driving KRKRKRKKKKKKKKKKKKK AAA RRA AAA KK RRA AA A A RR RRA KA A KR RRA A A A KK RRA AA KK KARA AAA A A RRA KA A KR void TimerOIntHandler void TimerIntClear TIMERO_BASE TIMER_TIMA_TIMEOUT Clear pending Interrupt signal During the zero crossing do not do anything wait for it to end The zero crossing pulse takes about 800 us if GPIOPinRead GPIO_PORTC_BASE Zcross Test if inside zero crossing ZcrossActive 1 else Counts Zero Crossings for the pulse skipping if ZcrossActive Executes once at the end of the zero crossing pulse i ZcrossActive 0 Prepares for next zero crossing ZcrossCount t Increments Cycles if ZcrossCount gt 4 If 5 zero counter ZcrossCount 0 TriacOnTimer 0 Triac is not fired yet if ToasterOn If control wants more heat if ZcrossCount lt OnCycles Activates for OnCycles limits power at each stage by skipping AC cycles TriacOnTimer if TriacOnTimer lt 20 Turn on the triac gate for 2 ms GPIOPinWrite GPIO_PORTC_BASE Outl 0 Turn on the heater else GEPIOPinWrite GPIO_PORTC_BASE Outl Outl Off gate current else GPIOPinWrite GPIO_PORTC_BASE Outl Outl Turn off the heater h CIRCUIT CELLAR e www circuitcellar com Donald E Stephens Convention Center e Rosemont IL www sensorsexpo com This
52. KX1400 s commands Most of the commands recognized by the KX1400 can be placed in an external EEP ROM These provide a simple yet powerful repertoire of control over the audio IC An internal tone generator can provide musical output note by note or prerecorded audio files can be played Attaching a microcontroller adds a potential for user interaction CIRCUIT CELLAR www circuitcellar com out of frequencies and pauses This project produced copious amounts of feedback Everyone was looking for more than just a programmed sequence of beeps and boops It wasn t in the cards at the time The first advance toward nirvana came with solid state recording devices Memory issues restrained these to a choice of high quality short duration or lousy quality long dura tion While this is subjective you don t get something for nothing File size is a problem Just look at some of your MP3 music files Let me introduce you to the Keterex KX1400 which is an inex pensive playback circuit with a num ber of useful options It can operate as a stand alone device or as an MCU peripheral In addition the KX1400 has a built in tone generator and a class D speaker driver requiring no external low pass filter It comes as a 20 pin SOIC or 24 pin QEN part STANDING ALONE As a playback device the KX1400 gets its instructions by fetching data sequentially from an external EEP ROM device The instructions are listed in Table 1 Note th
53. NU C C tools but Arduino hides them behind a simplified GUI stripped of bloaty features that might be unnecessary and confusing for beginners which means pretty much everything i e there s no debugger and all the arcane minutiae that go with it What you see in Photo 3 is what you get but for a simple app it s all that you need At least there s a built in terminal emu lator so you can PRINTF to your PC via the USB connection Indeed even the term toolchain is overkill because in the case of Arduino it pretty much just has one link the GUI The difference is apparent right from the start There s none of the complicated installation and configuration associated with industrial strength tools Just copy ARDUINO EXE and install the FTDI virtual COM port driver Windows did that automatically for me and you re done Another big plus is that the Arduino GUI is portable and works exactly the same on Windows Linux and Macs which is something that can t be said for most tools Arduino reminds me of ARM s mbed which I covered a few issues back in an article titled Easy E mbed Circuit Cellar 227 2009 While the implementations are quite different mbed being web based both share a philosophy of simplici ty ease of use and community aspiring to make the march of silicon accessible to all With the combination of AVR and Propeller Chameleon delivers a lot of I O
54. OO OO AREF y MOSI MOSI Latch g Ribbon cable to minute board Remove VCC pin from FTDI USB serial interface Figure 2 An Arduino Pro microcontroller handles all the logic with one input bit from the WWVB receiver an analog input from the photoresistor and an SPI chain to the display driv ers Photo 2 shows that the LCD interface isn t used December 2009 column about the Tek tronix memory reader board Figure 2 shows the microcontroller connections three SPI pins and one display enable bit under software control I set the SPI interface to 250 kbps equal to the CPU clock oscillator fre quency divided by 64 which is a reason able compromise between high speed and simple wiring Each display update requires 5 bytes just over 160 us so the serial interface has no effect on perform ance The clock sets the time and dis play brightness every 4 seconds spend ing essentially all of its time waiting The WWVB receiver has an input that freezes its Automatic Gain Control setting which is generally used in envi ronments with occasional high intensi ty RFI freezing the AGC prevents noise burst from swamping the WWVB signal In this application however the micro controller and display run full time so they must be quiet enough or well shielded enough to prevent interference with the AGC active TURNING DOWN THE LIGHT My friend says all her LED clocks are far too bright and she most emphatical ly did no
55. OSA d a ed y fi th the simulator g ot Mm naam to develop a de lopment Center El Segundo CA 00 April 2010 ssue 237 5 A auc by Jeff Shoemaker Converter Performance Management Design Tips for Working with On Chip ADCs When creating an application that uses a microcontroller s integrated ADC you need to Know how all the parts e g sensors can affect the system s overall performance This article includes design tips for getting optimal performance from an on chip ADC ften when designing embedded systems with analog to digital converters ADCs built into the microcontroller a designer will spend a lot of time calculating the resolution needed for the system but neg lect to spend any time understanding how other aspects can affect the analog to digital A D performance This article explores some of these other aspects and how they can influence A D performance It is not enough to just understand the specifications in the manufacturer s datasheet and how they affect performance Sometimes system parameters can be the limiting factor in perform ance and not the ADC itself ADC ARCHITECTURES The two most common ADC architectures found integrated into today s microcontrollers are Succes sive Approximation SAR and Sigma Delta converters Figure illustrates a block diagram of a successive approximation converter commonly found on modern day microcon trollers The basic premise be
56. SE Because the WWVB signal fades into the ambient noise during most of the daylight hours the Totally Featureless Clock must also function as an inde pendent clock All clocks have an oscillator to measure time and alas all oscillators have some inherent error The Arduino Pro microcontroller board generates its clock from a 16 MHz ceramic resonator rather than the more typical quartz crystal Res onators make poor clock oscillators with a typical frequency accuracy of 0 5 while a bad quartz crystal might be off by only 0 01 Both numbers seem small but half a percent adds up to 432 seconds over 24 hours more than 7 minutes That s large enough to be obvious even on a clock displaying only hours and min utes and far more than my friend was willing to accept A WWVB based clock has a major advantage over a completely free run ning clock it knows the exact time at least occasionally Two observa tions can compensate for the local oscillator s frequency offset while continuing observations can track and correct the effects of temperature and aging Figure 4 shows the clock s diagnos tic output for six successive WWVB synchronizations starting with the first synch after a hardware reset that set the clock s internal time The next synch occurred exactly 138 minutes later as computed from the WWVB time codes but the local variables showed 33 seconds less time had elapsed That offset means the local o
57. TERN controllers 100 Low Cost Controllers with ADC DAC UARTs 300 I Os solenoid relays CompactFlash LCD Ethernet USB motion control Custom board design Save es and money TERN 1950 5th Street Davis CA 95616 USA INC Tel 530 758 0180 e Fax 530 758 0181 www tern com e e eT com www circuitcellar com_ CIRCUIT CELLAR SCIDY SNE Offers a Full Line of Innovative Modules for PO 104 Applications 16 Analog Inputs 5V Power 8 AnalogOutputs Pulse Accumulator 24 Digital VO lines Open Drain Outputs meses DIO96 104 96 Bi Directional Digital Channels Input Output and Strobed O functions Lses Familiar 82055A Chips XIO RO8B Add eight High Power relay outputs to any digital port YNE 1 377 724 3963 www scidvne com XL MaxSonar Ultrasonic Ranging is EZ XL MaxSonar Products e High acoustic power Low cost e Low power 3V 5 5V lt 4mA avg 1 cm resolution Serial pulse width amp analog voltage outputs Real time auto calibration with noise rejection No dead zone XL MaxSonar EZ e Choice of beam patterns e Tiny size lt 1 cubic inch e Light weight lt 6 grams XL MaxSonar WR IP67 e Industrial packaging e Weather resistant e Standard 3 fitting e Quality narrow beam www maxbotix com ez_GD The Smart Display makes integrating a GUI ez Versatile Programming LCD module USB SPI RS232 TTL Interfaces Bright 350 Nit LED Display 320 x 240
58. Together they com prised a decently competent controller with enough memory and I O to handle a simple embedded application The 3 chip demo even came with a tiny BASIC interpreter crammed ma LEETETETETET POPP EEUET EE Aris into the 8755 s 2 KB EPROM Dr Li Chen Wang s article Palo Alto Tiny Basic is an interesting story in its own right that debuted in the very first issue of Dr Dobbs May 1976 Subsequently his Basic found its way into the RadioShack TRS 80 What s surprising is how little things have really changed It s still true you can do useful and fun things with just a few pages of code and some simple I O e g SIO PIO and Photo 1 It s multicore and heterogeneous multiprocessing for the masses Putting aside all the techno babble Chameleon makes it easy to do some pretty hard things like audio and video CIRCUIT CELLAR www circuitcellar com ADC The success to this very day of SBCs like the Parallax BASIC Stamp was foreshadowed in that 8085 3 chip BASIC Postcard But time and silicon marches on This month let s take a look at an SBC that does things that the old timey 3 chip lash up could only dream of TRIPLE THREAT The Chameleon see Photo 1 is the latest brainstorm from Andre LaMothe of Nurve Networks It s an SBC with a lot of personality make that personalities because it lever ages unique I O with
59. WWVB 58035009 Flags 0510 Valid 1 Drift Elapsed 7740 Offset 0 Correction 0 ICR1 39840 LY 0 LS 0 DST 0 Chg 0 UT1 1 Mon 12 DOM 16 Set 09 350 00 58 59 9 Loc 7 Age 0 UTC 09 350 02 32 00 9 Loc 9 Age 93 LY 0 LS 0 DST 0 Chg 0 UT1 1 Mon 12 DOM 16 WWYVB 320B5009 Flags 0510 Valid 1 Drift Elapsed 5580 Offset 1 Correction 7 ICR1 39833 LY 0 LS 0 DST 0 Chg 0 UT1 1 Mon 12 DOM 16 Set 09 350 02 32 59 9 Loc 9 Age 0 UTC 09 350 04 38 00 0 Loc 11 Age 126 LY 0 LS 0 DST 0 Chg 0 UT1 1 Mon 12 DOM 16 WWVB 37135009 Flags 0510 Valid 1 Drift Elapsed 7500 Offset 1 Correction 5 ICR1 39838 Set 09 350 04 37 59 9 Loc 11 Age 0 LY 0 LS 0 DST 0 Chg 0 UT1 1 Mon 12 DOM 16 Figure 4 The WWVB time code establishes the exact interval between two clock settings Comparing that with the same interval measured by the local oscillator reveals the oscilla tor s frequency error These lines show several successive frequency adjustments that reduce the oscillator s error from 0 4 to under 0 02 this always on application The three Schottky diodes in Figure 3 prevent the Arduino board and the ultracapac itors from powering the clock circuit ry during outages It s worth noting that the entire col lection of digital logic draws less cur rent from the power supply than two segments of the LED display Although LEDs win any energy effi ciency contest with incandescent bulbs they use nearly all of the power in this circuit TWEARING THE TIMEBA
60. a better feel for how many samples are needed by performing the analysis ahead of time using a spreadsheet or Matlab SYSTEM PERFORMANCE When designing systems that use a microcontroller s integrated ADC it is important to under stand how the system the sen sors and other tangibles can affect the system s overall per formance It is essential to con sider factors other than the reso lution of the ADC One must CIRCUIT CELLAR e www circuitcellar com consider the type of ADC and how it works and performs But more importantly one must consider the errors and how they can originate from internal and external sources One must be aware that there are techniques available to mitigate some of these errors but not all of them so the designer must have a thorough understanding of what the system can actually tolerate It is important to consider the value that you are actually measuring and the range and accuracy that is required In addition it is necessary to have a solid understanding of where to set the sampling frequency and when it is critical The sampling rate is not that critical when measuring a variable that is being put on a display but it is extremely critical when making precise measurements or when performing closed loop control Finally be sure to consider the impact on the conversion rate and how this can affect closed loop control It is only with a well rounded system level approach that one can achieve
61. additional capacitor should be proportional to the square root of the source capacitance and inversely proportional to the square root of the feedback resistor and gain bandwidth of the amplifier Any how you will not know the source of parasitic impedance in many applica tions so you ll have to use the trial and error method increase the feed back capacitor until you achieve stabil ity then increase it a little more and cl 220p then test it in all conditions It should work BUILD A PICOAMMETER You re now familiar with all the basic ideas associated with designing a low cost picoammeter Figure 6 is a full schematic diagram of my prototype The design is quite simple but I care fully selected the components Starting from the two inputs I included two protection diodes D1 and D2 which limit input voltage to 0 6 V to prevent overloading Be really careful These diodes can t be generic because their reverse current must remain far lower than the measuring range 100 pA in this instance I used a pair of low leak age NXP Semiconductors BAS416 diodes which are rated at 3 pA Com pare this value with the 25 nA of a standard 1N4148 Even at 20 C it s nearly 10 000 times lower Then the transimpedance amplifier is built around an Analog Devices AD8638 op amp which was selected for its low off set 9 nV and small bias current 7 pA is typical The gain resistor is manual ly selected from 1 Q to 10
62. alibrate and doing so is often impractical SYSTEM LEVEL POV Now we will take a look at some things to consider from a system level point of view First it is important to consider the parameter being measured versus the actual resolution of the ADC Of course one often assumes that more resolution is always better but you Non ratiometric Non ratiometric Figure 4 These are examples of ratiometric and non ratiometric conversion connections www circuitcellar com_ CIRCUIT CELLAR may not even need it Let s consider a 10 bit ADC as an example In this case we can resolve up to 1 024 counts If the measurement variable is temperature from 0 to 250 C our example ADC can resolve down to 0 25 of a degree or 0 1 accuracy The point here is that you need to consider how much accuracy you really need and over what dynamic range you really need it and factor that against the actual resolution that the ADC is capable of This requires understanding the sensor specifications and an understanding of how the system works Second it is important to consider the step size that one bit can repre sent relative to the voltage range of the ADC As another example if you are using a 10 bit ADC with a 5 V reference the smallest step size that you can resolve is 4 88 mV But what if your sensor requires that you be able to resolve a 3 mV step change and also requires a full scale output of 5 V There are a couple of desi
63. ams or schematics or for the consequences of any such errors Furthermore because of possible variation in the quality and condition of materials and workmanship of read er assembled projects Circuit Cellar disclaims any responsibility for the safe and proper function of reader assembled projects based upon or from plans descriptions or information published by Circuit Cellar The information provided by Circuit Cellar is for educational purposes Circuit CellarfY makes no claims or warrants that readers have a right to build things based upon these ideas under patent or other relevant intellectual property law in their jurisdiction or that readers have a right to construct or operate any of the devices described herein under the relevant patent or other intellectual property law of the reader s jurisdiction The reader assumes any risk of infringement liability for constructing or operating such devices Entire contents copyright 2010 by Circuit Cellar Incorporated All rights reserved Circuit Cellar is a registered trademark of Circuit Cellar Inc Reproduction of this publication in whole or in part without written consent from Circuit Cellar Inc is prohibited CIRCUIT CELLAR www circuitcellar com HOLTEK www holtek com Flash MCU With Holteks new generation of Flash A D type HT66Fxx series and I O type HT68Fxx series you obtain in one stroke a multi tude of highly functional hardware resources which together with
64. are diffi cult to find so you will have to select a device with reasonably low input offset voltages and high enough input impedance meaning far higher than R Usually you will also need both positive and negative power supplies for the amplifier because its output will be below O V when the input cur rent is positive Figure 4 depicts you a simulation of a transimpedance amplifier performed with Labcenter s VSM software The virtual voltmeter shows you the simu lator output voltage of the op amp Transimpedance amplifiers are everywhere In particular I bet that you will find them in most photodi ode based designs as such a light sen sor generates low currents with low voltages By the way another advantage April 2010 Issue 237 o gt WwW R1 11 10 nA U1 AD8638 Analog analysis Figure 5 If you consider that the input source has a parasitic parallel capacitance and if you don t damp the amplifier with a capacitor in parallel to the feedback resistor then you will have unfortunately built an oscillator as demonstrated here of the transimpedance amplifier over a simple series resistor is speed Why Imagine that you build an optical data transmission system with a photodiode providing a 100 nA current No compo nent is perfect so this photodiode will also have a parasitic parallel capaci tance usually around 10 pF Imagine that you measure this current with a simple high valu
65. as to build a small portable design but I d be lying I really just wanted to see if it could be done with something as inexpensive as a toaster oven see Photo 1 With this project you can in fact create a design that works as well as an expensive oven You just have to know how to control the temperature and respect the setup s limits Big PCBs are impossible to manage and the toaster has to have an even heat spread capacity to make it work well I wasn t trying to build a marketable consumer product so as I designed the controller I tried to keep nonrecurring engi neering costs to a minimum Engineering is a problem solving science so I always try to remain focused on finding the best solution yes even when the idea is as crazy as using a one off toaster as a reflow oven Like most of you I guess I have a mad scientist deep inside me When I began planning this project I wanted a portable sol dering setup to work as well as a seven zone reflow oven when used with small boards I also wanted a cool looking user interface and I needed the nonrecurring engineering NRE to be low Those requirements guided my software hardware and safety related decisions SMD SOLDERING BASICS In a large reflow oven with a conveyor belt the oven is divided into zones each of which has separate heaters and temperature control The board passes through them at a specific time to produce the proper temperature profile When
66. at if the first command is to play an audio file the remaining data in the EEPROM Q Lo Memory le I F ad ai ER MCU z Figure 1 Two SPIs allow the KX1400 to retrieve data from an external EEPROM while receiving commands from an optional microcontroller An internal tone generator and PCM ADPCM decoder provide audio sources for the class D speaker driver www circuitcellarcom gt CIRCUIT CELLAR might consist entirely of data sup porting one of three formats The first is similar to my original project that produced tones to play out the melody of a favorite song Each tone or rest lack of tone is accompanied by a duration that indicates how long the note or rest is held The tone data is a 14 bit frequency index O 16383 that corresponds to the fre quency using the following formula Frequency FI 4 096 The frequency index needed to produce the tone equal to A 440 would be 1 802 i e FI 440 x 4 096 The duration data is simply a 12 bit number 0 4095 equal to the duration in millisec onds Note that 0 is a special case that produces a continuous tone until a new command is received The remaining two formats are cause for jubilation Anyone familiar with audio formats will recognize pulse code modulation PCM and ADPCM as audio formats that have been around for years PCM files hold a sequential table of audio sam ples taken at a specific rate Com mon sampling rates are at 8 11 22 or 44 kHz
67. ates when a new command can be received while the Busy line indicates when the KX1400 has finished executing any received com mands I purposely left off a power switch The low power mode of the KX1400 and PIC16F677 are entered once a timeout has been reached without any push buttons pressed Take a look at You ll note a couple of things One there are two modes mode O for choosing a story 16 MB Flash e 76 Digital I O Lines e 2 Ports of USB 2 0 e SPI Bus e AC97 Amplified Audio e Battery Backed Clock e 2 Serial Ports e Low Power Consumption e RoHS Compliant Our newest ARM9 Linux controller the OmniEP doesn t cost an arm and a leg It delivers removable storage amplified audio ethernet and serial RS232 communication ports in a rugged and attractive enclosure Models without enclosure and LCD available The OmniEP comes preloaded with Linux to jumpstart your devel opment process with LCD and pushbutton drivers supplied Large capacity USB drives can be easily mounted in the USB port Call 530 297 6073 Email sales jkmicro com www jkmicro com System on Module Internet Appliance Engine ree O HEAT AT91SAM9G45 ARMS 400Mhz CPU e 4 Serial Ports amp 2 SPls e Up to 40 Digital GPIOs 2 USB 2 0 Host Device Ports 12S Audio Interface 10 100 BaseTeFastiEthernet D MMC Flash Card Interface Up to 1 GB Flash amp 256 MB RAM a e Linux with Eclipse IDE amp WinCE 6 0 AN Windows CE
68. c to the existing Arduino library and voila everything is there for you to use see Photo 4 While most of the Chameleon library addi tions deal with the Pro peller some don t For example the SPI TWI and UART modules simply run on the AVR and access only its hardware In some cases the Chameleon service is similar to or overlaps that of the existing Arduino library so you can stick with the latter if for example you re porting an existing Arduino sketch to Chameleon Hello World brings the Propeller into the equation taking advan tage of the chip s unique ability to drive NTSC and VGA video The Chameleon API is a mini me terminal emulator that has commands to clear the screen move the cursor and display a character or string The only thing the AVR has to deal with is ASCII characters while the Propeller does all the bitmap font 8 x 8 and display machinations e g scrolling behind the scenes The GFX graphics library takes video to the next level see Photo 5 It features a tile engine that treats the screen as an array of 32 x 24 tiles each 8 x 8 pixels i e 256 x 192 resolution optionally mapped onto a larger virtual playfield For instance you could specify a playfield of 64 x 48 tiles and then it s easy to scroll flip between screens by just changing the start address Do be warned this tile engine is pretty complicated stuff unless you happen to be an ol
69. ce voltage can be connect ed to the microcontroller s VCC or to a separate reference volt age The advantage of ratiomet ric conversion can be seen by observing what happens to the voltage equations Refer to Figure 5 Figure 5 The ratiometric circuit for derivation of Equation 3 R Vu V K MoA Re Re 1 Vi ADC reading x max ADC counts 2 REF Substituting Equation 1 into Equation 2 yields ADC reading Ri Max counts R R 3 There are no dependencies on voltage in Equation 3 This is highly advantageous as voltage can vary with tolerance and temperature The control variables are the resistor R and the resolution of the ADC The result is that we now have a much more predictable and repeatable measurement Regardless of which method is used there are sensing errors that must be taken into consideration That is com mon to both ratiometric and non ratiometric sensing First there is the error in the sensor itself Little can be done to compensate in this case as this is intrinsic to the sensor unless the error can be reliably predicted Second there is the ADC error which has been discussed previously i e offset error full scale error etc In the case of ratiometric conversion there is also divider error due to round off error and tolerance error in the resistor network Tolerance error can be calibrated out With non ratiometric conversion however there is the error in the reference volta
70. cellar com magazine 151 html CIRCUIT CELLAR www circuitcellar com The Newest Products or Your Newest Designs Embed Your Innovation into the Market Place A MICROCHIP MRF24J40MB 2 4 GHz RF Transceiver Module mouser com microchipmrf24j40mb 2 FTDI ND Chip AdaptivEnerqy USB COM PLUS Serial Modules JTRB e12 Ground Transport Energy MiniCore RCM5600W Wi Fi Module mouser com ftdiusbcomplus Harvesters mouser com rabbit_rcm5600w mouser com joulethieftransport WARNING Designing with Hot New Products May Cause A Time to Market Advantage With the newest embedded products and technologies you can get your designs to market faster Experience Mouser s time to market advantage with no minimums and same day shipping of the newest products from more than 400 leading suppliers a tti company mouser com 800 346 6873 Mouser and Mouser Electronics are registered trademarks of Mouser Electronics Inc Other products logos and company names mentioned herein may be trademarks of their respective owners BOARDS BOOKS DVDs AND MORE AT WWW ELEKTOR COM SHOP Elektor Shop The world of electronics at your fingertips The int ernational electronics magazine Jahrgang Ann e Jaargang Awal e 2009 m Volum All artides fro on DVD ROM All articles from Elektor Volume 2009 on DVD ROM DVD Elektor 2009 The year volume DVD CD ROMs are among the most popular items in Ele
71. changes the voltage on its output until the voltages on its two inputs are identical By the way this is partially wrong as the gain of the amplifier is not infinite But let s consider it to be large enough Op amp details will require another article So at equilibrium the voltage between points A and B is zero which is exactly what you are looking for to avoid any perturbation on the current U1 AD8638 Figure 4 This is a simulation of a transimped ance amplifier done under VSM The input current of 10 nA is translated into a 100 mV voltage thanks to the 10 MQ feedback resistor U R U 0V AB Figure 3 The transimpedance amplifier is a way to automatically adjust the counter voltage An operational amplifier will set its output in order to have a nearly null voltage offset between its two inputs U 0 which is exactly what we are looking for source If you consider the amplifier to be perfect no current is circulating through its inputs Thus the current I is entirely circulating in the resistor R and through the amplifier s output As a result the voltage at its output is R x I This is a transimpedance amplifier the current to voltage con version ratio is identical to a simple resistor of R ohms but with two key advantages no added serial voltage and a low output impedance Of course this presentation of tran simpedance amplifiers was a little simplistic Perfect op amps
72. chip automatically update the timer value to account for the number of cycles used during the interrupt handler regardless of whether the interrupt code path was longer or shorter for a given interrupt Imagine that you ve set the RTCC interrupt to occur every 129 clock cycles and that the interrupt handler takes anywhere from 51 to 69 clock cycles depending on what it does during the interrupt Regardless of the exact number of clocks that the interrupt handler uses on a given interrupt the special exit opcode will automatically reload the RTCC counter with the correct value to make the next interrupt happen exactly 129 cycles from the previous interrupt These two features fixed interrupt latency and the special exit opcode provide a completely jitter free interrupt period Because of this feature the SX allows you to create virtual peripherals that are rock steady For example if you want a PWM generator you write one that runs in the interrupt handler Want a UART Same approach Want six UARTs Just make sure the code to execute them can complete in the time between interrupts and you can have them Writing software lets you make the chip do what you need it to do rather than have a lot of extra peripherals on board that are either insufficient or over abundant for the needs of a particular design A Zilog Z8F4821 CPU controls and coordinates everything see Figure 1 The circuit shown in Figure 2 has a Parallax SX
73. com ICbank Deteussy te Erecirosics MP3P DIY KIT Do it you Include Firmware Full source Code Schematic 160 220 j qty 100 qty 1 150 qty 100 200 qty 1 180 qty 100 220 qty 1 ic ICbank e La dr Powerful feature MP3 Encoding Real time decoding 320Kbps Free charge MPLAB C Compiler student edition apply Spectrum Analyzer Application Focusing for evaluation based on PIC Offer full source code schematic Microchip dsPIC33FJ256GP710 16 bit 40MIPs DSC VLSI Solution VS1033 MP3 CODEC NXP UDA1330 Stereo Audio DAC Texas Instrument TPA6110A2 Headphone Amp 150mW 320x240 TFT LCD Touch screen SD SDHC MMC Card External extension port UART SPI 12C 125 Powerful feature Play MP3 Information Reward forward Vol Focusing for MP3 Player SD Card interface Power battery offer full source code schematic Specification MCU Atmel ATmega128L MP3 Decoder VS1002 VS1003 WMA IDE Interface Standard IDE type HDD 2 5 3 5 Power 12V 1 54 LCD 128 x 64 Graphic LCD Etc Firmware download update with AVR ISP connector Powerful feature Play MP3 Information Reward forward Vol Focusing for full MP3 Player Without case IDE Interface Power Adapter Offer full source code schematic www icbank com O N April 2010 ssue 237 pu DARKER SIDE by Robert Lacoste Picoammeter Design If
74. cuitcellar com GENERAL INFORMATION 860 875 2199 Fax 860 871 0411 E mail info O circuitcellar com__ Editorial Office Editor Circuit Cellar 4 Park St Vernon CT 06066 E mail editor circuitcellar com__ New Products New Products Circuit Cellar 4 Park St Vernon CT 06066 E mail newproducts circuitcellar com AUTHORIZED REPRINTS INFORMATION 860 875 2199 E mail reprints Ocircuitcellar com AUTHORS Authors e mail addresses when available are included at the end of each article CIRCUIT CELLAR THE MAGAZINE FOR COMPUTER APPLICATIONS ISSN 1528 0608 is published monthly by Circuit Cellar Incorporated 4 Park Street Vernon CT 06066 Periodical rates paid at Vernon CT and additional offices One year 12 issues subscription rate USA and possessions 29 95 Canada Mexico 34 95 all other countries 49 95 Two year 24 issues sub scription rate USA and possessions 49 95 Canada Mexico 59 95 all other countries 85 All subscription orders payable in U S funds only via Visa MasterCard international postal money order or check drawn on U S bank Direct subscription orders and subscription related questions to Circuit Cellar Subscriptions P O Box 5650 Hanover NH 03755 5650 or call 800 269 6301 Postmaster Send address changes to Circuit Cellar Circulation Dept P O Box 5650 Hanover NH 03755 5650 Circuit Cellar makes no warranties and assumes no responsibility or liability of any kind for errors in these progr
75. d school a la 1980s video games graphics guru Also due to the extra horsepower and frame buffer memory required for graphics GFX only works with the NTSC screen option and not for VGA The Sound library mixes up to four notes i e polyphonic onto the Y April 2010 Issue 237 April 2010 Issue 237 Photo 6 Hear that L cham av sound deme Andana 001 e siren With 180 A B MIPS under the ini T hood be careful you e don t get pulled over llos na int acals 440 456 404 571 554 587 622 650 608 740 784 831 800 5 tians i 2 33 z f float adjacent notes 059463094 for speeding bai Sou eer bays fdefine NUM NOTEZ 13 Coc mete OF note lt HUR NOTES Bot tl senle fnore 2 pow adjacent pote 4 fi sc ale note mono RCA jack i e aoaia A sound is speci fied in terms of frequency 0 to 2 000 Hz and rel Menard maca CCN ative volume 0 to 255 and each channel can be stopped started or changed inde pendently The screenshot in Photo 6 shows how easy it is to add some spiffy sound effects to your Arduino sketches Keyboard and mouse functions may seem mundane but if you ve ever dealt with them you know there s a lot of wrestling with initialization multi byte packets make and break scan codes motion counters and the like The Chameleon library hides all the details behind high level functions so you can easily capture a key press or track mouse motio
76. different applications Time to market can be reduced using the wide range of available development modules VISIT US AT ESC SILICON VALLEY WAS 29 el e010 AN SIAR ID NN IN i soeces ee oo USB MADE EASY qa www ftdichip com SUITE SPEEDS APPLICATION DEVELOPMENT FOR AT91SAM3U MCUs The Crossware Development Suite for ARM has been enhanced to make it compatible with Atmel s range of application examples available across its AT915AMSU family of Cortex M53 based flash microcontrollers The enhanced suite allows devel opers using these MCUs to speed up application development and to rapidly experiment with the SAMSU EK evaluation board Over 30 application examples are available demonstrating the use of the USB controller the NAND flash controller the SDIO SDCard controller the MMC controller and various other on chip peripherals FAT filing systems USB mass storage devices LCD mouse and keyboard interfaces are all demonstrated The application examples are imported into the environ ment in a structured way to make it easy for the developer to navigate through the source code and examine its operation The Workspace Creator uses the make file for the GNU versions of the Atmel examples to create a set of library projects and an application project The appropriate com mand line options for the compiler assembler and linker are determined and included in the build instructions The environment strings for the projects are
77. e Fd Nisley Picoammeter Design Robert Lacoste SILICON UPDAT Wizard Lizard Start Working with a Multidimensional SBC Tom Cantrell QM April 2010 Issue 237 The Arduino Based MiniEric Robot 1 s Converter Performance Management Design Tips for Working with On Chip ADCs Jeff Shoemaker G s Serial Network Hub Part 2 Circuit Design and Usage Peter Montgomery A O Smart Control An Innovative Approach to Reflow Soldering Alexandre Ney Guimaraes os TASK MANAGER New Development C J Abate NEW PRODUCT NEWS edited by John Gorsky TEST YOUR EQ ANSWERS CROSSWORD INDEX OF ADVERTISERS May Preview PRIORITY INTERRUPT Drive by Wire Roulette Steve Ciarcia CIRCUIT CELLAR e www circuitcellar com SPEED FLEXIBILITY PERFORMANCE 1114 Vinculum VNC A programmable system on chip dual USB 2 0 host slave controller Handles USB host interfaces and data transfer functions using the in built 16 bit enhanced MCU with 256 kbyte Flash and 16kbyte RAM Royalty free flexible C language Integrated Development Environment including complier drivers libraries and RTOS kernel to provide the designer with the ability to customise their own firmware Libraries for several USB classes FAT file system support Interfaces to UART FIFO SPI Slave SPI Master and PWM Multiple package size options including VNC1L pseudo compatible option provide cost effective solutions for the
78. e Story red button is used to read the next story title in mode 0 or reread the title of the presently selected story in mode 1 The Go green button is used to select the present story change the mode and read the instructions on using the buttons to read a story in mode 0 and to incre ment the storybook s page and read it in mode 1 The Again yellow but ton rereads the present story title in mode 0 and the present page in mode 1 A number of phrases are called directly The instructions turn the page sound effect story titles and story first pages are identified from the playlist By keeping track of the present and maximum count of stories and pages for each story the applica tion can figure out how to handle a request When incrementing through the title selections to choose a story the maximum story count determines the end of the list and resets the title pointer to the beginning By placing audio files for each story page in sequential order the phrase command is easily increment ed once it is initialized with the first page of the chosen story When read ing the story the maximum page count determines when the end of the story occurs and decreases the page count to prevent an unknown page fetch CONSTRUCTION When I saw the Serpac CA series of enclosures I thought it would make a good home for this project Having just finished a project where I etched my own PCB I wanted to get so
79. e areas of no speech and silence the passages effectively getting rid of the noise Preview your recording alterations and save the WAV file with the appropri ate file name after each phrase s recording session Note that this project requires over 130 phras es to be recorded with each of the four stories averaging 30 pages While that sounds like a lot of work it goes pretty quick ly with the easy to use tools provided with the KX1400 eval uation kit The application for this project runs on a small microcontroller I think I could ve crammed this application tial list File d View Project bai xe Stor hirder Lim Coker Document cdo LAA ami my bey lela ep Piar Took Help id ll z Photo 1 The Keterex IDE uses a scripting language KML to create a phrase list by processing a sequence of KA1400 commands for each phrase The Story4End sequence of the commands is defined just above the PlayList or sequen of all of the phrases used in this application into an eight pin chip but I didn t want to have to multiplex all of the switches using a single analog input So I chose the PIC16F677 which costs around 1 and has plenty of I O left over for tasks 1 haven t even dreamed up yet Besides switch inputs only five I Os are required to inter face with the KX1400 Actual ly you can get by with only four of those five lines The Busy and Ready lines are slightly redundant The Ready line indic
80. e 1 888 928 2562 TECHNOLOGY email sales comfiletech com R April 2010 Issue 237 FA BOVE THE GROUND PLANE by Ed Nisley Totally Featureless Clock Part 2 Hardware The first part of this series about a totally featureless clock detailed how to build a WWVB simulator This article covers the clock s hardware and overall design y friend s Totally Featureless Clock which simply displays the current hour and minute seemed like it should be a simple project After all keeping time is a simple matter of addition add 1 to the current time each minute Right It s somewhat more complex than that of course but much of the complexity lies in the analog and signal processing parts of the proj ect In this column I ll describe the clock s overall design and the hardware part of the proj ect My next column will cover the firmware including how it determines signal quality and synchs with WWVB plus the error handling required to ensure the clock always displays the correct time BEHIND THE BLUE DIGITS The clock sets itself from WWVB as often as possible and free runs whenever RF condi tions prevent signal reception with acceptable quality It shows an error indication when its internal time may have drifted far enough from WWVB s value to affect the display As far as my friend is concerned the clock requires no adjustments whatsoever Photo 1 shows the user inter face side o
81. e Sockets for ALL Xilinx and Altera Chips e Pitch 0 4mm to 1 27mm e SMT Options 4 Ironwood ELECTRONICS 1 800 404 0204 www ironwoodelectronics com a April 2010 ssue 237 Embedded Systems High End Performance TS 7800 with Embedded Ruggedness 500 MHz ARM9 Low power 4W 5V 128MB DDR RAM 512MB high speed 17MB sec onboard Flash Se ae 5 si x a e Y a 12K LUT customizable FPGA w oei AAN Aile Y Y EN oS y Internal PCI Bus PC 104 connector Se WN 7 A 2 host USB 2 0 480 Mbps Gigabit ethernet a 2 SD sockets 10 serial ports a 110 GPIO 5 ADC 10 bit a 2 SATA ports Sleep mode uses 200 microamps and backward compatible with TS 72xx Boots Linux 2 6 in 0 7 seconds Linux 2 6 and Debian by default TS TPC 7390 7 Color Touch Panel Computer a Low Power Industrial Quality Design Mountable aluminum frame 200 MHz ARM9 64MB SDRAM 128MB opt 512MB Flash w Debian Linux 800 x 480 video core Dedicated framebuffer 8MB RAM Audio codec with speaker Boots Linux 2 6 in less than 2 seconds Unbrickable boots from SD or NAND Runs X Windows GUI applications Runs Eclipse IDE out of the box More Touch Panel Computers on our website 7A Over 25 years in business a Custom configurations and designs w 2 Open Source Vision excellent pricing and turn around time A Never discontinued a product P A Most products stocked and available A Engineers on Tech Support for next day shipping Design your solut
82. e resistor say 100 kOQO to get a 10 mV output What will happen The 10 pF capacitor and this 100 kQ resistor will implement a low pass filter with a time constant of RC 1 us so the bit rate will need to stay quite low There s no way go get signif icantly higher than 1 MBps In compar ison with a transimpedance amplifier the measuring resistor is not visible to the source as the voltage at the measurement point stays at O V thanks to the amplifier so the bit rate is limit ed only by the op amp s bandwidth and parasitic components Far better per formance is possible as proven by giga bits per second fiber links However this source of parasitic capacitance induces another problem It might transform your amplifier into an oscillator The problem which is simulated in Figure 5 will make your life a little more difficult when work ing on real world applications This is not the only kind of circuit where para sitic oscillations can occur but it is always unpleasant Fortunately there s a solution you can limit the band width of the transimpedance amplifier by adding a parallel capacitor across the feedback resistor Although this will A April 2010 Issue 237 slightly reduce the system s bandwidth it will make it stable Bob Pease pro vides a good explanation in his article What s All This Transimpedance Amplifier Stuff Anyhow Electronic Design 2001 Basically this
83. eadphone and line drivers It s designed to offer low power consumption and significantly extend playback time in portable applications such as media players headsets voice recorders and multimedia phones Incorporated within the WM8904 is Wolfson s Class W amplifier technology which intelligently tracks the actual music signal level and uses an adaptive dual drive charge pump to optimize power dissipation The ground referenced output also elimi nates the need for large DC blocking headphone capacitors resulting in improved bass response savings in PCB space and the audio subsystem bill of materials Also featured in the device is the innovative SmartDAC technology a unique low power DAC capacitor switching architecture which enables DAC to headphone power consumption of just 4 mW and delivers up to 30 MW per channel into a headphone load Audio performance is significantly enhanced with the integrated SilentSwitch tech nology which extends its pop and click suppression capability by incorporating sophisticated clamp and sequencer circuitry The innovative RetuneTM Mobile parametric equalizer is a powerful feature that enables system designers to accurately customize the output signal path to optimize the performance of the speaker or other transducer Line inputs along with digital and analog microphone inputs are all supported with bypass paths to the class W headphone and line outputs The WM8904 is available for sam pling
84. ed EEPROM space The microcontroller can determine which phrase is executed and when If you were not using any PCM or ADPCM data the exter nal EEPROM would not even be necessary because these are the only commands that require external data In fact you may have noticed that there is a Play ADPCM MCU command that allows the micro to supply ADPCM data within each command instead of fetching it from the external EEPROM Because an audio file size is rather large this could really eat up your micro s memory space but it may be of some use depending on your design The application can keep its communication to a minimum by taking advantage of the KX s ability to execute a list of commands for each phrase Or the micro can minimize the use of the external EEPROM to just PCM or ADPCM data and issue individual commands like Mute and Unmute directly THE PROJECT PLAN I saw a recordable book featured in a Christmas commercial Hallmark has extended its use of digital record play back devices for greeting cards and pic ture frames to storybooks While easy to use the device is limited to a physi cal book not so much by the printed words but by the physical design of the page determination hardware If you haven t seen this ad you can find it at www hallmark com recordablestory book A row of light sensors are uncovered sequentially as you turn each page This determine
85. enesas Interactive gt For educators and students e prot slona gt Gain the technical knowledge Teach with professional America Renesas com Alliance grade tools Learn MCUs with a modern architecture you need Evaluate research and learn at your own pace a where you want when you ge LLIANCE gt want tor ee RenesasUniversity com PARTNER a Renesasinteractive com Asmorgasbord of support served Ea with every chip America Renesas com Ecosystem i ae _ i y Ma RenesasKU Zcom d MyRenesas a a gt gt Customize your data a Think it Build it Post it a 1 Ps pa o retrieval needs on the Renesas web site You ll receive Renesas Samples gt Get a first hand look at our updates on the products that you re interested in products Let us know RenesasRulz your needs and we ll get gt A forum and community site to share aes samples out to you America Renesas com MyRenesas technical information questions and It s that simple opinions with others who use Renesas America Renesas com Samples MCUs and MPUs RenesasRulz com Everywhere you imagine py N ESAS es N April 2010 ssue 237 1001800 IDE application see PH Audacity has some great tools besides just recording and sav ing the WAV file You can pass a file through an amplify algo rithm to assure maximum audio output And as this raises the noise floor you can select thos
86. erial to facilitate the USB communication and python twitter to work with Twitter I used an HTML form for collecting user data The form contain basic questions Based on the answer the script decides which feeling to display www circuitcellar com CIRCUIT CELLAR Photo la started with an simple representation of my idea and built a first prototype then began adding more elements and after a few iterations ended up with my final prototype b BONUS m April 2010 Issue 237 CIRCUIT CELLAR DIGITAL PLUS BONUS Y Potentiometer Tranzistor 4 2 3 4 5 6 7 8 9 Figure 1 The wiring for the final shield used three 2N2222 transistors super bright LEDs a basic 2 x 16 character LCD and a potentiometer suggested linking the 5 V pin and RESET pin with a 120 0 resistor This did have a drawback though I have to remove the resistor when uploading a sketch to the device An alternative to USB communication would involve adding an Ethernet shield for a direct communication with N April 2010 Issue 237 CIRCUIT CELLAR DIGITAL PLUS BONUS BONUS Twitter and the computer But that approach would come with an entirely new set of problems I plan to improve this project by adding several sensors so I can better identify and display feelings I also plan to use the Emotion Markup Language EmotionML 1 0 www w3 org TR 2009 WD emo tionml 20091029 which was desig
87. ers improved design communication with on page connec tors and a new WYSIWYG net naming system The academic version costs 499 Multisim 11 Pro fessional costs 1 549 National Instruments www ni com um a E y a a B Al t Baar RANABA a a he n api THE ORI GIN AL SINCE 199 PCB Pnr pan we ta LAYOUT Low Cost High Quality PCB Prototypes e Easy Online Ordering Full DRC included Lead times from 8hrs e FREE laser SMT stencil USB ISOLATOR PROVIDES PERIPHERAL ISOLATION amp HOST PROTECTION Reterex a manufacturer of mixed signal integrated cir cuits and systems has announced the availability of the USB 150 Full Speed USB Isolator The USB 150 electrically isolates a USB peripheral from its USB host while providing full transparent USB connectivity The USB 150 is used in applications where the USB host and peripheral device may operate at different ground potentials or where supply noise from the host must be eliminated The USB 150 breaks ground loops and protects the host PC from electrical damage in these environments The USB 150 USB Isolator is rated for full speed 12 Mbps operation and it is completely transparent to the host and peripheral An isolated 5 V supply delivers up to 400 mA to the peripheral over the standard USB cable enabling isola tion of hub powered devices No software device driver or configuration
88. es and unique tools built into real world systems and supported with open source hardware examples and the ability to reuse content across product lines and projects A single controlSUITE portal allows developers to easily manage available software collater al and support A new installer allows developers to select only the software components they require and gives the option for update notifications or automatic updates to eliminate version compatibility issues What development environment should use What software tools are there What debug options do have Debug Tools and Software Tools Code Composer Studio v4 Eclipse based IDE Full C C support DSP BIOS real time Operating System From Partners and 3rd Fary Network Code Generation Tools Modeling and simulation Tools 00 April 2010 Issue 237 What libraries do have to work with How do take the MCU and put it into my application How does the device work What support do have How can differentiate myself from competition Application Development Y Modular Application Libraries Digital Motor Control Digital Power Fully implemented systems Hardware Development Kits Software frameworks demonstrate Three device interlacing options Bit Field Headers Framework API Drivers Libraries and Utilities a OMath virtual floating point Detailed documentation FAOS walkihroughs and tutor
89. es and discharges which can have an adverse effect on the accuracy While this error can t be completely zeroed out we can minimize it Again assuming the micro controller has a 10 bit ADC let s say that we want an error to be much less than 0 1 1 1024 With a 10 MHz ADC clock the sample and hold capacitor charges for three cycles which is a total time of 300 ns So let s target a 0 005 error or 10 time constants to charge the capaci tor This requires that the RC time constant is not larger than 30 ns Since C is 1 5 pF the total resistance source resistance plus the internal resistance must not exceed 20 kQ Thus the sensor s source resistance must be less than 12 2 KQ i e 20 7 8 kQ So what are the options for minimizing the effects of source resistance The first thing that might come to mind is to actually decrease the source resistance But this might not be practical if you are required to use a certain sensor or you are integrating your microcontroller to a legacy system Another option may be to lower the sampling fre quency In many cases the sys tem may not need as high of a conversion rate For example if a 5 MHz sampling clock is used instead of the 10 MHz clock dis cussed previously the time to charge the sample capacitor dou bles and the allowable total resist ance doubles This results in a maximum source resistance of the sensor or 32 8 kQ Yet another option that works well in many cases i
90. f self taught Alexandre has studied electrical engineering on and off at PUC Rio College in Brazil PROJECT FILES To download the code go to ftp ftp circuitcellar com pub Circuit_Cellar 2010 237 SOURCES R276 Solder paste Kester www kester com MAX6675 Thermocouple interface Maxim Integrated Products www maxim ic com PCD8544 LCD Controller NXP Semiconductors www nxp com Type K Thermocouple Omega Engineering www omega com CP2103 Serial to USB interface Silicon Laboratories www silabs com LM3S102 Microcontroller Texas Instruments Inc www ti com NEED TO KNOW INFO Knowledge is power In the computer applications industry informed engineers and programmers don t just survive they thrive and excel For more need to know information about topics covered in Alexandre Ney Guimardaes s Issue 237 article the Circuit Cellar editorial staff highly rec ommends the following content Microcontroller Clock Locking by Michael Mullins Circuit Cellar 222 2009 Learn to build an accurate frequency reference synchronized to a GPS clock The device can display GPS information such as time location and velocity Topics Microcontrollers Frequency Clock LCDs Go to www circuitcellar com magazine 222 html Real Time Operating System Design by Naubert Aparicio Circuit Cellar 218 2008 You can customize an OS for a powerful embed ded MCU It handles all interrupts with priorities supp
91. f the Hour board dur ing construction on my work PCB to 160 x 100 mm so I divided the clock into its two natural pieces with a column of short jumpers linking the Hour and Minute boards The two boards fit inside a bezel barely larg er than the board outline behind a neutral density filter to improve display contrast and reduce the overall brightness From the front a simple black rectangle showcases four blue digits and a colon there s not much to it I used telescoping brass tubing and translucent plastic diffusers to shape the discrete LEDs into sharp edged dots The back of the Hour board shown in Photo 2 has an Arduino Pro microcontroller plugged into header strips straddling the power supply Photo 1 The front of the Hour board holds two 76 mm blue LED digits with their protective film still in place two discrete LEDs forming a colon bench Hee CadSoft s EAGLE and a large CdS photoresistor to sense room illumination The finished schematic and PCB layout edi housing puts a dark neutral density filter in front of the entire display to tor which limits the maximum improve contrast CIRCUIT CELLAR www circuitcellar com ss sem U 7 Ti a ia L AiE HAHET i Se ee o AI Photo 2 The circuitry side of the Hour board contains most of the clock hardware the ultra Capacitor power backup LED drivers and an Arduino Pro microcontroller The Minute board connects to the column of pads along the
92. feats the whole pur pose of the fail safe feature of the chip Fortunately since all my MAX3094 chips acted the same way I was able to work around this bug using a firmware fix but the correct solution will involve a new layout and PCB with the extra resistors added USING THE HUB The hub performed completely up to my expectations Not having to daisy chain every device for the display simplified the system layout and wiring I used one of the ports to run a line to a far corner of the house This let me plug in the remote without having to drag a monstrous cable behind me while using it I am especially pleased with the look of the finished device It looks like something commercially manu factured Since every single packet has to pass through this iN April 2010 Issue 237 device failure would have caused the entire show to stop running The strong physical construction combined with an internal power supply meant that the hub just chugged along all night passing packets and keeping the show alive l Peter Montgomery PJMonty csi com spent 12 years working as a visual effects supervisor on films such as Mortal Kombat and Ace Ventura When Nature Calls before becoming a director He has directed dozens of commercials and made the transition to episodic television with The Disney Channel s Lizzie McGuire Peter is self taught in both programming and digital hardware design PROJECT FILES To download the code go
93. ferent materials as meas ured with a 9 V battery and two electrodes 1 cm from each other polymeric plastic layers that have a far higher resistance just low enough to dissipate ESD charges So here we are Was this journey into the world of low currents pleasant I hope you are convinced that such a picoammeter should be on your workbench especially because you can build one in a couple of hours And of course I hope that you now have one more set of tools in your engineering toolbox transimpedance amplifiers al Robert Lacoste lives near Paris France He has 20 years of experi ence working on embedded systems analog designs and wireless telecommunications He has won prizes in more than 15 interna tional design contests In 2005 Robert started a consulting com pany ALCIOM to share his passion for innovative mixed signal designs You can reach him at rlacoste alciom com Don t forget to write Darker Side in the subject line to bypass his spam filters PROJECT FILES To download VSM project files go to ftp ftp circuitcellar com pub Circuit_Cellar 2010 237 RESOURCES Keithley Instruments Low Current Measurements Application Note 100 www keithley com data asset 6169 M Pachchigar Design Considerations for a Transim pedance Amplifier National Semiconductor AN 1803 2008 www national com nationaledge files national_AN 1803 pdf B Pease What s All This Transimpedance Amp
94. g featuring WPA2 Ultra compact form factor Embedded web server Low profile for design flexibility Ideally priced for cost sensitive applications Buy now at 1 888 411 7228 www rabbit com ccmc W FabbIt COM CCM 2900 Spafford Street Davis CA 95618 Fresh new products available clockwise from upper left Absolute Binary Rotary Encoder 27804 9 99 XBee and XBee PRO RF Modules www parallax com go XBee GPS Modules www parallax com go GPS X Band Motion Detector 32213 29 99 ColorPAL 28380 19 99 5 Position Switch 27801 4 99 Sound Impact Sensor 29132 7 99 2010 RF Design Contest To enter use the 433 MHz RF Transceiver 27982 in a unique project Final submissions must include a project report source code and photos Project numbers will be issued until 04 30 10 with all projects due by 05 31 10 3 000 in cash prizes available Programming and Customizing the Multicore Propeller Microcontroller 32316 Sale price 32 97 ae AAN Cc This exciting new Propeller micrcontontroller book pub DAA IAS Y lished by McGraw Hill begins with an introduction to the Lil Lit Propeller chip s architecture and Spin programming lan guage debugging techniques and sensor interfacing Next come eight diverse and powerful applications ending with a speech synthesis demonstration written by the Propeller chip s inventor Chip Gracey 475 pages Example source code and other related
95. gain at each stage of the solder ing process Preheating and soaking do not need much power but soldering needs all the power available to make the profile close to the ideal Photo 3a and Photo 3b show the scope traces for the zero crossings yellow trace and TRIAC activation signal The TRIAC gate is activated at a maximum 100 us delay from the zero crossing and the software keeps it active for at least 2 ms to ensure that the TRIAC has enough current flowing to keep it on through the entire semi cycle The examples are respectively two cycles out of six and four cycles out of six SOFTWARE The Keil IDE and Luminary driver library shortened the learning curve 1 Got Serial ANECA Network Volume Discounts PANE TL Fe 6 CIRCUIT CELLAR www circuitcellar com Stopped Trigger 5 2 2007 800 mv Sa Sec 10 0KSa s Saec 10 0KSa s Div T Div Sms V Div AIX B1IX Photo 3a Zero crossings are in yellow This example is two cycles out of six Triac activation is in purple b Zero crossings are in yellow This example is four cycles out of six Triac activation is in purple had my first Hello World program the available resources as we do most The pulse skipping TRIAC activation running in less than an hour It was of the time when using 8 bit parts and zero crossing control is all done easy to use and there were plenty of All the program s time critical func inside a 100 us inte
96. ge that must be considered A 4 096 V reference voltage is not always guaranteed to stay at that voltage at all times This voltage can drift as a function of time and temperature and this typically can not be calibrated out One must also consider the effects of source resistance the resistance from the sensor and how this can contribute to error in ADCs Often the manufacturer s datasheet or hardware manual will For M16C 62P Reg 7 8 k C a 1 5 pF S1 Closed for three fAD Cycles Figure 7 Adding a capacitor can be a simple way to mitigate the effects of source resistance error ADC Input Ckt Equivalent To ADC block For M16C 62P Rio 7 8k Cro 1 5 pF S1 Closed for three fAD Cycles Figure 6 The RC time constant of the source resistance and the sampling capacitor can cause an error deal with this with their own formulaic approach There is however an intuitive approach that 1 11 cover Figure 6 shows an example which illustrates the ADC input equivalent circuit with the source resistance R The sampling switch S1 is closed for 3 A D conversion cycles It is during that time in which the switch is closed that the capacitor C will be charged up to the input voltage Note that the time constant will include the contribution from the capacitor the input resistance and the resistance of the source Thus the effect of the source resistance will affect the time that the capacitor charg
97. gn options in this case One obvious approach would be to move to a 12 bit ADC But you could also consider reducing the reference voltage The 10 bit ADC with a 2 5 V reference a very common reference voltage results in a 2 44 mV step change per bit with a full scale limit of 2 5 V Finally there is a common miscon ception or interpretation of LSB error when reading the manufacturer s spec ification For example again referring to a 10 bit ADC the manufacturer specifies a 3 LSB error It is common to interpret this to mean that the effective resolution is 7 bit resolution by dropping off the last three LSBs This is not correct however What this type of specification actually means is that an ADC can be off by as many as three counts from the ideal count So for example if a voltage is ideally 100 counts it could read as 97 or 103 counts RATIOMETRIC VS NON RATIOMETRIC In addition to understanding the variable that is being measured one needs to consider how to measure it to ensure that measurement error is minimized Figure 4 shows some April 2010 ssue 237 pd N April 2010 Issue 237 examples of ADC connection configurations to illustrate the difference between ratiometric versus non ratiometric conver sions By definition ratiometric conversion means that the A D input voltage is a fraction of the reference voltage In the ratio metric cases in this diagram the referen
98. good as it worked see Photo 1 Look ing good meant having an attractive enclosure with well designed and machined panels For the enclosure I chose a small extruded alu minum unit from Ham mond It s a black anodized enclosure that s only 4 x 4 75 and 1 tall For the front and rear panels I used Front Panel Express once again Their software is quite easy to use and the total cost for the front and back panels was less than 75 This was for a pair of blue anodized panels with custom machined openings for the various connectors and switches as well as yellow text and a skull logo I designed in white The power supply for the hub was something I didn t design I needed the smallest power supply I could find I selected a MEAN WELL Enterprises NFM 20 12 switching power supply that provides 12 V at 1 8 A in a board 0 75 tall and only 3 5 x 2 in size I wanted ry e 512MB 1GB DDR2 RAM On Bo 4GB Compact Flash Disk e 10 100 Base T Ethernet Reliable No CPU Fan or Disk Drive 2 6 KERNEL Dimensions 4 9 x 4 7 x 1 7 125 x 120 x 44mm Power Supply Included Locked Compact Flash Access e Analog SVGA 3D Video Optional Wireless LAN e EMAC Linux 2 6 Kernel e AF Embedded amp WinCE 6 0 www emacinc com servers standard sib htm Phone 618 529 4525 Fax 618 457 0110 www emacinc com CIRCUIT CELLAR www circuitcellar com to make sure this was a safe device
99. h any other offers Worlds s Fastest EA 2 ch 12GHz sampling scope for high speed electrical signals RF Testing EMI Tents PSA2701T RF Generator APSIN6000 Portable RF test enclosures amp shielding tents with extemal frame High res extremely low noise portable 6GHz RF generator TorqSense le M A Configurable patented USB output non contact SAW digital rotary torque transducers with integral electronics Sound Module DG3061A 3101A 3121A 60 100 120MHz USB 14 bit ARB with USB RS 232 LAN GPIB Lorlin Switches 14 pin module plays back pre stored audio files from microSD card Fantastic array of stock and custom switching devices Wireless Solutions bedRF Adeunis AS ta Novel ambient sensors amp modules accurately measure temp RH USB Serial Analog input bluetooth wireless modules 433 868 915MHz USB COM Add 1 16 COMports via your PC s USB Port easily Acomplete CP2102 USB serial converter in a DB9 shell 26 Check www saelig com often for special offers bargains business hints blog etc UPSICAP DLP TH1 Mention offer SBW RF Testing EMI Tents RWT320 Above are some of our best selling unique time saving products see our website for 100s more WiFi 910MHz antennas wireless boards LCD display kits Ethernet IO USB RS232 485 USB OTG instant Ethernet serial CAN LINbus USB cables extenders line testers logic analyzers color sensors motion c
100. h the media functions i e audio and video the Propeller handles At the cost of shipping just a few bytes of command information the AVR can have the Propeller streaming megabits of colorful graphics and www circuitcellar com CIRCUIT CELLAR Photo 5 I m working Steve really The Crate It demo is a retro video game that puts the GFX tile engine through its paces polyphonic audio The combination of AVR brains and Propeller brawn proves surprisingly capable in prac tice when each chip does what it does best LIBRARY CARD An Arduino sketch Arduino speak for the C program running on the AVR always has two sections setup which is run once at start up and then the loop which runs forever At a minimum the setup for a sketch running on Chameleon needs to initialize the SPI connection to the Propeller and then delay a moment to give the Propeller time to boot up I mention this because the out of the box demos impose a 2 5 s delay which seems excessive and gets old really quick i e every time you edit download The documentation mentions this delay can be reduced or eliminated depending on what else your sketch is doing I cut it back to 0 5 s without any problems but left it 2 5 s in the examples Connecting your sketch to the Pro peller objects i e I O drivers is easy All you do is copy the Propeller library files from the Chameleon dis
101. hand a touch of firmware can now convert it into an actual clock that s next column s topic The row of empty holes near the front of the circuit board is for an ordinary 44780 based LCD module Although my firmware doesn t use an LCD you could build a fine WWVB clock without the inordinate power drain of those big LED digits You can download the com plete source code schematics and PCB layout from the Circuit Cellar FTP site k Fd Nisley is an EE and author in Poughkeepsie NY Contact him at ed nisley ieee org with Circuit Cellar in the subject to avoid spam filters PROJECT FILES To download the code schematics and PCB layout go to ftp ftp circuitcellar com pub Circuit_Cellar 2010 237 RESOURCES M Lombardi et al WWVB Radio Controlled Clocks Recommended Practices for Manufacturers and Con sumers Special Publication 960 14 NIST 2005 http tf nist gov general pdf 1976 pdf S Nickels Time Server Design Synchronize with the WWVB Time Code Signal Circuit Cellar 2 20 2008 E Nisley Totally Featureless WWVB Clock Part 1 WWVB Simulator Circuit Cellar 235 2010 2 April 2010 Issue 237 NIST WWVB transmitter and data format specs www tt nist gov stations wwvb htm SOURCES Arduino Pro Microcontroller board www arduino cc en Main ArduinoBoardPro EAGLE Schematic and PCB layout CadSoft www cadsoftusa com CMMR 6P 60 WWVB Receiver Digi Key Part No
102. hannels 12 bit 1 MS s 16 Digital Channels Square and PWM Genera Up to 128 Simultaneous DAQ Devices Free Software Upgrades Dave www poscope c com 00 a Falret Mega T Flaw e TAR drid de e O A a are less than 9 per unit The KX1400 has a set of I O pins designed specifically for external SPI communications Note that these big guns require a 24 bit address where as the smaller devices use a 16 bit address The KX1400 can be config ured to handle either address width through the MSIZE input pin In the block diagram in Figure 1 you will notice the separate Memory and MPU SPI interfaces Besides these SPI pins the speaker outputs and power pins there are few other nec essary connections MSIZE and MODE standalone MCU inputs make up the configuration inputs Two general output pins could be used to drive LEDs These output pins are controlled through the Set Outputs command While you have control of the output s volume through the Set Volume command the Mute and UnMute commands should be used to turn the output off and on to ensure the lowest power consumption An internal 8 2 MHz oscillator is factory trimmed and should remain stable over its operat ing range The oscillator s output or a 2 4 8 division of it is available at the CLOCKOUT pin At power up or a Reset command the KX1400 will interrogate its inputs to determine operating mode and
103. have minimal time between the adjacent samples In the case of closed loop con trol the sam pling rate becomes more critical A sam pling rate that is too slow will result in exces sive delay in the system that can impede performance There is no need to set the sampling rate faster than the system can control it This is just wasting CPU resources Instead the sampling rate should be dictated by the system s dynamics and how fast the control system needs to respond to disturbances and yet perform adequately in its response time Typically the sam pling rate is set several times faster than the highest bandwidth of the system How many times faster is a trade off between the control system performance robustness considera tions and the limitations of the microcontroller CPU bandwidth and the ADC It is also important to understand where the Nyquist fre quency is when selecting the sam pling rate to avoid aliasing Staying on the subject of delays in the system it is also important to consider the effect of phase delay on the system due to the conversion rate This is the difference between the time that the feedback parameter is actually measured and the time 54 70 28 99 0 5 50 2 Figure 9 The effect of sampling at twice the base frequency poorly approximates the integral of the waveform that it is available to be read by the control system In an ADC this is proportional to the conver
104. he EEPROM There is however a pass through mode that I have not implemented In that mode the microcontroller could place the KX1400 into pass through mode set ting a configuration bit in the reset Visit us in Boot 1142 at the Embedd ed Systems Conference in San Jose April 27 29 2010 See It amp Solve Y Logic Analyzers Oscilloscopes Signal Generators Y Protocol Analyzers 2C SPI Async CAN 1 Wire USB PS 2 125 SMBus Serial l OO Fre ha AH Erki ink CCAA er with USBee Test Pods Y Configurable v Programmable Y High Speed USB Y PC Based Y Affordable USBee E USB based Electrical Engineer www USBee com w April 2010 Issue 237 Energizer a y tal TFE ly Mi es iF ey Papas oe ha Photo 3 My homemade PCB for this project is designed to fit in the Serpac Key fob enclosure The speaker used here doesn t do justice to the high fidelity output available from the KX1400 command access the EEPROM directly retrieve any data necessary and hardware reset the KX1400 This would require some circuitry changes plenty of I O pins left My thought here was to create removable EEPROM modules that could hold other prerecorded stories The reason for needing to read some data from the EEPROM has to do with keeping track of the stories and pages within EEPROM Without being able to read some con figuration data there is no way of knowing how man
105. hich is used for encrypting and the other is used for decrypting Sometimes the keys are interchangeable in the sense that it doesn t matter which of the two keys you use for encrypting you use the other one to decrypt Asymmetric encryption allows you to publish one of the keys pub licly which then allows anyone to send you a message that only you can read This is Known as public key cryptography Public key cryptography relies on math functions that are easy to work in one direction but are exponentially difficult to work in the other Some well known examples of public key encryption ar e the RSA algorithm based on factoring algorithms based on elliptic curves and algorithms based on finite automata r 2 Public key asymmetric cryptography enables several interesting functions for secure communication including Authentication A person can encrypt a message or mor e typical ly a hash of the message with his private key which can then be decoded with his public key This is known as digital signature and it allows anyone to verify that the message came from that person Integrity A valid digital signature also verifies that a message wasn t altered after it was signed The questions and answers are posted at www circuitcellar com eq _ You may contact the quizmasters at eq circuitcellar com Nonrepudiation By the same token the person can t deny that the message came from him For example these featu
106. hind the operation of this converter is that the analog signal being sampled is latched into a sample and hold circuit and fed into a comparator The signal is com pared to the output of an R2R ladder digital to analog converter DAC ADC Register TZ Sample and hold circuit Figure 1 This is a SAR ADC The digital reading is constructed sequentially starting with the MSB and working down to the LSB by having the output of the DAC successively compared to the sampled signal until the operation is complete Key advantages to this type of ADC are that it is relatively fast and it is easy to multiplex signals However high resolution SAR ADCs can get very expensive due to the analog circuitry that can be difficult to manufacture with a digital process The Sigma Delta ADC is specifically designed for high resolution As shown in Figure 2 the 4 V signal is fed into an error amplifier and the result is fed into an integrator The integrator output the slope of which is proportional to the input voltage is compared to the refer ence voltage The flip flop generates the first bit MSB The advantage of this type of ADC is that it is mostly implemented in digital circuitry making it easy to manufacture and with the use of digital filtering noise levels can be kept very low This also ends up being a disadvan tage if high speed conversion rates are required due to the need for high speed digital circuits in order
107. hut down the audio or a Reset com mand in which case it would replay endlessly MCU The KX1400 does not have user inputs but it can be commanded by an external device usually a micro controller A second SPI is imple mented to keep communication traf fic separated When the KX1400 is reset and determines it is in MCU mode it will not fetch the Phrase 0 vector from the EEPROM It will instead wait for instructions from the microcontroller Should the micro controller send a Play Phrase com mand with a Phrase Index 0 to the KX1400 it will act as if it is in standalone mode executing the fetch and jumping to the vector address for Phrase 0 This doesn t make much sense But imagine if a number of phrases were stored in the external EEPROM The list of phrase vectors could be quite long up to 4 096 www circuitcellar com CIRCUIT CELLAR Leading Embedded Development Tools MDK ARM is an Integrated Development Environment for Easy to use from concept to final product RM and Cortex Y M microcontrollers RL ARM is a Library Collection designed to solve real time and communication challenges ULINKppro is a high speed Debug and Trace unit for detailed analysis of software quality www keil com 800 348 805 gt KEIL Tools by ARM April 9010 Issue 237 N m en W April 2010 Issue assuming all the audio clips fit within the allot t
108. i 1 Challenge yourself against other top embedded engineers around the world in DesignStellaris 2010 sponsored by Texas Instruments z A Y Jo E 3 A hae e La y E E I E DI 3 N ka Cc da 1 te gel dh Y ea i Use the Stellaris LM3S9B96 microcontroller from Texas i Instruments with Keil s RealView Microcontroller Development Kit RVMDK and SafeRTOS from Wittenstein to create your design contest entry and see how far your design will take you Eed 3 W TEXAS INSTRUMENTS EY Stellaris EKK LM3S9B96 Evaluation Kit free with your contest entry while supplies last e No purchase necessary to enter e 10 000 in cash prizes e Entry deadline is June 23 2010 e Winners will be announced at the Embedded Systems Conference Boston 2010 e Submit your design today The EKK LM3S9B96 Evaluation Kit includes an evaluation board with an 80 MHz LM3S9B96 MCU featuring Ethernet MAC PHY CAN USB OTG and SafeRTOS in ROM a time limited copy of the Keil RealView Microcontroller Development Kit cables documentation and StellarisWare software l j z ae ARM Cortex IKEI Ax greum For Complete Details Visit WITTENSTEIN Integration Innovative Intelligent di Vy 3 f j ZA a S AA Be mn e z a eS Al LAD e Y a a a ie ACY or _ a he i os A y 7D eI a IE NINES UA WER ANA esa ue aS NASEN EDS
109. ials Graphical User Interfaces GUis NEW individual technologhes and system integration A new High Voltage Motor Control and PFC Developer s Kit is the first to be based on controlSUITE software The kit offers developers an open source hardware and software platform to develop advanced motor control systems with digital power factor correction The free controlSUITE software is available at www ti com cs_controlsuite pr The High Voltage Digital Motor Control amp PFC Refer ence Design Kit costs 599 Texas Instruments Inc www ti com PRODUCT NEWS Edited by John Gorsky CIRCUIT CELLAR e www circuitcellar com y CH ZG CH2 280U M5A8ps CH2 416U B 55541 4KHz F a ji E i el E B P i p ig et q MHz 60 M ME Hz 100 pe 200 Mhz and 300 MHz bandwidths 32 automatic measurements 2 tuo ad ailable daii 4 math functions plus FFT Large internal waveform and setup storage interleaved d Multi language user interface and context sensitive help So qe olor deplay on all models Y USB connections for memory sticks printers and PCs A Starting at 695 To learn more about LeCroy s full line of oscilloscopes including the 30 GHz WaveMaster 8 Zi the world s fastest real time oscilloscope visit www lecroy com or call 1 800 5 LeCroy LeCroy fund April 9010 Issue 237 MULTISIM 11 SIMPLIFIES CIRCUIT SIMULATION Multisim 11 is National I
110. ing the buffer in RAM makes it easy to mix text and graphics on the display Serial output uses the routines that came with the Keil examples and just output characters This can be done with out interrupts but I left the full interrupt support just in case it becomes necessary in the future Plenty of resources are available so there s no need to worry about a little more code or RAM usage The timer interrupt that controls heater activation is the most interesting part of the program It is simple and gets most of the job done with minimal intervention from the main program It counts the zero crossings and activates the TRIAC gate at the right moment for the number of cycles that are best for each stage of the temperature profile It keeps the TRIAC gate active for enough time to ensure it has suffi cient current flowing to stay on for the rest of the cycle This also helps to keep TRIAC heat to the lowest possible levels The user input interface is just a button that restarts the timers and counters for the soldering process It couldn t get any simpler than that The display output shows all the important soldering parameters at each soldering stage and a graph of the tempera ture The temperature graph overlaps itself a few times to show the profile with enough resolution in the available dis play space The output is particularly important when you have an expensive prototype inside the toaster It s essential to keep an eye
111. ion with one of our engineers 480 837 5200 New Products TS 7500 250 MHz ARM9 Low power fanless lt 2 watts 64MB DDR RAM 4MB NOR Flash Micro SD Card slot SDHC USB 2 0 480Mbit s host 2 slave 1 10 100 Ethernet Boots Linux 2 6 in lt 3 seconds User programmable FPGA 5K LUT Power over Ethernet ready Optional battery backed RTC Watchdog Timer 8 TTL UARTs or 3 UARTs amp CAN 33 DIO SPI 12C 75mm x 55 mm credit card sized Dual 100 pin connectors Secure connection w mounting holes Common pin out interface Low profile w 6mm spacing a Our Smallest Computer at Our Best Price Point HEIR 74 3 mm 2 925 in EEs j a papa E Ei f a la Pp i jo sth 66 mm 2 600 in TS SOCKET Macrocontrollers Jump Start Your Embedded System Design Beginning in Q2 2010 Technologic Systems will release a series of Macrocontrollers based on the TS SOCKET connector standard These CPU core modules securely connect to your custom base board enabling drastically reduced design time and complexity Start your custom embedded system around one of our Macrocontrollers to reduce your overall project risk and accelerate time to market Simplifies custom embedded systems Rapid design process gets products to market faster Several COTS base boards for evaluation amp development Design your own base board or use our design services Macrocontrollers are interchangeable for future upgrades 33 Technologic
112. is required Any full speed USB peripheral device can be electrically iso lated from the host using the USB 150 and standard cables The USB 150 Full Speed USB Isolator costs 99 Keterex Inc www keterex com CIRCUIT CELLAR e www circuitcellar com CMAX RTA AND CMA TINY RTOS SUPPORT FOR EFMS2 FAMILY CMA Systems s CMX RTX and CMA Tiny RTOSes are made for Energy Micro s ultra low energy 52 bit EFM32 Gecko microcontroller family based on the ARM Cortex M3 Microcontroller Core The CMA RTA RTOS supports most 8 16 and 52 bit processors and DSPs and it offers one of the smallest footprints fastest context switch times and lowest interrupt latency periods of any commercial RTOS avail able RTOS functionality provided in CMA RTA includes support for tasks messages queues system events memory resource semaphores timers interrupts and optional kernel aware debugging Flash requirements are approximately 1 5 KB minimum to 4 5 KB maximum The CMA Tiny real time multitasking operating system is a lean and mean kernel for those processors that have a small amount of RAM embed ded on the processor s silicon minimum of 512 bytes and higher This unique RTOS based on a scaled down version of the popular CMA RTA retains most of the power of the CMX RTA as well as the more frequently used functions Flash requirements are approximately 1 KB minimum to 5 KB maximum The CMA RTA and CMA Tiny also feature ful
113. isplaying identifying proper intensity and expressing human feelings in a way that a machine The most time consuming aspect of the project was dis could understand abling auto reset during USB communication with the I built my own board for the project see Photo 1 After device The auto reset function is for uploading sketches a few iterations I came up with a possible solution that to the board without having to press the Reset button The featured the Arduino a basic 2 x 16 alphanumeric LCD serial DTR hardware control line controls this It auto several super bright color LEDs green red and blue and resets whenever the system is trying to open a serial con several other components like resistors transistors and a nection e g via the USB cable In order to send and potentiometer see Figure 1 I used Twitter for communi receive data from board I had to keep the connection cating emotions To make design user friendly I prede alive After trying a software approach and several pro fined a series of feelings happy sad and angry and then gramming languages such as Java PHP and C I decided integrated them with messages to be displayed on the to use an official solution from the Arduino website It LCD along with different colored LED combinations A Python script on the host computer handles the USB com munication with the Arduino device and Twitter API I used two modules in the Python script pys
114. itive LED6 Y Amber about 60 kQ at 2 5 V That s not a tightly controlled value so you must add balancing resistors across the capacitors to equalize their terminal voltages I measured the self discharge resistance at about 100 kQ and used 10 kQ resistors that draw about 250 uA The capacitor voltages remain within 100 mV of their rating through the entire charge discharge cycle The Arduino Pro draws about 30 mA at 5 V and somewhat less at 3 V soa 5 F capacitor can hold V o above the 2 7 V brownout reset level for more than 6 minutes 5F x 5 2 7 V 60s x 30mA 6 4 min A lithium cell could provide a much longer runtime but at the cost of charging circuitry for a secondary cell or replacing a dead primary cell after each outage My friend reports that the utility power to her house fails for only a few minutes at a time a few times a year and she s willing to use her watch until the clock recovers by itself The LM317 regulator in Figure 3 sup plies 5 V for the circuitry on the clock board and charges the ultracapacitors through a Schottky diode and 510 Q limiting resistor The charging time constant is astonishing 2550s 510 Q x 5F A full charge therefore requires more than 2 hours which is reasonable in 10F 2 5V Ultracapacitors C6 C7 VCC VDD Figure 3 A 12 VDC wall wart supplies power the LED displays dissipate nearly 6 W The 10 F ultracapacitors support the Arduino microcontroller s
115. ktor s product range This DVD ROM contains all editorial articles published in Volume 2009 of the English American Spanish Dutch French and German editions of Elektor Using the supplied Adobe Reader program articles are presented in the same layout as originally found in the magazine An extensive search machine is available to locate keywords in any article With this DVD you can also produce hard copy of PCB layouts at printer resolution adapt PCB layouts using your favourite graphics program zoom in out on selected PCB areas and export circuit diagrams andillustrations to other programs ISBN 978 90 5381 251 8 28 30 Prices and item descriptions subject to change E amp O E i project ov pribl 90192994 110 issues more than 2 100 articles DVD Elektor 1990 through 1999 This DVD ROM contains the full range of 1990 1999 volumes all 110 issues of Elek tor Electronics magazine PDF The more than 2 100 separate articles have been clas sified chronologically by their dates of publi cation month year but are also listed alphabetically by topic A comprehensive in dex enables you to search the entire DVD The DVD also contains free of charge the entire The Elektor Datasheet Collection 1 5 CD ROM series with the original full datasheets of semiconductors memory ICs microcontrollers and more ISBN 978 0 905705 76 7 111 30 Comm Curse A a Cor coon
116. l source code no royalties and free technical support and updates with every purchase The per user license for the RTOSes is 3 000 and includes free technical support and no royalty charge CMX Systems Inc www cmx com KIT MAKES IT EASY TO DEVELOP INDUCTIVE TOUCH SENSING DESIGNS The PICDEM Inductive Touch Development Kit part DM183027 makes it easy to develop inductive touch sensing applications using standard 8 16 or 32 bit PIC microcontrollers or 16 bit dsPIC digital signal controllers The kit includes a fully developed inductive touch board complete with an embossed metal front panel source code schematics and a diagnostic software tool that enables designers to evaluate their applications Inductive touch sensing s fundamental operating principles enable it to work throuah a front panel such as plastic stainless steel or aluminum providing a completely sealed user interface that works through gloves and on surfaces that contain liquids Major applications for inductive touch sensing user interfaces include those in the appliance market because of the possibility of a stainless steel front panel Industrial applications are possible because of the technology s robustness Automotive applications are possible because of the technolo gy s sleek aesthetics and ability to reduce accidental touch triggers The kit is available for 69 99 Microchip Technology Inc www microchip com www circuitcellar com
117. lar com magazine 202 html CIRCUIT CELLAR www circuitcellar com 7 cia A Prescribed reading for staff because that s where wW e noek professional guidance fo icrocontroller technology Frank ikes pe on et engineer january 2010 G PFC C eRACKDOWN amp pous factor revealed 2 A cr pints Be el t T LETTHE P SCEPTER E RULE MRG M fast prototyping a dj system Subscribe to Elektor mm Low power design for AVR applications LED Mixer withDMX i q Linux ona Chip Parking Radar Creati eative fresh articles since 1961 Ultra compact MODULO D A full fledged stereo amplifier Mii WIN 100 WITH ELECT RONICS PUZZLE OMOMOMO Ti ake out your subscription now ap GO April 2010 Issue 237 SILICON UPDATE Wizard Lizard by Tom Cantrell Start Working with a Multidimensional SBC Small SBCs are a dime a dozen so what sets one apart from another Sure the hardware capabilities are important but most SBCs cover the basics However there s more to the story than the spec sheet Check out the Chameleon a colorful controller that proves two heads are better than one omewhere in my garage is a box with my first SBC a circa 1970s 8085 3 chip board It was a demo kit Intel came up with to pitch their 8085 MPU and its companion inte grated memory chips the 8155 RAM I O and 8755 EPROM I O
118. lar design contest entrants have received thousands of valuable development tools and product samples Because of their contest participation these engineers receive advance e mail notice from Circuit Cellar as soon as new samples become available Now you too can benetit from this early notification Welcome to the Designer s Notifica tion Network Print subscribers are invited to join the Network tor advance notice about our new sample distribution programs Ready for Delivery From 16MB to 128MB Available Call 530 297 6073 Sales jkmicro com www jkmicro com JK microsystems Inc International Orders Welcome Find out more at www circuitcellar com network It writes your USB Code Creates complete PC and Peripheral programs that talk to each other over USB Ready to compile and run Large data Reports 64 000 bytes sec per Interface Easily creates devices with multiple Interfaces even multiple Identities Automatically does MULTITASKING Makes standard or special USB HID devices Developers Guide for USB HID Peripherals shows you how to make devices for special requirements Both PC and Peripheral programs understand your data items even odd sized ones and give you convenient variables to handle them PICBASIC Pro MPASM C18 Hi Tech C PICBASIC Pro MPASM Hi Tech C CCS C Delphi C Builder Visual Basic 6 HlDmaker FS Combo Only 599 95 www TraceSystemsinc
119. lifi er Stuff Anyhow Part 1 Electronic Design 2001 http electronicdesign com Articles Index cfm Article ID 43464pg 1 SOURCES AD8638 Auto zero operational amp Analog Devices www analog com VSM Mixed signal simulator Labcenter Electronics www labcenter co uk SP 200 31 Digit voltmeter Lascar Electronics www lascarelectronics com BAS416 Diode NXP Semiconductors www nxp com IVC102 Amplifier and TLE2425 virtual ground Texas Instruments www ti com NEED TO KNOW INFO Knowledge is power In the computer applications industry informed engineers and programmers don t just survive they thrive and excel For more need to know information about topics covered in Robert Lacoste s Issue 237 article the Circuit Cellar editorial staff recommends the fol lowing content Radiation Detection Digital and Analog Pulse Measurement by Pete McCollum Circuit Cellar 220 2008 Build a data acquisition system to measure cos mic rays natural background radiation and emis sions from radioactive objects Topics Radiation Geiger Muller Tube PGA Parallel Processing Go to www circuitcellar com magazine 220 html Energy and Load Analyzer by Ronaldo Duarte Circuit Cellar 202 2007 This datalogger can measure RMS voltage cur rent power harmonics and frequency You can analyze electrical values over time Topics Data logger Current Harmonics Frequency FFT Go to www circuitcel
120. llar com CIRCUIT CELLAR biPololu Robotics amp Electronics Robot Kits Line followers Robot arms Chassis ED H With coupon code eee CCLLR3PIJ ss Spi Robot High EN oe anda C programmable Ae based robot with Arduino support Items 975 1306 mMwmecnanical a al No SS Compone EN ov at oz programming connector ATmega48 328 microcontroller 20 MHz clock Solder Paste Stencils From 25 Use our low cost solder paste stencils EE EULLENL Cut your own custom chassis front panels and more 1 877 7 POLOLU www pololu com 3095 E Patrick Ln 12 Las Vegas NV 89120 April 2010 Issue 237 jun es ay A April 2010 Issue 237 USB DEVICE OFFERS DIGITAL PATTERN GENERATION AND SAMPLING The GP 24100 is a PC controlled USB 2 0 high speed device featuring digital pattern generation and digital data sampling capabilities The GP 24100 can be used as a logic signal source early in the digital system development cycle to substitute for components that are not yet available The device features 16 digital data lines running at up to 100 MHz either in or out and a total memory of 8 MB It is powered and interfaced through the USB connection In the past troubleshooting and design verification looked like pure measurement challenges with logic analyzers and oscilloscopes as part of the solution But these acquisition instruments have an important partner in the digital
121. low cost evaluation kit less than 50 has a working KX1200 and EEPROM and it comes with a KX1400 IDE application for the PC giving you all the tools you need to build EEP ROM files and down load them into external devices IDE The Keterex applica tion helps you by organ izing all of the data nec essary to your applica tion in a sequential file that will be pro grammed into the exter nal EEPROM see Photo 1 In this project most of that data comes as WAV files It is necessary to define a sequence of commands for each phrase A sequence might consist of unmuting the speaker playing an ADPCM or PCM WAV file muting the speaker and going into low power mode You can see the last sequence of my project Story4End defined in Photo 1 Just below this sequence is the beginning of the playlist This is a sequential list of phrase pointers from O up to 4095 and the associated sequence that will be executed when requested by your application Note that these four stories require 72 5 of the EEPROM leaving enough room for a fifth book Packaged with the Keterex IDE is an audio application that can be used to record the WAV files for your CIRCUIT CELLAR www circuitcellar com See us at ESC Silicon Valley Booth 2002 Alliance Partners Embedded Systems CONFERENCE _ gt The Alliance Partner Program allows you to connect instantly with hundreds Renes asUniversity of qualified design consulting and R
122. lutions for power supplies requiring low part counts small footprints thermal resistance and low EMI Using a library of 21 000 components from 110 manufacturers designers have a wide range of system alternatives for creating large scale complex systems The software can handle input voltages from 1 to 100 V up to 20 system loads from 0 6 to 300 V and per load power requirements up to 300 W When engineers finish dialing in their prefer ences for the footprint the system BOM cost and power efficiency the graphical analysis capability instantly identifies major sources of power dissipa WEBENCH Power Architect tion cost and footprint area It allows the user to PSA edit individual power supplies and loads to further ee model and optimize the overall system for ther sea tam mal and electrical performance design goals e When the design is complete the tool gener el a ua ates a system summary report that includes schematics a BOMs and electrical operating val ues Multiple international distributors provide pricing The WEBENCH Build It feature offers complete BOM prototype kits with overnight ship ping To view a video demonstration or begin a design with the WEBENCH Power Architect go to www national com powerarchitect 1 bi hope ra De TEIS i ana forme ai at oe e iem nn ien mE i Smaller Footprint National Semiconductor Corp www national com NEW
123. me thing in hand right away so I made this PCB as soon as I did a schematic and layout to fit the CA enclosure see Photo 3 The CA 10 has room for a couple of AAA batteries but it s tight This prototype was made with www circuitcellar com CIRCUIT CELLAR ES Heey i Die Ede Waa Pint Generate Elie nadyrr Hirig aL gt e n m 20 3 0 Corr 00001815 am fins To 0 TE Fae p SOF j Ee 50 Photo 2 The Audacity digital audio editor makes it easy to record edit and save each WAV file used in your application This 9 s audio file instructs the user on the button functions for selecting a story DIP sockets for the microcontroller and EEPROM so I could change them Headers allow the microcon troller and EEPROM to be pro grammed on board so SMT parts could be used in the future Besides the audio work determin ing which speaker to use turned out to be a chore I bought about a dozen various small speakers from 0 25 to 3 W to find a good match and was fair ly disappointed with most of them I found the KX1400 s internal class D audio driver to be barely usable at 3 3 V 120 mW 320 mW at 5 V While a larger 4 speaker produced an output that was adequate the smaller ones that could be mounted in the CA enclosure did not have the oomph to show off the great play back fidelity possible with the KX1400 Presently a microcontroller can not receive information back from t
124. medium power range of up to 20 W This ultra compact converter measures only 52 4 mm x 27 2 mm x 23 5 mm Lx W x H It is supplied in the same housing as the popular 10 W model and it s also pin compatible with the equally popular 5 W model The converters are designed for use on universal mains with input voltages of 90 to 204 VAC They are available with output voltages of 5 5 5 12 15 and 24 V All the models attain an unusually low no load consumption of under 500 mW These not only meet the EU s green power policies for 2010 but also those planned for 2015 Compared to ts predecessor the power density of the module has been increased by 120 to 0 6 W cm Efficiency varies according to output volt age limits reaching a peak of 86 at 24 V In free air con vection the ambient temper ature operating range of the converters is between 40 and 70 C The RAC20 5B fami ly is also fitted with an integrat ed class B filter All models are isolated to 5 000 VDC mini mum and exhibit an MTBF of 250 000 hours to MIL ADBR 217F specifications The RAC20 5B costs 29 76 in 1 000 piece quantities RECOM Electronic GmbH www recom electronic com MICROCONTROLLERS FEATURE ON CHIP DATA CONVERSION The ADuC7023 and ADuC7 122 are analog microcontrollers featuring data con verters and other analog peripherals that combine to deliver a high level of pro Grammability and small package size Effective for digital diagnostic
125. ment resistance you will change the actual current by up to 33 because the current now will be U 20 mV R 100 200 MQ 67 pA How can you get a precise current measurement without interfering with the source You need to avoid any added series voltage More precisely www circuitcella com gt CIRCUIT CELLAR you will insert a measurement circuit in the current loop but the voltage between the two measurement points must stay as close as possible to zero The solution is simple but powerful you can add to the circuit an anti volt age source that s set to exactly com pensate the voltage drop caused by the measuring resistor see Figure 2 That way the voltage across the measuring device stays zero as the resistor drops and the voltage source cancel each other so a precise current can be meas ured The only difficulty is that this anti voltage must be adjusted depend ing on the current if the current is constant you can trim it yourself But if it is varying you need some kind of control loop to automatically adjust it TRANSIMPEDANCE AMPLIFIERS If you think op amp when you read the words control loop you re right A transimpedance amplifier is the exact implementation of the anti voltage current measurement idea Look at Figure 3 The op amp s two inputs are connected to the two ends of the measuring device As you know such an amplifier when properly wired with a negative feedback
126. mentation The software simulation of gauges control knobs meters and indicators which behave just like real hardware components ona PC s screen is known as virtual instrumentation In this book the Delphi program is used to create these mimics and PIC based external sensors are connected via a USB RS232 con verter communication link to a PC Case stud ies of virtual instruments are detailed including a compass an oscilloscope a dig ital and analogue thermometer and virtual displays for cars and aircraft 264 pages ISBN 978 0 905705 84 2 47 60 C 2008 o NET PROGRAMMING Learn more about Cf programming and NET C 2008 and NET programming for Electronic Engineers This book is aimed at Engineers and Scientists who want to learn about the NET environ ment and C programming or who have an interest in interfacing hardware to a PC The book covers the Visual Studio 2008 develop ment environment the NET framework and C programming language from data types and program flowto more advanced concepts including object oriented programming 240 pages ISBN 978 0 905705 81 1 47 60 Elektor is more than just your favorite electronics magazine It s your one stop shop for Elektor Books CDs DVDs Kits amp Modules and much more www elektor com shop Jektor Elektor US PO Box 180 Vernon CT 06066 USA Phone 860 875 2199 Fax 860 871 0411 E mail sales elektor com a AL mr S
127. mon solution is CIRCUIT CELLAR www circuitcellar com Figure 2 Unfortunately the current moving through the circuit will be modified by the added serial voltage The key idea is to add a counter voltage to exactly nullify the voltage between points A and B to build a current to voltage converter followed by a high impedance volt meter And the most basic current to voltage converter is simply a resistor see Figure 1 Thanks to Ohm s law the voltage across the resistor R will be V R x I so I V R You know R because you chose the resistor You measure V so you can calculate I But this approach has two drawbacks when measuring very low currents One you need to use a high value resistance For example if you want to convert a 100 pA current into 10 mV you need a 100 MQ resistor You then need to use a voltmeter with an input impedance far higher than 100 MQ which will be a challenge if even possi ble The other problem is more insidi ous low currents are often generated by low voltages The additional meas urement resistor adds a small voltage in series on the circuit and of course it s identical to the voltage sent to the multimeter Unfortunately this added serial voltage may change the current actually circulating in the wire Do you want a numerical example Imagine that the 100 pA current source is gen erated by a 20 mV voltage in series with a 200 MQ resistance If you add a 100 MQ measure
128. n and button presses Just remember the Chameleon has only one PS 2 connector so you can use a mouse or keyboard but not both at the same time r pow adjacent_pote 5 1 z pow jadjacent_oote amp i i Shims Fla 10 ineen smd Flay l intizi 5 Bomi Fiay 2 int 23 1 va le ta Print ahuff tE a AS YOU LIKE IT Chameleon does a good job of enhancing the Arduino concept with some unique I O capabilities while remain ing true to the keep it simple concept Right out of the box it only takes a few lines of code to create Arduino sketches that feature sound and video But nothing is set in stone The documentation explains how to put together your own collection of dif ferent Propeller objects You can write them yourself or better yet choose from the free object database Parallax maintains to create your own application specific accel erators that take advantage of the Propeller s raw per formance Offloading the details to the Propeller is a win win situation making simple Arduino sketches shorter and easier while at the same time freeing up AVR MIPS and flash to support more elaborate ones Indeed if you ll pardon the metaphor mix one can imagine Chameleons with completely different spots i e Propeller hardware software and API optimized for a specific application Kudos to LaMothe for putting together a complete package To give you an idea the user manual is 268 pages long Going beyond j
129. ne or incongruous inputs Causing just plain gotchas in my con trol software but it does happen The typical failures experience with commercial electronics aren t just dead failures More often than not they just stall or get stuck in some aberrant operating pattern It seems stupid that modern commercial hardware doesn t seem to know it isn t working properly and reset itself but it doesn t Rather than wait three months to clear a stuck router or video server chose to rely on tried and true brute force use a bunch of electromechanical timers on the power lines to turn the devices on off on once every 24 hours It doesn t keep a web camera from hanging after the thunderstorm today but it usually fixes it for tomorrow speak from experience on this subject One poignant example was many years ago when Circuit Cellar columnist Jeff Bachiochi and designed an electromagnetic bug repelling device for a customer who subsequently sold a million of them on The Home Shopping Network To make a long story short it used a single chip microprocessor to pulse an electromagnetic coil As you might expect when manufacturing a high volume device cost goals determine the trade off between satisfactory operation and bullet proof safety For example we could use thinner wire and cheaper plastic bobbins because the coil only experienced 5 duty cycle and rarely got hot Fortunately just as we were about to send the design out for production we experienced a
130. ned to enable computers to represent and process data that reflects affective states in a future version of this project i Author s note Source code is available at www qithub com blankdots Feeltagged A video demonstrating the project is available at wWww vimeo com 4930074 Stefan Negru is studying for an MSc in Software Engineering at The Faculty of Computer Science at The A I Cuza University of lasi in Romania He is focused on developing new and interactive applica tions For more information about his work go to www blankdots com SOURCE Arduino www arduino cc CIRCUIT CELLAR www circuitcellar com
131. ng for Circuit Cellar since 1988 His background includes product design and manufacturing You can reach him at jeff bachiochi imaginethat now com or at www imaginethatnow com SOURCES KX1400 Audio playback IC Keterex Inc www keterex com PIC16F677 Microcontroller Microchip Technology Inc www microchip com PCB Fab In A Box Kit Pulsar Professional FX www pulsarprofx com CA 10 4 Key fob enclosure Serpac Electronic Enclosures www serpac com NEED TO KNOW INFO Knowledge is power In the computer applications industry informed engineers and programmers don t just survive they thrive and excel For more need to know information about topics covered in Jeff Bachiochi s Issue 237 article the Circuit Cellar editorial staff highly recommends the following content Cost Effective Mobile Data Storage Interface an SD Memory Card with an MCU by Mandar Bagul Circuit Cellar 221 2008 You can expand a micro s nonvolatile data storage capacity with an SD card It s a great way to handle the excessive memory requirements of typical embedded applications Topics Memory SD cards Data Storage Go to www circuitcellar com magazine 221 html MCS 51 SBC for the Classroom by Praveen Deshpande et al Circuit Cellar 151 2003 Problems when working with development sys tems that use PLDs and ASICs An 8051 based SBC is an alternative Topics SBC 8051 Memory Go to www circuit
132. now in a 52 lead 4 x 4 mm QFN 36 ball CSP package For 1 000 piece quantities the WM8904 costs 2 14 Wolfson Microelectronics ple www wolfsonmicro com NPN O E j Ee S Got a PIC Question We have the answers 3 gi s Sees A PROGRAMMING ADVANCED PIC niet ty j MICROCONTROLLER tra St MICROCONTROLLERS im C PROJECTS n C WA Interacting Hardware Simulation From USS 10 ATOS wiih the PIC TSF Serias Programming 16 bit Microcontrollers in C Leaming to Fly the PIC 24 Programming 32 bit E Microcontrollers in Exploring the PIC32 A j r 15 Lucio Di Jasio ae Lucio Di Jasio a n aen AA Set ba to i pl ge L 8 BIT PIC By Lucio Di Jasio By Dogan Ibrahim ISBN 9780750682923 ISBN 9760730686112 49 95 39 95 Look for the latest titles from Newnes Press to help you maintain your competitive edge at Amazon com or your favorite online retailer at sae Receive our best discounts Hear about books before they publish N ewnes A Access to free sample chapters video tutorials and more jul oO CIRCUIT CELLAR e www circuitcellar com Y r 1 Symmetric encryption uses the same key for both encrypting and decrypting The key must be shar ed between sender and recipient and kept secret from everyone else Some well known examples of symmetric encryption are DES IDEA and AES Asymmetric encryption uses two complementary keys one of w
133. nstruments s latest version of its circuit simulation software with specialized editions for both hands on learning and professional circuit design The easy to use software delivers a graphical approach that abstracts the complexi ties of traditional circuit simulation helping educators students and engineers employ advanced circuit analysis technology The academic edition of Multisim 11 incorporates specialized teaching features and is complemented by circuits textbooks and courseware This integrated system helps educators engage students and reinforce circuit theory with an interactive hands on approach to investigating circuit behavior Multisim 11 Professional helps engineers optimize circuit designs minimize errors and reduce prototype iterations When combined with the new Ultiboard 11 layout and routing software Multisim provides enai neers a cost effective end to end prototyping platform Its integration with LabVIEW measurement software also helps engineers define custom analyses to improve design validation Key benefits of Multisim 11 Professional include the ability to better simulate with SPICE parser improve ments updated BSIM models support for advanced parameters and enhanced digital simulation accuracy It also enables easier prototyping and ensures design synchronization and transparency with enhanced for ward backward annotation from the Multisim schematic to an Ultiboard layout In addition Multisim 11 off
134. o an on board computer that coordinates all this to physically control the real brakes real motor and real vehicle Step on the brake or shift into drive and pray that the guy who wrote the software was an MIT grad As I m writing this all the insanity about floor mats under the accelerator adding shims or whatever to sticky pedals and about a hundred other car problems is still going on For Toyota it has become the problem of the day and then the fix of the week While noth ing has been entirely solved as of yet was glad someone in the press finally asked whether all the electronics in cars could be caus ing some of these problems That question made me smile perhaps because I m an electrical engineer and know that secure elec tronic control is an oxymoron Engineers only design perfect circuits and write perfect code of course so it has to be the floor mats and stupid drivers started thinking about all the rest of the electronics depend on like my router webcams home control system etc and my experience with them Anyone who thinks that electronic stuff works right all the time is nuts When spend a few months at the cottage depend on all the electronics at home to keep running smoothly My experience is that if the device can be even remotely described as electronic it will hang up screw up or bite the dust at some point in that few months It might be EMI from a lightning strike transient spikes on the power li
135. om Issue 236 Across Down TRANSFERRATE The 10 in 1 NATIONALELECTRICALCODE Z Y m QO April 2010 Issue 237 10BaseT two words WOZ Wozniak FEMTOAMPERE 10 amp fA WWVB NIST radio station NETHERLANDS nl MIDRANGE Max Min 2 BTU 1 055 J TITUS Mark 8 minicomputer Vir ginia Tech 1973 GIGAOHM G ohm sign OHMSLAW YV R x two words PASCAL Pa COEFFICIENT What is 3 in the term 3x y CONDUCTORS Silver graphite copper PROJECTFILES ftp ftp circuitcel lar com pub Circuit_Cellar 2010 236 two words An electrician s bible three words GEOTHERMAL Energy in the Earth s crust EXECUTABLE EXE ADDRESS Leetspeak addy WONDER 1 d r OPERATIONAL Op ZEBIBIT 2 DIELECTRIC An insulator LANCASTER The TV Cheap Video Cookbook 1978 LEGACY Old hardware in a new design O kekek gt gt 2 m 3 o n plulc r tir li x lels CIRCUIT CELLAR www circuitcellar com NDEX OL ADVERTISERS The Index of Advertisers with links to their web sites is located at www circuitcellar com under the current issue Page Page Page Page 75 AAG Electronica LLC 73 Embedded Developer 56 Jeffrey Kerr LLC C4 Parallax Inc 48
136. on the process ART amp SCIENCE Engineering is both an art and a science Why can t it be fun It can be and should be especially if we are to get the job done with the tight budgets and impossible schedules that we manage everyday I can still remember my first blinking LED with a transistor multivibrator running on a protoboard Today I get the same thrill at my day job but it s even more exciting when I complete a project after hours I love seeing a nicely soldered board come out of my toaster The results of this proof of concept project couldn t be much better The cost to develop the project was minimal The temperature profile is as good as a larger more expensive reflow oven Plus the process information is always available via the graphical display As a result boards come out nicely soldered in a few minutes The pleasure of doing something in a new way is simply priceless lil Alexandre Ney Guimar es alexandre logikos com br is the CTO and founder of Logikos Tecnologia He has worked as an embed ded hardware and firmware designer for more than 20 years during which time he worked on projects ranging from bathtub controllers to a full audiometer design At the age of 12 he began experimenting with blinking LEDs and making weird noises with speakers and astable multivibrators Alexandre s passion for electronics and computers bloomed during his high school years Although he considers himsel
137. ontrollers eng software wireless boards SMD adapters I2C adapters GPS loggers automotive testing security dongles video motion detectors crystals oscillators custom switches barcode scanners DSP filters PLCs Remote MP3 players etc FREE Starbucks card with your 50 order to get a 50 Hz interrupt frequency Changing the Timer period by one tick changes the frequency by 1 0 0025 25 x 10 40 x 10 The firmware computes the error multiplies by the cur rent Timerl period then adjusts the period by that amount The Drift lines in Figure 4 summarize those computa tions The first 0 4 correction subtracted 159 counts from the Timerl period adjusting the error below 1 second which truncates to zero during the next 130 minutes The time was off by 1 second in the next 93 minutes reducing the period by another 7 counts After 126 minutes the local clock was fast by 1 second and the longer baseline reduced the adjustment to 5 counts The error correction seems to be tracking the oscillator s temperature drift The resonator stabilized during the course of two con tinuous power on months and now keeps time to within 2 seconds in 24 hours That s the smallest adjustment pos sible 1 part in 40 x 10 The firmware now steps ICR1 by one count around 39841 the value that sets the Timer period to exactly 20 ms with a change perhaps every other day CONTACT RELEASE With the hardware in
138. opeller and Arduino let s put them together Keep in mind this dis cussion applies to the out of the box configuration Anyone willing to get their hands dirty can use the native tools e g AVRStudio and Par allax SPIN to give Chameleon a brain transplant But for now let s keep it simple At power up via the USB port or 9 V battery wall wart the AVR is in charge running the Arduino i e C application that resides in its Verdy Compile Ctrl HR op Show Sketch Folder Oil K Impent Library Add File CHAM_AVRFLASH DEV VOTO CHAM AVR GFX DEV VOLO CHAM AVE_KETBGARO DEV VIO include CHAN AVE SYSTEM VOLO H En Di include CHAN AYR TUI SPI DRY Y010 finclude lt CHAM_AVE_ MTEC DPS FOLO ho CHAM AVA MOUSE GRV VOIO HAM AVR NTSC DRV v t CHAM AVR PROP PORT_DEV wat CHAM AVR SOUND DAV VOID CHAM AVE SYSTEM Wit CHAM ARTS PLAN 010 THAM AVE_UART Oe WOND CHAM AVE VGA DRV W01O EEPRCIA Ethernet vaid metal SPT Inici 341 DEFAULT PATE delay mn 25007 l poid Menge NT3C_Teca_Frint Hello Varld G20 Tecum Char Ob i Firmida Ligue ayrstal Makro Eno aod Eo td Sube Keppi Wwe Photo 4 Programming Arduino sketches is easy thanks to a built in library of useful functions all the more so when enhanced with the Chameleon additions CIRCUIT CELLAR www circuitcellar com 32 KB on chip flash mem ory That s not a lot of room but as you ll
139. optimal performance with on chip ADCs Jeff Shoemaker is a Field Applications Engineer for Renesas Tech nology America Previously he spent a number of years as an embedded systems engineer working on embedded control sys tem design in robotic and servo control systems Jeff holds a Bachelor s degree in Electrical Engineering from the University of Minnesota and a Master s degree in Electrical and Computer Engi neering from the University of Massachusetts Amherst You may contact him at jeffrey shoemaker renesas com WIRELESS MADE SIMPLE QUICKLY AND COST EFFECTIVELY MAKE YOUR PRODUCT WIRELESS HELENI RF MODULES Featured Products L COTE nna DAN GPS Modules J aii z a GPS MADE SIMPLE RF MODULE sae RXM GPS5 SR Mori oo RXM GPS SG izaag SMITTERS RECEIVERS BE High Performance TRANSCEIVERS Easy Serial Interface Ultra Compact DA Low Power Consumption Low Cost INTEGRATED CIRCUITS ENCODERS DECODERS TRANSCODERS These easily applied GPS modules blend performance and cost effectiveness inte a single compact SMD package The low a ane wae ant am aN at a d a ri qe a e E e Y HA 1 aa ee a ra a na a a A e BN an AN i A power chipset minimizes power consumption and 4 ak A provides exceptional sensitivity Choose either an integrated or external antenna Development Systems THE FAST TRACK TO WIRELESS SUCCESS Link development systems contain everything needed to e
140. orts nested interrupts and implements binary semaphores and events as the resource sharing mechanisms Topics RTOS Multitasking Nesting Go to www circuitcellar com magazine 218 html CIRCUIT CELLAR e Www circuitcellar com Introducing the new improved enana CUWIN4300A 800 x 480 resolution 260K colors RS232 x 2 RS485 x 1 or RS232 x 3 Mono Speaker and Stereo jack Real time clock Battery backup USB I F ActiveSync Keyboard or Mouse support ARM9 32bit 266MHZ processor Windows CE 5 0 64MB FLASH 64MB SDRAM 499 o 10 2 DIAGONAL A Hi Windows CE DIAGONAL E Windows CE CUWIN3200A lt lt CUWIN3500A Mono Speaker and Stereo jack 800 x 480 resolution 260K colors Real time clock Battery backup RS232 x 2 RS485 x 1 or RS232 x 3 USB I F ActiveSync Mono Speaker and Stereo jack Keyboard or Mouse support Real time clock Battery backup ARM9 32bit 266MHz processor USB I F ActiveSync Windows CE 5 0 Keyboard or Mouse support 64MB FLASH 64MB SDRAM ARM9 32bit 266MHz processor 3 9 9 Qiy 1 64MB FLASH 84MB SDRAM 42 9 Qty 1 Y Touch Panel y Color LCD Display Ethernet RS232 RS485 Works with MS Visual Studio Pannen 1175 Chess Dr Suite F FOSTER CITY CA 94404 O M F L call 1 888 9CUBLOC toll free ws Me AD im B
141. out that the code for the Z8 barely made a dent in the EEPROM using only 3 KB How ever it wasn t really an option to use a smaller part as the smaller Z8s have less RAM and RAM was something I want ed to have plenty of The Z8 has to RS 232 to Host FlashPro430 USH FlashPro CC i E FlashPro2000 k GangPro430 GangPro CC Reliable and the fastest programmer on the market Perfect for production usage ai tet e a 4 USB FPA 1 2 A ee E a use rpa 2 AA prada a E A A pa i aN j AN rr de ey f USB FPA 8 ETET i a N EF TRAUN A A f pa N 6 Port UART Figure 5 Top level connections for the serial network hub retrieve each byte of data from the SX and store it internally in a ring buffer dedicated to that UART It then moni tors each ring buffer to see if it has a completed packet When it finds a com plete packet the Z8 uses one of its hard ware UARTs to send it to the laptop Since I wanted to give each UART a 256 byte buffer the RAM needed for buffering alone took up 1 5 KB CONSTRUCTION Just as I did with the Halloween Remote I wanted the serial network y hog 1 Weis UY 1i k gt E e Fanless x86 500MHz Two RS 232 Ports Four USB 2 0 Ports Audio In Out Standard SIB Server In a Box Starting at 305 Quantity 1 since 1985 25 YEARS OF SINGLE BOARD SOLUTIONS EMBEDDED SERVER hub to look as
142. p RS 485 422 support and terminal block connector SOLUTIONS Instantly network enable any serial device Works out of the box no programming is required Customize to suit any application with low cost development kit 256 bit encryption protects data from unauthorized monitoring Features 10 100 Ethernet TCP UDP SSH SSL modes DHCP Static IP Support Data rates up to 921 6kbps Web based configuration Need a custom solution NetBurner Serial to Ethernet Development Kits are available to customize any aspect of operation including web pages data filtering or custom network applications All kits include platform hardware ANSI C C compiler TCP IP stack web server e mail protocols RTOS flash file system Eclipse IDE debugger cables and power supply The NetBurner Security Suite option includes SSH v1 amp v2 support etBurner Networking in One Day Information and Sales sales netburner com Web www netburner com Telephone 1 800 695 6828 freescale Alliance Member a F ai a Door to Door Delivery Overseas Manufacturing Imagineering Inc enjoys the reputation of being one of the most experienced amp successful Sig ificant offshore PCB suppliers Price Saving I CAM USA ISS Our Illinois based DFM office AS NET CE has eight fully staffed CAD i CAM stations Within hours of receipt of new Gerber files our i highly experienced
143. ping systems are helping thousands of engineers around the world take their development time from days and weeks to minutes and hours In today s race to market it s like having a time machine www lpkfusa com pcb 1 800 345 LPKF You can t beat an LPKF system for prototyping We do up to three iterations of a design within a day Leonard Weber Agilent ls XAK Laser amp Electronics April 2010 Issue 237 a W proceeded to lay out the board and then sent it to be manu factured When I got it back and started adding parts all the testing went great until I added the SX 28 to the PCB Sud denly the power LED was dim indicating a heavy load and the SX 28 got extremely hot very fast I had overlooked a minor but critical detail The SX 28 comes in two different surface mount packages SOIC and SSOP While it s true that the DIP and SOIC packages use identical pinouts I was using a chip in the SSOP package Sadly the SSOP has a very different pinout I ended up having to correct the parts in the schematic and PCB software modify the layout design and then get a new PCB manufactured Another lesson learned involved the MAX3094 RS 485 quad receiver chip On page 1 of the datasheet it says When active these receivers have a fail safe feature that guarantees a logic high output if the input is open circuit This definitely made life easier since I didn t have to worry about wha
144. pts relating to current measurement and transim pedance amplifiers I will then describe how I prototyped a small low cost picoammeter in a couple of hours with satisfactory results Lastly with memories from my childhood fresh in my mind I ll show you how I ve used it to measure high impedances Let s go Switch on your soldering iron BASIC CURRENT MEASUREMENT Imagine that you have a wire in which a small current is circulating say from pico amperes to micro amperes How can you meas ure this current nearly impossible with a stan dard multimeter For example my trusted Fluke 189 which is 6 a very high end device has a best case resolution of 10 nA per count which makes meas urements under 40 or 50 nA unrealistic To measure lower Some methods don t require you to open a circuit e g like Hall effect sensors or current transformers but they are usu ally not applicable to such low currents You can also use a gal vanometer in which the current directly moves the indicator currents a dedicated low cur rent piece of equipment is Figure 1 This is the basic current l l measurement method Just open the reasonably high currents micro but you also will be limited to required namely a picoamme circuit insert a resistor and measure amperes or more So the most ter Usually when you work the voltage across this resistor obvious and com
145. r Cate Figure 2 These are the system s main parts used a Nokia 3310 graphical display because it was easy to interface consequently less thermal inertia than a bigger oven Plus the available power per volume is much higher than a toast er oven It heats and cools much faster than an oven could Adding a nitrogen puff at the right moment to expel most of the oxygen from the soldering atmosphere would also be inexpensive because the volume is so small That is on my to do list I already have a spare AK As low as 9 95 each Unmasked boards ship next day www apcircuits com AP CIRCUITS PCB Fabrication Since 1984 Two Boards Two Layers Two Masks One Legend CPU output to add that function Using nitrogen improves the wet ability of the solder paste and reduces oxidization A nitrogen atmosphere toaster is a nice idea for the future POWER CONTROL STRATEGY The Toaster has way too much avail able power so a simple on off control would not be ideal Although mostly ta Qridconnect www gridconnect com 1 800 975 4743 resistive the heaters have some induc tance that would generate quite intense noise if activated outside the zero cross ings To solve these two possible prob lems the activation is performed right after the zero crossing detection and some cycles are skipped to control the available power think of it as the sys tem s
146. re measure ment I used an affordable K thermo couple and a Maxim MAX6675 interface chip The thermocouple was attached to a PCB to help measure the temperature as close as possible to the compo nents and solder paste Measuring air temperature inside the toaster would not help much Once more this decision was driven by the need to lower NRE costs Using op amps cold junction compensation and ADCs would n t make sense for a small project The power section is galvani cally isolated using one AC TPL620 AC optocoupler for detecting the zero crossings and an MOC3011 optoisolated TRIAC driver The BTA12 600CW is a snubberless 12 A TRIAC At the power levels involved here the zero crossing activation may seem like overkill but the pulse skipping technique keeps switch ing noise levels down stresses the TRIAC and heaters less and allows better temperature control over the full temperature profile The toaster I used was one of the cheapest on the market It cost me 10 and had a PCB inside to control when the toast was ready I removed the control elec tronics This low cost element of the system performs incredibly well It has low thermal mass and April 2010 Issue 237 e mJ ia 00 April 2010 ssue 237 External 6Vx100 mA 3 3 V Power supply a LM3S102 B MAX6675 Thermocouple Nokia display Push buttons CP2103 USB Connection Optoisolated triac Toaster heater Zero crossing detecto
147. re slowly pushes CIRCUIT CELLAR e www circuitcellar com the minimum and maximum values toward the average to ensure that they don t get stuck at transient extremes POWER CONTROL Each digit segment contains four blue LED chips wired in series so the dis plays run at a nominal 11 to 12 VDC I used an unregulated 12 VDC 1 2 A wall wart that produces about 13 5 V under a typical load That s enough voltage headroom for the TLC5916 constant current drivers to maintain proper regulation The entire clock dissipates 5 W mostly in the LED panels while showing 12 08 to a bright room so this is not a low power project There is obviously no practical way to provide enough battery backup to keep the LEDs lit during even a short power failure Instead I put a pair of Maxwell 10 F ultracapacitors in series across the Arduino Pro s Voe supply to support just the microcontroller dur ing power outages This brute force solution enabled by recent capacitor development eliminates all the tricky power management programming The capacitors have a 2 5 V work ing voltage Stacking two in series halves the total capacitance but they still have far more energy storage than any ordinary electrolytic cap that would fit in the clock s ruthlessly flat package The capacitor specs set a maximum self discharge current of 40 uA which corresponds to a leakage resistance of Arduino VCC 12 VDC input center pin pos
148. res can be combined to create a sys tem for recording anonymous financial transactions creating what is known as digital cash communications you also need to pay attention to how keys ar e generated and distributed and you have to pay attention to the protocols used to carry the data from one place to the other Weaknesses in either of these areas can completely bypass a strong cryptosystem A lot of it comes down to human engineering making sur e the users of the system understand the nuances of what they should or should not be doing with the system A Answer 4 While public key cryptography provides one way to address the key distribution problem one of its major drawbacks is that it tends to be computationally very intensive to encrypt or decrypt a block of data as compared to symmetric cryptography Therefore most real cryptosystems such as OpenPGP use a hybrid system in which symmetric cryptography is used to encrypt the message but public key cryptography is used to encrypt the random key called the session key used in the first step This means that the computationally intensive asym metric algorithm is confined to a small chunk of data typically 128 to 256 bits while the bulk of the data uses the r elatively efficient symmetric algorithm Contributed by David Tweed SS MICROCHIP AmE a f y F ANA ye a Atal i Ca A A YA j bead ri freescale aoe TEXAS INSTRUMENTS F w AA F
149. rrupt CPU cycles available As a result I tions occur inside timer interrupts The I also developed a Delphi 3 yes I am could use C language exclusively and I main loop handles decisions that are that old program to make it easier to didn t have to worry about exhausting made every 0 25 s and user interfacing visualize the reflow profile performance nae i l Prototype Scion We add value to PCBs o gt a gt when others just sell it Designing Service 3D Enclosure Designing Virtual Assembly PCB Di Component ACTA ATT 6 dl i Fa af ld ty iy 1 LEE www EzPCB com Email salesOezpch com April 2010 Issue 237 www circuitcellar com CIRCUIT CELLAR Nn April 2010 Issue 237 It s not the main topic in this article but it s important enough for at least a paragraph Why would I use something as old as Delphi 3 instead of the richer languages that are currently available Simple it gets the job done and I know how to use it quite well I choose the tools I use with great care which means I always try to use the most effective tools without worrying whether they are outdated or unfash ionable My main concern is always to deliver the best product for the given budget and time I m allotted FIRMWARE The firmware includes three sections The main loop section takes care of the temperature profile serial output of process data display output and check ing
150. ry hardware spe cific I used macros to isolate Embedded Systems Development tracerthan a Mi Chan A mir A TT epica o mag oars TF Y at osaa Y bere 004 ma La aTi ma 7098 ma lat 2474 ms A anA oh Drass SigGeni L000 Y Tas 2 000 Teme 1 000 ms en oh ie ND A ese i a a LD ooo LoS 20 30 4D de 6 0 nm 0 30 ia so Tne ra Example State based toy with sound As f mere a eam each state is exercised the pits Sila ates la adie controller sends an SPI message eesti to the sound generator Here a sinusoid is used for testing Both the SPI message and Uart test string are decoded and displayed We triggered on State 001 In the USA call A April 2010 Issue 237 April 2010 Issue 237 the logic from the chip specif main Processor ic details If 1 move to a com pletely different processor I can update the code by changing only the macros These changes are then prop agated to the rest of the code during compiling rather than manually hunting through the source code for the hard ware dependent sections It also helped me when I moved from the development hard ware to the final hardware and completely changed the port and pin assignments in the process The macros also make the working part of the code incredibly easy to read The Z8 was a great chip to use as the CPU in charge With 48 KB of EEPROM and 4 KB of RAM I had plenty of room for code and buffering It turns
151. s power source Any transformer will have huge parasitic cur rents in comparison to the pico amperes you want to meas ure I used a simple 9 V battery regulated by an LP2950 5 V regulator A symmetrical power supply was needed so I added a Texas Instruments TLE2425 virtual ground genera tor This chip divides the power supply rail into two halves so I could use its output as a virtual ground and the O and 5 V lines as a 2 5 V power source Such a circuit must be assembled on a properly designed PCB to achieve good performance In particular a good ground plane should be used as well as guards around the ultra low current inputs Well I tried to build it on a stan dard prototyping board see Photo and Photo 2 I expected disappointing results but I was pleasantly surprised to be able to use it down to the 2 nA full scale range Honestly the 200 pA range is currently useless because measurements are a little erratic but it should be usable with a proper PCB I had more difficulties with the high current ranges of 200 uA and 2 mA which occasionally oscillate on my prototype The www circuitcellar com CIRCUIT CELLAR feedback capacitors on these two ranges are definitively too small but the difficulty would be to find low leakage capaci tors with high capacitance more than 100 uF Anyway this is not a serious problem because my standard multimeter is working like a charm for reasonably high currents I didn t spent a
152. s in optical transceivers and modules based on both fixed and tunable frequency lasers the ADuC7025 and ADUC7 122 precision analog microcontrollers use an ARM 7 processor with up to 126 KB of flash memory to ensure the accurate control of optical drivers and diagnostics The ADuC7122 includes a 52 bit ARM7TDMI processor core operating at 41 78 MHz with 8 KB of on chip SRAM and 128 KB of on chip EEPROM memory with software triggered in circuit reprogrammability While competing devices use PWMs and lower performance ADCs to perform monitoring and control func tions the ADuC7 122 microcontroller features a 14 channel 12 bit 1 Msps SAR ADC 12 buffered 12 bit DACs a programmable gain amplifier and an on chip temperature sensor The ADuC7122 also features five timers including a wake up timer and watchdog timer as well as two IeC interfaces one SFI one UART and 32 GPIO signal pins that can be independently configured as inputs out puts or open drain For fixed frequency optical transceivers in SFP SFP AFP and GPON the ADuC70253 offers 8 KB of SRAM 02 KB of flash EEPROM memory 19 general purpose I O pins three general purpose timers and 16 programmable logic ele ments Analog peripherals include a 12 channel 12 bit 1 MSPS ADC a 16 bit six channel PWM and four buffered 12 bit DACS The AduC7 122 and the ADuC7023 cost 8 90 and 3 65 respectively in 1 000 piece quantities Analog Devices www a nalog com www circuitce
153. s to add a capacitor to the A D input as CIRCUIT CELLAR www circuitcellar com Let your geek shine Meet Jamie Robertson SparkFun customer and 30 year embedded design veteran When Jamie needed a small MP3 player that could respond smoothly to volume commands for his latest interactive art collaboration he didn t head to the local electronics store Rather Jamie turned to SparkFun and custom built his own media device After a few enhancements his prototype became the MP3 Trigger now available at SparkFun com Whether you re looking for new ways to explore interactive art or want a tutorial on physical computing the resources are out there Find out how electronics fit with your passions and let your geek shine too sparkfun LECTRONICS Sharing Ingenuity WWW SPARKFUN COM 2010 SparkFun Electronics Inc All rights reserved All other trademarks contained herein are the property of their respective owners Read more about Jamie and his project with musician Mike Gordon and artist Marjorie Minkin at www robertsonics com www wmaastudios org or www makerjam com N N April 2010 ssue 237 Frequency fo 1 2 n RC 20 kQ R and 0 0015 F 5 3 kHz corner Figure 8 Adding a capacitor can also create a low pass filter shown in Figure 7 This capacitor acts as a charge pump for the sampling capacitor It is important to make sure that the charge capacitor is large enough that the con
154. s which message segment to play record Power On or reset Story red pushed Go green pushed Again yellow pushed Figure 3 The microcontroller has a few simple tasks It must monitor the push buttons Keep track of the story and page data and command the appropriate phrase to be played by the KX1400 Rather than mutilate a book and mimic this feature which has some inherent problems dealing with suffi cient light I decided to design this project with push buttons to allow movement between pages This fea ture adds some flexibility such as rereading a page moving going for ward backward or even choosing between stories Figure 2 is the schematic of this project The generic SPI interface makes it ease to replicate with just about any microcontroller I used a low cost 20 pin Microchip Technolo gy PIC16F677 for this project There isn t anything unique about this part except that it can operate down to 2 0 V This allows two AAA cells to power the circuit without the need for any regulation One of the four push button switches is a reset which is used as a power switch and brings the system out of power down which sleeps at less than 1 pA The other three push buttons are used as function keys Note also that there is a 2x5 pin header that contains the signals necessary to interface with KX USB 710B programmer This programmer comes along with the KX1400 evaluation board This
155. scilla tor was running slow by 33 0 4 3 99 x 10 8280 Although I don t know the exact spec for the Arduino Pro resonator the observed frequency error is within the usual specification I set the Atmel ATmegal68 s Timer clock prescaler to 8 which ticks Timer1 at 2 MHz then divided that by 40 000 CIRCUIT CELLAR www circuitcellar com 2 ch trigger standalone USB bench scope 287 499 Handheld Scopes 20MHz 6OMHz USB 2 ch scope N 2 ch 40 100 200MS s 8 bit scope range with 5 10 25MHz 246 USB Bus Analyzers VEZ nn DCL Fits Packet Master USB 1 1 2 0 analyzers and generators 699 Waveform Generator USB2 0 speed 16 bit digital pattern or arbitrary waveform generator Wireless Data Loggers Log and display temp hum volt event time or pulse counting data Drop in solution connects PC to I2C SMBUS 32 I O lines 89 USB board adds 55 I O and 5 x 10 bit VD inputs 1 x 10 bit analog O P Small 2 2 x 2 2 lowest cost NET Micro Framework dev system 888 7SAELIG 5022S PDS6062T 2 PD 022MN HDS2062M 72 2 ch 1GSa s 25GSa s equiv 50 100 MHz scope 595 795 10 25MHz USB powered scope in a info saelig com probe Up to 100MS s 193 280 Scope Logger PS2203 4 5 2 ch DSO 16 bit DSO FFT VM logic analyzer standalone 24 I O 16 Ch Logic Analyzer Intuitive full featured 16 ch 4MB 200MHz
156. sensors and software that inhibits conflicting control inputs albeit a rusty gas pedal or a misplaced floor mat If you step on the gas and brake at the same time German cars say verboten and give priority to the brake In my opinion successful embedded control design isn t always just about making something work correctly Good designers take the effort to make sure it can t work any other way Perhaps Toyota concluded that a 2 sensor on the brake or gas pedal was too much to add to millions of cars but it sure seems that some simple code that said press the gas pedal or press the brake but not both at greater than 30 mph might have solved some of these problems a long time ago In the meantime while they continue to figure it all out I ll just go enjoy my BMW Of course such satisfaction only goes so far since it is parked next to my Toyota Cw E F hal n Steve ciarcia circuitcellar com CIRCUIT CELLAR www circuitcellar com Sweet Wireless or Wired Networking in One Small Package Smaller than a sugar packet but big on features the Rabbit MiniCore series of easy to use ultra compact and low cost networking modules come in several pin compatible models Optimized for real time control communications and networking applications such as energy management and intelligent building automation MiniCore will add sweetness to your design Wireless and wired interfaces Secure Wi Fi networkin
157. signal genera tor to form a complete stimulus response solution for functional testing and debugging The GP 24100 is delivered with the 8PI Control Panel software suite including Windows QUI a TCL tk interface and access to C DLL The programming interface allows developing custom test programs from any C compatible environment to automate and repeat specific tasks GP 24100 also features triggering pattern looping and exter nal I O voltage selection from 1 8 to 5 5 V In addition to the standard ADWG pattern gener ator and logic analyzer mode of operation the GP 24100 can be turned into a SPI master analyzer and lC master analyzer with extra modes of opera GP 24100 is available now for approximately GP GP 24i110 byteparadigm iGanavator Avalysee Analyser 1 400 with standard options software and cables Byte Paradigm www byteparadigm com D panes amp ENG ENC LO SURES l customized froni etl can be oy esde 701s 1010 ziz China PCB Supplier Prototype thru Production e Cost effective prototypes i v 1 layer up to 30 layer and production runs v Cost and quality e Wide range of materials or customization of provided v On time delivery des me v Dedicated service e Automatic price calculation z Eroon 1 36 7 days S v Instant Online Quote amp Order o nn Day and Night Sample price J Dig i No minimum quantity 1 piece is welcome Check o
158. sion time The longer the conversion time the longer the phase delay This can influence how well control system performance can be optimized and the robustness of the system to reject disturbances and maintain stability Keep in mind that there are other fac tors that will contribute to this delay such as how fast the result is read from the ADC as might be the case in a multiple input control system For closed loop control if using an ADC for measuring feedback it is important to make sure the ADC conversion rate is as fast as possible to minimize phase delay and to have a thorough understanding of how the microcontroller reads the result into memory Often times in signal processing we need to approximate an integral such as when calculating the average voltage or average power In some cases a Rie mann sum can be used for this approxi mation When doing so always remem ber that more samples are better The Nyquist theorem states that when a periodic signal is sampled by more than twice the highest frequency compo nent sufficient information is avail able to reconstruct the signal Note that this is sufficient to reconstruct the signal but hat doesn t mean it will look pretty when it is done Take a look at Figure 9 where the signal is sampled at twice the frequency but the integral approximation is not very accurate Obviously more samples will be needed for a more accurate representation A designer can gain
159. system SPlandnonstandard 4 wire and 3 wire NH RF amp EMF Spectrum Analyzer serial protood interfaces up to 50 Mbps Automotive Testing 12C Xpress Kits turn your PC into vehicle electrics diagnostic tool USB Loggers e Standalone USB temp hum volt current loop data logger 49 CAN USB MSR145S FT232RL Intelligent CAN connection from PC s USB port 299 Z110SR W5100 uOLED 96 G1 Simultaneously transmit composite video and stereo audio signals EL USB 1 2 3 4 PS3423 KLARI MOD CAN USB AWME6EXX TX RX 1Hz to 7GHZz for WiFi mikes etc CANminiBOX Embedded controller series 2 x CANbus Ehternet USB2 0 CF Electronic DC Load 2220 9000 amp E ae i ni e pay Const current resistance conductance voltage amp power modes Serial Ethernet Cable Network serial product easily without a PC using this 28 cable 89 EL BEN Ready to go out of the box FPGA DSP designs for beginners and experts 9p 9p or 25p 25p self pwrd isolated RS232 RS422 485 uCAM 232 uCAM TTL MC RF amp EMC Spectrum Ww RTG005 KK Systems Saelig CEO Only 180 Multichannel DAQ a 12 16 input 1kS s 10 12 bit PC connected voltage logger EMC Spectrum Analyzer f I Handheld Palm PC based 2 7GHz Spectrum Analyzer Call 1 888 772 3544 to get a free Starbucks Card with your gt 50 order PL1012 PL1216 While supplies last not available wit
160. t REDUCING THE NOISE Most large LED displays use multi plexing activating only one digit or Blue 75mm LED digits Hour MSD Hour LSD segment of each digit at any time Mul tiplexing simplifies the hardware and improves power efficiency at the cost of high speed high current switching The highest current will be roughly number of digits x LED peak current rating more than 3 A for this clock Putting a sensitive radio receiver beside that circuitry simply begs for trouble I avoided those problems with a sim ple direct current display design four Texas Instruments TLC5916 drivers draw a constant current through each illuminated segment The schematic in Figure 1 shows the connections on the Hour board the Minute board is similar DC drive has the pleasant side effect that the digits don t flicker or break up during sudden eye move ments which both my friend and I find unpleasant An 8 bit register inside each TLC5916 controls the display current although the current does not vary lin early or even monotonically with the register value An external resistor determines the maximum current the chip can handle 120 mA per output far in excess of the 20 mA limit for these digits The dynamic range is unfortu nately fairly small 1 58 to 18 8 mA for the 1 kQ resistor I used just over 10 dB The Arduino Pro controls the TLC5916 chips through its hardware assisted SPI interface pins using the same techniq
161. t Cellar 206 2007 Tom turned to game expert Andr LaMothe to see how to teach new school hardware some old school programming tricks Are you game Topics Multi core Propeller Hydra Game Programming Go to www circuitcellar com magazine 206 html Efticient Micro Mathematics Multiplication and Division Techniques for MCUs by Kripasagar Venkat Circuit Cellar 212 2008 Many micros require numerous instruction cycles for mathematical operations Here you learn to perform efficient multiplication and division Topics Horner s Algorithm Filtering Multipliers Go to www circuitcellar com magazine 212 html CIRCUIT CELLAR e www circuitcellar com Pick a Tool Any Tool Find the Right Development Tool Compare it to Other Tools Evaluate It and Buy It from Digi Key ToolsXpress Without Leaving Our Site Embedded Developer s intuitive research engines are used to find compare and buy the Cariaco TE Digi Key ToolsXpress engineered Ay Port Fatboy by Embedded Developer is the only site in the industry where Any Tool Type s right hardware or software WA engineers can quickly find and Any Tool Provider l development tool for your next compare the embedded industry s embedded design EM EODEODEVELOPER leading development tools Search Compare before you buy tools are listed side by side with features and Ya performance specs availability and prices JT AG toi
162. t the chip would do when nothing was attached to the inputs of the chip After I got the revised PCB I proceed ed to add parts to it and test it as I went along Electrically the board was solid with no parts overheating or exhibiting strange behavior I then downloaded the code into the SX 28 and Z8 Encore chips and immediately discovered strange behavior If I plugged a device into the hub but the device didn t send any data the SX 28 was seeing a stream of zeros flooding in on that UART Some time spent debugging the hardware revealed that until the first byte was received the MAX3094 receiver was stuck with the output low causing the UART to view it as a stream of zeros I reread the datasheet in detail and discovered buried on page 10 that the super handy fail safe behavior actually fails if the input is terminated Since it is an absolute requirement of the RS 485 spec that the last receiver is terminated and a hub is by default the last receiv er then all the RS 485 receivers in the hub exhibited this bad behavior It seems to me that calling something fail safe which is actually guaranteed to fail simply by following the electrical spec of RS 485 kind of implies they need to come up with a different name to describe the feature I was shocked that this condition wasn t properly handled by the chip Maxim provides a fix for this that requires adding two more resistors for each input but that pretty much de
163. t want a brilliant display that lit up the entire house at night I decid ed to set the LED current to correspond with room illumination turning it down as far as possible overnight The photoresistor shown in the upper right corner of Photo 1 and Figure 2 pro vides a way to measure room illumina tion The LED digits leak a surprising amount of light through their white plastic sides so 1 put a brass shroud around the photocell to limit its view The front face of the clock consists of a single layer of 1 stop neutral density fil ter the shroud fits through holes in the additional layers of 2 stop filter material that permanently reduce the maximum display brightness The firmware reads the voltage across the photoresistor every 4 sec onds combines that value with the average of 15 previous measurements to eliminate sudden changes then sends the appropriate current control command to the TLC5916s Unfortunately the driver s 10 dB current range is far less than the possi ble variation in room brightness The photoresistor varies from about 50 Q in full sunlight to 500 kQ in total darkness a 40 dB range although typi cal room illumination falls in a 10 dB range near 1 to 10 kQ The firmware tracks the minimum and maximum illumination levels and maps the LED current range across those extremes so a dark room will always receive the minimum LED light This isn t ideal but it seems to work well in practice The firmwa
164. tance see Photo 3 Neither a classic plas tic bag nor an FR4 epoxy substrate gave measurable current meaning lower than 10 pA They are definitively good insula tors On the contrary I was able to measure the resistances of a full range of other materials see Table 1 even if nearly all the materials appeared as perfect insulators when tested with a classic multimeter Measured values are very high in always impressive to see a 100 pA range April 2010 ssue 237 oO nN O O April 2010 ssue 237 Photo 3 This is the setup used for surface resistance measurements A second 9 V battery is used to build an ohmmeter and the test probe is made with a 1 cm wide header and two test pins gigaohms but this is not a surprise Even good antistatic bags are specified for typical surface resistance of 10 GQ per square In fact such bags have an inner layer with a far bet ter conductivity but this layer is wrapped between two Measured current Material Equivalent resistance between two electrodes 1 cm apart Greater than 900 GQ Classic plastic bag Less than 10 pA Greater than 900 GO FR4 Epoxy substrate Less than 10 pA 530 GQ Antistatic foam pink 17 pA Antistatic bubble wrap pink 42 pA 210 GQ Dry paper 70 pA 130 GQ Antistatic bag black 250 pA 36 GO Antistatic carpet 11 nA 820 MQ Table 1 Here list the surface resistivity of dif
165. the Chameleon DVD includes both AVRStudio and the Propeller tool chain Of course DVDs can get stale so you should check the Atmel and Parallax websites for the latest ver sions or go ahead and install the DVD versions and then update However you don t need these tools to get started Indeed you may never need them at all thanks to the third tool option Say hello to Arduino R WHO Most folks have probably heard mention of Arduino by now I just Googled it and got 775 000 hits and more than a few of them dealt with just how you pronounce the name I say R DWEE NO But for a little more international flair you might try R DO WEE NO trilling the R for extra credit Now that you ve got that let s try the latest Arduino board the Duemilanove 2009 Alto gether class repeat after me R DO WEE NO DO EH MEEL AH NO VEH On second thought you re prob ably better off heading over to the Arduino website www arduino cc and listening to the official pronunciation http arduino cc en uploads Main Arduino_Duemilanove wav Now that you know how to pro nounce Arduino look to the web site s homepage to find out what it is Arduino is an open source elec tronics prototyping platform based on flexible easy to use hardware and April 2010 Issue 237 Q m April 2010 Issue 237 File Edit Sketch Tools Help 6 BE E include lt
166. the ability to host three completely different soft ware regimes As you can see the secret to the Chameleon s versatility is that it combines two MCUs an Atmel AVR and a Parallax Propeller Note a ver sion with a Microchip PIC instead of the AVR is also available Along with the pair of MCUs there s an FTDI chip for USB host PC connec tion 1 MB of SPI flash for general purpose data storage and 64 KB of EEPROM for booting the Propeller That s twice the EEPROM the Pro peller needs so the extra 32 KB is available for your application The AVR 328P integrates 32 KB of flash 2 KB of SRAM and 1 KB of EEPROM along with a decent con sidering the limited pin count com plement of blue collar I O SIO PIO and A D Meanwhile inside the Pro peller you ll find eight count em 32 bit 20 MIPS cores each with 2 KB of local RAM and shared access to centralized RAM 32 KB and the chip s pins Neither of these chips is new to the pages of Circuit Cellar or Silicon Update readers I ve covered the AVR since the very beginning e g Not Your AVRage MCU Circuit Cellar 81 1997 as it s made good on the seemingly improbable proposition of introducing a new 8 bit architecture decades after the fact Now the AVR is a top contender and Atmel offers a vast stable of parts covering the spec trum from Pico to Mega More recently I covered the Parallax Propeller Turning the Core ner
167. their in system programming interface now have the ability to easily upgrade your application programs while still in circuit The hardware and programming flexibility of these new devices will find excellent usage in applications such as household appli ances health and exercise products household security indus trial control consumer electronics and car peripheral applica tions to name but a few SPUPC UART USB Analog Inputs s 12 bit Flash Program Memory EEPROM A EEPROM 8 Bit RISC CORE A e Wide Operating Voltage 2 2V 5 5V e Flexible Timer Modules e SPI I2C UART and USB external interfaces Max Operating Frequency 20MHz e High and Slow system clock 8 Industrial Specifications 40 C 85 C Multi function I O pins and LCD drive outputs dynamic switching High noise immunity and excellent e Fully integrated system oscillator Fast wake up function ESD protection Flash bei MCU Program Data Compa HT66F20 2 2V 5 5V 400KHz 20Mhz or 32768Hz 1Kx14 64x8 8 18 2 oee e a T SPI C HT66F30 gue Cathal SPI I C HT66FU30 2 2V 5 5V 400KHz 20Mhz or 32768Hz 2Kx14 96x8 64x8 22 4 vo vy 2 12 bik8 10 bit ETM V 4 2 UART HT66FB30 USB HT66F40 10 bit CTMx1 SPI I C HT66FU40 2 2V 5 5V 400KHz 20Mhz or 32768Hz 4Kx15 192x8 128x842 4 Vv v 2 12 bix8 10 bit ETMx V 8 2 UART HT66FB40 16 bit STMx1 USB HT66F50 10 bit CTMx2 SPI I C HT66FUSO 2 2V 5 5V 400KHz 20Mhz or 327
168. to achieve this The Sigma Delta architecture requires many samples CIRCUIT CELLAR e www circuitcellar com extending up to full count and the highest voltage The real transfer curve is going to deviate from this ideal curve It will not be O counts at O V and will in fact have an offset known Digital filter Integrator output Figure 2 This is a Sigma Delta ADC in order to construct the digital sig nal which can induce a phase delay that may be unacceptable to applica tions where minimizing phase delay is important Full scale error Full scale Non linearity error Ideal curve ADC Counts Corrected curve Real curve VFULL Scale Offset error Input voltage Figure 3 These are ADC error specifications Figure 3 shows an ideal transfer curve for an ADC Here we have a straight line starting at O counts at O V Ratiometric Ratiometric M as the offset error Conversely when the voltage is full scale the A D counts may not be full scale In that case we have a full scale error When designing embedded systems that use ADCs the manufacturer s datasheet will often denote the full scale and offset error These errors can typi cally be calibrated out with techniques that are well known Note that the ideal curve is a linear monotoni cally increasing function The real curve is indeed monotonic but is not linear The nonlinearity error becomes more difficult to c
169. tribution in total capacitance due to the internal capaci tance of the ADC is very small In this case the change in voltage of the charge capacitor will be very small by the relationship Q C x E An impor tant thing to remember is that when adding a capacitor to the circuit you are creating a low pass filter Therefore one needs to carefully consider where the corner frequency is set in the frequen cy spectrum as indicated in Figure 8 A good rule of thumb is to set the cor ner frequency to be one decade higher than the highest periodic waveform that may be encountered SAMPLING FREQUENCY This leads us to the next point in our discussion Where do you set the sam pling frequency If you are just taking a measurement from a sensor to put on display e g temperature it is not that critical where the sampling rate is set Simply sampling the data and dis playing it may not be a good idea since it is going to be noisy To cut down the noise try averag ing it or oversampling by at least eight and then filtering To get rid of the outliers throw out the highest and lowest values in the array You should also consider how you space those samples In a slow changing environment like temperature the samples could be evenly spaced with fairly wide spacing to minimize noise If you are trying to capture a sig nal that may change faster e g a fan speed you can still oversam ple but you would typically
170. u been to that fair I then devised a project around bit banging a melody out of a small microcontroller The user was responsi ble for choosing and programming the tune April 2010 ssue 237 N gt Command Length Type Description Reset 8 Bits Control Cancels any pending operation and returns the device to its default configuration Stop 8 Bits Control Halts the processing of any active audio command or phrase Set Duration 16 Bits Control Specifies the length of time the tone generator plays tones in response to Play Tone commands Play Tone 16 Bits Audio Instructs the tone generator to synthesize a tone at the specified frequency Mute 8 Bits Control Disables the speaker driver Unmute 8 Bits Control Enables the speaker driver Play Phrase 16 Bits Audio Retrieves and processes a phrase from external memory Set Volume 8 Bits Control Sets the volume level of the output Set Outputs 8 Bits Control Sets the state of the two general purpose output pins Play ADPCM 16 Bits Audio Sends 4 bit IMA ADPCM data to the audio processor Set Clock 8 Bits Control Enables disables the clock output CLKOUT and selects frequency 8 Bits Control Reserved Play PCM 16 Bits Audio Sends 12 bit PCM data to the audio processor Table 1 These are the
171. ue I described in my Colon top LED current Min 5 0 315 Rext Max 15 1 25 Rext Match resistors to 1 SDI LSB first SDO MISC Figure 1 The TLC5916 drivers maintain a constant direct current in each LED display segment Two discrete LEDs form the colon with each LED under program control o April 2010 Issue 237 Q e April 2010 ssue 237 i A Learn CPLDs SS the fun way with 24 the MACH64 This comp comes with everything you need to take you from mystery to mastery with CPLDs and programmable logic Learn to turn software into hardware PIC SERVO MOTION CONTROL controller chips controller boards Add USB to Your Designs Chips code protocols embedded US A COMPLETE wireless options debugging USB 3 0 and SuperSpeed FOURTH JAN AXELSON Seid an too USB Complete The Developer s Guide Fourth Edition Jan Axelson ISBN 978 1 931448 08 6 54 95 Lakeview Research LLC www Lvr com By the author of Serial Port Complete LCD Module dl LT 2 WA 8 10 cafe co o E zZ ra AAN Light sensor H VCC A J2 El D774 RS 3 PWM5 7f Datastream HLD 5_ PWM3 a o co ro ge OlEI CJE Ma Kalo IN INTIS INIA ji Ribbon cable to WWVEB receiver VCC Choose sense resistor to match mid to dim R1 light conditions Photocell 1000 AINO 3 used as digital output O O O
172. ur low price and save big 86 571 86795686 sales pcbcore com www pcbcore com 43 78 plus S amp H FRONT PANEL www frontpanelexpress com EXPRESS 206 768 0602 CIRCUIT CELLAR e www circuitcellar com SPI 1 C UART INTEGRATES AN OSCILLATOR AND SAVES SPACE The MAX3107 is the industry s lowest power fastest and smallest serial UART to communicate over an SPI I C interface The device s fast data rates 24 Mbps and deep FIFO 128 words allow additional buffering and thus relieve demand on the system s microcontroller The MAX3107 also offers an industry first an integrated oscillator that reduces BOM cost by an aver age of 20 The device s PLL clock divider prescaler and fractional baud rate generator allow the ultimate flexibility in high resolution baud rate program ming The baud rate is no longer dependent on the frequency of the reference clock but it can be set independently to meet system needs The MAX3107 uses multiple operational modes to lower power consumption The Sleep mode turns off all UART related on chip clocking while the Shutdown mode turns off the chip complete ly In Auto Sleep mode the device automatically enters Sleep mode after a period of no activity on its I O pins The device automatically wakes up when activity is detected on any input pin The device operates from 2 55 to 5 6 V and is fully specified over the industrial 40 to 85 C temperature range The MAX3107
173. using a batch oven or a bread toaster you need to make the temperature as close as possible to the manufac turer s recommended profiles I used the recommended pro file for Kester R276 solder paste as a basis for my tempera ture control procedure Photo 2 shows the ideal profile compared to the results I measured from the toaster You can see how close I was to the ideal profile even with a simple algorithm I didn t even consider PID because the difference from overshooting was not enough to cause any problems in a Photo 1a l used a small bread toaster with a temperature controller on the side b This is a close up view of the controller boards with the display c This is a logic board with a Luminary Micro LMS5102 and Maxim Integrated Products MAX6675 thermocouple interface chip CIRCUIT CELLAR www circuitcellar com Photo 2 This screen capture shows the ideal profile red and measured temperature green the soldering process I first got the toaster to stabilize the temperature around 80 C to get the sys tem to a point where most of the ther mal inertia was gone After that there were the usual phases for soldering pre heating soaking reflowing and finally cooling All the steps of the profile were reproduced nicely but they took a little CN3 Type K Thermocouple PAO UORx PAT UOTx PA2 SSICIk PAS SSIFss Figure 1 The design is built around an LM3510
174. ust what it conveys valu able insight by explaining how and why In addition to all the tools involved i e Arduino AVR and Pro peller the DVD is crammed with extras including a compendium of related application notes handy utilities and even a BASIC compiler m N With something for Arduino ites Propeller heads and AVR freaks Chameleon lives up to its name by being able to change its appearance at will It s got something for everyone and everything for someone and maybe that someone is you lkl Tom Cantrell has been working on chip board and systems design and marketing for several years You may reach him by e mail at tom cantrell circuitcellar com REFERENCES 1 TRS 80 org Dr Dobb s Journal www trs 80 org dr dobbs journal 2 Arduino homepage www arduino cc SOURCES Arduino single board computer Arduino www arduino cc AVR MCU and AVRStudio Atmel Corp www atmel com Chameleon single board computer Nurve Networks LLC www xgamestation com Propeller MCU Parallax www parallax com NEED TO KNOW INFO Knowledge is power In the computer applications industry informed engineers and programmers don t just survive they thrive and excel For more need to know information about topics covered in Tom Cantrell s Issue 237 article the Circuit Cellar editorial staff highly recommends the following content Game On by Tom Cantrell Circui
175. valuate the Linx product of you choice and implement it in record time COMMAND CONTROL KEVLESS ENTRY ANTENNAS FROM WHIPS TO CHIPS 600 736 6677 155 Ort Lane Merlin OR 57532 iy EL ey TECHNOLOGIES linxtechnologies com www circuitcellar com CIRCUIT CELLAR OD oon EIC mier ev A Y NEED TO KNOW INFO Knowledge is power In the computer applications industry informed engineers and programmers don t just survive they thrive and excel For more need to know information about topics covered in Jeff Shoemaker s Issue 237 article the Circuit Cellar editorial staff highly recommends the following content ADC and DAC Bandwidth by Ed Nisley Circuit Cellar 185 2005 What happens when analog input frequency exceeds an ADC s ability to handle it Ed presents a low frequency sampled data circuit Topics ADC DAC Sampled Signals Bandwidth Go to www circuitcellar com magazine 185 html DMX 512 Control Build a USB to DMX 512 Converter by Stefan Kalbermatter Circuit Cellar 170 2004 Need a lighting controller Try a USB to serial converter chip to achieve DMX 512 control Topics Converter DMX 512 USB Datastream Go to www circuitcellar com magazine 170 html BGA amp QFN Sockets Quick Turn Custom Designs e Bandwidths to 40 GHz e Industry s Smallest Footprint e Five different contactor options e Ideal for Prototype and Test e BGA and QFN e Simulation Models Available
176. ver they needed to but it required extra circuit ry complicated the software running on each node and introduced increasing time delays for slave nodes sending messages to the master node My ultimate solution was to build a six port RS 485 hub that implemented my Halloween net work packet system and allowed me to greatly simplify the wiring of the nodes The design cri teria included writing as much code as possible in TX_HOST DATAO 7 DBG Interface hub has six ports on the PCB building a device that has its own power supply in the case no wall warts and building a device that is small and professional looking Did I suc ceed Let s find out CIRCUIT DESIGN Like everyone else who does this kind of stuff I have my personal favorite processors My processors of choice are ADDR O 2 PAO TOIN PA1 TOOQUT PA2 DEO PA3 CTSO PA4 RXDO PA5 TXDO PA6 SCL PA7 SDA PCO T1IN PC1 T10UT PC2 S3S PC3 SCK PC4 MOSI PC5 MISO PC6 T2IN PC7 T20UT DATA_AVL DATA_RCVD PBO ANAO PDO PB1 ANA1 PD1 PB2 ANA2 PD2 PBS ANAS PD3 DE1 PB4 ANA4 PD4 RXD1 PB5 ANA5 PD5STXD1 PB6 ANAG PD6 CTS1 PB7 ANA7 VREF AVDD VDD VDD VDD VDD Lo T AVSS GND Power supply test points GND GND 2 1 co Pose 3 3V e ADJ GND 0 01u o otu 100u i Tale Figure 1 This is the 28 portion of the Serial Network Hub It manages all the C minimizing the number of UART chips the packet buffering and communication
177. will wait for instructions from an MCU unless it is in standalone mode Assuming standalone mode the KX1400 will then retrieve the address of its first phrase from a list of up to 4096 jump vectors at the beginning of the external EEPROM device Note the word phrase is used here to indicate a set of commands You may simply want to play a PCM file To do this you might use a sin gle phrase see Table 2 If you are using the large 24 bit address format a single jump vector in the first 3 bytes of the EEPROM will point the KX1400 to the fourth byte where it would find an Unmute command followed by a Play PCM command holding the first 12 bit PCM value in the fourth and fifth bytes of the EEP ROM The sixth and seventh byte would hold the next Play PCM command holding the next 14 bit CIRCUIT CELLAR www circuitcellar com VDD vss H2 OSC1 RAS RAO OSC2 RA4 RAI MCLR RAS RA2 NT RCS RC4 RC1 RC3 RCS RB4 SDI RC7 SDO RB5 RX RB7TX RB6 SCK PIC16F677 2 CLKOUT MODE VDD SPO RST BUSY RDY 25VF016 MISO POS PO4 POS GND SO PO F WPYACC 25FL128 Figure 2 This project uses a microcontroller to access a KX1400 and associated EEPROM to play prerecorded audio files of favorite storybooks Each story is divided into separate page files that are selected by the user PCM value and so on until the file s end is reached The final command might be a Stop command to s
178. y stories and pages there are in the playlist Although I could use some of the extra I O pins to allow configura tion inputs it would be nice to have all of this work automatically and I d like to be able to use write a more generic application I already chose a second generation design configura tion It features a long clipboard to hold the book with the electronics built along the bottom of the board This would provide a larger area for a better speaker and it could use a thumb drive for the audio files The KX1400 can be used without an external EEPROM as long as the microcontroller can keep feeding it the audio commands samples fast enough The thumb drive could in fact hold a configuration file making it all work automatical ly Hmm Keeping the external EEPROM might work into this scheme as well Without the thumb drive attached the external EEPROM could hold the basic instructions and sound effects as well as a starter story I AS April 2010 ssue 237 could then use the thumb drive specifically for audio clips Now for the rest of the story that I started at the beginning of this article Merlin s solution made the king very happy Even when he was away slaying drag ons the children of the kingdom were comforted by the sound of his royal voice reading their favorite bedtime stories Everyone in the kingdom slept happily ever after il Jeff Bachiochi pronounced BAH key AH key has been writi
179. year s Conference Program includes more than 40 Technical Sessions in 8 Tracks covering e Energy Harvesting e MEMS amp MCUs e Low Power Sensing e Monitoring Tools amp Applications e Wireless Networking e Novel Approaches to Measurement e Bio Sensing e Power Smart Grid Monitoring Control Co located with the Learn today Design tomorrow Sensors Expo brings together the largest and best in class showcase of sensing technologies and systems for attendees to evaluate and make Chicago June 8 9 2010 informed decisions Register today at the Early Bird rates amp save up to 200 on your Conference Pass To register visit or call 877 232 0132 or 972 620 3036 outside U S Use prize code and enter to win an iPod Touch PRODUCED BY OFFICIAL PUBLICATION SILVER SPONSOR MEDIA SPONSOR QUESTEX Sensors M EPSONTOYOCOM CIRCUIT CELLAR O N April 2010 ssue 237 parameters The software is simple and gets the job done see Listing 1 As engineers we should always try to get a job done as cheaply as possible while still respecting safety requirements and performance specs Code aesthetics should not be your main concern The LCD controller does not have a character generator so I made a RAM buffer for the entire display and downloaded the changes to the LCD controller once for each 250 ms main loop cycle There is plenty of time to spare while the CPU is just waiting for the next temperature reading Keep

Download Pdf Manuals

image

Related Search

Related Contents

Yosemite Home Decor MAG1512 Installation Guide : Free Download, Borrow, and Streaming : Internet Archive  工事関係提出書類作成手引きのダウンロードは、こちらから  Fellowes Quasar-E 500 Electric Comb Binder  reglement de consultation valant avis d`appel public a la concurrence  Universal Air-Conditioner Remote  www .vtec.fr  Consulter  Mitel 6863i SIP Phone Release 4.1.0 User Guide  Hermetic Oxy Gas Sampling Device User Manual  vege fertilor-1.pub  

Copyright © All rights reserved.
Failed to retrieve file