Home

ANALOG TECHNIQUES

image

Contents

1. i ete mess DIXYS CRO CTRONICS i i M al Si quus T N d 2 SURGE MONUN Leading Innovation gt gt gt E freescale Analog Power Supply ans 5 Power Management Devices A NI EC POWER atti ce www mouser com freescale a amp The ONLY New Catalog Every 90 Days CYPRESS 2 freescale Actel SILICON LABS RER FORM M 1 N Experience Mouser s time to market advantage with no minimums and same day shipping of the newest products from more than 390 leading suppliers E Yas AX CEL C hi TECHNOLOGY 5 N 9 THE I O INTERCONNECT SOLUTION California Eastern Laboratories AV a cTe TE C H N O L O G l E S gp A FERICOM smsc Central EPSON nabling Serial Connectivity qu CRC ES se Y De SIGH Uca he eda 2 Yo Jii 2 TNT Z O g ISSI 2 4 Ba Cmm RN WJ is Now mu of minii EA T f tel fuse ENPIRION i Expertise Applied Answers Delivered a tti company The Newest Products 3 For Your Newest Designs www mouser com Over A Million Products Online 800 346 6873 Embedded Single Board Computers 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 12K LUT customizable FPGA Internal PCI Bus PC 104 connector 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 pt Sleep mode uses 200 microan w option
2. NMS uses this MIB again at the other end of the network is responsible for exchanging data packets with the NMS Each packet contains an SNMP message holding compressed data The agent decodes an SNMP Get message as a request for data grabs the requested data and encodes it into an SNMP Response packet Or if the decoded message is an SNMP Set message the agents store the data at the appropriate location and return an SNMP Response message indicating the status of the request At the NETWORK MANAGEMENT The management of networks refers to the activities methods pro cedures and tools used in the opera tion administration maintenance and provisioning of networked sys tems Keeping tabs on managed devices such as servers routers and switches gives IT personnel a way to monitor a network s health But today the SNMP goes beyond the task of network welfare The SNMP has found its way into managed device the MIB allows the SNMP agent to know all about the data it will be working with The Listing 1 The read only object upsIdentManufacturer is a string of up to 32 characters that will contain the name of the UPS manufacturer upsIdent OBJECT IDENTIFIER upsObjects 1 upsIdentManufacturer OBJECT TYPE SYNTAX DisplayString SIZE 0 31 MAX ACCESS read only STATUS current DESCRIPTION The name of the UPS manufacturer upsIdent 1 Got Serial ELECTRONI
3. 1 for square wave FSK data instead of the three step wave form to feed the filter and 1 for FSK sine wave output The PSoC internal main oscillator is accurate to 42 5 over the full range of voltage and temperature While this is good enough for UART communications the HART standard requires 1 frequency accuracy This require ment is met using the PSoC s 32 768 kHz external crystal oscillator with phase locked internal main oscillator Resource utilization boils down to the required d istortion Digital Analog Current Distortion blocks blocks mA Square wave 3 0 0 1 Square wave 3 2 1 3 1 Filter 3 Step 0 1 3 Step Tad 1 Filter 3 Step 2 5 2 Filter Table 1 Increasing the digital waveform complexity and adding filter sections yields steadily lower distortion www circuitcellar com CIRCUIT CELLAR Figure 10 The final filtered output of the FSK generator driven by alternating 1 and O data shows a clean waveform and smooth phase transitions when the data changes The granularity of the sine wave is a function of the scope resolution not the generated signal level with options summarized in Table 1 SOFTWARE The entire code to operate the FSK modulator is listed below in C Counter freqO Start Counter freql Start PWMDB8 Start BPF2 Start MEDPOWER LPF2 Start MEDPOWER Starting and stopping the modulator output is done by con trolling the PWMDBS Enabl
4. GPS Device known New config parameters Update config parameters No Yes Able to read GPS Desirable GPS sentence Yes No Yes No No GPS Device attached Able to open GPS device No Yes Configure GPS TTY Port No GPS Device GPS Device now known Record position Modem Modem still Something to Correct known Yes available Yes read Yes gt password Yes No No No Send SMS with position Modem attached Yes Yes GPS Device now GPS Device not Send one No known known power up SMS CIRCUIT CELLAR www circuitcellar com After pulling the NSLU2 out of the box the network param eters and administrative pass words need to be configured Then you must put the NSLU2 into Upgrade mode by holding in the Reset button requires a paper clip for approximately 10 s and pressing releasing the Power button once In Upgrade mode either Sercomm s Win32 tool Windows or UpSlug2 Linux can be used to transfer the SlugOS image and re flash the firmware on Mozilla Firefox oe pm 4 File Edit View History Bookmarks Tools Help Q X 4 Lj http v92168 100 4 Most Visited 4 Getting Started a Latest Headlines http 192 168 100 4 x RainShadow Tech Mobile GPS Locator Mon Dec 15 21 39 33 UTC 2008 6 CONFIGURATION PARMATERS Baud rate for modem 4800 Enable SMS send at
5. Microcontrollers in C Exploring the PIC32 Lucio Di Jasio F Leaming to Fly the PIC 24 asit Byh Martin Bates By Lucio Di Jasio By Dogan Ibrahim 687096 ISBN 9780750689601 ISBN 9780750682923 ISBN 9780750686112 39 95 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 ob ee Receive our best discounts Hear about books before they publish Newnes ahaha ii Access to free sample chapters video tutorials and more EN e CIRCUIT CELLAR e www circuitcellar com PROPELLER PROTOTYPING SYSTEM Parallax has partnered with SchmartBoard to create an easy Propeller prototyping system in the form of a kit The P8X32A Q44 SchmartBoard Kit part number 27150 allows you to easily work with the surface mount Pro Deller chip This kit is a perfect starting point The SchmartBoar d technology makes surface mount soldering easy Once completed the board will host the powerful microcontroller on this convenient development platform allowing access to all 52 I O pins of the multicore chip The kit includes surface mount and through hole package types for some components offering a soldering choice and challenge The kit features the Propeller PBX52 Q44 microcontroller along with header sockets for easy access to the Propeller I O pins Also included is 512 KB of EEPROM for program and data storage 5 5 and
6. 39 99 is a very easy to use and low cost module capable of sending serial data wirelessly between microcontrollers or to a PC The low power consumption makes this module ideal for use in battery powered applications This module sends and receives data by AM or CPCA modulation thus offering a higher average output power which extends its range This module is equipped with an RSSI feature that can be utilized to improve power efficency by waking up circuitry only when an external signal is detected Features e High speed data transfer rates 200 9600 bps SIP header allows for ease of use with breadboards Compatible w many microcontrollers including the Propeller chip and BASIC Stamp modules PP34LL ACA Power down mode for conservative energy 433 MHz usage longer battery life RF Transceiver Line of sight range up to 2500 feet REV A depending on operating conditions 27982 Application Ideas www parallax com Remote controlled Boe Bot robot Wireless data acquisition Remote signal beacon for adventure seekers Remote industrial monitoring Lighting control Keyless entry To order the 433 MHz RF Transceiver visit www parallax com Or call the Parallax Sales Department toll free 888 512 1024 Monday Friday 7 a m 5 p m PT www parallax com Prices subject to change without notice BASIC Stamp and Boe Bot are Friendly microcontrollers legendary resources registered trademarks of Parallax
7. e WWW circuitcellar com The Next Generation of In Circuit Debugging QUY Q Q za v D Q Py v QAO EE The NEW MPLAB ICD 3 MPLAB ICD 2 RECYCLE The MPLAB ICD 3 In Circuit Debugger is Microchip s most cost Return your old MPLAB ICD 2 and effective high speed debugger for Microchip Flash PIC Microcontrollers receive 2596 off the new MPLAB MCU and dsPIC Digital Signal Controller devices It debugs and ICD 3 MPLAB REAL ICE or PICkit 3 programs PIC MCUs and dsPIC DSCs with the powerful yet Debug Express For more easy to use graphical user interface of MPLAB Integrated Development information on this offer please Environment IDE visit The Microchip name and logo the Microchip logo MPLAB and PIC are registered trademarks of Microchip Technology Incorporated in the U S A and other countries PICkit is a trademark of Microchip Technology Incorporated in the U S A and other countries 2009 Microchip Technology Incorporated All Rights Reserved T Mienocur ILhank Gateway to Elmctranics MP3P DIY KIT Do it yourself Include Firmware Full source Code Schematic Powertul 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 Stere
8. 699 USB2 0 speed 16 bit digital pattern or arbitrary waveform generator Log and display temp hum volt event time or pulse counting data Dropin solution connects PC to I2C SMBUS 32 I O lines 89 Keyboard Simulator USB board adds 55 I O and 5 x 10 bit A D inputs 1 x 10 bit analog O P NET Board 5022S PDS6062T H 2 ch 1GSa s 25GSa s equiv 50 100 MHz scope 595 795 PD Pen Scopes 1022MN HDS2062M 23 10 25MHz USB powered scope in a probe Up to 100MS s 234 369 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 sampling memory 279 USB12 480 500AG Wave Xpress Versatile USB 2 0 I2C protocol exerciser and analyzer Multiparameter Loggers Mini logger with built in temp hum pressure 3 axis accel sensors FTDI USB ICs USBI2CIO Popular UART and FIFO chips Upgrade Legacy designs to USB Instant Ethernet PoKeys55T No OS needed TCP IP offload ICs improve system performance Scope Analyzer DS1000E 25MHz 2 ch 16 logic scope and logic analyzer 1195 XP Emb Touchpanel 104 PS2105 N PS Windows PC LX800 512MB 4GB Ethernet 3xUSB SD Mephisto 100MHz Scope Spectrum Logic Analyzer and Signal Generator 1259 SPI Bus Analyzer wa Protocol exerciser analyzer for standard SPI andnon standard 4 wire and 3 wire seria
9. CAPP1 VDDINLCD VDD3V6 VDDLCD VDDCORE ERASE UUUUUUUU 6266606262602 0 a O OA v Q C102 ZZZzz Hd gt DPPP NZZ O OUOUCUU U lt WN 0O4 O ZU DA m OQ TI Figure 1 On the outside the HP20b looks like a normal calculator But when you look inside you see a very open platform The ARM under the Bakelite is yours to reprogram as you see fit play test your progress There are four other unused pads Let s review One pad is a spot for an optional crystal You need to connect a 32 kHz crystal if you are trying to develop an application that needs a real time clock or serial communications that have to be spot on with no allowance for speed drift Because the HP 20b does not have the cr ystal mounted by default the serial com munication speed setting is not accurate It is based on the master EN e clock so it is dependent on the slow clock which is inaccurate if you don t use a crystal Thus if you want to send serial data you must set the serial speed parameters for each calculator to a value that works with its specific master clock speed The other alternative is to create a communication protocol that auto matically detects and tunes the speed parameters This is what Atmel did in the SAM BA boot The PC program sends known data con tinuously until it receives a response The system tracks the received data and calculates its speed based on it So
10. Lips 400 MHz PowerPC Ultra Reliable w 128MB ECC RAM with Floating Point Unit POE ready a Dual execution unit double precision FPU a Multifunctional PC 104 connector 12K LUT customizable FPGA 512MB NAND Flash 1 USB Host 1 USB Device 12 Mb s Boots Linux 2 6 in lt 2 seconds Fanless 4W sleep mode 1mW Regulated 5 28V power input 2 10 100 ethernet 2 SDHC sockets 4 COM ports a 5 10 bit ADC SPI amp DIO a RTC amp WatchDog RS485 RS422 a 2 DMX Channels shown w optional SD Card AR E EL T echnologic We use our stuff Visit our TS 7800 powered website at www embeddedARM com November 2009 Issue 232 by Noel Rios Energize a Circuit An Innovative Switched Mode Power Supply Design Energy control is an essential aspect of many electronic applications If you build a switched mode power supply SMPS you can regulate a design s current to meet your specific project goals ost engineers technicians and designers need power supplies for energizing their cir cuits Do you You can use a power supply instead of batteries If portability is not a requirement a power supply is a viable alternative to batteries because it costs less to use It s nice if you can adjust the volt age but it is even better if you can also modify the current The switched mode power supply SMPS I recently designed enables you to adjust the voltage from 0 to 20 V and the current from 0 to 1 A see Photo 1 You c
11. N November 2009 Issue 232 TOUCH AND MOTION SENSING USB STARTER RIT The MPLAB Starter Kit for PIC18 Microcontrollers part number DM180021 contains all of the components docu mentation schematics debugging and programming capa bilities needed to evaluate the high performance PIC18 8 bit microcontroller MCU family in low power USB and touch sensing applications The kit includes a development boar d featuring a 44 pin PIC18F46J50 MCU mTouch capacitive touch sensing accelerometer 64 KB flash program memo ry and much more T a it MPLAB Starter Ki MPU for PIC18 Hardware debugging and programming come integrated with the kit meaning an additional debugger or programmer is not required The kit is completely USB powered so a separate power supply does not need to be purchased Fre programmed touch sensing code as well as a free USB application stack and bootloader eliminate the need for engineers to develop their own code Additionally the board includes demo application software that enables it to read from the memory card MSD or function as a USB mouse or joystick HID or a simple COM port CDC By simply scrolling through code options using capaci tive touch buttons you can demonstrate the FIC18 MCUs with a MicroSD memory card potentiometer acceleration sensor and OLED display The Starter Kit includes the BMA150 digital triaxial accelerometer which enables the board to detect acceleration i
12. Then I incre ment the input index to that array When the index is past the end of the array I reset that index to the star t of the array This manages the rolling over of the indexes and creates a circu lar never ending buffer to the data Lines 98 104 define the variables I think I ll need to detect the peaks and valleys Think about this you will only know the peak or valley conclu sively after you ve passed it In the case of a valley once the input data starts increasing you re then sure you ve got a valley So I declared these variables to help with the process of detection Routine FindA2DZero contains all the code to detect a valley and retur ns a Yes or No to report the results The same with FindA2DPeak There are two additional routines Wa i A2DZero and Wai tA2DPeak that wait for a valley or peak respectively So here are all the A2D routines I need to do the job I hope Actually I m sure I ll need more and the ones I defined here will change Step back and take a look at the routines What other variables might be needed W ell the timestamp variable needs data from the CPU timer and the A2D of course needs to manipulate the A2D hardware in the CPU But other than that this module stands alone I know I ll need to report the actual peaks and valleys I ve detected along with their timestamps But perhaps I could put the code that uses these values in this routine to also cut down on par
13. This means that at 9 um you have 0 000354 which will be displayed as 0 0004 and 10 um will also be displayed as 0 0004 Thus we have a loss of resolution in the English units I ve run into this problem before It is even more pro nounced when converting tempera ture units of Celsius to Fahrenheit For example 25 1 C converts to 77 1 F while 25 2 C converts to 77 4 F If you are trying to display 0 1 F you have a real problem For my application I can live with miss ing a few ten thousandths of an inch This also falls within the accu racy of the system There was one calibration that had CIRCUIT CELLAR www circuitcellar com Are you up for i 9V What is the missing ANNAN component 8c f Industry guru Forrest M Mims Ill has created a stumper Video game designer Bob Wheels needed an inexpensive counter clockwise rotation detector for a radio controlled car that could withstand the Jric busy hands of a teenaged game player and endure lots of punishment Can you figure out what s missing Go to www Jameco com unravel to see if you are correct and while you are there sign up for our AMECO ELECTRONICS 1 800 831 4242 free full color catalog t f f l i Tal Eiei L i i iil a t i P E n i f s Ls a D bs of rud Ne i WS P A xr ht b m ve E Tis nas QN NE s it 4 i D 3 E o E d P Te A y B NI t j au r EX L3 ud
14. is an electronics design engineer who has worked with various semiconductor and electronics companies like Microcircuits IMI Allegro ASTEC Stratex Inno vatronix Applied Systems and Micrologic His interests include computers embedded control power conversion GFIB control and testing and measurement Noel accepts C firmware development work and subcontractor jobs that involve the 8051 and 8051 derivatives digital circuits and analog circuits p PROJECT FILES To download the code go to ftp ftp circuitcellar com pub Circuit_Cellar 2009 232 S OURCES DS89C430 Microcontroller Maxim Integrated Products www maxim ic com direct MC34072 Op amp ON Semiconductor www onsemi com TL494 PWM Control circuit Texas Instruments Inc www ti com November 2009 ssue 939 UJ Nn qu cA JAARUCH MS November 2009 Issue 232 by Carl Stoesz Precision Linear Encoder Display Linear encoders are essential parts in many industrial automation applications Here you learn how to mount an optical linear encoder to a metal lathe used to create small precision parts A few affordable parts and some C code enable you to transmit vital displacement and speed data to an LCD manual 7 metal lathe is ideal for creating small precision parts However a manual lathe does not come with any means of measuring the shape of a part while it s being worked Typically the machinist must measure cut remeasur
15. privately owned receivers located seemingly everywhere picked up the beacon and forwarded the car s location to the Internet By tapping into the APRS network or using a publicly available website I could view the car s location and even its path over the pre vious 24 hours on Google maps This worked well But due to the cost of all the com ponents including the radio radio installation antenna mount antenna electronics to modulate the digital data and the smart controller to turn on off the radio it wasn t the most affordable solution and it requires a ham license When searching for commer cial vehicle tracking solutions I typically found expensive hardware service contracts fairly high monthly fees and devices that were not particu larly versatile At one point I Photo 1 The assembled vehicle locator includes a Linksys NSLU2 USB Network storage link a Motorola G5M phone and a Deluo U5B GF5 device CIRCUIT CELLAR www circuitcellar com stumbled across an inexpensive GPS GSM modem targeted at just this type of appli cation However its fixed set of features and inability to enable custom processing were shortfalls After experimenting with embedded USB controllers for a while I finally determined that an off the shelf Linux solution would be far cheaper faster to prototype and easier to modify than microcontroller code Instead of develop ing and fabricating a custom solution for
16. the O 22F supercap located on the For instance I could clearly see the difference in gain and directionality as I tried each antenna by observing the brightness of the LED as I varied the dis tance and orientation And indeed as advertised the Yagi and patch antenna were quite sensitive in this regard But I also deter mined that calling the dipole antenna omnidirec tional was a bit of an overstatement as there were clearly observable dead zones i e positions and orientations where power delivery was somewhat attenuated That s not a knock on PowerCast just RF reality This has implications for mobile applications namely you wouldn t be able to presume continuous i e unin terruptable power in a mobile application without care fully considering limits on the orientation Chances are you d need to incorporate back up power e g battery or supercap or alternatively a multi transmitter array arranged to cover all orientations Of course the same caveat applies in an environment with transient obsta cles e g people walking around Another interesting phenomenon I noticed was that power delivery seemed non monotonic relative to range For a given orientation you d expect the LED would brighten dim directly with changes in distance But I noticed as I increased the range the LED would dim and then brighten a bit before becoming yet dimmer This is likely explained by multipath phenomenon Since this tra
17. vehicle tracking I used an affordable off the shelf Linksys unit I found on the Internet to construct a highly versatile easy to configure embedded Linux based vehicle locator In addition to a 5 V power supply three devices connected with USB cables complete the setup a Linksys NSLU2 USB Network storage link i e a network attached storage or NAS device a Motorola V195 prepaid T Mobile GSM phone and a Deluo USB GPS device see Photo 1 SYSTEM OPERATION Although my design is simple it achieves its objec tive It has three primary features One every time my car starts the design sends an SMS message to a default phone number with a Google Map link to the car s cur rent location Two if the car is running I can locate it by sending an SMS message with a password from any phone When the unit receives the SMS message and v er ifies the password it responds with a Google Map link that indicates the car s current location Three I can modify basic configuration parameters using a network connection and an Internet browser Configuration param eters include the default phone number to notify me via an SMS message when the car star ts the ability to enable or disable start up SMS notifications and the ability to set the authorization password for SMS location requests When using an Internet connected phone such as an Apple iPhone or Google gPhone it is quick and easy to read the SMS message You can then
18. while a scope typically has five to eight digits of resolution An added bonus is that counters start at a much lower price than scopes Thus counters are viable solutions in applications such as timebase calibration oscillator development test ing and clock signal accuracy testing A counter s high accuracy and high resolution also make it a powerful solu tion for high precision digital signal propagation delay measurements Only counters provide accurate measure ment resolution down to nanosecond and even sub nanosecond levels This level of resolution is required for measuring the propagation delay of a cable solder run high speed digital logic circuit or any combination of the three How short of a delay time can counters accurately resolve The answer depends on multiple factors such as the frequency and accuracy of the counter s timebase www circuitcellar com CIRCUIT CELLAR whether statistical calculation can be employed and more In this article I ll describe how a counter makes a signal path delay measurement the level of precision possible with a counter and how to maximize it I also explain how to identify and eliminate error in your measurement setup TIME INTERVAL MEASUREMENTS You can measure propagation delay using a counter s time interval measurement feature A time interval meas urement is an elapsed time measurement between some start event and some stop event It is comparable to using a st
19. C if you want to develop your application on a PC Although this is not a necessity doing most of your appli cation development and debugging on the PC can greatly simplify and speed up the process Let s assume that you will use HP s advised setup JTAG IAR and Visual C Files called HP20b_c exe and at91sam71128 flash bin are included in the SDK package This is the application example PC and tar get versions created by HP in order to provide a good starting point for custom application development This is a simple guess the number application with a number between 0 d Qo and 10 000 The number keys enable you to enter a number Input is used to find out if the number to guess is larger smaller or if you won The Backspace key is used to erase the last digit entered The On key is used to cancel an entry or a game The framework provided by HP includes all the drivers and initial ization as well as the power man agement Within this framework your main application function is the KeyPress function called each time you press a key Key codes are given as a two digit integer yx where y is the row of the key and x is the col umn For example the open paren thesis key keycode is 32 The second function that you need to provide is the init function which is called when the memory is erased or reset In this framework your application is implemented as a kind of state machine that upd
20. Driver Library framework has been used to develop a number of sample applications for the LPC35141 OEM board Included in the kit are an LPC5141 OEM board an LFC51 xx base board v2 0 a USB cable and a headset with microphone Also included is a serial number that gives you access to the support site The developer s kit costs about 260 Embedded Artists AB www embeddedartists com COST EFFECTIVE TWO CHIP PLATFORM FOR SMALL ENGINES Faced with world wide emissions regulations and rising gas prices the small engine market is migrating from mechanically carbureted systems to cleaner more efficient electronic control and electronic fuel injection T o address the global need for these eco friendly designs the MCZ33812 combined with a 16 bit MCU provides a cost effective platform solution that s ideal for small engine control A reference design consisting of the MCZ255812 an advanced analog integrated circuit optimized to control fuel and spark in EFI and electronic carburetion e carb systems and a Freescale 512 MCU is now available This comprehensive small engine control platform helps lower harmful emissions and reduces system complexity bill of materials and manufacturing cost while accelerating time to market The device combines a voltage regulator fuel injector driver and ignition pre driver as well as a relay and lamp driver a watchdog timer and a reset generator all optimized for small engine control This exceptional
21. FSK Generation Dennis Sequine TASK MANAGER You re Covered C J Abate LESSONS FROM THE TRENCHES Passing Parameters George Martin SILICON UPDATE Power Pitcher Wireless Power on a Microelectronic 5cale Tom Cantrell FROM THE BENCH Device Management PRIORITY INTERRUPT S O Monitor Networked Devices Via SNMP beenden Jeff Bachiochi Sieve Garcia CIRCUIT CELLAR www circuitcellar com Se mb 2009 Issue 239 Hammer Down Your Power Consumption with picoPower THE Performance Choice of Lowest Power Microcontrollers Performance and power consumption have always been key elements in the development of AVR microcontrollers Today s increasing use of battery and signal line powered applications makes power consumption criteria more important than ever To meet the tough requirements of modern microcontrollers Atmel has combined more than ten years of low power research and development into picoPower technology 41 LA vw picoPower enables tinyAVR megaAVR and XMEGA microcontrollers to achieve the industry s lowest power consumption Why be satisfied with microamps when you can have nanoamps With Atmel MCUs today s embedded designers get systems using a mere 650 nA running a real time clock RTC and only 100 nA in sleep mode Combined with several other innovative techniques picoPower microcontrollers help you reduce your applications power consumption without compromising system performance Visit o
22. Figure 2 Counter_freq1 divides the clock source to provide a fixed multiple of the output frequency at the logical 1 frequency 160 x 2 200 Hz or 352 kHz Counter freq0 divides the clock source to provide a fixed multiple of the output frequency at the logical O frequency 160 x 1 200 Hz or 192 kHz E November 2009 Issue 232 The PWM divides the summed output of Counter_freq and Counter freq0 by 160 to provide a wavefor m at one or the other of the signaling frequencies The PWM a counter with a controllable output pulse width has a 50 duty cycle in order to guarantee a square wave to minimize even har monic distortion The remaining trick comes in picking which frequency is transmitted The enable inputs of Counter freq1 and Counter freq0 are driven by the common data signal T ypi cally this comes from a UART clocked at the baud rate Counter freql is enabled when the data input is high Counter freq0 has its enable input inver ted so that it runs when the data input is low and stops when the enable input is high With one of the counter enables inver ted when the output of one counter is toggling the other is static The outputs are added together with an exclusive OR gate When one input is low and static the output follows the other toggling input When one input is high and static the output is inver ted from the toggling input Thus when one of Counter freql or Figure 1 The FSK waveform encodes digita
23. Inc Parallax and the Parallax logo are trademarks of Parallax Inc CIRCUIT CELLAR THE MAGAZINE FOR COMPUTER APPLICATIONS E SAG by Neil Forcier Measuring Propagation Delay with a Universal Counter Have you lost interest in universal counters It s time to reexamine their use value in comparison to more expensive oscilloscopes This article details how a counter makes a signal path delay measurement the level of precision possible with a counter and more You ll also learn to identify and eliminate error in your measurement setup ver the past couple decades many engineers have lost interest in using universal counters for signal timing measurements e g period pulse width and rise fall time because they prefer the more visual features of an oscilloscope They would rather see a visual display of the signals they are trying to characterize than a digital display of a long sequence of numbers that can change to a totally different value with a slight adjustment of a single setting Not to mention that the measurement capabilities of a scope go much further than just timing Scopes often provide features that allow engineers to decode digital pro tocols and capture nonrepetitive signals for example The main advantage that counters still hold over today s typical scopes is the ability to make high accuracy and high resolution time measurements Typically a quality counter offers 10 to 12 digits of resolution
24. Le 4 i D s Fo Qo D i 3 B MW te cs E Dyer J00 Mew Py pele ut 4 d Fe a L Li P F Lowest Port in the ldap 5 sl A d T Lan fe a MX ele onilin i 2 IS x Ex Fes Ey a F ma i gem 19 November 2009 Issue 232 1 800 95 686 USB Oscilloscope for 169 50 Logic and Spectrum Analyzers Generator www HobbyLab us s tr o ao it ue u h mam fe LLL hi a US r1 any me oe mee 9 5 AA i uat Pi E ise Adsl s r mn bs 2 e ri a oe ee g ae mim Vie PIC SERVO MOTION CONTROL e controller chips Ji controller boards JEFFREY KERR LLC Celebrating Our 10 Year Anniversary PC Scope amp Generator IN ONE PCSGU250 Oscilloscope i2 aa Generator TT PCSU1000 USB PC Oscilloscope 298 99 That Your Electronic Hobby Stores Used To Be www DesignNotes com S Photo 2 Take a look at the completed project box The green PCB board contains the PICL8F2520 The board at the top contains the L57S66R There is plenty of room for a sec ond daughter board to be performed for accurate bed travel speed display During the development stage I used a pin to toggle an LED on and off I use this as a heartbeat to indicate that the PIC is in the do loop and function ing To calibrate the bed travel speed I simply hooked up my data acquisi tion card to the heartbeat and deter mined the time p
25. November 2009 Issue 232 which are critical if you plan to do any hardware modification a readme file with important information the source code for a sample application and the simulation code that you can use to develop on the PC and the LCD artwork The artwork is useful if you plan to draw directly on the screen because it will tell you which bit of the ARM LCD controller mem ory maps to which LCD pixel Second in order to program your calculator you probably will want to use a JTAG interface Although this is not 100 necessary it allows you to connect the CPU directly to the development environment which is a great plus because you can have a one step solution for downloading your program in the calculator and step by step debugging If you don t have a JTAG interface you need to compile a binary and send it to the calculator using the serial port You can purchase a JTAG interface from Atmel or other retailers that is priced in the 100 to 200 range look for SAM ICE You will also need a development environment HP is using the IAR Systems embedded workbench you can download a test version at www iar com but it should be possi ble to also use other environments or even the gnu toolkit You can look for example at the HP20b repurpos ing project group s wiki at http hpwiki fatcity com doku php It uses uses the GNU toolchain Finally there s the Visual C option You can use Visual
26. R59 100 Q and capacitors C29 and C30 0 001 uF act as a parallel snubber It protects the MOSFET 04N60C2 by absorbing the energy as the MOSFET ceases to conduct Two recovery diodes D14 and D15 connected to the primary winding return the energy to the DC bus if there is no energy transfer between the primary and secondary IC U8 IR2117 is a high side gate drive IC which is the gate drive for the high side MOSFET see Photo 3 Transformer T2 is a power trans former with a ferrite core A power ferrite is needed because of the fre quency the transformer operates If you use an iron core it heats up because of eddy currents This is why a 60 Hz transformer has a lami nated core because of the losses By using a laminated core the circuit path is limited to a single laminate The power ferrite transformer con verts the high voltage DC to a small er value by making the windings have a turns ratio according to the voltage you will need By the way in Flyback mode converters the power transformer is not a transformer at all but only an inductor As the bofk eS amp Electronics RI Robot Kits Line followers Robot arms Chansa Motion Control Motor controllers Servo controllers power LED green es programming ATmega48 328P connector microcontroller 20 MHz clock Solder Paste Stencils From 25 Use our low cost solder paste stencils to quickly assemble P a ane tuj
27. REFOUT AGND Current Reading MAX1111 P2 0 P2 1 P2 2 P2 3 P2 4 P2 5 P2 6 P2 7 P3 0 RXDO P3 1 TXDO P3 2 INTO P3 S INT1 P3 4 TO 1k P3 5 T1 L P3 6 WR o P3 7 RD SW Set Voltage PSEN mi swe Set Current MAX550A November 2009 Issue 232 N ml November 2009 Issue 232 D1 gt 1N5407 gt 1N5407 D3 1N5407 D4 1N5407 Swi Close if 110V D12 1N4001 1N4001 Dg 1N4001 J8 C12 L 24VAC oO z 2200uF ig hem PE 1N4001 ss CC OUT CN MAX738A C19 Xtformer IR2117 C27 10u Q12 LN R26 O4N60C2 RGPo1 8 1k 24V 24V 5 5 1 R55 4 2 10u R42 10k R41 10k FEEDBACK DTC OUTPUT CTRL VCC LX GND Power to digital part 1 Figure 3 This is the analog portion of the SMPS chose this microcontroller for its speed and because it is in system programmable You don t need a device programmer for programming the DS89C430 All you need is to configure the microcontroller s pins and connect a MAX232 so you can connect it to a PC s serial port see Photo 2 You can use HyperTerminal or any terminal software After you have applied the power you must press the Enter key so that the microcontroller can detect the data rate However I discovered that the maximum data rate is 19 200 bps The DS89C430 controls both the DACs and the ADC It also reads the keypad and processes the numbers for the proper voltage The MAX1111 U2 i
28. There s only one assembly related catch Out of the box the NSLU2 device won t automatically power up when power is supplied For unattended operation this is an absolute requirement Luckily the NSLU2 can be easily reworked to automatically power up by soldering in a 100 uF electrolytic capacitor between pin 4 of U15 i e R94 and ground Since placement is not critical it can be installed in a convenient hole at the cor ner of the board This enables it to be installed on the top of the board where there is enough case clearance see Photo 2 If you want to make the unit stealthy and not beep when booting up you can try to cut off the buzzer EMBEDDED LINUX amp SlugOS The secret and the magic to using Linux and the NSLUJO device as a controller comes from an open source project www nslu2 linux org The NSLU2 Linux development group and user community discuss devel op and modify the fir mware and hardware of the NSLU2 In addition with a complete binar y SlugOSBE 4 8 beta firmware zip from the website and re flashing the NSLU2 firmware with SlugOS BE the road to an embedded controller is very straightforward November 2009 Issue 232 im m November 2009 Issue 232 EA Qo Start gt an ates eet e Initialize variables Figure 1 This is the flowchart for the main control loop Attach port 80 monitor Network connection on port 80 ee Output HTML status
29. This family also includes 12 bit ver sions for increased flexibility Pricing for the ADS1115 starts at 2 25 in quantities of 1 000 units The AD51114 starts at 2 and the AD51115 starts at 1 85 pata Texas Instruments www ti com S NPN EN N9 converter i XA T9 A De RUM Ni Industry s smallest 16 bit ADC ADS1115 Voltage C COMP OUT Reference Gain x2 3 x1 x2 x4 x8 x16 ADDR SEL E 16 bit A gt KC iE A A pgs Interface E ADC E Oscillator Wij TEXAS INSTRUMENTS CIRCUIT CELLAR e www circuitcellar com CHIP FERRITE BEADS OFFER 60 LOWER DC RESISTANCE The BLM15AX 5H series is an advanced ferrite bead that lowers DC resistance by up to 60 compared to previous models As part of an expanding electromagnetic interference filter EMIFIL line the chip ferrite bead was developed with new ceramic materials and processing technologies that improve performance and reduce size in order to provide power and space sav ings in portable electronics Compared to its predecessors the BLMI5AX 5H chip ferrite bead has a DC resistance as low as 0 02 Q a reduction of 60 while the corresponding maximum rated current has increased from 1 000 to 1 740 mA The series s low DC resistance also helps reduce power consumption for battery powered applications Developed in a compact O402 size package 1 0 mm x 0 5 mm x 0 5 mm it is ideal for designers seeking to reduce board
30. This means if you were trying to measure the signal path delay of an RG 58 A U 50 Q coax cable which has a delay of approximately 0 052 ns cm the counter could only resolve a minimum cable length of 1 923 cm The second problem with this time interval measure ment technique is that the counter s clock is asynchronous to the start event You have no way to tell if the clock count began right at the start of a clock pulse or right at the end of a clock pulse so this can lead to a clock pulse count error of 1 to 1 in extreme cases To deal with these two limitations modern counters typ ically employ some form of interpolation Interpolation can come in both analog and digital forms It can be imple mented by employing a ramp voltage with a known linear slew rate When a start event occurs it starts the voltage ramp Once the first clock edge occurs an analog to digital converter measures the current ramp voltage The meas ured ramp voltage and the known ramp rate are used to cal culate the elapsed time between the start event and the first clock edge A second interpolation circuit is used for the stop event Combining the start and stop interpolation calculations enables a counter to capture start and stop events smaller than a single clock cycle with resolution into the sub nanosecond realm The ability to interpolate is typically what separates low cost low precision counters from high precision universal counters For example Agi
31. a spindle angle with 0 5 accura HEDS 9700 Quadrature encoder cy or better to accurately place Agilent Technologies www agilent com angular marks on a project for cir cumference division I have plenty of room for a second board in my proj LS7366R Quadrature counter LSI Computer Systems www lsicsi com ect box and more than enough pro PIC18F2320 Microcontroller cessing power to accomplish this al Microchip Technology www microchip com November 2009 Issue 232 www circuitcellar com CIRCUIT CELLAR p es ay unas by Cyrille de Brebisson How to Repurpose a Development Platform With some knowhow and little bit of cr eativity you can pop open an HP financial calculator and use its electronics to develop a variety of special purpose applications This article shows you how to use the calculator s screen keyboard and PCB as a development platform ast year Hewlett Packard HP introduced a new HP also introduced a new version of the venerable calculator By itself this could be of great interest HP12C based on the same Atmel microprocessor Like to a Circuit Cellar reader however this is not the point of this ar ticle especially as the HP 20b Business Consultant happens to be geared toward financial calculations No what is important to a Circuit Cellar reader is that this calculator is rela tively inexpensive around 40 retail price it has a screen it has a keyboard and it has a connect
32. and standard method for communicating over telephone lines and a variety of other transmission media A typical example is shown in Figure 1 with one bit at logic 1 followed by two bits at logic O in a repeating sequence The design is demonstrated at 1 200 and 2 200 Hz Bell 202 standard 1 200 baud modem frequencies Common applica tions for these operating frequencies include telephone caller ID and Highway Addressable Receiver Transmitter HART modems HART modems are used for transmission over DC power lines often shared with 4 to 20 mA cur rent loop data The HART standard waveform while not enforcing a specific requirement has a relatively low distor tion level A simple square wave will not do The design is implemented in a Cypress Semiconductor CY8C29866 PSoC although it will easily fit in several other PSoC part families The PSoC programmable mixed signal array has programmable digital blocks for generating timing signals programmable impedance I O for creating multi step waveforms and switched capacitor analog blocks for imple menting filters The resulting FSK generator implementation is all hardware it takes no run time code The device has an efficient 8 bit CPU and lots of digital analog and memor y resources left over to implement a measurement system that uses FSK as a means to transmit data DIGITAL FSK GENERATION The basic FSK generation structure uses two counters and a pulse width modulator PWM as shown in
33. and multiple power management modes including a 5 4 uA Low Power Run mode 5 5 uA Low Power Wait mode 1 uA Active Halt with full RTC and 550 nA Halt mode The device can wake from Halt within 4 us enabling frequent use of the lowest Dower mode Low power peripherals include the sub 1 uA RTC and Automatic Wake Up Overall this platform enables dynamic current consumption as low as 150 uA MHaz The 5TM8L1OI line is the entry point of the STM8L ultra low power 8 bit portfolio Two other product lines making up the product range are scheduled for production in early 2010 The STM8LI5x line adds extra features including up to 52 KB on chip flash and up to 2 KB SRAM external crystal clock capability enhanced reset features and support for DMA There are also additional peripherals on chip EEPROM with true Read While Write RWW capability The third line the STM8L152 features an integrated LCD controller Family pricing starts with the STM8L101 4 KB flash version in QFH20 5 x 3 mm low profile package at 0 68 in 10 000 unit quantities STMicroelectronics www st com NPN MES AM er MEL ME EM Got a PIC Question We have the answers ith i EE E E ES A cis AM at J ur e Ti dis c pt t ai PROGRAMMING ADVANCED PIC d bs S e a 8 BIT PIC MICROCONTROLLER ui MICROCONTROLLERS n C PROJECTS uw C velit interactive Hardware Samulation From USB to RTOS with the PIC1B8F Series Programming 32 bit
34. calibration technician aboard the USS Harry S Truman CVN 75 He earned a bachelor s degree in engineering from The Pennsylvania State University University Park Neil is an application engineer for Agilent Technologies System Products Division His areas of interest include embedded system design testing automated measurement technology network architecture and alternative energy S OURCE 53131A and 53132A Universal counters Agilent Technologies www agilent com mm November 2009 Issue 232 CIRCUIT CELLAR DIGITAL PLUS BONUS BONUS CIRCUIT CELLAR www circuitcellar com
35. integra tion eliminates up to a dozen discrete components and reduces the circuit board area for engine mak ers while also helping customers enhance the qual ity and reliability of their products The off the shelf MC255812 reference design allows developers to evaluate a two chip solution based on the MC255812 and 512P MCU and emulate a complete small engine electronic control unit The 512P delivers the performance benefits of a 16 bit MCU while supporting the entry level pricing low power electromagnet ic compatibility and code size efficiencies of an 8 bit MCU The MCZ255812 is a commercial grade device available now for production at a suggested resale price of 1 70 in 10 000 unit quantities Freescale Semiconductor WWW freescale com NEW PRODUCT NEWS Edited by John Gorsky Qo November 2009 Issue 232 CIRCUIT CELLAR e www circuitcellar com USB MOTOR CONTROLLER WITH FEEDBACK The jrk line of USB motor controllers includes highly configurable versatile devices that make it easy to add open or closed loop control of brushed DC motors to your computer or microcontroller based project The jrk supports four interface modes USB for PC based control logic level TTL serial for use with embedded systems analog voltage for simple potentiometers and joysticks and RC pulse for radio con trol systems It can perform open loop speed control closed loop position control with analog voltage feedback to mak
36. magazine s CD ROM archives These convenient PDF archives contain complete issues just as they appeared when they were printed Get back on track and follow along the uninterrupted Circuit Cellar timeline For package deals on all of our archives visit www circuitcellar com archives CIRCUIT CELLAR Designer s Notification Network Circuit Cellar 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 benefit from this early notification Welcome to the Designer s Notifica tion Network Print subscribers are invited to join the Network for advance notice about our new sample distribution programs Find out more at www circuitcellar com network CIRCUIT CELLAR e www circuitcellar com High level RS232 Low cost interface e In stock Easy to program Add color graphics to any 8 16 bit embedded system Easy fast and flexible Up and running in hours RZACKH www reachtech com 510 770 1417 842 Boggs Avenue Fremont CA 94539 CS T _ APO S aen re r T iit CANUSB Features Free ActiveX component PC MAC amp Linux support Both 11 amp 29 bit ID support Simple CAN logger included Free Threaded Windows DLL Firmware upgradable via USB progr
37. on input A The CNTR can be cleared loaded from the DTR or transferred out to the OTR The OTR serves as a buffer for CNTR To prevent missed counts the CNTR data is transferred to the OTR and then the OTR is output to the MISO pin STR is the status register indicat ing carry borrow compare event encoder index count enabled power loss count direction and sign MDRO and 1 set the operating mode for the counter The IR command byte controls the LS7366R see Figure 2 The appro priate register is selected with bits 3 to 5 One of four operations on that register is selected in bits 6 and 7 The four operations are Clear CLR Read RD Write WR and LOAD All those specifications are pretty dry There is nothing like an example Listing 2 Read register32 is used to obtain a 52 bit count value The 55 line RA5 is toggled low followed by setting the IR register to read The counter value is then read in a loop and assigned to the return variable signed int32 read register32 int reg Read 32 bit counter Examples write register8 OTR LD 0 software request to move counter to OIR for a read counter read register32 OTR RD to avoid missing counts int32 data 0 int i RA5 1 RA5 0 SPI WRITE reg form 0rTedr 4 E int temp temp SPI READ 0x55 data data lt lt 8 data data RA5 1 return data www circuitcellar com CIRCUIT CELLAR temp read counter from O
38. reality is that I have a very eclectic mix of lighting solutions that are constantly evolving Much to the chagrin of the politicians I have to honestly say that a few of my lighting applications are best handled with regular incandes cent or halogen bulbs For anyone critical enough to take me to task over it I just say that when you re generating your own power too we ll talk steve ciarcia Q circuitcellar com CIRCUIT CELLAR www circuitcellar com Sweet Introducing the MiniCore Series of Networking Modules Smaller than a sugar packet the Rabbit MiniCore series of easy to use ultra compact and low cost networking modules come in several pin compatible flavors Optimized for real time control communications and networking applications such as energy management and intelligent building automation MiniCore will surely add sweetness to your design e Wireless and wired interfaces e Ultra compact form factor e Low profile for design flexibility Priced for volume applications Wi Fi and Ethernet Versions MiniCore Module Development Kit Buy now at 1 888 411 7228 rabbitwirelesskits com 1 888 411 7228 rabbitwirelesskits com 2900 Spafford Street Davis CA 95618 JINON JH 00001 LOT LTEEF WHL oo 2 EE T eet RJ PRALAXA oF omm D ME LL nr Iransceiver Send serial data wirelessly The 433 MHz RF Transceiver 27982
39. routine In that define PARAMETER_BLOCK ValueA ValueB ValueC ValueD PointerToValueE struct INT16 INT16 INT16 INT IS INT8 INT8 rs struct PARAMETER BLOCK MyData MAX DEF CHARS 10 define a structure DefinitionStringLMAX DEF CHARS declare an instance of that struct void SomeFunction struct PARAMETER BLOCK PtrToStruct void SomeOtherFunction void Struct PARAMETER BLOCK Ptr2MyData Do something Fill Ptr2MyData amp MyData SomeFunction Ptr2MyData Work with the results void TheBestFunctionYet void Do something Fill SomeFunction amp MyData Work with the results the MyData structure with appropriate data Point to my data Call a routine the MyData structure with appropriate data An even faster call CIRCUIT CELLAR www circuitcellar com routine Lines 78 and 94 are used to toggle an unused output bit on the CPU I can then hook up a scope and measure the code s timing Early in the A D interrupt I read the ADC and the CPU clock Then I start another conversion All this code has no condi tional execution so it takes the same number of CPU clocks to save that data each time through the code Line 84 is used to slow down the data rate In this code I m using every other A D reading When I want to save the data Lines 86 92 I save the ADC and time stamp in an array I do this using an index into that array
40. see the car s loca tion on a Google map COMPONENTS amp ASSEMBLY The NSLU2 USB network storage link has 8 MB of flash memory and 32 MB of SDRAM It uses an ARM based Intel IXP420 processor and runs at either 133 or 266 MHz By removing a surface mount resistor the older 133 MHz version can be modified to run at 266 MHz The device contains two USB ports and one network jack Connection points are available for adding a JT AG port an additional USB port and serial ports After it is re flashed with an embedded Linux image the original NAS functionality is replaced and the device can become an embedded controller www circuitcellar com CIRCUIT CELLAR Photo 2 I installed a 100 uF electrolytic capacitor between pin 4 of U15 and ground The placement was not critical so put the capacitor on the top of the board The only requirements for this project s mobile phone were that it support AT style modem commands for sending and receiving text messages and that it be able to connect to a host via a USB cable that also doubles as a phone charger The Motorola V195 worked nicely The only requirements for the GPS device were that it con nect to and receive its power from the host via a USB cable The Deluo USB GPS device I used is based on a Motorola SiRFstarIII chipset Assembling this project is simple Plug the phone s USB cable and the USB GPS device into the two USB ports of the NSLU2 After that you re almost done
41. space without performance degradation in portable equipment The ferrite bead s wide impedance ranges from 10 to 1 000 Q with an operating temperature range of 95 to 125 C The BLM15AX 5H series is available for 90 016 and lead times are approximately six to eiaht weeks Murata Electronics North America www murata com INDUSTRIAL OUTPUT SIGNAL CONDITIONERS The MAX15500 MAX15501 industrial analog output signal condition ers offer the industrial market a unique combination of higher func tionality greater integration and smaller total solution size than com petitive devices They feature unprecedented integration a program mable voltage output amplifier and a current output amplifier x10 V and 4 to 20 mA outputs operating directly from a 24 V field supply 55 V circuit protection extensive error reporting capability and daisy chain flexibility The devices save board space and design time in 4 to 20 mA and bipolar unipolar voltage output applications They are ideal for PLC MAX15500 MAX15501 Sh INTERFACE BIDIRECTIONAL CURRENT DRIVER BIDIRECTIONAL VOLTAGE liis ann F a E E a 3 www circuitcellar com CIRCUIT CELLAR analog outputs distributed I O embedded sys tems and industrial control and automation Their high integration adds flexibility for designs Use a single device for channel isolated applications or multiple devices for group isolated applications Typ
42. stalls waiting for the mobile phone to reply with its standard OK or ERROR response Once the expected response is received the www circuitcellar com CIRCUIT CELLAR port is put back into non blocking mode and the control loop proceeds to loop normally If the control loop detects an incoming message from the mobile phone the incoming string is tested to see if it is a CMTI message indicating an incoming SMS If it is the SMS message number is extract ed from the sentence and used to query the actual SMS text by using the AT CMGR command After the message is read it is immediately deleted with the AT CMGD command The previously read message is then searched for the password and originating phone number If the password is found the last known position encoded in a web URL is used as the SMS payload for the return message to the originating phone number LINUX DAEMON In the same way the device needs to automatically power up when the The brighter side of electronics The Next Generation of Character Display All New Y Series Vacuum Fluorescent Display Highlight Characters Wide Temperature Range 40 c 80 c Display More Characters Selectable Font Sizes 1 800 779 5846 www noritake elec com International Font Table Serial Interface iron November 2009 Issue 239 NO eq ql engine is switched on The TCL script must automatically sta
43. symmetrical sinusoidal out puts 90 out of phase Some encoders output this signal directly My unit converts it to a TTL quadrature signal The optical encoder fit perfectly on the back of the bed see Photo 1b The unit was ideal but I couldn t afford the display At work I ve purchased quadrature displays for about 500 which is way outside my budget So I set out to make my own with what I had on hand I came close B2 B1 BO XXX Don t care B5 B4 B3 000 Select none 001 Select MDRO 010 Select MDR1 011 Select DTR 100 Select CNTR 101 Select OTR 110 Select STR 111 Select none B7 B6 O00 CLR register 01 RD register 10 WR register 11 LOAD register DESIGN OVERVIEW The optical encoder out puts a TTL quadrature sig nal see Figure 1 A quadra ture signal has an A andaB component that are 90 out of phase This arrangement works well to convey dis placement by counting the November 2009 Issue 232 UJ m November 2009 Issue 232 transition edges and direction by determining which signal comes first A or B Each cycle of data con tains four transitions two on A and two on B There are three ways the transi tions can be counted that determine the resolution of the measurement see Figure 1 The first way is the 1 x method where the count is obtained only on the transition of A for each full cycle This gives the coarsest reso lution Alternatively the
44. ta www ProlificUSA com 2 GP SoC November 9009 Issue 939 m m Adapt9S12XDP512 Modular Prototyping System ulli Robotics and Mechatronics x Electronic Fuel Injection ulli af er I E E AD do RTOS capable FX Ma rm c SEE valuate Educate Embec F Assembler BASIC C and Forth www TechnologicalArts com ge LIE TPC 43A Fanless Wall mountable 32bit 200Mhz ARM9 CPU SDRAM FLASH with Linux 2 6 2x with drivers amp GUI RTC w battery l6bit Audio 10 100 Ethernet R5232 IrDA USB Host USB Device SD MMC card Optional Java Bluetooth ZigBee WiFi 4 3 WQVGA 480x272 x 65K Color Touch Screen LCD w backlight From 339 www medallionsystem com 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 Low Cost CAD Software for Windows XP NT and Vista Circuit design package with schematic entry circuit board layout with autorouting and simulation for only 499 Buy modules starting at 119 SuperCAD SuperPCB mentalSPICE amp SuperSIM Order and download instantly Full up package allows up to 16 layers p
45. the company s Intelligent Well Systems group Carl At least two of those counts can be enjoys playing in the electrical engineering sandbox in his spare time attributed to the lack of channel A signal when changing directions I D purchased my counter on e Bay for PROJECT FILES 10 so it is not likely to be a highly To download the code go to ftp ftp circuitcellar com pub Circuit_Cellar accurate piece of equipment A 2009 232 sticker on it says the last time it was calibrated was 1987 Either way D I can certainly live with a 10 um ESOURCES accuracy Agilent Technologies Small Optical Encoder Modules Technical Data The LS7336R is a sweet little chip HEDS 9700 Series http content honeywell com sensing sensotec ith th h le f ee a dnd Microchip Technology PIC18F2220 2320 4220 4320 Data Sheet thi ject h so that th ee DS39599G 2007 www microchip com stellent idcplg IdcService SS_GET PIC18F2320 is not working hard at _PAGE amp nodeld 64 all I even had to insert a delay loop to slow down the update rate on the The Sensors Reference Input Output Devices Linear E ncoder Information amp display With extra processing avail Linear Encoders Machine Design www sensors transducers machinedesign able what else can be done At some com guiEdits Content bdeee4 bdeee4_3 aspx point I would like to add a rotar y encoder to the spindle to determine S the spindle RPM I would also like to OURCES read
46. the counter which are out of your control except for regular calibration In quality universal counters sys tematic error will typically add up to at least 1 ns or high er But because systematic internal counter error is repeat able you can eliminate the majority of it and most cabling effects by simply performing an offset measurement The exception is long term oscillator drift Because the oscilla tor serves as our time reference for every measurement we cannot perform an offset measurement to eliminate errors related to it but fortunately it is one of the smallest con tributors to internal systematic error For instance with the 53131A and 53132A universal counters timebase error can be less than 1 ps Resolution from averaging THE COUNTER ADVANTAGE Counters offer higher accuracy better resolution and lower cost than scopes In addition they are viable solutions in applications that require high precision signal timing meas urements This holds true when you are trying to capture the BONUS W November 2009 Issue 232 CIRCUIT CELLAR DIGITAL PLUS BONUS propagation delay through a cable solder run high speed digital logic circuit or any combination of the three down to the nanosecond range of useful resolution and in some cases the sub nanosecond range of resolution l Neil Forcier neil_forcier agilent com served in the U S Navy for six years as a test and measurement equipment
47. to read each byte Notice that I had to send 0x55 with each read to generate a clock for the counter That took some time to debug In fact it drove me nuts for a week I m not sure if it is a compiler thing a PIC thing or an LS7366R thing It worked so I used it The data is ORed together and then returned Finally SS is tog gled back high ending the command I started a 32 bit write command but never finished it It would come RU ri Ss DET ami arsa 7724 hy 4 d iie x Nat cr It takes more than a top program to win the Product of the Year Award five times running gt For instance reasonable prices without hidden costs gt A fair update policy without mandatory maintenance fees or costly add on contracts gt A competent hotline available free of charge for every customer gt A program development and optimization process based on an open discussion with the users In other words EAGLE is one of the world s highest rated schematic capture and PCB board layout packages because for the last twenty years we have been treating our customers the way we would like to 3 be treated ourselves An example In the course of product development we implemented a Follow me Router which saves an enormous amount of time during the manual routing process This new function is available free of charge to every customer as are all new features within a main EAGLE release In this pa
48. 0 Pines Blvd Suite 217 Pembroke Pines FL 33029 Hotline 954 237 0932 Fax 954 237 0968 E Mail info cadsoftusa com E November 2009 ssue 939 returns the remainder of a division For example 38 2 mod 12 or in English 38 mod 12 2 T his feature can be used to count the number of events in a cycle This is like count ing in base 12 Say you want to count only from 0 to 11 in a cycle Set the DTR register to 11 The LS7366R then returns count 2 x mod n 1 An example of this would be for counting the hours in a day and tracking AM and PM from a free running counter THE PROGRAM The program is written in C lan guage It displays displacement on the first line and carriage bed travel speed on the second line I wanted to zero the display at any time and convert the readings and display metric or English units I also want ed to have it come up in units previ ously used when the display was turned on Take a quick look at the program posted on the Circuit Cellar FTP site Variables are set up ports are configured for proper I O and the LCD and counter are initialized A unit flag is read from EEPROM and the display units are set before entering the main loop Here you look for the Zero button and the Change of Units button to be pressed You then read the counter convert to real world units and dis play Nothing fancy There is one thing to note on the conversion of units 1 um 0 00003937
49. 2x way is to count the transition on A and the transition on B for each cycle This is twice the resolution of 1 x The finest resolution is the 4x mode where each transition of A and B is counted I wanted the finest resolution so I was looking to implement the 4x mode My first approach was to use a Microchip Technology PIC18F2320 because I had several on hand I was thinking of decoding the signal directly using the interrupt on change available for Port B Then I thought about the carriage travel speed In a hurry I can move the car riage several inches per second At 2 per second I would need to decode a total of 101 600 pulses and then dis play the results in real world units Running at the maximum of 40 MHz I would need to decode to display in 98 instructions With a floating point multiply required that approach went right out My second approach was to use an LSI Computer Systems LS 7084 quad rature clock converter which I had on hand The LS708 reads the qua d rature signal and outputs a clock and a direction thus simplifying the interpretation All I had to do was monitor the direction and then incre ment or decrement a counter in interrupt Four times a second the PIC performed a floating point mul tiply and displayed the results on an LCD I thought everything was fine until I hooked up a bench top count er to the LS7084 and compared the results to the PIC18F2320 output I was missing counts so I change
50. 5 VDC on board regulators surface mount and through hole components to populate the board a barrel jack for a 2 1 mm cen ter positive 6 to 9 VDC power supply not included and a four pin programming header for the Prop Plug also not Iil included re l The P8X32A Q44 SchmartBoard kit costs 39 95 E ME Parallax Inc www parallax com Em e N n Pro JJ GL ifs Sia za i DIA d Distributors of Low Power RF modules Zigbee Bluetooth WiFi GPS GSM GPRS mnm wt 1 EGG Part 90 Compliant Customise ols panels can be easily OE ed OMETRIX designed with our tree software Eron f Panel Designer NBFM Multi channel UHF Transceiver NBFM Multi channel with Programmable RF Power 500mW VHF Transceiver i TEC WOW y e Cost effective prototypes VHF Narrow Band DO p and production runs FM 2 Watt Multi channel transmitter 2 Watt Multi channel VHF Transceiver e Wide range of materials or customization of provided material SMX1 RX1M LMR1 e Automatic price calculation ST 4 e Fabrication in 1 3 or 7 days VHF Narrow Band VHF Narrow Band VHF NBFM Low Cost FM Multi channel FM Multi channel Multi channel Transceiver Radio Receiver Radio Receiver Sample price 43 78 plus S amp H FAAP www lemosint com Tf NEL www frontpanelexpress com i o d 866 345 3667 J ail 206 768 0602 INTERNATIONAL sales lemosint com November 2009 Issue 232 www circuitcellar com CIRCUIT CELLAR pd
51. 58 dB reduction of the third harmonic can be seen with the three step waveform attained when the lowest harmonics are eliminated FILTERING OUT HARMONICS The third harmonic content of the waveform is less than 0 5 a good start but not up to the standard of the HART modem The output of the three step generator is filtered with a switched capacitor band pass filter The switched capacitor low pass filter LPF is clocked at four times the sample rate With the clock at 160 times the out put frequency the waveform is sampled at 40 times per sam ple The three step waveform uses the combined outputs System clock Data in PWMDB3 divided by 160 ENABLE ENABLE Figure 6 The complete block diagram shows the relatively simple digital structure combined with a tuned band pass filter pass filter removes the sampling aliases from the band pass filter Q e XORed of two blocks but the clock to the filter can only come from a single block selected by the analog clock mul tiplexer This signal is derived by connecting the composite clock output to a DigBuf then using this buffer output as the clock source for the analog column The completed dig ital block connection with digital signal generation and fil ters is shown in Figure 6 Design of the band pass filter is enabled by using either the filter wizard in PSoC Designer or the design spread sheet in PSoC Designer Help Documentation The input to the
52. C N ee d N etwo r k COMMUNICATIONS DES NJ MATHEMATICS IN ELECTRONICS Linear if Technology a E BASIC INSTRUMENTATION m Introductory Circutt Analysis Volume Discounts PAW ETI Fle i Gridconnect www gridconnect com 1 800 975 4743 November 2009 Issue 232 www circuitcellar com CIRCUIT CELLAR m IN November 2009 Issue 232 Fi iara acean NIS Bremcier a pae Qpentioas Tools Bookmark Help Address ILH Li Bbyunged Th NIE S Result Table DE 131512133 11312 Tul Openrbentc Get Subirnr UP S MIR it o arg dod internet mage rris d upih on pez EIL vie a upaGbymeks Gi upiident B D upiEattery amp pieu D upiinputiineBad updhputhumline E T wpctnputTabie m MP andnputirtry upiti inim dien lupildenti anufaztuner D lupildentidadel b tupsldentidume d tupildentA acha dU nocer d lupsEattezy oltage 4 updater Temperate hupsingasi anal adhi lu Chur ines d upidlepulialtage ideni wpilnpubt urina apdinputTratPewer E D upsOutput E G upiBypas EO upstlam Ga upiTast i Z3 upsCoetrel DEn upitonfig et up Tape t upi C anfarmangr fupiinpetveitia i upzC amp utputsource P tupsCtpantFrequancy li upitu mii L lupitbutputLinelridex 1 upiDutguticitagi l lugiutgsdtPercentl gad upzlypaziamLines 4 lug uMaemiP ne dit D updnputfreguency 1341213213117 lhl Serin HanfiegatreeInbngrr Ebor read
53. Cast transmitter to my head but otherwise I wouldn t get too worried Perusing the PowerCast website and documentation there s little on the subject of safety so presumably no news is good news The only precaution I could find is as follows FCC radio frequency safety guidelines require the device to be operated with the external antenna at least 20 cm 8 inches from the user s body The owner of the device must ensure this condition is met even if the device is operated by a third party or the device is incor porated into another product The owner of the device must communicate this information to any subsequent purchaser Use and maintain the device only as specified in this manual Enough of the fine print time to get hands on Power Cast sent me a selection of components to play with including a transmitter a selection of antennas and a plug in LED module see Photo 3 The antenna modules each have a built in P1100 harvester two P1100s on the patch antenna and a header that the LED board plugs into It s a simple setup but nevertheless able to deliver useful insight into real world application issues lower right side of the board Photo 3 PowerCast gear shown here includes the transmitter a selection of antenna modules with built in harvesters and a plug in LED board www circuitcellar com CIRCUIT CELLAR Photo 2 PowerCast offers an evaluation board that uses a P2100 harvester to charge and fire
54. Cellar s home page and click on the link to All Bonus Content Issue 228 NimbleSig III A New and Improved DDS RF Generator Thomas Alldread Sound Synthesis Made Simple Full article plus video example A Multi MIPS Music Box Peter McCollum Issue 229 USB I O Expansion Brian Millier Issue 230 Verification and Simulation of FPGA Designs Sharad Sinha Issue 231 Buddy Memory Manager Sitti Amarittapark Arduino Based Temperature Display Mahesh Venkitachalam Are you interested in writing for Circuit Cellar Consider a submission to Circuit Cellar s bonus section in the Digital Plus venue As you see from this statement of availability the bonus sec tion of Digital Plus is available to all Circuit Cellar readers Authors are choosing to be published in our bonus section for a variety of reasons These reasons include but are not limited to Articles of various lengths can be published in the digital venue Follow up articles are published in the bonus section without concern for the impact on the current issue s theme Articles may include audio or video enhancements Speed to publication Space restrictions in the print magazine can delay publication There are fewer restrictions on the digital side Whether you want to submit an article for print publication or for publication in the bonus section of Digital Plus please write to editor circuitcellar com to present your ideas November 2009 Issue 232 NN mJ
55. DHCP static IP support e Web based configuration Jus ER TO AALLS E La l The all new INDUSTRIAL SERIAL TO ETHERNET SOLUTION Board Part Number SBL2e 200IR ETE TAROT Information and Sales sales netburner com Networking in One Day Web www netburner com Telephone 1 800 695 6828 4 freescale Alliance Member 5SLellofis Connected Versatile Cost effective s i y v Aaa ET Stellaris LM3S9B90 Stellaris LM3S8962 Stellaris LM3S3748 Ethernet Evaluation Kit Evaluation Kit Evaluation Kit featuring USB Ethernet featuring integrated Ethernet featuring USB Host Device and CAN and CAN e Deterministic ARM Cortex M3 cores Stellaris Means Real time multi tasking MCUs e Advanced interrupt driven software with Stellarisware software Stellaris LM3S6965 Stellaris LM3S81 1 Stellaris LM3S2965 CAN Ethernet Evaluation Kit Evaluation Kit Evaluation Kit demonstrating an embedded featuring basic embedded demonstrating a CAN network web server out of the box control out of the box POWERED e CIRCUIT CELLAR the YY onderful izard in Your creativity and design project idea could win you a share of in Cash Prizes and Recognition in Circuit Cellar magazine For details visit www VV Zwiki net FUTURE WZ ELECTRONICS iIMCU7100EVB Contest Special Price 49 00 USD Co sponsor Official Sample Purchase www FutureElectroni
56. If not check for a pulsating signal on the SCLK DIN DOUT CSI or SSTRB Please note that if the LCD mod ule is defective or if the ADC is defective it will hang the pro gram because it polls the busy flag on the LCD module and if the conversion is finished on the ADC by polling SSTRB You should also check if the REFOUT pin is connected to the ADC s REFIN pin For the analog part don t connect to the mains if you aren t sure of your design If there is an error in the www circuitcellar com CIRCUIT CELLAR construction such a connection may damage the MOSFET the 1N5407 or the power ferrite transformer First apply a 12 V DC voltage to J7 and use an oscilloscope to monitor the output of the PWM controller TL494 You should see a square wave output at pins 9 and 10 on the TL494 and at the gate pin on the IRF840 If the TL494 s supply drops to a low value check if the totem pole gate drive circuit is shorted Also check for a sawtooth output at pin 5 on the TL494 In addition check for a 5 V potential at pin 14 on the TL494 If you adjust the voltage from 0 to 2 5 V using a separate power supply at pins 1 and 16 on the TL 494 you should see the duty cycle vary at the output of pins 9 and 10 Check the polarity of bulk capaci tor C2 or it will explode Be sure the primary winding is connected to the MOSFET s drain The secondary should be connected to D 6 1N5822 After performing all of the afore m
57. L494 s auxiliary supply I used another 60 Hz transformer for the supply of the digital part which uses the MAX738 I did this because I couldn t add separate windings from the power ferrite trans former because the power supply s out put drops to zero As the supply decreases to zero the voltage on the auxiliary winding also drops to zero In some power supplies a series pass pre regulator makes the circuit run as the power is applied However this is good only if the auxiliary supply takes over as the power supply runs The series pass preregulator has a low efficiency as a linear regulator so I decided to use a 60 Hz transformer for the auxiliary power supply I used another 60 Hz transformer to power the digital par t CONSTRUCTION amp ASSEMBLY This project involves exposure to high voltage which could lead to Logic Analyzers Oscilloscopes Signal Generators Protocol Analyzers 2C SPI ASYNC CAN 1 Wire PS 2 USB 25 SMBus Serial www USBee com See It amp Solve It with USBee Test Pods Configurable Programmable High Speed USB PC Based And start at 139 USBee USB based Electrical Engineer November 2009 ssue 939 UJ UJ electrocution or a fire if you don t use the correct fuse rating and the proper design If you are a novice consider switching to a linear power supply using a 60 Hz transfor mer You can use a presensitized PCB fo
58. LOPMENT TIPS Before I finish this article I want to describe a few tricks for develop ing on the calculator itself I trust you ll find them useful IAR has some issues For example it doesn t always properly erase the CIRCUIT CELLAR www circuitcellar com flash ROM before trying to repro gram the flash memory so it is usu ally better to erase the flash manual ly with the cable Press and hold Erase press Reset press On and release the Erase key Sometimes the JTAG link connec tion breaks You need to unplug the SAM ICE and then plug it in again You can t debug a CPU when it s off In fact the debugger closes when CPU contact is lost This makes it hard to debug in the HP framework because it continuously turns off the CPU So when you are developing I recommend commenting out the calls to TurnCalcOff and PutCalcIdle to avoid entering these modes k Author s note If you have questions or need more information you can contact me directly or interact with other knowl edgeable HP people in any of the following public forums www hpmuseum org cgi sSys cgiwrap hpmuseumvforum cai http hpwiki fatcity com doku php or comp sys hp48 A A AP CIRCUITS As low as Two Boards Two Layers N Two Masks each One Legend Unmasked boards ship next day www apcircuits com VISA MasterCard Paya IPC meneen EA O mm www circuitcellar com CIRCUIT CELLAR Cyrille de Br b
59. N Input Output and Strobed I O functions ES Uses Familiar 82C55A Chips XIO RO8 Add eight High Power relay outputs to any digital port Call or Visit us on the web YN E 1 877 724 3963 www scidyne com Microcontroller C 4L Development Tools 68000 68010 683xx 68HC11 68HC12 68HC16 Z80 EZ80 6502 65816 PIC16 Macro Assemblers C Compilers Software Simulators 207 596 7766 sales avocetsystems com d c O v E J w go gt N 4 Q al O i o gt o EL ls m 3 m o 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 HIDmaker FS Combo Only 599 95 www TraceSystemsIinc com 301 262 0300 rius I missed dssue a fs a EIC eh m CELLAR in sy Revolutionary new expandlO USB chip wW USB Status AID I O SPI I2C 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 Farnell Amazing PIC programmer Most devices supported ICSP SQTP amp copy limits at Digikey ha 32 amp Mouser E wns Actual size patents pending www flexipanel com with Circuit Cellar
60. TATIVE Shannon Barraclough Direct 860 872 3064 E mail shannon circuitcellar com ADVERTISING COORDINATOR Valerie Luster E mail val luster Q 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 Q circuitcellar 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 circuitcellar com GENERAL INFORMATION 860 875 2199 Fax 860 871 0411 E mail info Q circuitcellar com Editorial Office Editor Circuit Cellar 4 Park St Vernon CT 06066 E mail editor circuitcella 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 Q circuitcellar com AUTHORS Authors e mail addresses when available are included at the end of each ar ticle CIRCUIT CELLARG THE MAGAZINE FOR COMPUTER APPLICATIONS ISSN 1528 0608 is published monthly by Circuit Cellar Incorporated 4 P ark 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 Mexic
61. TP Oo CIRCUIT CELLAR back issues available as Searchable Archives on CD ROM CD ROM 13 2008 Issues 210 221 CD ROM 12 2007 Issues 198 209 CD ROM 11 2006 Issues 186 197 CD ROM 10 2005 Issues 174 185 Order Online www Circuitcellar com or call 860 875 2199 CIRCUIT CELLAR www circuitcellar com Figure 9 Adding a low pass filter clocked at a much higher frequency results in the significant reduction of the band pass filter s sampling aliases square wave output can be constructed with three digital blocks A three step analog output version takes another digital block replacing the PWM with a PWMDB If a ver y clean waveform is needed the three step waveform and both filters are used This takes a total of five digital blocks and four analog blocks This fits best into a 28 pin or larger part a Cypress Semiconductor CY8C27443 or CY8C29866 If a PGA is used for wavefor m input to the filter instead of Port 2 1 the design will fit into the eight pin CY8C27143 or the 20 pin CY8C2 7243 If all that is required is the FSK modulator with modest allowed harmonics and no on chip data generation the design can fit easily into an eight pin CY8C24123 which has four digital blocks and six analog blocks The filter can be either the single band pass which will also help limit power requirements or the combined band pass and low pass In either case the pin requirements are 1 for digital data input
62. TR Set IR to read register Send 0x55 with read to generate clock for counter b l mounted the optical linear encoder 6 to the to really see how simple it is to con figure and read a count see Listing 1 Let s first clear the counter I set up the driver defines so I didn t have to constantly transfer instructions to hex The IR command for clearing CNTR is 0x20 or CNTR CLR We want to write a single byte Using my driver interface the program line is simply write register8 com mand data orwrite regis ter8 CNTR CLR 0 Diving into the routine you see what happens First the SS pin RA5 in this case is toggled high just to make sure it actually is high then low Using the CCS compiler s built in SPI Write function the com mand is written followed by the data The SS pin is then toggled high I used multiple write register8 commands to configure everything the way I wanted Now let s try a counter read see Listing 2 The first thing to do is to move the counter data to the OTR register so you can read it at your leisure and not lose any counts This is done by the line write regis ter8 OTR LD 0 You next read all 32 bits with counter read reg ister32 O0TR RD Again stepping into the routine you see what hap pens First SS is toggled low and the read command is sent using November 2009 ssue 939 GU SPI WRITECOTR RD We then loop through four SPI READ cycles
63. Ul02 J6 99 In29412 MMM Energize a Circuit with an SMPS p 26 Wireless Power Delivery p 60 CIRCUIT GELLAR THE MAGAZINE FOR COMPUTER APPLICATIONS ANALOG TECHNIQUES Low Distortion FSK Generation Explained Build a Precision Linear Encoded Display Embedded Linux Based Vehicle Tracking Device Management via the SNMP Ol 01 ATE THE HE TBI HIE TL I k TTT IERES P gt mm 7 TU Me ii Al f E AL 57 7T s gem c s nhi g roles i i EEEL EY mur HEN s Bl mm ino EE m tr Lc u fe x Aw i LL P alil ai X4 I E iS nin Em i k 2 Em x EMEN RS BT B EA q t ay Ti ye EE a e E D a jh cue a T pr r OF is h u BR eit Ii S ac LT j CX ELA im 0 ETE 0 74470 75549 0 v C 7 M y 7S D 11 5 95 U S 6 95 Canada 74 7 E mes NN f MTS pos RIN HL ES e iE NANT cami MO H G 4 m A Low Cost Solution for Industrial Serial to Ethernet with Digital I O and Analog to Digital Converters Hardware Features TWO TTL serial ports e 10 100 Mbps Ethernet e Up to 10 digital I O e Four 12 bit A D converters Operating temperature 40 to 85 C e Dimenstions 1 2 x 2 e 32 bit performance Software Features No programming required e TCP UDP Telnet HTTP modes e
64. XP Linux support Windows XP based Touch Controller complete embedded computer with a multitasking operating system an impressive array of development tools and signifi cant driver support for hard ware As such multiple pro gramming languages are available e g C C Perl and TCL I chose to use TCL for several rea sons One it is an interpreter Writing inm Ze gt Windows CUPC P80 699 Qty 1 CUWIN3100 gt ARMO 32bit 266MHz WinCE 5 0 Core RTC SD CARD support gt RS232x 2 ports USB port gt Speaker amp Stereo Jack o oT November 2009 ssue 939 EN te mull testing and debugging is quick November 2009 Issue 232 Highly optimized and efficient object code is not necessary Two it greatly simplifies string processing with access to high level constructs such as regular expressions Three there is easy access to shell commands Four it has constructs making it trivial to listen for TCP IP conn ec tion and communicate with the net work The fifth reason is that I ve found the TCL syntax easier to understand than Perl especially for new programmers trying to under stand code written by expert Perl coders The one issue I stumbled across with TCL was the legacy convention of interpreting numbers with leading zeros as base 8 numbers Because the code pulls parameters out of fixed length str
65. adheres to the National Marine Elec tronics Association NMEA standard of position reports Typing nmea gps for mat in a search engine produces a large quantity of reference material AII the characters in the standard are print able ASCII text plus carriage return and line feed The characters are sent at 4 800 bps and comprise sentences whose fields are delimited with com mas One of the most interesting asso ciated with this project is the sentence that starts with GPGGA global posi tioning system fix data The fields of a GPGGA sentence provide the UTC time of the fix the latitude the longitude the altitude and the number of satel lites being tracked In one statement the TCL code uses a regular expression to match to the GPGGA sentence prefix characters and extract the above data With this accomplished the data is massaged slightly and put into web URL form that works with Google Maps On an Internet connected phone e g an iPhone or gPhone it is easy to click through to the Google Maps from the received SMS SEND amp RECEIVE COMMANDS The modem TTY port is generally configured in a non blocking Read mode This enables the control loop to poll the mobile phone asking for any new data If data is not available it continues on to its other tasks When the controller wants to send AT messages to the phone it tem porarily puts the port into Blocking mode In this way the control loop
66. al SD Cards and backward compatible with TS 72xx Boots Linux 2 6 in 67 secon Linux 2 6 and Debian by d 200 MHz ARM Family Power as low as 1 4 Watt TS 7200 8 boards over fee shown with IM optional A D 2000 configurations 2 converter Compact Flash NEL and RS 485 Fanless no heat sink SDRAM up to 128MB Flash up to 128MB onboard 10 100 Ethernet up to 2 DIO lines up to 55 a SD card option 2 USB ports Oe ts 7 xm 5 Senge COM ports up to 10 a VGA v options include Programmable FPGAs onboard temperature sensor A D Converter 8 channel 12 bit Extended Temperature Battery Backed Real Time Clock USB Flash USB WiFi Linux Real Time extension D 7 Over 20 years in business 3 Custom configurations and designs w 3 Open Source Vision excellent pricing and turn around time Never discontinued a product 3 Most products stocked and available 3 Engineers on Tech Support for next day shipping Design your solution with one of our engineers 480 837 5200 TS 7500 Our Smallest Computer 250 MHz ARM9Q at Our Best Price Point a Low power fanless lt 2 watts a 64MB DDR RAM a 4MB NOR Flash a 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 Customizable FPGA 5K LUT Power over Ethernet ready Optional battery backed RTC 74 3 mm 2 925 in Watchdog Timer 8 TTL UART 66 mm 2 600 in 33 DIO SPI IC
67. ameter passing and minimizing the exposure of those variables SPEED OF EXECUTION As I write this and explain the code I realize that all the variables for buffering the A D data and time stamps are global to this routine I did that for speed of execution This code needs to read the data buffer it and then process the new readings Global variables made the most sense in this application I hope you take a closer look at your modules and consider parameter pass ing and the organization of the rou tines in those modules Please drop me a line if you have any C topics you would like me to explain al George Martin gmm50 att net began his career in the aerospace industry in 1969 After five years at a real job he set out on his own and co founded a design and manufacturing firm www embedded designer com His designs typically include servo motion control graphical input and output data acquisi tion and remote control systems George is a charter member of the Ciarcia Design Works Team He is currently working on a mobile communications sys tem that announces highway info He is also a nationally ranked revolver shooter Pros ECT FILES To download code go to ftp ftp circuitcellar com pub Circuit_Cellar 2009 232 a S Joon How Are Parameters Passed 2003 www comp nus edu sg esim faq node13 html SECTIONO007 1000000000000000 T Zhang Sams Teach Yourself C in 24 Hours Macmillan Computer Pu
68. amplifier will only act like a com parator and it will have only two val ues O or the maximum output of the error amplifier which is 5 V or V er R42 10 kQ and R41 10 ko pull down the error amplifier s input so the error amplifier will function prop erly Optocouplers U5 4N35 and U6 4N35 isolate the output from the input The LED inside the optocoupler lights up if the power supply s sam pled output is greater than the refer ence in our case it is the DAC R22 2 2 KO and R23 2 2 kO limit the current flowing through the opto couplers A MC34072 U4 high per formance op amp acts as an error amplifier on the secondary side C13 100 pF C14 0 0833 uF and R24 317 kQ act as a compensation circuit for the op amp Compensation is need ed because the power supply might oscillate at varying load conditions The compensation circuit varies the op amp s gain and decreases at 20 db as the frequency increases Pole zero com pensation is used It is applicable for discontinuous Flyback mode regulators and it also alters the phase of the op amp s output so that it doesn t return to 360 Remember that negative feedback provides a 180 phase shift Resistors R1 0 1 Q R2 100 9 R3 1 KQ R48 10 kQ and U2 MC34072 op amp act as a current detector Resistor R1 0 1 Q acts as the resistive sensor for the current detector As current passes through the resistor a voltage drop is generated across
69. ams in C C VB Delphi C PureBasic etc No need for external Works up to 1Mbit CAN E Supports RTR Frames USB 2 0 Full Speed p Free USB drivers CE Approved o9 0 SEN UJ Uu UJ cOf nus D COIm Solve complex signal acquisition isle Us positioning amp control gg environmental A acceleration transients pressure vibration sonar GPS Linux Driver Guaranteed in stock Many newly added features 16 bit analog inputs and outputs Million sample FIFO eliminates interrupts Wide analog input and output ranges 40 C to 85 C Standard co CED Order 24 7 fast and easy tx1 04 com ppgvvon ste04 com help stx104 com 608 256 0767 x24 ezLED The Smart Display makes integrating a GUI ez ce e ae Versatile Wea USB SPI R5232 Interfaces Bright 250 Nit LED Display 800 x 600 Integrated Touch Screen LUA Scripting Language capable For stand alone embedded apps Memory 3 8 MB SD to 2G ezLCD s are also available in 2 7 15 950 045 10A LA A Atl mild ACL Call for Custom Display Configurations Embedded Standalone C C Programmable e Low Cost User Interface with Ethernet USB CF d RS232 ADC DAC m Sa I Os Relays U Drive 5 7 QVGA TFT rt at a CAN Ethernet CF start at GY ADC DAC 60 Low Cost Controllers with TFT ADC DAC UARTs 300 I Os solenoid relays Compact Flash LCD Ethernet USB motion c
70. an change the voltage and current by entering the value on the keypad and checking the output on the 2 x 16 LCD module As you can see in Figure 1 the SMPS is built around a Maxim Integrated Products DS89C430 microcontroller Figure 2 shows the digital portion of the design Figure 3 depicts the analog portion In this article I ll describe the project from start to finish FLYBACK REGULATOR A flyback regulator works by storing energy in the core material The energy is stored while the power switch conducts The power transformer of a flyback converter is not really a transformer but an inductor After the power switch stops conducting the power transformer flies back or reverses in polarity That is why the phasing of the power transformer of a flyback transformer has the opposite polarity when compared to a forward converter The energy stored in the core material is transferred to the secondary winding by induction The filter capacitor smoothes the regulator s output The topology used in this design is a diagonal N eo Photo la As you can see the SMPS s front panel features an LCD with a backlight b Take a look inside the D589C450 controlled SMPS The two 60 Hz transformers are for the auxiliary supply of the analog part The other 60 Hz transformer powers the digital part It s clear why 60 Hz transformers are needed CIRCUIT CELLAR www circuitcellar com Control and sequencer Internal re
71. and connectors When zeroing out the delay of your cabling and connectors use as few additional connectors as possible if any because every connector added for the zero measurement will add timing error to the final measurement Performing a delay meas urement on your cabling to zero out its effects will also factor out any repeatable systematic trigger error Using a single counter channel to perform your propagation delay measurement means you must use some type of T connec tor to route both your start and stop signals into the single channel The delay added by the T connector cannot be zeroed out of your final measurement The better choice is to use a two channel counter that allows you to choose one channel as the start input and the other as the stop input This will alleviate the need for a T connector which will cut down on the error of your final delay measurement When measuring propagation delay through high speed digital logic you may want to reduce any error caused by slew rate and amplitude differences between the output signal stop event and input signal start event In Figure 2 you can see that the trigger level is set for 3 V for the start and stop edges The digital logic changed the amplitude and slew rate of the pulse so the start and stop triggers occur at different percentage points on the edge To reduce this type of error use the counter s time inter val measurement capability or the built in rise fall time
72. asy To L se BASIC Commands Windows 9x Me 2K XP Interface B PICBASIC Compiler 99 95 BASIC Stamp 1 Compatible Supports most 14 bit Core PICs Built in Serial Comm Commands PICBASIC PRO Compiler 249 95 32 bit signed vanables and math operations Supports Microchip PIC10 PIC12 PICT4 PIC16 PIC17 and PIC18 microcontrollers Direct Access to Internal Registers Supports In Line Assembly Language Interrupts in PICBASIC and Assembly Built in USB I2C RS 232 and More Source Level Debugging See our full range of products including books accessories and components at www melabs com November 2009 Issue 232 m Q November 2009 Issue 232 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 PERIPHERALS SCIDY WE Offers a Full Line of Innovative Modules for PEH Applications Peer i ali sa ADIO 104 rnis Module SIME 16 Analog Inputs 5V Power 8 AnalogOutputs Pulse Accumulator 24 Digital VO lines Open Drain Outputs mes DIO96 104 ICM 6 Bi Directional Digital Channels E
73. at I still have a 700 kWHr surplus they owe me Based on what the electric company will give me for the surplus power when we settle up at the end it s actually cheaper for me to continue using the remaining incandescent bulbs I have versus the cost of buying more CFLs OK I ll stop ranting I understand the bigger picture regarding energy waste but simply substituting CFLs or LEDs for every incandescent light bulb is a myth The naive truth is maybe If you have a light next to your easy chair where you sit to read Circuit Cellar it is a perfect candidate for a CFL replace ment If your Home Control System HCS automatically turns that light on or the wall switch controlling the light is a dimmer switch good luck If you have a 150 W motion controlled flood light on your front walkway it might seem to be the perfect candidate for a 38 W CFL flood light replacement provided the controller uses a relay and not a triac and that you don t mind being 10 seconds past the point of needing light before you actually see any I might have a unique case of triple witching electronically speaking but I think there are a lot of Circuit Cellar read ers who utilize powerline or wireless communication and control technologies You may not be running a complete HCS like I do but the inoperability of any automated device is just as frustrating CFLs are wonderful except when they don t work For the most part they don t like low temperatures shor
74. ates itself each time a key is pressed This leaves us with the problem of where and how to store the state The Atmel chip has 6 KB of RAM which is a strange number But there is a reason for this and it is linked with the power saving features of the AT91SAM7LI128 The CPU has four power modes Well this is a simplification But as far as I m concerned for the moment four power modes of interest The first one is running when the CPU is actively calculating This is the mode to use when your application is running The second mode is Idle In this mode the CPU is paused This is the mode used when a key press has been executed but the key has not been released yet The CPU can t turn off because it needs to poll the keyboard regularly to detect a subsequent key press or release In the third mode the CPU is turned off but the LCD is still running This is the mode used as soon as all keys are released but the LCD is on In the last mode every thing is off except the back up mem ory This is the mode used when you turn off the calculator Out of the 6 KB of RAM 4 KB are in the CPU and 2 KB are the back up memory So as soon as the CPU is off which is pretty much all the time because most of the time is spent when the LCD is on but a key isn t pressed this memory is lost These 4 KB are perfect for storing the stack and temporary variables The other 2 KB of RAM or back up RAM stay pow
75. attenuated but it is hard to evaluate distor tion less than 196 with an oscilloscope The LPF has aliases at 1 0 MHz 2 2 kHz and 1 0 MHz 2 2 kHz Sampling aliases follow a sin x x pattern As the ratio of the over sample increases the aliases are closer to 160 x Filter clock FSK LPF2 OUT 7100 Hz BPF2 1200 2200 Hz The following low CIRCUIT CELLAR www circuitcellar com Gee ILbank 3 PORT INTERFACE i Vi Mt i i N y Li iy Toy i 4 Vi i v mis foa l y Lid i p P f 3 iy put nm 4 i a rm E of m X 7 F Ea les RS 485 to Ethernet Converter Powerful feature Protocol converter RS485 between Ethernet Offer TCP IP Communication to Devices with RS485 I F ee a E Ap L Specification Network TCP UDP DHCP ICMP IPv4 ARP IGMP PPPoE Ethernet Auto MDI MDIX 10 100 Base TX Auto negotiation Full half Duplex Serial RS485 3 Ports 1 200 115 200 bps Terminal block I F Type Control program IP Address amp port setting serial condition configuration Data transmit Monitoring Accessory Power adapter 9V 1500m4A LAN cable Etc DIP Switch 485 Baud Rate setting LED Power Network 485 Port transmission signal ILhank Vim musa bo biep Sr minii November 2009 Issue 232 Figure 7 The three step waveform is cleanly filtered to generate a decent sine wave but still with significant steps at the sampling rate 40 times per cycle the
76. blishing http aelinik free fr c ch14 htm www circuitcellar com CIRCUIT CELLAR MR REA OH LOSH Learn CPLDs 7 the fun wa with e the MACH64 This complete kit comes with everything you need to take you from mystery to mastery with Learn to turn software into g hardware fe www XGAMESTATION com OSD 232 RS 232 TTL controlled on screen composite video character and graphic overlay in a small 28 pin dip package Intuitive Circuits www icircuits com 248 588 4400 Add USB to Your Designs Chips code protocols USB embedded See COMPLETE wireless delUVl ams options debugging USB 3 0 and SuperSpeed JAN AXELSON SA Poe Conant OO 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 PLDs and programmable logic November 2009 Issue 232 Nn Ug i UN RTICLE by Dennis Sequine Low Distortion FSK Generation This article demonstrates a means to generate FSK modulation with low distortion and low transition phase error You can use a P5oC s digital and analog block features and zero run time software to achieve this goal requency Shift Keying FSK encodes digital data to be transmitted in an analog fashion by assigning one frequency to a logical O and another frequency to a logical 1 Transmitting data in this manner is a simple robust
77. by a timer interrupt routine and all the other uses were to read that variable for information purposes I might con sider making that timer a global vari able so that any routine may use its value Let s say you want to pass a param eter operate on it and return the Listing 2 Making all variables global calculate the average INT16 y get the average of A amp B changed variable Consider this simple code fragment c toupper c In this example a routine from one of the C libraries is used to conver t a char acter that might be uppercase or lower case to a character that is uppercase So we pass the variable by value and the return value gets stored in the address of the variable just passed Caution The C routines like toupper are actually passed an int and also return an int So be careful to understand C character rep resentation before you start using them What if we want to pass a variable and have the routine modify the original instance of that variable In Listing 3 we pass two variables by value We also pass the third by value but in this case that value is the variable s address Knowing the address the called routine can modify the contents of that third variable With one variable we could use the return parameter of the function to change the variable If you have two variables to change then passing the addresses of each would be the method INT16 total INT16 A B Resul
78. c CIRCUIT CELLAR e www circuitcellar com Enterprises 1 Cm 5 C 1 3 6 1 4 1 Imagine that 33764 1 3 6 1 4 1 33764 Figure 1 You can follow the root or structure of the management information base MIB down to the SNMP node using the dotted integer path 1 5 6 1 2 1 11 Note that SNMP 11 is part of the MIB for the simple network management protocol SNMP found in RFC5418 consists of packets of information carrying e mails photos and media files between users and that would be true However there is other traf fic that doesn t have anything to do with personal communications it carries control and status informa tion This information doesn t neces sarily need to be presented in a viewable fashion it can be as simple as a single prearranged value MANAGEMENT INFO BASE The Open Systems Interconnection OSI is an attempt to standardize networking by the International Organization for Standardization ISO and the International Telecom munication Union IUT The OSI consists of a Management Informa tion Base MIB that is used to iden tify all devices in a communications network WwwW circuitcellar com CIRCUIT CELLAR The structure is made up of data objects or object identifiers OIs rep resented by a sequence of integers which traverse a global tree identify ing a particular node The tree begins with a main root connected to a num ber of labeled sub roots or nodes Ea
79. carefully tucked the encoder strip away for another day CIRCUIT CELLAR www circuitcellar com x4_CLK PLE LPL LE LEE LI LL LEP LEP LL LI Le see note x2_CLK fL SL jL see note toz x1_CLK see note Note x1 x2 and x4 CLKs are internal up down clocks derived from filtered and decoded quadrature clocks Figure 1 These are A and B quadrature signals and options of A1 X2 and A4 decoded outputs Using A4 gives the highest resolution Another option would have been to use what is some times referred to as a yo yo or a pot string encoder This is a string or wire wound around a spring tensioned drum attached to a multi turn potentiometer As the string is pulled off the pulley and tur ns the potentiometer a ratiometric voltage is produced that can be conver ted into displacement Would this work If I used s ay a 0 5 to 4 5 V range with the built in 10 bit ADC in a Microchip Technology PIC microcontroller the resolution would IR The IR is an 8 bit register that fetches instruction bytes from the received datastream and executes them to perform such functions as setting up the operating mode for the chip load the MDR and data transfer among the various registers er ee see The actions of the four functions CLR RD WR and LOAD are elaborated below 1 CLR Clear MDRO to zero Clear MDR1 to zero None Clear CNTR to zero None Clear STR to z
80. ch node may in turn have sub roots or children of its own which are labeled This process may continue to an arbitrary level of depth Figure 1 shows a partial view of the root structure For additional information refer to Keith McCloghrie et al s Structure of Management Informa tion Version 2 SMIv2 Most of the OIs are predefined as labeled pairings of a brief textual description and an integer in the form of text 4 The integer is a shorthand representation of the node OI A dotted sequence of these integers identifies a specific path The root node itself is unlabeled but has three children directly under it one node is administered by the ISO with label iso 1 another is administrated by the International Telegraph and Telephone Consulta tive Committee CCITT with a label ccitt 0 and the third is jointly administered by the ISO and the CCITT joint iso ccitt 2 Along the MIB tree s ISO path you can find the Department of Defense DOD under the other organiza tion node It has authority over a subtree which includes the Internet In Marshall Rose and Keith McCloghrie s Structure and Identifi cation of Management Information for TCP IP Based Internets the sub tree of the Internet is defined as hav ing four nodes Directory Manage ment Private and Experimental The Management sub tree defines objects November 2009 Issue 232 mJ Nov
81. cs com Internet Embedded MCU IMCU W7100 8051 core Flash Controller I F Manager 11 0592 MHz Register Manager TCP IP Core ICMP 802 3 Ethernet MAC JeBpupw Aiowew WVudd X3 X1 8x2 e H W TCP IP MAC 10BaseT ad A 100Base TX Ethernet PHY 18V e Fully software compatible with standard 8051 T e Pipelined architecture with standard 8051 dial e 64K Bytes e Flash memory e 64K Bytes SRAM memory e 100 LQFP Lead free package e Single Chip Serial to Ethernet Gateway IMCU 7 100EVB y Open Source Codes e TCP lookback e UDP lookback e DHCP Client e DNS Client e Serial to Ethernet Gateway e Internet LCD display e HT TPC e Telnet RS232 RJ45 32GPIO LCD Available at www W Zwiki net www WlZnet co kr WIZnet www WIZwiki net ASK ANAGER You re Covered f you need it we ve got it Whether you are looking for solutions to design problems helpful programming tips ideas for exciting new projects or insight on the new technologies coming down the pipe Circuit Cellar has you covered That is our main objective and it always has been Ask any staffer who has been around since Issue 1 and you ll find that we ve always considered ourselves a one stop shop for everything embedded But this month we ve outdone our selves How We literally have something for everyone Linux lovers C language devotees surveillance enthusiasts power hung
82. d A D input data and timestamps Vari ables inpt and tStamp are temporary Nn N Listing 3 Passing by reference void Operation INT16 x Total SIlotsgl X F y INT16 y end of void Operation INT16 x void Functl void INT16 A B Avg do some stuff Operation A B amp Avg Avg do some more stuff end of void Functl void variables for the input A D reading and its timestamp The routine InitWaveln does all the initializa tion required for my variables but not the hardware for the A D conver ter The routine Ini tA2DHdw initializes all the A D converter hardware set up The variable A2DCounter is used to slow down the rate of new readings As I explained this is very early code I m not sure of the timing of all the components How fast do I need Listing 4 Passing a pointer to a structure INT16 Total Keep a running total INT16 y INT16 Total declare these variables here pass 2 variables A amp B and address of data versus how long will it take to process that data I need to run the A D converter as fast as possible and then I ll slow it down by using this counter In the final version I ll use the CPU internal registers to run the A D converter at the rate suitable for the design But until then I can easily speed up or slow down the amount of data feed to my processing routines Lines 75 and 76 define the A D converter interrupt
83. d and places it on the stack before the rou tine is called This is certainly straightforward enough In Listing 1 I defined two variables INT16 A and B Both variables are passed to the routine INT16 AvgCINT16 x INT16 y This routine calculates the average of the parameters passed and returns the average There are several points to cover in this sim ple example Copies of the values of variables A and B are passed to the Avg routine That routine performs an operation on them and then returns the result of the operation That result is then saved in the variable Result The variables A B and Result are defined in the routine Funct1 and are only known to the scope of the routine Functl For a discussion of scope in the C language refer to Tony Zhang s Sams Teach Yourself C in 24 Hours which I list in the Resources sec tion of this article The variables total x and y are only known to the Avg routine This design approach makes sense considering many routines can use the Avg routine and its mechanism remains hidden This hiding is a great feature in several respects On large com plicated projects you can be working on Functl andI can be working on Avg Ican give you my latest version of the routine Y ou can use it without a complete understanding of the implementation You don t have to under stand my work just use it On simpler projects this hiding can be used by one designer to divide the wo
84. d the crystal and upped the processing speed I was still missing counts when I moved the carriage too fast so I tried the internal phase locked Go Qo Listing 1 Communicating with the L57566R is simple The write register8 func tion is used to set up the counter It is also used to move the count contents to buffer OTR immediately prior to a read to prevent missing counts void write register8 int cmnd Examples write register8 CNTR CLR 0 write register8 MDRO WR MDRO as a free counter write register8 OTR LD RA5 1 RA5 0 SPI_WRITE cmnd SPI_WRITE data RA5 1 loop PLL to increase the clock speed to 40 MHZ As it tur ned out I had an old compiler version that did not support the PLL option Purchas ing a new compiler for this p roject was not an option For my final approach I broke down and purchased an LSI Comput er Systems LS7366R 32 bit quadra ture counter with a serial interface I bought two for about 30 This put all of the processing burden on the LS7366R and left the PIC18F2320 with almost nothing to do There is more than one way to skin a cat COUNTER The LS7366R quadrature counter has loads of features for all sorts of comparator counting or quadrature interface operations It can use the index signal from the encoder to out put two marker flags that can be used as alarms or trigger microcon troller interrupts These can also be used for over travel or
85. d you can cut the wires and ditch the wall warts once and for all t s no secret that wireless gadgets I call em wadgets are all the rage Cell and cord less phones Blackberries Wi Fi Bluetooth and a zillion flavors of IEEE 802 15 4 e g ZigBee GLowPAN and proprietary all ride the airwaves More power to them Literally Virtually every wadget must spend at least some time con nected to a wire e g wall wart car charger to get its power fix Sure there are some applica tions that are so simple and intermittent e g garage door opener key less remote that they just run on batteries period But despite advances in battery tech nology truly wireless wadgets are the excep tion rather than the rule Energy harvesting EH to the rescue Thanks largely to the Moore for less march of silicon many embedded wireless apps are able to skim the energy they need from their ambient environment Solar more generally photovoltaic conversion is the most popular efficient and well under stood approach But now EH is really getting creative with virtually any and every joule whatever the source e g vibration ther mal fair game for the taking But there s a problem Just like real crops Photo 1 A century ago Nikola Tesla had science fiction like visions of wireless power delivery that PowerCast delivers as science fact today Source The Tesla Memorial Society of New Yor
86. dule pl2303 and a com munications modem driver package kernel module cdc acm DEVELOPMENT ENVIRONMENT Having a complete Linux desktop environment makes the NSLU2 con figuration and programming task much easier It allows easy access to main pages editors development environments windowing systems and a host of other tools Instead of building up a machine to host the Ubuntu Linux distribution I used Sun s xVM VirtualBox and ran Ubun tu as a virtual machine on top of Vista Make sure you have 3 or 4 GB of memory This provides the best of both worlds having two computers operating with the same mouse and keyboard For network connectivity the virtual machine should be config ured to use the local subnet by put ting in the host network controller into Bridge mode If the virtual machine is using NAT instead of being bridged access to the virtual machine from the NSLU2 is difficult www circuitcellar com CIRCUIT CELLAR Photo 3 This is the web interface for status and configuration used Mozilla Firefox but you can use the browser of your choice The easiest way to configure and operate the NSLU2 reconfigured with SlugOS is to use secure shell ssh The SlugOS will allow at Touch panel amp Touch controller AMD Geode LX800 500MHz 512M DDR RAM 4G FLASH HDD USB ETHERNET RS232 RS485 port SD card support Windows XP embedded Windows 2000
87. e 1 3 6 1 4 1 2680 1 2 7 3 2 0 01 94 78 01 02 07 03 02 00 CIRCUIT CELLAR e www circuitcellar com Pick a Chip Any Chip Find a Solution to your next Embedded Challenge Do the Research you should but never had time for Embedded Developer s intuitive research engine Mg zx each y B Ns m z helps you speed your chip z A E E o evaluation time You don t have cmm PSE 1 8 Encryption to know the manufacturer chip m Tl ec M interna sdla family or part number just irmcrzcmmmm 7c cm S Dn tea select the features you want DENEN and let us do the rest a We help you research your best option Nowhere else can you compare your best options side by side from different manufacturers Click on the device you want and a product page lets you select Distributor Buy Quote options send RFQs Flash 262144 0 262144 l download datasheets and more Max Freg 55 166 1235 i EE Plus Hearst stock check gives you Bee TN Ae wa ups PowerPC etC 2 m Once you have the chip that meets C CAN Ethernet ND ete your needs review and compare the hardware and software RTOS ICE Eval Boar development tools that support it from multiple manufacturers and buy them on line through our shopping cart isa PCI DDR etc d Shave days off your schedule with Embedded Developer the A only site in the world wher
88. e and then repeat the process until the desired dimension is reached When using a manual lathe you have three means of controlling the cut The first is with the cross slide that s mounted to a carriage see Photo la The cross slide controls the cutting bit perpendicular to the work piece It allows a machinist to faceoff the end of a part and move the cutting bit in and out for turning the diameter The second way to control the cut is with the com pound rest or top slide This sits atop the cross slide and holds the cutting bit The compound rest can be used to cut angles and make fine depth adjustments in turning operations Both the cross slide and the compound rest have vernier indicators stamped in a ring for deter mining their movement with a 0 001 resolution Driven by the need for accuracy I installed inexpensive electronic indi cators that perform the same task with more conven ience and have a resolution of 0 00 01 The third option is to control the carriage travel The carriage travels axially along the part and thus controls the axial placement of the cutting tool mounted on it The carriage travel on my lathe is less than 12 A com mercially available means of accurately determining car riage travel is expensive costing several times what I paid for the lathe in the first place So driven by the need for precision on all fronts I e began investigating various linear encoders I was looking for so
89. e 6GHz RF generator 60 100 120MHz AWG Embedded controller series 2 x CANbus Ehternet USB2 0 CF Electronic DC Load lA AP E le p Lo Le O m current 60 100 120MHz USB 14 bit ARB with USB RS 232 LAN GPIB Lorlin Switches Const resistance conductance voltage amp power modes Serial Ethernet Cable Network serial product easily without aPC using this 28 cable 89 Fantastic array of stock and custom switching devices Wireless Solutions RTG005 Ready de outoFthe box FPGA DSP designs for beginners and experts Analog input bluetooth wireless modules 433 868 915MHz KK Systems 9p 9p or 25p 25p self pwrd isolated RS232 RS422 485 Add 1 16 COMports via your PC s USB Port easily 180 really like this scope adapter its meant for teaching electronic experiments but it s ideal for engineers too 5 www saelig com Alan Lowne Saelig CEO Call 1 888 772 3544 to get a free Starbucks Card with your gt 50 order PL1012 PL1216 While supplies last not available with any other offers Mention offer SBW PSA2701T 2 ch 12GHz sampling scope for high speed electrical signals RF Testing EMI Tents APSIN6000 Portable RF test enclosures amp shielding tents with external frame RF Testing EMI Tents TorqSense Configurable patented USB output non contact SAW digital rotary torque DG3061A 3101A 3121A RWT320 transducers with in
90. e or Kill input This design has a significant advantage over direct digital synthesis techniques using a DAC in that zero run time code execution is required When implemented as part of a complete system this leaves the processor available to do what processors do best calculate and control ASSOCIATED PROJECT The associated project is built in a CY8C29866 Data is simulated by a PWM16 This can be replaced by a UART and clock generator or the modulator can be fed digital data through a global input This signal generation technique is useful in many appli cations not just FSK transmission The idea is to reduce the harmonic content prior to filtering and then take advantage of the PSoC s switched capacitor filters al Dennis Seguine BSEE and MSEE UC Berkeley is an applica tions engineer at Cypress Semiconductor He has broad expe rience in system and analog circuit design and he holds eight U 5 patents You may contact him at seg cypress com S OURCE CY8C27xxx and CY8C29xxx PSoCs Cypress Semiconductor Corp www cypress com November 2009 Issue 232 Q S November 2009 Issue 232 ILICON UPDATE Power Pitcher Wireless Power on a Microelectronic Scale by Tom Cantrell Nikola Tesla s century old dream of wireless power delivery is coming true at least for chips This month Tom looks at a system from PowerCast that deliv ers power via radio waves Combine it with low power silicon an
91. e your own serv os and closed loop speed con trol with frequency feedback from a tachometer The jrk 21v5 the smaller of the two units currently available has an operating range of 5 to 28 V and can deliver 5 A continuous output 5 A peak The jrk 12v12 which is the more powerful of the two has an operating range of 6 to 16 V and can deliver a continuous output of 12 A 30 A peak Both devices can handle transients of up to 40 V A free confiquration program Windows XP and Vista compatible is available for calibrating your system Real time plots of variables such as control input feed back motor output and current draw make it easy to fine tune settings such as FID constants acceleration and current limit for your application The unit price is 49 95 for the jrk 21v5 item 1392 and 99 95 for the jrk 12v12 item 1393 HIGH VOLTAGE LINE DRIVER WITH INTEGRATED DC DC CONVERSION The ZIOL2401 is a high voltage line driver with IO Link functionality The first member of a family of high vo Itage line drivers the chip offers two independent l O channels that meet the physical layer requirements of sensor and actuator systems used in factory automation applications The ZIOL2401 combines an advanced two channel IO Link driver with a DC DC converter capable of producing up to 15 V This can power external sensors as well as the ZIOL2401 and it saves space and cost in boar d designs The IO Link drivers are fully programmab
92. e youre only clicks away from finding the chips and tools to get you up and running quickly Try EmbeddedDeveloper com or EmbeddedDeveloper cn in Chinese European Epoca 1 FIND COMPARE BUY The Sites for Engineers with a Job to Do November 2009 Issue 232 upsMIB 1 3 6 2 1 33 Groups Sub groups Objects Sub Objects 1 upsObjects upsMIB 1 1 1 upsident upsObjects 1 1 1 1 upsldentManufacturer upsldent 1 4 1 2 upsldentModel upsldent 2 IEEE upsldentUPSSoftwareVersion upsldent 3 1 1 4 upsldentAgentSoftwareVersion upsldent 4 1 1 5 upsldentName upsldent 5 1 1 6 upsldentAttachedDevices upsldent 6 1 2 upsBattery upsObjects 2 1 2 1 upsBatteryStatus upsBattery 1 ee upsSecondsOnBattery upsBattery 2 1 2 3 upsEstimatedMinutesRemaining upsBattery 3 124 upsEstimatedChargeRemaining upsBattery 4 1 2 5 upsBatteryVoltage upsBattery 5 1 2 6 upsBatteryCurrent upsBattery 6 EE upsBatteryTemperature upsBattery 7 1 3 upsInput upsObjects 3 1 3 1 upsInputLineBads upsInput 1 Mae upsInputNumLines upsInput 2 1 3 3 upsInputTable upsInput 3 1 3 3 1 upsInputLinelndex upsInputTable 1 1 3 3 2 upsInputFrequency upsInputTable 2 1 3 3 3 upsInput Voltage upsInputTable 3 1 3 3 4 upsInputCurrent upsinputTable 4 1 3 3 5 upsInputTruePo
93. ebsite http www machinepier com www circuitcellar com CIRCUIT CELLAR Problem 2 What is the purpose of R1 R2 and Q1 Problem 3 What can you say about the LED current with respect to the actual voltage on point A Problem 4 What can you say about the LED current with respect to ambient temperature Contributed by David Tweed PCBCORE China PCB Supplier Prototype thru Production v 1 layer up to 30 layer v Cost and quality v On time delivery v Dedicated service X Instant Online Quote amp Order Day and Night No minimum quantity 1 piece is welcome Check our low price and save big 86 571 86795686 www pcbcore com sales pcbcore com November 2009 Issue 232 s Q Ko ES e REGLE November 2009 Issue 232 by James Stephanick Embedded Linux Based Location System You can build your own vehicle location device without br eaking the bank This article details how to use a few r eadily available parts an ARM based USB network storage link a prepaid GSM cell phone and a USB GP5S device to build an easy to configure location system fter the second time my car was stolen out of my driveway I began looking for an inexpensive way to track my vehicle s location The first solution I implemented was a ham radio ph eo APRS installation When the car was on a ham radio and GPS unit were used to beacon the car s location every 3 minutes Random
94. ember 2009 Issue 232 used in the management of the Inter net standard this path is the way to the simple network management pro tocol SNMP 1 3 6 1 2 1 11 while the Private subtree provides nodes to companies requesting a private enterprise number PEN from the Internet assigned numbers authority IANA under its enterprises node For instance my PEN is 33746 With this assignment my tree path would be 1 3 6 1 4 1 33746 This is sig nificant to me because I can define the sub tree below this node More on this shortly SNMP The Hypertext Transfer Protocol HTTP is the application layer pro tocol you are probably most familiar with because you use it every day for interacting with others through graphics audio video and plain text The Simple Network Manage ment Protocol SNMP is similar to HTTP but it deals directly with net work attached devices and doesn t need the fluff required for human readability The SNMP protocol includes an application layer the how a database schema the where and a set of data objects the what The SNMP exposes data objects which describe the device configuration and even status and control values These objects can then be queried and even set by managing applications An SNMP managed network con sists of at least one managed device an agent and a Network Manage ment System NMS A managed device has its own pool of data relat ed to its function b
95. endar puts the OmniFlash ahead of the competition Call 530 297 6073 Email sales jkmicro com On the web at wwW jkmicro com E November 2009 Issue 232 Low Cost panel PC PPC E7 Fanless ARMS 200MHz CPU e 3 Serial Ports amp SPI Open Frame Design 3 USB 2 0 Host Ports 10 100 BaseT Ethernet 35C 125 Adio Mterlace SD MMC Flash Card Interface Battery Backed Real Time Clock Upto 64 MB Flash amp 128 MB RAM Mower n fem DESPITE I3 Windows CE JTAG for Debuging with Real Time Trace JS WVGA 800 x 480 Resolution with 2D Accelerated Video Four 12 Bit A Ds Two 16 Bit amp One 32 Bit Timer Counters setting up a Panel PC can be a pllzzling experience However the PPC E Compact Panel PC comes ready to run with the Operating System installed on Flash Disk Apply power and watch either the Linux X Windows or the Windows CE User Interface appear on the vivid color LCD Interact with the PPC E7 using the responsive integrated touch screen Everything works out of the box allowing you to concentrate on your application rather than building and configuring device drivers Just Write It and Run It Starting at 495 For more info visit www emacinc com panel pc ppc e7 htm Since 1985 OVER 24 Suz NL J NC YEARS OF SINGLE BOARD SOLUTIONS Phone 618 529 4525 e Fax 618 457 0110 www emacinc com CIRCUIT CELLAR e www circuitcellar com when the transformer is storin
96. entioned checks look to see if there is 24 V powering U2 MC34072 and U4 MC34072 and the optocouplers U5 and U6 4N35 are good or else this will cause the PWM controller to output a maximum duty cycle with the control loop not functioning properly Before testing your power supply connect a 10 V potential at the output of the supply and adjust R38 10 kO multiple turn trimmer so that the wiper ar m s output or voltage reading pin is 10 of the output USING THE POWER SUPPLY For an output of 5 V simply key in 5 00 or press 5 and then the key which acts like an Enter key while the symbol acts as a decimal point The same goes for the current The power supply s maximum voltage is 20 V The maximum current is 1 A Please note that there will be no output if you enter a voltage on the keypad and you don t enter a current setting because the power supply will be in a constant current mode Also if the voltage is not reached after the load is applied adjust the current until the voltage is correct POWERFUL SMPS My SMPS can be used for powering any circuit that uses up to 20 V and a current up to 1 A The voltage input is 220 V which is the voltage in our country If your mains supply is 110 V close the switch so the volt age doubler will function You can also use a 12 V exhaust fan to cool the SMPS in case the ambient tem perature in your area is high al Noel Rios noelrios7 yahoo com and noelrios 7 Qqmail com
97. er loop This value was then hard coded into the soft ware I wasn t too concerned with bed travel speed accuracy Bed travel speed is an indication of the feed rate when making an axial cut by hand It is used for reference only PROJECT BOX Refer to the circuit diagram see Figure 3 The encoder inputs A and B are connected to LS7366R input pins 12 and 11 respectively The clock connected to fCKi and fCKO is required for the filter when in quad rature mode The serial SPI commu nications are on pins 4 to 6 and con nect directly with the PIC18F2320 SPI pins with the exception of SS which is connected to RA5 The assembled project box is shown in Photo 2 I used a prototyping board I had made several years ago for a PICIG6F873 All the pins mapped over to the PIC18F2320 which was quite nice That board was one of my first and there were lots of errors I didn t include a pic ture of the underside where I made all my corrections I used a separate prototype board for the LS7366R and connected it to the PIC with a header and cable I then placed both boards inside a proj ect box and tacked them in place with a spot of glue There is no power switch Simply plug in the wall wart to turn it on If I use this more than anticipated I ll end up installing a power switch PERFORMANCE STOP TO STOP How does it all perform The only way I could think of to compare the two signals was to connect the counter to the A channe
98. er path took to him to the mobile phone indus try where he led the Tegic engineering team James is now leading the engi neering team at Cequint a Seattle based start up company that provides enhanced caller ID solutions for North American mobile phones You may con tact him at james rainshad owtech com p ROJECT FILES To download the code go to ftp ftp circuitcellar com pub Circuit_ Cellar 2009 232 D so RCES Developers Home Short Mes sage Service SMS Tutorial www developershome com sms GPS Info http gpsinfor mation net NSLU2 Linux development group and user community http www nslu2 linux org TCL Developer Xchange www tcl tk Sauce USB GPS Device Deluo LLC www deluogps com Ubuntu 8 10 Desktop Edition Canonical Ltd www ubuntu com Linksys NSLU2 USB Network storage link Cisco Systems www linksysby cisco com VirtualBox Open source virtual ization software Sun Microsystems www sun com CIRCUIT CELLAR www circuitcellar com The Newest New Products from TEXAS Y INSTRUMENTS ON ITT AN MICROCHIP Authorized Distributor ON Semiconductor S FB TEXAS ers Authorized Distributor Green Mode PWM Controller eases Sas aes 4 UCC28600 FAIRCHILD VISHAY 3 03 NO www mouser com Sener founded by Philips tipowermanagement a Infineon i Supertex STM6904 STM6905 Multiple Voltage Supervisor www mouser com st a
99. eration Dipole Omnidirectional Sleeve dipole Omnidirectional Short loaded dipole Omnidirectional Flexible dipole Omnidirectional Patch Directional from surface Yagi Directional from edge Table 1 When it comes to RF the choice of antenna may not be everyt hing but it s a big deal Directionality is a key factor acting like a magnifying glass to focus the available enerqy the distance from the transmitter The black magic of RF is found in the antenna gain factors which depends on a variety of factors including both the type of antenna and implementation issues You don t have to be a rocket scientist to P1200 wire is omnidirectional radiating in a circular donut pattern Other antennas such as Yagi patch or dish exhibit various degrees and patterns of directionality They offer more gain than a dipole presuming of course that the transmitter and P2100 Application Rechargeable alkaline Rechargeable lithium Capacitor charge and fire Recommended operating input 0 to 20 dBm 0 to 20 dBm 10 to 10 dBm Voltage output 3 3 V Maximum 4 2 V Maximum 2 8 to 5 0 V Configurable Power output lt 100 mW continuous lt 100 mW continuous 262 5 mW Peak Table 2 The PowerCast harvester lineup consists of three parts tar geting the most likely applications The P1100 and P1200 feature outp ut voltage limi
100. ered even when the CPU is off and this is where you need to store your application state I don t know how to use the IAR compiler to indicate that a specific variable must be in the back up RAM section so everything is han dled with a TApplication structure application h that contains the application state that needs to be kept active An Application vari able is then created at address 0x300000 the beginning of the back up RAM and is used th roughout the program Note Do not exceed 2 KB HP also provides screen drawing functions graphics h as part of the SDK source code The functions enable you to display text numbers and graphics on the screen They also give you control of the 11 indicators so you don t have to handle each pixel by hand APPLICATION MODIFICATION Now that you re familiar with the application architecture you can start digging in I suggest that you first look at the PC version of the application in the debugger Place a breakpoint at the beginning of the KeyPress function in the applica tion cpp file Then you can perform step by step debugging to learn how the sample application works Moving on open the IAR project compile it F7 and program it on the calculator Ctrl D followed by F5 to run Next come modifications to the example application For exam ple transform it in an integer only or floating point four operation calcula tor Or just start your own project DEVE
101. eries have a 0 050 x 0 050 grid array for maximum grounding and routing flexibility and are optimized to reduce skew and impedance mismatch They feature rugged Edge Rate con tacts which are designed for superior signal integrity reduced broadside coupling and crosstalk and high cycles SEARAY right angle sockets are currently available in four row up to 200 contacts and six row up to 300 contacts configurations Eight row up to 400 contacts and 10 row designs up to 500 contacts along with a right angle termi nal SEAM RA series are in the final stages of development This system mates with SEARAY surface mount terminal series which has optional guide posts for blind mating and a choice of tin lead or lead free solder char ged termination Press fit tail terminations are currently in development SEARAY surface mount systems with up to 500 single ended or 125 differential l Os coax cable assemblies with 180 or 240 I Os and high density flex jumpers are also available Pricing begins at 0 05 pin in 1 000 piece quantities Samtec Inc www samtec com STATEMENT REQUIRED BY THE ACT OF AUGUST 12 1970 TITLE 39 UNITED STATES CODE SHOWING THE OWNERSHIP MANAGEMENT AND CIRCULATION OF CIRCUIT CELLAR THE MAGAZINE FOR COMPUTER APPLICATIONS published monthly at 4 Park Street Vernon CT 06066 Annual subscription price is 29 95 The names and addresses of the Publisher Editorial Direc tor and Managing Editor are Publishe
102. ero EE CNTR None None MDRO None MDR1 None None Figure 2 These are IR register commands and the effects of the four functions CLR RD WR and LOAD The register to be operated on is specified in B5 B5 The action to perform is contained in Bo and B7 Source LSI Computer Systems www circuitcellar com CIRCUIT CELLAR Output MDRO serially to TXD MISO Output MDR1 serially to TXD MISO None Transfer CNTR to OTR then output OTR serially on TXD MISO Output OTR serially to TXD MISO Output STR serially to TXD MISO Write serial data at RXD MOSI into MDRO Write serial data at RXD MOSI into MDR1 Write serial data at RXD MOSI into DTR Transfer DTR to CNTR in parallel Transfer CNTR to OTR in parallel have been only 0 0039 per bit That wouldn t have been good enough I would have had to go up to a 16 bit ADC to get good enough resolution I considered purchasing a chip but I still wasn t quite satisfied I kept looking One day while browsing on e Bay I found the solution a 12 optical linear encoder with a 1 jum resolution man ufactured by RSF Elektronik Typically an optical linear encoder uses a glass scale with a light source on one side and a set of four photosensors on the other A scanning reticle with four windows sits in front of the photo sensors The reticle and photosensors are spaced to give signals that are 90 apart The signals are then combined to produce two
103. ers include a so called Standing Wave Ratio SWR i e a measure of how much energy is reflected shutdown that automatically turns off the transmitter before damage occurs Along the same lines there s a thermal shutdown feature The PowerCast lineup consists of a radio power gener ating station i e transmitter and three receivers see Table 2 The transmitter operates in the 900 MHz band with the exact frequency selectable by pressing a button on the unit in 2 MHz increments between 903 and 927 MHz The frequency select capability allows the use of m ulti ple transmitters at different frequencies to avoid the wave cancellation that other wise might occur The receivers are tailored for slightly different applica tions see Figure 1 The P1100 and P1200 offer fixed out put voltage limiting that makes them a good choice for designs using rechargeable batteries alkaline and lithi um respectively Design in is as simple as it c an be just connect the antenna on one side and the load on the other The P2100 is a bit different It features a selectable out put voltage between 2 8 and 5 0 V set with exter nal resistors connected to the V pin and is especially tai lored for capacitor based charge and fire designs see Photo 2 The P2100 charges the capacitor attached to the CAP pin to 1 2 V and then tur ns on the DCOUT stepped up to the selected output voltage to t he load When the capacitor voltage falls to 1 05 V
104. es with a wide variety of har dware and software options With 512 MB SD RAM and 2 GB in CompactFlash this sys tem boots quickly has passive cooling with no mo vinq parts at all DIN rail mounted units can be placed almost anywhere due to the very small dimensions 5 7 x 6 5 x 9 0 for standard version 5 7 x 6 5 x 9 0 for two PCI slot version Standard interface connections for CANatomBOX are pro vided on the front panel and Windows Vista XP CE Linux or other choices such as QNX or VxW orks can be preinstalled together with other application software to exactly fit cus tomer needs The CoDe5ys 5oftPLC runtime environment is also supported on this platform CANatomBOd features front panel availability for two inde pendent 10 100MBit s Ethernet ports status LED s an RS 252 serial port two opto isolated CAN ports two USB2 0 ports I O lines etc Units are 10 to 28 VDC powered mak ing them ideal for battery powered operation All inputs fea ture ESD protection of 2 kV Made in Europe by Janz AG a leading industrial control and CANbus manufacturer the CANatomBOX is now avail able exclusively in North America from 5aelig Company with units starting at 1 599 Saelig Co www saelig com NPN RIGHT ANGLE HIGH DENSITY INTER CONNECTS The SEARAY high density open pin field interconnect family is a new line of right angle sockets for perpendicular and high speed micro backplane applications The SEAF RA s
105. filter is a 5 0 V signal which is large enough to saturate the filter output unless the filter is designed to attenuate the signal Narrowband PSoC filters have high gain This is a mathematical limitation based on the range of capacitor values available While a filter band width of 50 Hz would be nice in order to reduce har monics it is not achievable At 2 2 kHz a bandwidth of 800 Hz is achievable This results in attenuation of the fifth harmonic by more than 20 dB the third har monic is already attenuated by the three step wavefor m Of course the filter characteristic on the 1 2 kHz signal is the same as the 2 2 kHz signal because the filter per formance is deter mined by the synchronized over sample clock The filter output waveform is shown at 2 2 kHz in the time domain in Figure 7 and frequency domain in Figure 8 The harmonics are considerably reduced from the levels shown in Figure 5 The highest har monic is the fifth at 38 5 dB below carrier or 1 296 distortion All others are lower except the lines at 87 8 and 90 2 kHz these are the sampling aliases of the filter with a level 32 dB below car rier The sum of the low order har monics and the first pair of aliases results in a signal to noise ratio of 29 dB or 3 396 distortion For further reduction the band pass filter is followed by a 7 1 kHz LPF with a 1 0 MHz sample rate The waveform looks even cleaner because the first filter s sampling alias is significantly
106. from the trenches of C coding p 50 He makes a con vincing argument for passing parameters in the first place and then describes how to do so and get results Do you remember Dennis Seguine s 2006 Circuit Cellar 194 arti cle titled Simplified FSK Signal Detection There he presented an efficient method for detecting FSK signals This month he describes how to to generate FSK modulation with low distortion and low transition phase error p 54 On page 60 Tom Cantrell presents a truly exciting concept wire less power on a microelectronic scale That means wireless power delivery The future is now And lastly we arrive at a topic important to everyone device management Jeff Bachiochi explains how to monitor networked devices via the simple network management protocol SNMP With the SNMP you can keep build an MCU based managed device to monitor numerous networked modules and log critical data p 66 C Ahit cj circuitcellar com i November 2009 Issue 239 CHIEF FINANCIAL OFFICER Jeannette Ciarcia MEDIA CONSULTANT Dan Rodrigues CUSTOMER SERVICE Debbie Lavoie CONTROLLER Jeff Yanco ART DIRECTOR KC Prescott GRAPHIC DESIGNERS Grace Chen Carey Penney STAFF ENGINEER John Gorsky ADVERTISING 860 875 2199 Fax 860 871 0411 www circuitcellar com advertise PUBLISHER Sean Donnelly Direct 860 872 3064 Cell 860 930 4326 E mail sean Q circuitcellar com ADVERTISING REPRESEN
107. g ener gy while the MOSFET conducts see Photo 4 Use the right gauge or a lower gauge number for the primary and secondary to minimize copper losses Also make the PCB trace of the out put of the transformer to the power supply s terminal block wide enough so that there will be no voltage drop across the output I bolted the power MOSFET to the supply s chassis so it runs cool even under full load If you can t make the trace wide enough apply solder to it to increase its cur rent capacity While you re testing the power supply never bypass the fuse or use a breaker with a low cur rent rating I used a circuit breaker with a 0 5 A rating TROUBLESHOOTING Don t be discouraged if the sup ply doesn t work the first time after con struction If it doesn t work consider the following tips Test the digital and analog parts separately Connect a 5 V supply to the digital part Enter a voltage on the keypad The output of the volt age DAC should be from 0 to 2 V and the output of the current DAC is from 0 to 1 V If the DAC has no out put check if there is a pulsating sig nal on the SCLK CS2 CS3 or DIN after the voltage is entered on the keypad Also check for a 2 048 V at the reference pin of the DACs This 2 048 V comes from the ADC MAXI1111 Check if the ADC and DAC have their V and GND con nected properly Apply a voltage to the ADC s inputs from 0 to 2 V and check if the display is correct
108. g returned While SNMP gives you a way to pass data how do SNMP Message Type Sequence Length 44 you know where to find this data DATASHEET The key to the location of the data is the datasheet or in this case the MIB s Ols The standards group has predefined data objects OIs for a number of standard devices such as a modem a cable device an uninter ruptible power supply UPS a printer and so on Let s take a closer look at the stan dard MIB for a UPS The standard MIB for a UPS uses OI 1 3 6 2 1 33 upsMIB covered in RFC1628 Table 1 includes the first OI in the sub roots of this MIB The first object in this tree is upsIdentMan ufacturer 1 at sub root node 1 1 1 of the upsMIB Each object is described using the Abstract Syntax Notation One ANS 1 This is a standard notation structure that ensures data will be presented in a machine independent way The Packed Encoding Rules PER that enable this data to be compressed and transmitted is complex and SNMP PDU Type GetRequest Length 30 Request ID Error index Type Integer Type Integer Type Integer Length 1 Length 1 Value 1 Value 0 06 OD 2B 0601 04 Figure 3 The SNMP data is rolled into the IP packet in Figure 2 e Qo Varbind List Type Sequence Length 19 Varbind Type Sequence Length 17 Object identifier Value Type Object identifier Type Null Length 13 Length 0 Valu
109. g such devices Entire contents copyright 2009 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 e www circuitcellar com W f i n SON a a N E a E i T serere 7 ety Fey Sy a eee aJ SES EAS so L UN ATT ELLI i LA I4 ts vz 2 2 T M NA WaveSurfer P CE WaveJet 200 MHz 1 GHz WaveAce 100 MHz 500 MHz 60 MHz 300 MHz Experience the New LeCroy Oscilloscopes Debug verify characterize troubleshoot analyze oscilloscopes do it all but LeCroy s breakthrough oscilloscopes do more More measurements more math and more time saving tools to easily make measurements in even the most challenging situations LeCroy To learn more about LeCroy s full line of oscilloscopes including the 30 GHz WaveMaster 8 Zi Sees eae the world s fastest real time oscilloscope visit www lecroy com or call 1 800 5 LeCroy SSUE a Unver Euer o November 2009 Analog Techniques 1 Embedded Linux Based Location System James Stephanick c Energize a Circuit An Innovative Switched Mode Power Supply Design Noel Rios gt Precision Linear Encoder Display Carl 5toesz A lt How to Repurpose a Development Platform Cyrille de Brebisson AL Low Distortion
110. g the capacitor and therefore not restart the device However the next time the car is left off for 5 minutes it will proceed to boot normally Note that there are other power on hacks available to get around this short coming They completely disable the Off button should you use this con troller for other purposes I m considering a few new features for the design I want it to accom modate gt KETTE Development Solutions for ARM 8051 amp XE166 Microcontrollers C and C Compilers Royalty Free RT X Kernel py Vision Device Database amp IDE p Vision Debugger Examples and Templates Complete Device Simulation Keil PK51 PK166 amp MDK ARM support more than 1 700 microcontrollers November 2009 Issue 232 N N RTX Kernel Source Code TCPnet Networking Suite Flash File System USB Device Interface Examples and Templates CAN Interface Keil RL ARM and ARTX 166 highly optimised royalty free middleware suites Download the py Vision4 Beta Version keil com uv4 time zones instead of simply repor t ing UTC time I also want the design to temporarily shut off the power up SMS capability at certain times of the day l James Stephanick BSEE MSEE MBA began designing and programming real time embedded image processing systems to automatically analyze cytol ogy specimens Later his care
111. ght bulbs have remained pretty much untouched for 130 years Certainly no other elec trified invention can claim so much history so why dump it all now Barely 6 of the energy powering an incandescent bulb is light And while 94 radiated as heat might seem absurd it isn t always viewed as a complete waste when there is 3 of snow outside and you re heating a house in Connecticut with 4 per gallon heating oil Of course personal rationalization aside the vast majority of the world views incandescent bulbs as grossly inefficient As of September 1 you can no longer purchase them in Europe and the same situation will exist here in 2012 The primary lighting source for the immediate future is supposed to be com pact fluorescent lights with LEDs a bit more down the timeline Invented about the same time as the incandescent bulb it took until the 1970s for us to have a workable CFL design and it wasn t until the 1990s that they became affordable today they are 1 50 They use about one fourth the power of an equivalent lumen incandescent bulb last 10 times longer and run a whole lot cooler What s not to love I am probably a very unique case but let me just tell you some of the realities of no more incandescent bulbs from my perspective And before any newbie readers e mail me to chastise me for my energy inefficiency let me remind you that I have 10 760 W of PV panels powering my house and right now my latest electric bill 0 says th
112. gisters Decoder Internal control bus Timer counters Serial I O Watchdog timer and power manager XTAL1 XTAL2 RST Interrupt SFRs P DPTR AR INC DPTR1 n Address bus gt 16 KB 32 KB 64 KBx8 I O Ports Flash memory Memory ROM control Loader PO P1 P2 P3 EA Z Lu 09 A ALE PROG Figure 1 l used a Maxim Integrated Products D589C450 microcontroller for this SMPS project chose it for its speed and because itis i n system programmable flyback for a variable SMPS It uses two power MOSFET switches and two fast recovery diodes The MOSFET fast recovery diodes and the flyback transfor mer s primary is connected in such a way that when no energy transfer is made to the secondary the energy stored in the primar y winding of the flyback transfor mer is returned to the P1 0 T2 P1 1 T2EX P1 2 RXD1 P1 S TXD1 P1 44NT2 P1 5 INT3 P1 6 INT4 P1 7 INTS XTAL1 XTAL2 EA VPP VCC 1 D2 D3 5 volts DC is 1N4734 Zs 1N4734 Figure 2 This is the digital portion of the SMPS It dictates the voltage that the analog portion outputs www circuitcellar com CIRCUIT CELLAR ALE PROG source of the DC Bus voltage CIRCUITRY The heart of the circuit is a DS89C430 microcontroller U1 which is an 8051 compatible microcontro ller It has three timers two serial ports and 1 KB MOVX RAM I Voltage Reading CHO VDD CH1 SCLK CH2 CS CH3 DIN COM SSTRB SHDN DOUT REFIN DGND
113. h the four pulse width modulation generator channels of the AT91ISAM7L128 and the SPI This enables control of up to three peripherals An IRQ signal is also available as well as three CPU wake up pins that can restart the CPU from Off or Backup mode For more in depth information about these connectors and how to use the CPU peripheral refer to the HP schematics that are included with the system development kit and the AT91SAM7L128 documentation SYSTEM DEVELOPMENT Now that you re familiar with the platform the question is How do you do something with it The first thing to do is download the system development kit Refer to the link in the Resources section at the end of this article or follow the software and drivers link from the HP 20b page on HP s website The kit includes the HP 20b binary so you can reprogram your calcula tor with the original firmware if needed the calculator s schematics www circuitcellar com CIRCUIT CELLAR 66 In order to program your calculator you probably will want to use a JTAG inter face Although this is not 100 neces sary it allows you to connect the CPU directly to the development environ ment which is a great plus because you can have a one step solution for down loading your program in the calculator and step by step debugging 99 The following Circuit Cellar bonus content is now available for you to read online or in a downloadable PDF Just visit Circuit
114. he first PWMDB output is low pulled down and the second PWMDB output is high pulled up the combined output is resistively divided at a point at V p 2 resulting in the three step wavefor m of Figure 4 But why does the three step wavefor m work so well This waveform has a Fourier series 5 Hes 2 where d is the duty cycle of the half wave pulse Parsing the equation will help understanding f is the FSK output fre quency either 1 200 or 2 200 Hz sin n 1 2 yields zero when n is even guaranteeing that the wavefor m has only odd har monics sin nzxd 2 is zero when n x d is an even integer so for d 2 8 sin nznd 2 0 when n 3 9 15 The resultant spectrum is shown in Figure 5 dBC refers to decibels below carrier A similar result for d 0 8 results in suppression of harmonics 5 15 25 The best result is n7 sin 2nf t Clock to filter 160x Clock FSK 3 Step out PWMDB div by 160 ENABLE Figure 4 The PWMDB has two complementary outputs When either side is active the output is pulled to the respective rail During the PWM deadband time the outputs are resistively added to form a third level November 2009 Issue 232 Nn Q November 2009 Issue 232 Square Wave 3 Harmonic hirer ALIE ELI LIU Pe tt A 3 Step 3 Harmonic 48 dBC Figure 5 The spectrum of a square wave shown in the upper plot has components that fall off as 1 n A
115. he polarity of the secondary winding s terminal connected to the Schottky diode becomes positive and the other ter minal becomes negative Thus the A A x Awy But I used a larger core which enables me to handle more power and there is a less chance that the ferrite core will saturate Make sure the power ferrite core is rated for 100 kHz or else the core will heat up due to core losses Wind the magnet wire neatly and tightly so that the coupling of the primary and secondary is good Wind the primary clockwise and the secondary counter clockwise It s important that you wind the two in opposite directions otherwise your power supply won t work It is not Schottky diode is forward biased and delivers the energy stored in the core material The secondary delivers the stored energy in the core material only after the MOSFET becomes an open switch because of the Schottky diode The Schottky diode blocks the voltage 16MB FLASH 32MB RAM 200Mhz Arm9 CPU 16 Digital I O Audio Watchdog In Out 10 100 Ethernet 2 Serial Ports Battery backed Clock Calendar 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 the 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 Cal
116. here are several approaches lots of filter sections elliptical filters with strategically placed notches or digital waveform modifications to reduce near band har mon ics before they are filtered Modifying the PWM to be a PWMDB with a dead band a three step waveform can be generated as shown in Figure 4 The dead band is set to be one third of each half of the wave form or 6796 duty cycle One of the PWMDPB s outputs is inverted and the two PWMDDB outputs are added together This is not done logical ly but rather arithmetically using resistors One way is to connect a resistor 10 kQ is sufficient from each PWMDB output to a common point Easier yet is using the resistive Figure 5 The outputs of the data enabled counters of Figure 2 clearly show the over clocked nature of the generator The PWM divider output results in a square version of the F5 encoded data www circuitcellar com CIRCUIT CELLAR Counter freqo FSK OUT Counter fregit Figure 2 The data input enables one of two counters to generate o verclocked he output frequency The EXOR selects the valid clock as the source which divides down to the desired output frequencies pull up and pull down outputs of the PWMDB GPIO When both outputs are high the strong drive of one drives the out put to the positive rail V pp When both outputs are low the strong drive of the other output drives the summing point to the negative rail V When t
117. ical competitive signal conditioners need pre cision matched resistors to track voltages well over temperature The MAX15500 01 s integrated volt age amplifier and voltage to current converter elim inate the need for those additional resistors Only the current gain setting resistor is external to the device The devices offer extensive fault detection including open circuit load in current mode short circuit load in voltage mode over temperature and supply brownout Both intermittent and permanent load faults can be detected If a fault occurs the open drain fault interrupt pin will be pulled low The status of the fault bits is available through the SPI interface With a higher 24 V supply voltage the MAX15500 01 can handle a typical load of 750 Q in current mode With 52 5 V supplies this increases to 1 000 Q Additionally the MAX15500 01 outputs power supply inputs and sense inputs are protected against overcurrent conditions a short to ground or supply v oltages UD TO 55 V Prices start at 2 96 1 000 up FOB USA Maxim Integrated Products www maxim ic com NPN November 2009 Issue 232 x GU November 2009 Issue 232 FANLESS FLEXIBLE CANbus WINDOWS CONTROLLER The CANatomBOX is a versatile compact embedded con troller targeted for embedded CANbus control applications Based on Intel s 945GME 1 6 GHz Atom processor this con troller box is application customizable even in small quanti ti
118. icrocontroller Control with Serial Mode PWM Control for High Efficiency Suitable for 12V and 24V Systems www futurlec com November 2009 Issue 232 November 2009 Issue 232 Q E508 FROM THE TRENCHES by George Martin Passing Parameters How do you partition a design problem into manageable modules With this article you ll learn why it s smart to pass parameters in the first place and then find out how to pass parameters and receive results with the C language would like to talk about passing param eters and receiving results using the C lan guage I plan to cover why you would want to pass parameters in the first place and how the language performs this operation This is a small portion of a larger topic How do you par tition a design problem into manageable mod ules that can be designed coded tested and released into the complete system That topic is at least a master s thesis and probably more in the doctoral thesis arena Let s start with the basics of passing parameters and then take a look at design partitioning PASSING BASICS While searching the Internet for concisely worded material as background I came up with several discussions on this topic An example is S Joon s website noted in the Resources section at the end of this article Let s start with the simple rule that C passes parameters by value The compiler makes a copy of the value to be passe
119. in timed periodic fashion Data D logging applications require the kind ESOURCES l DO e P E EES be D Bruey SNMP Simple Network Management Protocol RaneNote 161 a E ETE O S bores Rane Corp 2005 www rane com notel61 html In the future I ll work on a managed D Harrington et al An Architecture for Describing Simple Network device that will have multiple distribu Management Protocol SNMP Management Frameworks RFC3411 The tions on a network This will require Internet Society 2002 http tools ietf org html rfc3411 writing a management application to handle data monitoring and logging Internet Assignment Numbers Authority IANA www iana org and it will include separate alarm parameters for each device Let me know if you re already using SNMP or K McCloghrie et al Structure of Management Information Version 2 SMIv2 RFC2578 The Internet Society 1999 http tools ietf org html if you re just interested in reading r c2578 mek een ete Own HORE ME MIB Downloads ByteSphere Technologies www oidview com mibs 0 md Jeff Bachiochi pronounced BAH key AH 0 1 html Rote RH ESTES la R Presuhn ed Version 2 of the Protocol Operations for the Simple since 1988 His background includes prod Network Management Protocol SNMP RFC3416 The Internet Society uct design and manufacturing You can 2002 http tools ietf org html rfc3416 reach him at jeff bachiochi imaginethat no
120. ings there is a function to strip leading zeros so as to not mis interpret the integer s value I completed this project using less than 400 lines of TCL code This included simulating a web server to provide network based status and 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 exbresspcb com N remote configuration CONTROL LOOP amp CODE TCL is not necessarily rich in data structures but that is not necessary in this small application I wrote this project old school style with a heavy dependence on a handful of global variables and only a single thread As such it is not difficult to under stand debug or enhance The control loop comprises three top level functions monitoring con nections to the mini web ser ver monitoring the GPS device and monitoring the mobile phone modem see Figure 1 Monitoring port 80 of the network connection to simulate a mini web server takes only a couple lines of code socket server websocketproc 80 sets up the callback routine websocket proc to handle any port 80 connec tions Inside the main control loop update relinquishes the processor to address any outstanding network connections and to call websocket proc when appropriate The func tion websocketproc contained in the source code posted on the Circuit Cellar FTP site reads any data from the con
121. ion 2 2 2 A counter random error start random error stop random error For counters that employ a high quality quartz oscillator and use some form of interpolation the random useful res olution of the counter will typically be in the sub nanosec ond region With a continuous start and stop signal the averaging capabilities of the counter can be used to further improve the resolution of the counter Random timing error JN N is the number of measurements averaged together In theory by continually increasing the number of readings averaged together the random error will continue to approach zero In reality you will eventually hit the noise floor inside the counter The noise floor depends on the counter itself and the environment it is in Typically in a quality counter you can expect the noise floor to be less than 10 ps or somewhere between 11 and 12 digits of reso lution You can easily find the number of averages it will take to reach the noise floor by brute force just keep try ing higher averages until you no longer notice any improve ment in the resolution Accuracy is dependent on your ability to reduce system atic errors First you will want to eliminate or reduce all the errors over which you have some control discussed above l namely zeroing out cable effects setting the prop er trigger level using two channels and setting the input for DC coupling Then you re left with the systematic errors of
122. ipatia taka 1 ilpsCkutletShed amp ctian 1 milpicutetehedDataTyge l tlUpsOvtietTyne C M psDutletShedData 1 o tDutiet5rati 125141851 1430 1 18 2 1 2 TRIPPLITE MIB INTEGER unknown eff T enc amid anby Cure re ULips etl tice The current vob el the Chithet r1 Tiati der ibaira pirid weribergeriter rip pire LIPS tini icti BlUpiQutiet HUp rDutlet Tabla Up rDutlet ntry tlUp cOuzletttate 1 rilipzWiastrhdngSeriBeforefebact B d V ST ANUACTISIMOH a LF i 10090424 Parisd i IDEM 0 60 8 3 i 1 remain Ott alii Sec ends a remaintn dala Intecendi a imaa saha B Photo la MIB browsers can send SNMP messages to a managed device on the network You ll need to Know the network IP address And it also helps to import the MIB txt file dis tributed with the device Although you can still access the device the data will have no con text b A private MIB txt file may be used when the device s objects don t conform to one of the standard MIBs When a private MIB has been produced for a managed device it should use a private enterprise number allocated by the Internet Assignment Numbers Authority IANA This is a free service all industries thanks to the common thread interconnecting our world Not only does a network standardize connectivity but it also removes the need for local presence The industry has seen growth in the use of SNMP monit
123. ircuit in use 14 Eilts the first 19 3 600 Joules two words 20 106 cycles second The answers are available at www circuitcellar com crossword November 2009 Issue 232 N THE DIRECTORY OF PRODUCTS AND SERVICES DEA BOX AD FORMAT Advertisers must furnish digital submission sheet and digital files that meet the specifications on the digital submission sheet ALL TEXT AND OTHER ELEMENTS MUST FIT WITHIN A 2 x 3 FORMAT Call for current rate and deadline information E mail adcopy circuitcellar com with your file and digital submission or send it to IDEA BOX Circuit Cellar 4 Park Street Vernon CT 06066 For more information call Shannon Barraclough at 860 875 2199 The Vendor Directory at www circuitcellar com vendor is your quide to a variety of engineering products and services The 69 PLC Work as Stand Alone Ladder Logic PLC Or as Smart Remote I Os of PC PLCs RS485 allows 256 units to be networked Incredibly Easy to Program ms Our software is used by many colleges for teaching PLCs Get Free Ladder Logic Simulator www tri plc com cci htm Kes Tel 1 877 874 7527 PLC specialist since 1993 Order online at www melabs com USB Programmer 89 95 for PIC MCUs as show RoHS i EI iini CUR Compliant fe fri Programs PIC MCUs including low voltage 3 3V devices includes Software for EE Windows 98 With Accessornes for 119 95 Me 2K amp XP Includes Programmer Sof
124. is technology to build an MCU based managed device that monitors multiple networked modules and logs critical data ost engineers look through a new part s datasheet before attempting to use it This might be to simply identify the part s connections or to fully understand its working parameters In general a datasheet provides specific answers that cannot be gleaned from just looking at a proverbial albeit tiny black box You wouldn t think of connecting a peripheral to your micro with out some knowledge of how it will integrate into the design With the pinout you could connect all of the signals using the proper communication bus structure You might even be able figure out if it is an input or an output device But without knowledge of a device s inner workings trying to make full use of it is futile For years we used serial and parallel ports on our PCs without any real knowledge of what was being plugged in Originally about all that was available was a printing device and driver support was unnecessary But once manufacturers understood just how useful these ports could be peripheral I O devices started popping out everywhere document scanners barcode readers weight scales mice modems and more One day someone asked Wouldn t it be nice to have some kind of universal port that you could plug anything into That question lead to USB and FireWire technologies USB and FireWire attempted to become eve
125. isson cyrille hp com is a French engineer living in Boise Idaho where he works for Hewlett Fackard s calculator division He earned a degree in computer science electronics and control from one of the French Grande coles Cyrille is particularly interested in optimization D eresence 1 Atmel Corp AT91 ARM Thumb based Microcontroller 6257 AS ATARM 2008 http atmel com dyn resources prod documents 6257s pdf R ESOURCE Hewlett Packard HP 20b Business Consultant Financial Calculator Dri vers and Software Download http h20000 www2 hp com bizsuppor t TechSupport SoftwareIndex jsp lang en amp cc us amp prodNameld 3732535 amp prodTypeld 215348 amp prodSeriesId 3 732534 amp swLang 8 amp taskId 135 amp swE nvOID 54 S OURCES AT91SAM7L128 SoC Atmel Corp www atmel com HP 20b Business Consultant Financial Calculator Hewlett Packard www hp com Save Up To 6075 on Electronic Components New Ethernet Mini Board deal for Connecting Microcontrollers and Control Boards to a Network A WA X Supports both 5V and 3 3V Systems I Suitable for both Full and Half i Duplex Modes i oe A E F i AEE a 5 the ATMegal 28 Elre ontroller with 128k Flash Memory zpl ae PI 12C PWM All Supported ESSo se 53 I O Points 19 9 CERE mbedded Controller y 10A Dual Battery Solar Regulator Automatically Switches between Batteries depending on the state of Charge M
126. k www teslasociety com sometimes the harvest may not come in For example a solar harvester is subject to the whims of the weather i e clouds One solution is to over engineer the design e g larger panel and battery to account hopefully for the worst case What if there were a way to have the best of both worlds i e the convenience of wireless combined with the predictability and relia bility of wires Power would be supplied on your terms when and where you want it and not depend on the vagaries of nature or the application Wireless power delivery isn t a new concept Fully 100 years ago Nikola Tesla used his parlor trick of illu minating a light bulb in his hand as the basis for an elaborate vision of wireless CIRCUIT CELLAR www circuitcellar com power transmission on a grand scale see Photo 1 Coming down to earth consider your electric toothbrush Obviously mixing wired contacts and water isn t going to cut it Instead we find a transformer like arrangement with the AC powered primary cradle transferring energy to the secondary in the toothbrush across a her meti cally sealed gap PowerCast is an outfit that brings Tesla s vision of a wireless power utility to life on microelectronic scale As their company name implies they broadcast power using radio waves So how much power can you extract from RF Bell Labs radio scientist H T Friis came up P1100 Antenna Type Op
127. l calculation capability e g averaging that can be applied to the stored readings For instance the 53131A and 53132A can store as few as two and up to 1 000 000 readings in memory that can be analyzed with built in statistical tools The only trade off of employing averaging is a longer total measurement time SYSTEMATIC ERROR There are two main types of systematic error that you have some control over when you make time interval measurements trigger error and cabling connector error Let s first focus on trigger error You have some control over the quality of the start and stop edges the input settings and the trigger level settings Any input start or stop trigger edges that do not have smooth voltage transitions through their rise or fall will cause timing errors unless the irregularities are repeatable between the start and stop edges For accurate trigger tim ing on digital signals setting each input on the counter for DC coupling is important AC coupling will have a drastic affect on the input digital signal s slew rate Also the effect on the start event slew rate will differ from the effect on the stop event slew rate because the capacitance in the start input circuit will not be exactly matched with the stop input circuit capacitance Trigger errors also surface if you set the trigger level controls improperly on the start and stop events You need to ensure each event triggers off the same percentage point of the sle
128. l data as a selectable fre quency This example has 1 200 baud data one bit high at 2 2 kHz two bits low at 1 2 kHz CIRCUIT CELLAR www circuitcellar com Counter_freq0 is static the output follows the tog gling input of the other Counter The result is a square wave output generated without software intervention For an initial evaluation a PWM with 1 200 baud alternating 1s and Os is used to provide the digital data The input data the two 160 times multiples of the output frequencies and the FSK encoded signal are shown in Figure 3 The HART modem spec allows up to 20 degrees phase error in the transition from one bit to the next Since the output frequency is derived from a 160x clock the phase error will be between 0 and 2 25 degrees This clean phase transition limits the inter symbol error and enables easier detection of the FSK data at the receiving end What remains is tur ning that square wave into a respectable sine wave or something with low enough harmonics to meet the intent of the spec System clock Data in replicas of t to the PWM DIGITAL HARMONIC REDUCTION The square wave output of a PWM has har monics all ODD that fall off as 1 n Thus the third har monic is down 10 dB the fifth down 14 dB the seventh down 17 dB the ninth down 19 dB and so on The higher harmonics are easily filtered but it is difficult to attenuate the third har monic because it is very close to the useful band T
129. l of the encoder multiply by two and then divide by 1 000 to get the LCD when in metric units This was as good a method as I could think of to com pare It is not perfect because the counter cannot work with a quadra ture signal I then ran the carriage from stop to stop manually as fast as I could and then very slowly CIRCUIT CELLAR e www circuitcellar com Figure 3 This is the entire system The counter chip sits on a separate board and is connected to the main 10k Change Units cL board with a cable RAO ANO Note Disconnect LCD RA1 AN1 during ICSP programming RA2 ANZ VHEF CVHEF RAS AN3 VREF RAA TOCKI C1OUT RAS5 ANA SS LVDIN C2OUT OSC2 CLKO RAG OSCI CLKI RA7 RBO AN12 INTO FLTO RB1 AN10 INT1 RB2 AN8 INT2 RBS ANS CCP2 RB4 AN11 KBIO RBS KBH PGM RBS KBIZ PGC RB7Z KBI3 PGD RCO T1OSO T13CKI RC1 T1OSI CCP2 UOE ROC2 CCP1 RCS SCK SCL m RC4 SDI SDA do pu RC5 SDO To Board 2 CON2 RC6 TX CK RC7 RX DT MCLR VPP RE3 c inaya 10 Board 2 PIC18F2525 Zero Display Reset To encoder supply Wall wart Power Supply DFLAG LFLAG To encoder signal LS7366 Swap A and B to reverse direction I noted a typical stop to stop error Carl Stoesz carl stoesz bakerhughes com is a mechanical engineer who works as a of six to 10 counts between the research and development engineer for Baker Hughes His focus is on the integration of bench top counter and the display fiber optic sensors into oil wells for
130. l protocol interfaces up to 50 Mbps LAD 16128U Automotive Testing ET lt My e Kits turn your PC into vehicle electrics diagnostic tool I2C Xpress USB Loggers MSR145S Standalone USB temp hum volt current loop datalogger 49 CAN USB FT232RL Intelligent CAN connection from PC s USB port 299 IZ110SR W5100 uOLED 96 G1 Simultaneously transmit composite video and stereo audio signals DS1052D EL USB 1 2 3 4 PS3423 KLARI MOD CAN USB AWM6OXX TX RX 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 20M S 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 Mac OS s Only 180 microCAM Multichannel DAQ 12 16 input 1kS s 10 12 bit PC connected voltage logger EMC Spectrum Analyzer Compact compressed serial output camera module for any host system EMC Spectrum Analyzer uCAM 232 UCAM TTL RF amp EMF Spectrum Analyzer 1Hz to 7GHz for WiFi mikes etc CANminiBOX Handheld Palm PC based 2 7GHz Spectrum Analyzer MC RF amp EMC Spectrum Ww RF Generator w High res extremely low noise portabl
131. le including slew rate and current limitation and offer complete diagnostics as well as over temperature protection The maximum current driven by the output stages can be set to a value that best fits the customer s application All configuration parameters are stored in an on chip EEP ROM and automatically loaded during power up The ZIOL2401 reports all status information such as an over load condition or over temperature A SPI supports the access to configuration and status registers In addition to IO Link device and master ports the device supports stan dard I O and works with both 5 5 and 5 V systems It also offers wake up detection and fast direct event signaling Unit prices start at 5 in vol umes of 1 000 devices or more ZMDI AG www zmdi com www circuitcellar com CIRCUIT CELLAR Pololu Corp www pololu com MAGNETIC ROTARY IC The AS55215 a new dual die high precision analog sine and cosine output magnetic encoder IC tar gets redundant motion sensing solutions for automotive microcontroller based systems The IC is also ideal for safety challenging applications such as electronic power steering systems The amplitude of the A5215 s output signal is program mable via sensitivity and gain settings Due to its selec table output mode signals raw inverted or DC refer enced the A552195 can fit a variety of conventional motion sensing systems which require measurement redundancy for safety reason
132. lent s 53131A and 53132A universal counters employ digi tal interpolation that enables them to resolve single shot time interval measurements as low as 750 ps and 350 ps respectively AVERAGING MEASUREMENTS So far we have discussed only how low a counter can resolve a single propagation delay measurement time inter val measurement Single shot measurements are done with just a single start and stop pulse versus continuous repeating start and stop events The problem with single shot meas urements is that random error and noise in the start stop signal in the counter s clock signal in the input signal con ditioning and in the interpolation circuitry will reduce the measurement s useful resolution Performing statistical aver aging on a continuous start stop signal can help reduce ran dom error The key here is that the error has to be random meaning it takes on a Gaussian or normal distribution No November 2009 Issue 239 CIRCUIT CELLAR DIGITAL PLUS BONUS BONUS Averaging will not reduce systematic errors discussed later The more measurements you average together the more the random error will approach zero Of course there is always a limit to averaging The limit is usually the noise floor which typically limits the benefits of averaging to more than 2 ps The majority of counters on the market today can store a certain number of readings in memory and they include built in statistica
133. low to high transition of the SS pin Data is shifted into the MOSI pin most significant byte MSB first on high transition leading edges of the SCK clock Data is shifted out of the MISO pin MSB first on low tra nsi tion trailing edges of the SCK clock Write commands cannot be com bined with read commands The counter can be configured as a 1 2 3 or 4 byte counter All the registers will automatically adjust to the specified byte width For exam ple if the counter is configured as a 2 byte counter it expects 2 bytes in reading and writing operations fol lowing the instruction byte If 3 bytes are sent to a 2 byte configured chip then the third byte is ignored The LS7366R uses five registers DTR CNTR STR MDRO and MDRI DTR is an input data register for storing values to be written to the CNTR It is also used for Modulo n and Range limit comparisons CNTR CIRCUIT CELLAR www circuitcellar com weer ii lt Ta OUI Photo la This is a typical manual metal working lathe Y ou can see the cross slide with indicator 1 the compound top slide with indic ator 2 the carriage hand wheel for axial travel 5 a tool post 4 and a spindle with chuck 5 back of the bed It is mounted upside down to prevent debris from entering the slide is the counter which tracks up and down counts from the quadrature clock signal at A and B In non quad rature operation it counts each up and down pulse
134. lus 4 power planes e Manufacture circuit boards at any board house Mental Automation Inc 253 858 8104 www mentala com November 2009 Issue 232 m QO Free 96 page catalog 1 800 826 5432 r 186 processor 33 MHz DOS w Flash File system 44 Digital I O lines w CPLD Console Debug Serial Port 7 34V DC or 5V DC power 2 Serial Ports Accepts 8MB DiskOnChip 2 16 bit Timers 512K DRAM amp 512K Flash Watchdog Timer Expansion options with Peripheral Boards Flashlite 186 controller Borland C C ver 4 52 FREE Email Tech Support s Serial Driver library AC Adapter and cable Call 530 297 6073 Email salesejkmicro com On the web at www jkmicro com CUSTOM MEMBRANE KEYBOARDS SWITCHES e VERY COMPETITIVE PRICING e Ex 5 4 switch keyboards for 395 00 ePCB backed switches e Custom metal backplates assemblies e Electronic assemblies graphic overlays e Electronic file transfer capabilities Picofab Inc 47808 Blvd Henri Bourassa Charlesbourg Quebec Canada G1H 3A7 Tel 418 622 5298 Fax 418 622 9996 Email sales picofab net 64 BIT FLOATING POINT A feature of the Crossware 8051 Development Suite a C Compiler a Assembler a Code Wizards a Debugging a Simulation a Support Advanced software tools since 1984 www crossware com info crossware com CROSSWARE Tools for Embedded Development Weather Instruments fo
135. m The PowerCast documenta tion notes that many embedded wire less gadgets but apparently not the EmbedRF modules have automatic frequency hopping built in that might prevent problems That got me thinking it would be nice if the Pow erCast transmitter had a computer interface of some kind e g U ART SPI USB that with the addition of external intelligence would allow changing frequency monitoring the alarm conditions SWR thermal and so on According to the Power Cast website they re open to OEM and customization proposals so I imagine something could be worked out if a deal made sense Speaking of alarm conditions I noticed the PowerCast transmitter automatically turned off when I touched the antenna see Photo 5 presumably causing an impedance mismatch and enough reflected ener gy to trigger the SWR shutdown fea ture Ditto for removing the antenna E November 2009 Issue 232 completely a welcome safety feature for the absent minded POWER TO THE PEOPLE Just for kicks I fired up my cell phone and sure enough in close proximity it was able to light up the PowerCast receiver LED too Will we see a time when you use your cell phone to wirelessly recharge your pacemaker Or how about charging your laptop while you sip a latte at the local Wi Fi hotspot I ll leave it as an exercise for any body who has more free time than common sense to try cooking dinner with 3 W Sounds like a go
136. measurement capability to find the slew rate and ampli tude of both the start event and stop event Use that infor mation to establish a trigger level for each based on a per centage of the slew rate This step will eliminate any error caused by differences in the start signal and stop signal slew rates and amplitudes You can also do this using a scope in conjunction with the counter for an easy visual way to match trigger levels based on a percentage of the slew rate ACCURACY amp RESOLUTION We discussed various sources of errors and how you can take advantage of the settings and functionality of a univer sal counter to overcome or reduce them in your digital propagation delay measurements So putting it all togeth er where does that leave you as far as resolution and accu racy are concerned This is not an easy question to answer because counter specifications are often hard to read and vary from manufacturer to manufacturer www circuitcellar com CIRCUIT CELLAR Here is a basic framework to determine a counter s reso lution and accuracy If you re dealing with a single shot delay measurement your useful resolution will be limited by the manufacturer specified time interval measurement random error the random error of your start event and the random error of your stop event The total amount of use ful resolution is obtained by using the root sum of squares RSS method on the three terms Single shot resolut
137. mething that could match the resolution of the compound and cross slide indicators LINEAR TRANSDUCERS Linear transducers come in all sorts of styles One commonly used linear transducer is the linear variable differential transformer or LVDT The LVDT has three sets of coils placed end to end around the tube The cen ter coil is the primary and the outer two coils are the secondaries A ferrometalic core is attached to an object and run through the tube An alternating current is driv en through the primary causing a voltage to be produced in the secondary that is proportional to that of the pri mary These devices had the precision I required howev er when I began investigating them I f ound out that they were just plain too long For example an LVDT with an 8 stroke had a 31 body which was longer than my lathe They were also quite expensive so I moved on I remembered scrapping an HP DeskJet printer and finding inside a strange plastic strip just behind the print er cartridges An optical encoder strip When I scrap ped the printer I saved both the encoder strip and the reader The optical reader was an Agilent HEDS 9700 quadrature encoder with a TTL output A quick Internet search gave me technical data so I promptly hooked up the reader and encoder strip to my counter and a micrometer I was disap pointed that the resolution was only about 0 007 good enough for a printer but not quite enough for this project I
138. n of the IC R21 10 kQ and C11 0 001 pF are connected to the oscillator of the PWM IC which dic tates the switching frequency of the power supply The isolated Flyback mode power supply s switching fre quency is 100 kHz R18 1 kQ Q13 2N3906 R17 1 KQJ Q9 2N3904 Q10 2N3904 and D1 1N4148 form the power supply s gate drive circuit A totem pole was used because the MOSFET must be switched on and off rapidly If the switching of the MOSFET is slow this will result to switching losses that will heat the MOSFET R20 1 kQ switches on Q13 2N3906 C23 10 uF R43 10 kOJ and R44 1 kO act as a soft start circuit It controls the duty cycle of the PWM IC after it is powered up The FlashPro430 FlashPro CC i FlashPro2000 GangPro430 GangPro CC m es TE OVID Reliable and the fastest programmer on the market Perfect for production usage ammers can be co onnec ted one arget d levic es sim 1ultaneously Prog ran nmers ab EET Eu B FPA 1 3 or BSL PE wee wa cu USB FPA 2 MSF L EN use FPA 8 CIRCUIT CELLAR e www circuitcellar com duty cycle slowly ramps up after the capacitor charges R55 10 kQ and R56 10 kQ scale the voltage V to 2 5 V which is fed to the error amplifier R39 510 Q R40 510 9J R37 510 kQ and R38 510 kQ gives gain to the error amplifier and also makes the error amplifier linear If there are no resistors the er ror
139. n three perpendicular axes for sensing the board s tilt and motion The board ships with demo code that enables it to function as a USB mouse or joystick using the accelerometer The accelerometer allows the cursor to move slowly when the board is tilted a small amount and quickly when there is a steeper tilt The evaluation kit is available today for less than 60 Microchip Technology Inc www microchip com 16 BIT ADC FOR INDUSTRIAL AND CONSUMER APPLICATIONS The ADS111x is a new family of 16 bit analoq to digital converters packaged in a leadless QFN measuring 2 0 mm x 1 5 mm x 0 4 mm 70 smaller than the nearest competition In addition to significant system space savings the ADS1115 family pro vides product options for scalable integration to reduce component count and simplify design This family supports battery monitoring portable instrumentation industrial process control smart transmit ters medical instrumentation and other industrial and consumer systems Designed for precision power efficiency and ease of implementation the devices perform conversions at programmable data rates up to 860 samples per second con suming just 150 pA typical of supply cur rent and operating down to 2 V The AD51115 is the most highly integrated AINP1 member of the new family incorporating an oscillator low drift reference program mable gain amplifier comparator and four channel input multiplexer into a tiny pack age
140. nection looks for parameters to update and then dumps HTML status information back to the port With this technique the device can be configured and queried for status information from any web browser see Photo 3 To query the device sta tus simply use its IP address as the URL e g http 192 168 100 4 To update a parameter put the parameter name and new value between ques tion marks e g http 192 168 100 4 sendonesms 1 2 Monitoring the connection and dis connection along with the GPS device s datastream is also straightforward This is a fixed purpose embedded device and not a general purpose computer so the simplifying assumption was made that any USB device detected by the system dev ttyUSB must be the GPS Once detected the device serial connection is configured to interact nicely with the expected data rate and buffering options The process of monitoring the con nection and disconnection along with incoming SMS messages from CIRCUIT CELLAR www circuitcellar com the mobile phone modem uses essen tially the same techniques as reading in the GPS datastream Any devices detected by the operating system dev tty ACM are assumed to be phone modems If an unexpected read error occurs when accessing the device the device is assumed to be disconnected The next time through the top level loop will try to detect and reinitialize SENTENCE PARSING The Deluo GPS device conveniently
141. nsmitter was equipped with an omnidirectional anten na at a given location reflections can partially reinforce Figure 5 Like a cell phone network multiple transmitters can help ensure full coverage a must in situations where receivers may move around or be blocked by transient obstacles such as people wandering around November 2009 ssue 939 Oo UJ EmbedRF Desktop Pro File Device Help No response was received from the EmbedHF device Configure Transmit Hecelve Photo 4 Needless to say the PowerCast transmitter can overwhelm wireless radios on the same frequency Recognizing the poten tial problem the PowerCast transmitter fre quency can be adjusted via a push button to allow it and the wireless radio to co exist or attenuate energy delivery A con tributing factor may be that accord ing to the datasheet the har vester conversion efficiency varies between 50 and 70 and in some cases is higher at a lower level of received energy What about interference I dug through my pile of gear and found a 900 MHz embedded wireless setup the EmbedRF modules I covered in Here Come the Wadgets earlier this year Circuit Cellar 223 The bad though not unexpected news is that the PowerCast transmitter com pletely blitzed the radio transmission see Photo 4 The good news is that simply pushing the button on the PowerCast transmitter i e shifting its frequency by 2 MHz solved the proble
142. null points of sin x x and their levels drop The LPF reduced the aliases from the band pass filter The spec trum scan from 0 to 100 kHz in Figure 9 shows that the first filter s alias components are reduced to a negligible level The highest harmonic is the third at 44 dB The total distortion is less than 0 8 The highest alias is at 998 kHz at 52 dB This is a very clean easily generated wave form THE ORIGINAL SINCE PCB PnaL Bete ORUN Low Cost High Quality j pg M E PCB Prototypes qeu 2 j e Easy online Ordering e Full DRC included e Lead times from 24 hrs Optional Chemical Tin finish no extra cost Watch ur PCB Follow the production of your PCB in REALTIME a a E F email salesepcb pool com Toll Free USA 1 877 390 8541 VUA TVA Hejoi 001010 Kero aa LAYOUT Q Qo Figure 8 The band pass filter spectrum shows that the dominant harmonic components are from the sample rate not the harmonics of the intended fundamental The input data three step wavefor m and the final out put are shown in Figure 10 The steps in the output wave form are from the resolution of the digital scope not the sampling in the FSK generator CONSTRUCTION OPTIONS The FSK generator can be limited to a simple modulator driven by externally supplied data or it can be par t of a larg er system built in the PSoC A digital only version with
143. o 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 Cir cuit 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 amp makes no warranties and assumes no responsibility or liability of an y kind for errors in these programs or schematics or for the consequences of any such errors Furthermore because of possible variation in the quality and condition of mater ials and workmanship of read er assembled projects Circuit Cellar amp 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 amp The information provided by Circuit Cellar is for educational purposes Circuit Cellar amp makes no claims or warrants that readers have a right to build things based upon these ideas under patent or other rele vant 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 operatin
144. o 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 I ENET MCU Atmel ATmegai28L MP3 Decoder V51002 V51003 WMA IDE Interface Standard IDE type HDD 2 5 3 5 Power 12V 1 5A LCD 128 x 64 Graphic LCD Etc Firmware download update with AVR ISP connector Only Powerful feature 180 qty 100 Play MP3 Information Reward forward Vol Focusing for full MP3 Player Without case 220 IDE Interface Power Adapter qund Offer full source code schematic bank www icbank com 66 A TL494 U1 voltage mode PWM controller is the heart of this Flyback mode power supply Inside this IC is an oscillator with a sawtooth wave form output two err or amplifiers a comparator commutation logic and a r eference The PWM principle is straightforward Diodes D2 and D3 1N4734 act as protection components and conduct when the supply exceeds 5 0 V It is better for the Zener diode to get dam aged in the case of reverse polarity or overvoltage instead of the microcon troller DACs or ADC The LCD module U5 is an HD44780 based display which displays the voltage and current Capacitor C3 choke T1 and C4 form an EMI filte
145. od way to lose some weight Give PowerCast credit for thinking outside the box and the wire Beyond the technology itself they were smart enough to recognize the convergence of trends i e low power silicon embedded wireless energy harvesting and the green rev olution that mean the time is right for wireless power delivery If Tesla were still alive he would no doubt be impressed and proud deservedly to say he told you so k 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 D erenence 1 PowerCast Corp Lifetime Power Evaluation and Development Kit Rev D 2009 www powercastco com PDF UserManualWeb pdf OURCE P1100 P1200 and P2100 Powerharvester modules PowerCast Corp www powercastco com ee in Po LU d 7 P m 1 S2 p fin De o zl E tu cldi Pew da ue A _ Photo 5 There s more to antenna gain than just the type of antenna A faulty implementa tion e g impedance mismatch can cause a loss of ef ficiency or even damage the trans mitter Here the red LED on the transmitter indicates it has shut down having detected something is amiss CIRCUIT CELLAR www circuitcellar com 2 ch trigger ees USB bench scope 315 499 2 ch 40 100 200MS s 8 bit scope range with 5 10 25MHz 246 Packet Master USB 1 1 2 0 analyzers and generators
146. only Tiwha furit Dufyal Indies upzinparLineimdies Depr The present input frequency prong ded imtermgt mart mih Las MEE ae pe upilngut updinput T aide upiineutintry upzinputinequency 1 Tiener MUS Browser 13 n epi Tools Bookmuadks Help upildentUP ioiei Veriian d Tnppisr TEIPP LITE SMARTS ST ta lupildienb amp usenkSefbarareVerionl 13040045 Device 1 upisima C hargrfurenaemnag D 1M 44 il i upMdOTAM FGM Address 172 16 137 bw Advanced DOE 114 41259 1800 1 1832 11 1 je Operstiens Get Subtes Mie Mii Beudt Table Bi E TRIPPLITE MEB jzc org dod intemet peivate enterpeives tripplite Mame om Value i Cl trippUPS aiUgildeniiEi o iE CH tEnumeratiani tlUpzSnmpaedSeriailium D iE C3 dCanFarmanea nlUp latter Agi D gm PS fllipaTerpiitureF d me tipi Ch eer ii SP pildant de Ga tilipiBabbery Wpilpput euprDutput MUpsCanfighatrtepiDate b wpa 1098 La 0 97 0 iE C3 t lpr larm HL14L41858100 15 1 0 B E t piTest Mpita umutiti E I Ppt airal dHUpiCutlrtindin i CH piCenfhig m priuat Spruta ES ugstesterTable El e Hips Detletiniry OY nupiDuttetissirs Tr nis 14 1559 130 148 100 0 fiUp rTastDate d Lipa Tetris Darulb il UpiWatrhdaaSupported t tuni QutletType l ulipiCeutient anmai t dUpsutiethiame t WU psSutetRampaction 1 jugi curetampData Typed H
147. ontrol Custom board design Save time and LT TERN 1950 5th Street Davis CA 95616 USA A INC Tel 530 758 0180 Fax 530 758 0181 www tern com e sales tern com www circuitcellar com CIRCUIT CELLAR y ou rie au Wl EL Inside great products Behind great ideas phyCORE System on Modules shorten time to market reduce development costs and avoid substantial design issues and risks Windows Embedded CE and Linux BSPs processor dependent 129 unit benchmark price at 1K for ARM9 based SOM Design Services available to assist with deployment into target applications ARM11 i MX35 i MX31 ARM9 i MX27 LPC3250 LPC3180 Cortex M3 STM32F103 ARM7 LPC2294 XScale PXA270 x86 Z510 Z520 Z530 Atom z i Blackfin ADSP BF537 Coldfire MCF5485 t PowerPC MPC5554 MPC5567 phyCORE LPC3250 MPC5200B MPC565 MPC555 phyCORE Rapid Development Kits include SOM Carrier Board LCD kit specific schematics software free BSP for applicable kits and a start up guarantee The Carrier Board serves as a target reference design allowing the SOM to easily port to the user s target hardware www phytec com 800 278 9913 www phycore com Protocol Analyzers Host Adapters 1 Multiplexers Battery Applications D Software Micro Computer Control PC is a trademark of Philips Corporation WwWwWW Mcc us com rolificusas World Class Solutions
148. opwatch to time a runner where the start event is the signal telling the runner to go and the stop event is the runner crossing the finish line For a counter making a time interval measurement the start event is an electrical edge and the stop event is an electrical edge occurring later Gate closes Gate opens Start O MEN Stop MEN Gate Oo Open clock IEEE TET LL LLL EE EEELLEE T LLLLELELEEEL LLL UI Accumulated count Accumulated clock pulses Figure 1 The time interval measurement process BONUS November 2009 Issue 232 CIRCUIT CELLAR DIGITAL PLUS BONUS in time The time interval is measured by counting the number of clock pulses that occur between the start and stop event Figure depicts the time interval measurement process The start event opens a gate that triggers the counter to start counting the timebase clock ticks The counter continues tallying the timebase clock ticks until the stop event triggers the counter to close the gate and stop counting clock ticks There are two fundamental problems with this method of measuring the time interval between two events The first is that the minimum time interval that can be meas ured is limited by the counter s clock frequency With a typical clock frequency of 10 MHz the minimum time interval a counter can resolve is 100 ns the period of one clock cycle
149. or constants and the PARAMETER BLOCK definition will not change as we run the code We then save room for one such PARAMETER BLOCK and name it MyData MyData is where the struc ture is located MyData ValueA refer ences the ValueA variable in the structure MyData Definition StringL2 references the third arrays start at 0 element in the character ar ray Next we tell the compiler that there is a function somewhere in our code named SomeFunction and that the function is passed a pointer to the start of a PARAMETER_BLOCK structure In SomeOtherFunction we are working with our data and have it all loaded in the str ucture MyData before we call the routine that operates on the data And finally TheBestFunctionYet does the same without a lot of overhead In SomeOtherFunction I can put November 2009 ssue 939 Q ash November 2009 Issue 232 in breakpoints to make sure I ve got the correct values for the address of the structure Once I m sure the code is correct I ll change to the faster ver sion I hope you find Listing 4 to be straightforward It might make your head hurt but when you use it suc cessfully for the first time I bet you ll have a smile from ear to ear Let s review We can make variables global Fast but you lose control We can pass variables by value This makes a copy and then calls the rou tine Good but it slows down when we have lots of data to pass We can al
150. or on EUH the PCB that gives access to a serial B8 M M BM if LUE eT or RS 232 port eight GPIO lines Il 1 CES e four ADC channels and the JT AG programming interface of a 36 MHz Atmel AT91SAM7L128 ARM based system on a chip SoC with 128 Kb of flash ROM and 6 KB of RAM see Photo 1 In other words HP created a calculator that is also a versatile development platform Thus you can use this calculator for small or medium quantity special purpose devices Applications could range I M a from software only modifications e g a device designed to help implement a company s specific processes or calculations to a soft ware hardware hybrid with the cal culator connected to external hard ware e g a weather station or A T automation controller The possi Photo la This is the HP20b calculator b The HP20b inside out The Atmel microprocessor bilities are endless is hiding under the Bakelite blob and the JT AG connector at the bottom ee m r E p iR November 2009 Issue 232 CIRCUIT CELLAR e www circuitcellar com INPUT NE BEG STO RCL RAD 360 RPN Photo 2 The HP20b screen has both a numerical display and a matrix area for text or Graphic display the 20b it has a serial port but it does not have the JTAG and other exposed inputs and outputs PLATFORM OVERVIEW The calculator by itself is about 15 cm x 8cm x 1 5 cm and weighs a
151. oring and control of both com mercial and residential properties Environmental security automa tion and data logging applications take advantage of the SNMP Most network device manufacturers provide applications that give access to their products You can find free MIB browsers that not only communicate m N directly with a managed device via SNMP messages but also have high er functions to help in the discover y of accessible SNMP MIBs like walk The Tripp Lite UPS on my home network has implemented some objects in the standard UPS MIB These can be accessed using a browser like the iReasoning MIB browser shown in Photo la Here it s displaying an import of the standard UPS MIB txt file in the left panes and a subtree search of the related Ols in the right pane I highlighted one OI upsInputFrequency that shows the present value in tenths of a cycle requested from the Tripp Lite UPS Photo 1b shows a private Tripplite MIB Remember our ear lier discussion of a Private Enter prise Number PEN Tripp Lite s PEN 850 gives them full con trol over special objects they want to define in their own Tripplite MIB txt file I highlighted the tlupsOutlet State which indicates the present state of the Tripp Lite conditioned power outputs If you look carefully you can see a number of Ols listed by their dot nodes as opposed to object names These are objects that are no
152. powerup 1 sendonesms 17 Number to notify at powerup 12065551212 phonenumtonotify 12065551212 Authorization keyword for SMS response bogus smsauthkeyword bogus GPS DEVICE No satellite fix last known positions are GPS Sentence GPS URL GPS Stat MOBILE PHONE least four concurrent log ons enabling the one device editing of multiple script files and a shell from which to execute the scripts To simplify editing I used the nedit mouse based source editor and edited the files using the Ubuntu virtual machine The Ubuntu virtual machine had the scripts located in a network share to which the NSLU2 had executable access After debugging and completing the scripts I copied them to the GSM Pathname dev ttyACMO the NSLU2 Although designed to work with an external disk the pre CGMI Motorola CE Copyright 2000 _ CGMM GSM900 GSM1800 GSM1900 GSM850 MODEL V 195 _ CGSN IMEI353914016039302 NSLU2 using scp TCL IMPLEMENTATION SlugOS on the NSLU2 is a compiled SlugOS image is a minimal Linux configuration that can run entirely from internal flash memory without a disk or network share The minimal configuration takes up about 75 of the 8 MB flash memo ry leaving sufficient room to add an available TCL script interpreter package tcl a USB driver pack age kernel module usbserial a USB to serial port driver package kernel mo
153. r Sean Donnelly 4 Park Street Vernon CT 06066 Editorial Director Steven Ciarcia 4 Park Street Vernon CT 06066 Managing Editor Carmine J Abate 4 Park Street Vernon CT 06066 The owner is Circuit Cellar Inc Vernon CT 06066 The names and addresses of stockholders holding one percent or more of the total amount of stock are Steven Ciarcia 4 Park Street Vernon CT 06066 The average number of copies of each issue during the preceding twelve months is A Total number of copies net press run 19 292 B Paid Requested cir culation 1 Mail subscriptions 7 211 3 Sales through dealers and carriers street vendors and counter sales 4 974 4 Re quested through other USPS classes 211 C Total paid requested circula tion 12 396 D Nonrequested distribution by mail and outside the mail 1 Outside county nonrequested sample copies 1 76 4 4 Nonrequested copies distributed outside the mail trade shows other sources 1 666 E Total nonrequested distribution 3 430 F Total distribution 15 826 G Copies not distributed 3 46 6 H Total 19 292 I Percent paid requested 78 Actual number of copies of the single issue published nearest to filing date October 2009 Issue 231 A Total number of copies net press run 18 0 10 B Paid Requested circulation 1 Mail subscriptions 6 656 3 Sales through dealers and carriers street vendors and counter sales 5 105 4 Requested through other USPS classes 187 C Total paid reques
154. r PCs electr nica www aagelectronica com ww zecip com CIRCUIT CELLAR www circuitcellar com NDEX OF 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 78 AAG Electronica LLC 69 Embedded Developer 22 Keil Software 77 Phytec America LLC 49 AP Circuits 20 ExpressPCB 53 Lakeview Research 78 Picofab Inc 78 All Electronics Corp 73 ezPCB 77 Lawicel AB 31 Pololu Corp 77 Apex Embedded Systems 76 FlexiPanel Ltd 5 LeCroy 77 ProlificUSA 7 Atmel 11 Front Panel Express LLC 11 Lemos International Co Inc C3 Rabbit A Digi International Brand 76 Avocet Systems Inc 49 Futurlec 77 MCC Micro Computer Control 77 Reach Technology Inc 33 CWAV 71 Grid Connect Inc 15 MachinePIER 65 Saelig Co 40 CadSoft Computer Inc 42 HobbyLab LLC 78 Mental Automation Inc 76 Scidyne 19 Comfile Technology Inc 78 2CChip 29 Microchip Technology Inc 78 Technical Solutions Inc 78 Crossware Products Inc 30 57 ICbank Inc 75 microEngineering Labs Inc 24 25 Technologic Systems 75 Custom Computer Services Inc 53 Intuitive Circuits LLC 23 Mouser Electronics 78 Technological Arts 42 DesignNotes 75 Ironwood Electronics C2 NetBurner 77 Tern Inc 34 EMAC Inc 32 34 JKmicrosystems Inc 21 Noritake Co Inc 1 Texas Instruments 77 Earth Computer Technologies 78 JKmicrosystems Inc 53 Nurve Networks LLC 76 Trace Systems Inc 32 Elp
155. r so noise will not propagate to the mains Because the MOSFET switches rapidly and the bulk capacitor C2 charges quickly it generates some noise that could affect other equipment The choke has no value since I took it f rom an old power supply D1 D2 D3 and D4 1N54007 act as a rectifier for the mains voltage It converts the AC voltage to DC voltage C2 acts not only as a filter but also as stor age for the energy to be delivered by the supply Resistor R19 acts as a series resist ance to the gate of the MOSFET Q12 The resistor prevents the MOSFET from oscillating because a voltage is impressed across the gate and source Resistor R26 discharges the voltage across the gate of the MOSFET and source of the MOSFET This is because the gate and the source of the MOSFET form a capacitor that holds a charge If there is a voltage across the gate and source this will leave the MOSFET in the on con dition It will be damaged if powered up and the Texas Instruments TL494 PWM controller will also be damaged www circuitcellar com CIRCUIT CELLAR 9 if the gate drive circuit is defective MOSFET Q12 and MOSFET Q15 04N60C2 act as a power switch for the supply and conduct at the same time It changes the steady DC sup ply to a square wave with a varying duty cycle To increase the voltage output the pulse width is length ened If a smaller voltage is needed the pulse width is made shorter Resistors R58 and
156. r the digital and analog parts I made my own PCB layout but I ve since made corrections so I won t recommend it It is better if you make your own PCB using your own PCB layout software The most critical part of this switch mode isolated flyback power supply is the po wer trans former Whether or not the power supply functions depends on the transformer includes the specs of the power transfor mer and ferrite E and I core I computed the core area product Photo 4 Take a look at the transformer s output The 5chottky diode blocks the negative voltage generated when the MOSFET conducts and when the transformer stores energy The 5chottky diode is forward biased when the MOSFET becomes an open switch which you can see in the waveform and has a potential of 5 V The filter capacitor smoothes the pulsating DC which becomes a requ lar DC voltage and is the power supply s output important which is clockwise and counterclockwise Just be sure you wind in opposite directions The direction of the primary winding is not important because one of the primary s terminals is connected to the positive DC bus The other is connected to the MOSFET s drain which switches the transformer to ground After the power switch opens the terminal of the primary winding connected to the positive DC bus becomes negative and the one connected to the MOSFET s drain becomes positive When the power switch opens on the secondary side t
157. rk The overall problem is divided into smaller operations and each operation is designed coded and tested VARIABLES GLOBAL Let s stop here for a bit and talk about mak ing all the variables global Making them global would expose all the variables to all the routines and parameter passing would go away This CIRCUIT CELLAR www circuitcellar com Listing 1 A simple example of parameter passing by value INT16 Avg INT16 x INT16 total INT16 y total xty 2 return total end of INT16 Avg INT16 x void Functl void INT16 A B Result do some stuff Result Avg A B do some more stuff t end of void Functl void seems like a shortcut and simpler but it s just a good way to lose control of your project Consider Listing 2 where all variables are global It s a lot less code which can be a plus But if you want to call Avg from several places in your code with different val ues you would have to expose the variables A and B by declaring them as extern and transfer those values into A and B before the call I hope you can see how cumbersome this would be for anything but a trivial program Also realize how fast you would lose control of your variables Based on the design you might some times have a compelling reason for making a variable global in scope Per haps a timer variable showing operat ing hours is a candidate to be global If this timer were incremented
158. rotronic 41 Jameco 15 PCBCore 75 Triangle Research Int l Inc 10 Elsevier 42 Jeffrey Kerr LLC C4 Parallax Inc 2 3 WlZnet ATTENTION ADVERTISERS REVIEW December Issue 255 Theme Programmable Loaic January Issue 234 Deadlines Space Close Nov 9 Material Close Nov 16 Retrocomputing on an FPGA Reconstructing an 80s Era Home Computer with Programmable Logic Building Microprogrammed Machines with FPGAs A Practical Parallel CRC Generation Method WiZnet iMCU Design Contest Primer Theme Embedded Applications Bonus Distribution DesignCon THE DARKER SIDE Digital Modulations Demystified ABOVE THE GROUND PLANE Memories Not Forever FROM THE BENCH Extending and Isolating the 12C Bus SILICON UPDATE IP Unplugged The Internet Silicon and Software Call Shannon Barraclough now to reserve your space 860 875 2199 e mail shannon circuitcellar com mT November 2009 Issue 239 www circuitcellar com CIRCUIT CELLAR Issue 252 November 2 UU RIORITY INTERRUPT by Steve Ciarcia Founder and Editorial Director Keeping the Lights On nu like to think that Thomas Edison came up with the light bulb in 1879 all by himself But a patent set tlement clearly gives equal credit to Joseph Swan an English inventor More importantly while those early designs have evolved from glowing carbonized bamboo in a vacuum to radiant tungsten in argon gas the concept and imple mentation of incandescent li
159. round 110 g Two 3 V CR2032 lithium bat teries which are expected to last for one year power the calculator In addition to a 37 key keyboard the cal culator has a 400 segment screen that has a 15 digit seven segment display area at the bottom 12 large num bers and three smaller ones a couple of indicators on the top right and a 6 x 43 pixel matrix that s suitable for dis playing text or small graphics see Photo 2 If you remove the battery door you will see a small six pin connector The connector is designed primarily for software updating You can update any calculator with a new version of software without having to open it This is possible because the microcontroller is flash memory based and not ROM based But you can also use the serial port as part of an application that needs a serial communication for debugging HP has a cable that plugs into this port It is avail able provided your project is accepted by the person at HP in charge of distributing the cables that s me for the moment and that you agree not to do anything that could harm HP or the sales of the calculator You need to use Atmel s SAM Boot Assistant which is referred to SAM BA for short and is also called the AT91 ISP for AT91 In System Program ming software to perform software upgrades using the cables www atmel com d roducts tools_card asp tool_id 3883 When you open the calculator you have access to the PCB which con
160. rt to execute when the Linux device fin ishes booting A Linux daemon accomplishes this I created an exe cutable shell script that launches and forks the primary TCL script bin sh root main tcl amp and placed it inthe etc init d direc tory With that complete I created a file system link to it in the f ollowing manner ln s init d executableshellscript etc rd3 d S99executbleshellscript DESIGN REVIEW The programmed vehicle locator design is working reliably in one of my vehicles However this off the shelf hardware solution has two pri mary shortcomings The first is that if the vehicle is not operated fre quently enough the mobile phone battery completely discharges because the phone doesn t turn off Eventually the phone shuts off and doesn t restart Luckily the Motorola keil com 1 800 348 8051 V195 has an impressive battery life with a quick recharge cycle As a result I haven t dealt with this fail ure mode because I drive the vehicle nearly every day And since I expect an SMS with every vehicle trip I can detect a dead battery right away The second shortcoming is a tem porary failure mode The capacitor solution to automatically power up the Linux device may not work if t he power is not removed long enough Specifically if the car ignition is set to accessory and then you turn the key to start the car the transient power loss may turn off the Linux device without dischargin
161. rticular case you need to have the autorouter module of version 5 Light Standard Max number of schematic sheets 1 99 999 Max board size 4x3 2 inch 6 4x4 inch Max of signal layers 2 4 Layout or Schematic Editor 249 Layout and Schematic Editor 498 Layout Editor and Autorouter 498 Layout Editor and Schematic Editor and Autorouter 747 Professional 64x64 inch in handy if you are doing any com parisons I wasn t so I left it for another day While I was setting up the dri ver I played around with some of the other modes In single cycle counter mode you quickly discover that it counts each transition so be careful with that The range limit counting allows you to count only so high It then stops until you reverse direction The Modulo n counting was some thing I haven t seen before in quadra ture displays The Modulo n operation EAGLE Version 5 Schematic Layout Autorouter for Windows Linux Mac Annual award of the leading German electronics magazine The winners of eleven categories are determined by the reader s votes e o owe o oes p a ra m s 6 Se BB 444484 ety Standard and Light Editions have full functionality except for the limitations mentioned in the table You can use EAGLE Light for evaluation and non commercial applications without charge Download it from our web site 800 858 8355 Cadsoft Computer Inc 1962
162. ry design engineers innovative embedded network developers signal theory buffs and do it yourselfers who love popping open MCU based gadgets and repurposing them for exciting new applications we ve got you covered Heck we even have a project for those of you who have metal lathe shops next to your circuit cellars In Embedded Linux Based Location System James Stephanick explains how to build a vehicle location device p 16 An ARM based USB network storage link a prepaid GSM cell phone and a USB GPS device comprise this handy location system Turn to page 26 where Noel Rios presents a switched mode power supply design With it he can adjust voltage from 1 to 20 V and current from 0 to 1 A He does this by entering the values on a keypad When precision matters consider a linear encoder Carl Stoesz explains how he mounted an optical linear encoder to a metal lathe that he uses to create small precision parts p 36 He uses the setup to send speed and displacement information to an LCD There s a big difference between hacking and repurposing Hacking is about deconstruction and investigation Repurposing takes things a bit further you take apart a design and use its features to create something new or improved On page 44 Cyrille de Brebisson explains how to repurpose an HP financial calculator and use it for a variety of embedded design apps Check out George Martin s Passing Parameters for yet anoth er lesson
163. rything to everyone Without knowing what was being plugged in how could an application make use of a device like this The key to this problem was to have the peripheral identify itself when plugged in And even though this sometimes requires a special driver to be installed adding a device is a relatively simple task for the most part Like USB and FireWire the Internet is just another of the many communication medi ums available today The Internet intercon nects networks throughout the world It uses standardized protocols to allow private pub lic academic business and government net works to communicate with one another over various technologies The copper fiber optic or wireless technologies used today offer something not available from USB or FireWire and that is distance For years we ve been able to pick up a telephone and connect to anyone else on the planet with telephone service To do this you need to dial a special number that the telephone network uses to route a connection to the appropriate telephone The Internet uses an IP address to do the same thing and connect your computer with another on the Internet While you may actually use a domain name this is converted into a specific IPv4 address This dotted notation of 4 bytes x x x x soon will be eclipsed by a 16 byte notation IPv6 X X X X X X X X X X X X X X X X But that s another story You might imagine that Internet traffi
164. s Based on a patented stacked die solution the dual die A55215 provides excellent phase matching and very low sensitivity drift over the full ambient temperature range of 40 to 150 C The A55215 is available in a small TSSOP 14 package and operates at a 5 V supply vo Itage The A55215 is priced at 6 40 each in 1 000 unit quantities austriamicrosystems WWW a ustriamicrosystems com Dual Die Motion Sensing IC for Microcontroller based Systems jms D E x Analog Sin Cos output 150 C ambient temperature iamicro 5 ys tems 3 a leap ahead in analog NPN November 2009 Issue 232 November 2009 Issue 232 8 BIT MICROS ON ULTRA LOW POWER TECHNOLOGY PLATFORM The STM8L product family comprises 26 devices in three lines spanning a broad spectrum of performance and function They combine high performance 8 bit architecture with ultra low power inno vations to save power in active modes as well as when idle The lines are built on an ultra low power technology platform using a dedicated proprietary 150 nm process optimized for ultra low leakage Unique advantages include full CPU performance up to the maximum operating frequency throughout the entire supply voltage range from 1 65 to 5 6 V Moreover using an on chip regulator power consumption is independent of supply voltage thereby providing extra flexibility and simplifying design Other innovations include low power embedded nonvolatile memory
165. s a serial ADC It has four inputs that can be config ured as single ended or differential It N Qo is a SPI peripheral The DS89C430 has no SPI port so it is done by bit bang ing The MAX550 U3 is a single seri al DAC It is an 8 bit device Its out put is O to 2 V The circuit uses two DACs one for current setting and the Photo 2 I used a Dallas Programmer to program the D589C450 It is merely a socket with a MAX252 A device programmer isn t needed S U4A 4 MC34072 C13 100p CURRENT DAC VOLTAGE DAC C14 R24 0 08338u VOLTAGE READING 317k 0 08338u CURRENT READING other for voltage setting C3 10 uF R3 10 kQ and D1 1N4148 form a reset circuit for the microcontroller As the capacitor charges a voltage is generated across the resistor and the voltage tapers off as the capacitor is fully charged The diode discharges the voltage across the capacitor once the supply is turned off so the micro controller will reset again if the sup ply is turned off and on in an inst ant C1 30 pF and C2 30 pF act as load capacitors They are needed by the internal oscillator together with the crystal Y1 to act as the clock for the microcontroller C12 0 001 uF and C13 0 001 uF act as a filter for the DAC C14 10 uF and C15 act as supply decoupling while C10 0 1 uF and C11 0 1 uF act as a fil ter capacitor C4 acts as a filter capacitor for the entire circuit CIRCUIT CELLAR
166. s also provide a measure of redun dancy i e the system can be designed to deliver an ade quate level of power even if a single transmitter should fail or otherwise be compromised for example in the presence of moving obstacles SAFE AND IN SANE Maybe you ve seen the YouTube video purporting to show cell phones popping popcorn or cooking eggs Or maybe you ve seen the ads for RF ar mored underwear to protect your family jewels For those of you who believe Measured at 15 103 s Measured at 10 152 s Measured at 20 145 s T o c 9 o D 2 o D g o Sleeve dipole G 1 5 Air dipole G 4 1 Yagi G 6 1 20 25 40 45 Distance feet Figure 2 This graph showing the capacitor recharge time for a P2100 demonstrates the influence of key factors i e antenna gain and distance in the Friis equation CIRCUIT CELLAR www circuitcellar com the future of journalism is information that wants to be free all I can say is you ll get what you pay for The fact is a cell phone s transmit power is on the order of 1 W with the power dynamically adjusted to compensate for obstacles e g indoor use and distance from the base station So if you re wor ried about your 1 W cell phone shouldn t the 3 W PowerCast transmitter raise concern But remember the inverse square law The cell phone is an inch from your brain I wouldn t tape a Pow er
167. set point trav el indication At 5 V operation in single count mode it has a maxi mum counting frequency of 40 MHz It is configured with read and write operations over the SPI to function in the desired mode of operation In quadrature mode it has x1 x2 or x4 mode decoding with a filter It can be set to Modulo N Non recycle or Range limited operation It can be set to 8 16 24 or 32 bit configura tions A status register stores count related events such as carry borrow index latch power loss direction and sign The counting register can be zeroed or an initial value can be placed in it int data clear counter CNTR AB on index transfer CNTR to OTR 0 move CNTR contents to OTR for OTR read FREE RUN CNTR_OTR set set IR to write to specified register send data The back of the specification sheet for the serial counter contains assem bly code for the serial interface to a PIC18Cxxx I prefer to work in C lan guage So using the assembly code as a guide I wrote my own driver com patible with my CCS compiler The serial interface is a synchro nous four wire SPI bus controlled by the microcontroller s SCK clock Each transmission is organized in blocks of 1 to 5 bytes of data Com munication is initiated by a high to low transition of the SS pin The first byte received is always an instruction byte The second through fifth bytes are data The communication is terminated by a
168. so pass by reference That is a good choice if you want the called routine to change the variables And finally we can create a structure to hold the data and pass the address of that str uc ture Think about passing parameters and the more you work with the dif ferent methods the better you ll understand the benefits of each Now let s take the next step toward the deep end of software design How do you make a module MAKE A MODULE Another word for a module is file An actual file from a project I m working on is available on the Circuit Cellar FTP site The module file AZD C contains all the A2D routines for my project Let me explain a bit more about the problem I m trying to solve The input to the microprocessor is a full wave rec tified signal I need to find the signal s peaks and valleys and add a timestamp for each This project is in an early stage and I can almost guarantee that the code will change as we move on Look at the module the routines it contains and the variables and how they re passed Look how I divided the code not to copy this code but to understand my trade offs and then use them as a basis for your design The include statements in lines 19 21 and 22 infor m the compiler about the CPU general constants and A D constants The module A2D h will be used to give other modules needed information about this module s contents Lines 28 and 29 define a structure that will be used to hol
169. t void Avg void total A B 2 void Functl void do some stuff Avg ss do some more stuff WwwW circuitcellar com CIRCUIT CELLAR to use The notation amp Avg is the address of variable Avg The variable Avg is stored in a memory location amp Avg We are giving the address of that location to the Operation routine Now the Operation routine gets an address but an address to what Well that s where the INT16 Total comes in That informs the Operation routine that the parameter is a pointer to an INT16 type variable Said another way it s the address of an INT16 type vari able While c toupper c works with one variable when you need to change two or more variables the pass ing by reference is the method to use Life is good But what if we need to pass 20 variables to a routine and receive 10 results Good point We would not want to do all that using the stack mechanism It would be too much of a burden on the code and CPU time Well let s just make them all global Not so fast All the prob lems with global variables are still rel evant Take a look at Listing 4 Can you follow the code Just start at the top The Zdef ine defines the size of some character array 10 characters that s used in the structure Remem ber to leave space for the trailing null Next we define a structure naming that definition as PARAMETER BLOCK Remember it is good practice to use uppercase f
170. t defined in the Tripplite MIB but exist in the device as real objects Tripp Lite chose not to document these and others found using a dis covery operation called walk in their Tripplite MIB Some of these are proprietary and used by their Power Alert Shutdown Agent appli cation software IT S YOUR TURN The PEN gives every design engi neer a way to create a device that can be managed over a network using the SNMP As long as you follow the rules for declaring objects in your personal MIB and as long as you support SNMP communication by including SNMP agent support in your product you will have a prod uct that can be added to the growing base of SNMP managed devices If your widget falls within a standard MIB you won t even need a PEN However it s good to know that there s a way to define your device if it s nonstandard so that anyone can use it And the registration process for your own private PEN is free You ll find that most of the popu lar embedded micro manufacturers already provide support for SNMP in their TCP IP stack offerings This should also include an MIB editor compiler If you want to write your own applications to make use of managed devices you can find SNMP support for most languages running on almost any OS SNMP devices keep network traffic to a minimum This is especially CIRCUIT CELLAR www circuitcellar com useful when multiple devices must be polled
171. t duration power cycling or semiconductor based power controls like dimmers or lamp modules X10 type automated lighting con trols should be tested with the specific CFL to be used to make sure that it works and that leakage currents don t cause the CFL to flash If you have automated lighting or high traffic areas where the CFL constantly cycles like a staircase be prepared to see an 85 reduction in lifespan on most brands If you need to keep the dimming capability and still want a CFL be prepared to pay three to five times more for a dimmable CFL and wait a few seconds longer for it to light In my opinion CFLs are an interim fix on the road to better lighting efficiency but they certainly aren t the solu tion In the long run I believe LED lighting is the answer but be careful before you jump off that cliff right now too So far half of the lights at my house are fluorescents in one form or another I live with the lower lifespan in some places simply because 5 W trumps 60 and I feel like I should try In another dozen places I m using LED bulbs Their fast turn on and long cycle life is great for staircases bathrooms and hallways but they are still too expensive for gen eral implementation some high brightness bulbs also radiate too much RFI I m currently testing a 15 W 40 fluores cent tube replacement that looks promising but at 70 versus 3 I need a lot more reason to swap out the 50 or so flu orescent tubes I have The
172. tains less than 40 sur face mounted resis tors capacitors and diodes You also can access the bat tery connectors and the Atmel AT91SAM7L128 CPU SoC in die form that s wire bonded to the PCB and protected under a blob of black resin OPEN THE CALCULATOR To open the calculator you must first remove the five screws that hold the top case to the bottom case Three of them are easily spotted behind the batter y cover two at the top and one located between the two batteries The last two screws are located under the no slip pad at the bottom of the calculator You can use an Exacto knife or your fingernail to lift 5 mm of the material on each side and gain access to the screws without having to remove the no slip pad This enables you to close the calculator when you are done without leaving a visible www circuitcellar com CIRCUIT CELLAR jg 898 sign that it was opened The last step in opening the calcula tor involves separating the top and bot tom cases The two parts are held together with 10 clips three on each side and two at the top and bottom The best way to open the calculator is to start by popping the middle clip on the left side located between the Input and the CashFlow keys Insert a small flat screwdriver between the black and grey plastic push outward and the clip should pop out You can then use your thumb and press down and out on the grey plastic to pop the two other clips located ne
173. ted circulation 11 948 D Nonrequested distribution by mail and outside the mail 1 Outside county nonrequested sample copies 1 714 4 Nonrequested copies distributed outside the mail trade shows other sources 995 E Total nonrequested distri bution 2 709 F Total distribution 14 657 G Copies not distributed 3 353 H Total 18 010 I Percent paid requested 82 certify that the statements made by me above are correct and complete Sean Donnelly Publisher EN UN CIRCUIT CELLAR e www circuitcellar com Test Your Edited by David Tweed Problem 1 While reverse engineering an LCD module with LED backlight a colleague came across this circuit and had trouble figuring it out Let s see if we can help him out 50v R1 LED 3K R2 EREE 2 of R3 B2 N Point 4 Point A connects to one of the external pins of the module and appears to be used for switching the backlight on and off First of all what is the purpose of R4 What s yourEQ The answers are posted at www circuitcellar com eq _ You may contact the quizmasters at eq circuitcellar com rom Idea to Reality gt Design gt Prototyping gt Production see Our Differences in gt Quality gt Service gt Price Milling Turning Grinding CNC Wire Cutting Laser Plasma Water Jet Plastic Injection Sheet Metal Gear SLA FDM SLS LOM MachinePIER Tel 408 421 9840 Email sales machinepier com W
174. tegral electronics Sound Module 14 pin module plays back pre stored audio files from microSD card Temp RH Sensors bedRF Adeunis UPSICAP DLP TH1 Is Novel ambient sensors 8 noaie accurately measure temp RH USB Serial USB COM A complete CP2102 USB serial converter in a DB9 shell 26 m 4bove 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 controllers eng software wireless boards SMD adapters I2C adapters GPS loggers unique Saeli BBB 75RELIG infa amp saelig com 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 Check www saelig cam often for special offers bargains business hints blog etc November 2009 Issue 232 ep o gt ROM THE BENCH by Jeff Bachiochi Device Management Monitor Networked Devices Via SNMP The simple network management protocol SNMP enables you to monitor a network s activity and stock data units in a management information base MIB Today many embedded microcontroller manufacturers provide SNMP support in their TCP stack offerings You can use th
175. the P2100 automatically turns off the DC output and begins anoth er recharge cycle Per Friis Figure 2 shows how the recharge time varies depending on distance and the antenna gain RF power output of the transmitter is specified as 3 W while a P1100 or P1200 can deliver up to 100 mW at the receiving end With a supercap to draw from the P2100 can fire significantly higher peak power up to 262 5 mW Sure it s lossy and nowhere near the efficiency of a wire e N but there s definitely enough power on tap to do mean ingful things The point is that PowerCast is an option when a wire isn t FREE AT LAST Looking at the big picture one can imagine a variety of wireless power application scenarios As mentioned above options include powering a device directly if it can get by on 100 mW or recharging a battery or supercap for higher power devices The transmitter could be powered at all times or on a scheduled basis Sampling a bunch of sensors could be as simple as turning on their power i e the transmitter s periodically Alternatively a battery powered sensor detecting its battery is running low could radio a request to turn on the transmitter i e via a radio receiver controlling the transmitter s power supply Like a cell phone network multiple transmitters can be used to provide wide area coverage within which any number of receivers is free to move about see Figure 3 Multiple transmitter
176. the op amp s inputs The higher the current the greater the difference at the op amp s inputs This makes the op amp s output increase to make the MOSFET Q14 conduct which pulls down resis tor R2 100 O until the voltage at the op amp s noninverting and inverting pins are equal Resistors R36 10 kQ and R5 560 Q act as a voltage divider to sample the regulator s output www circuitcellar com CIRCUIT CELLAR Frequency 50 kHz 0 3 tesla MAX 0 7 cm core area A A 1 3 cm core window area N 268 turns PRIMARY 27 turns N econnary AWG Primary AWG Secondary Table 1 These are the parameters of the power transformer The operating frequency of the power ferrite core should be equal to or greater than 50 kHz C1 47 uF acts as a filter capacitor R49 100 Q acts as a minimum load necessary for the stability of the supply D9 and D11 1N4001 act as a rectifier that converts AC to DC C12 220 uF and C21 470 uF act as a filter capaci tors Resistors R35 510 kQ and C18 0 1 uF act as a soft start for the MAX738 U7 C17 0 01 uF acts as a filter for the MAX738 s reference C19 330 pF acts as a compensation for the MAX738 The D7 IN5819 Schottky diode acts as a commutating diode that conducts as the switch in the MAX738 opens up As the 1N5829 conducts the energy in the inductor is delivered to the load I used two 60 Hz transfor mers for the T
177. ting for alkaline and lithium battery char ging respectively The P2100 is a bit different designed to charge a supercap and then fire a confiqurable voltage output with the answer some 60 years ago Herewith the Friis Transmission Equation 2 a aaf P AxR On the surface the equation is quite easy to understand It simply states that the power received P is a frac tion of the power transmitted P that s determined by three factors the wavelength A distance R and the effectiveness i e gain of the transmitting G and receiving G antennas As you can see from the equation received power increases for a longer wavelength i e lower frequency That explains why for example a 900 MHz radio works better i e overcomes interference and obsta cles than a 2 4 GHz radio with the same power output And there s the familiar inverse square law in the denominator showing received power declines with the square of www circuitcellar com CIRCUIT CELLAR imagine there s a difference between a trace on a PCB and a satellite dish PowerCast offers a selection encom passing everything from a simple dipole to a more sophisticated Yagi and patch antenna to match the needs of different applications see Table 1 One key antenna factor is direc tionality A simple dipole piece of receiver are properly aimed at each other Directionality and a similar phe nomenon polarization directl
178. tor commutation logic and a reference The PWM prin ciple is straightforward First the sample voltage from the output of the power supply is fed to the noninverting input of the error amplifier and the reference of the supply is fed to the inverting input of the supply After the two voltages are compared an error or control voltage is generated at the output of the error amplifier This error voltage is compared to a sawtooth voltage by a e 32 MB RAM 76 MB Flash e 76 Digital VO Lines 2 Ports of USB 2 0 a SPI Bus e AC97 Amplified Audio e Battery Backed Clock e 2 Serial Ports e Low Power Consumption e RoHS Compliant 249 Qty 1 Our newest ARMS Linux controller the OmniEP doesn t cost an It delivers removable storage amplified audio ethernet and serial RS232 communication ports in a rugged and attractive enclosure Models without enclosure and LCD available arm and a leg 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 JK microsystems comparator The larger the error volt age the wider the comparator s pulse The comparator s output is connected to the commutation logic and then to the output transistors In my application I used a single ended output by grounding the output con trol pi
179. tware USB Cable and Programming Adapter for 8 to 40 61 DIF Serial LCDs 2 line x 16 39 95 4 line x 20 49 95 Quantity Discounts Available www circuitcellar com CIRCUIT CELLAR DesIGN IN HALF THE TIME Cea C Compiler for all Microchip PIC MCU Over 307 Built in Functions for optimized code aA 133 Example Programs for quick start up Compilers starting at 150 www ccsinfo com CCNEW Coming Soon New Compiler Features amp Enhancements Details to come inV 4 1xx sales ccsinfo com 262 522 6500 x35 micro CS ngineering abs nc Development Tools for PIC Microcontrollers LAB X Experimenter Boards gg Pre Assembied Boards eee Available for 8 14 18 28 SEE and 40 pin PIC MCUs fm 2 line 20 char LCD Module m9 9 9 pin Serial Port 3 Sample Programs Full Schematic Diagram Pricing from 79 95 to 349 95 Rn Double Sided with Plate Thru Holes M Circuitry for Power Supply and Clock 4 Large Prototype Area M Boards Available for Most PI c MCUS s Documentation and Schematic Pricing from 8 95 to 19 95 iC Device amp Package Converters Quick Turn Gustom Solutions Uperade Your PGB Designand AXzbet2ag ere sisn ibasuisblf Fast Replace Jolais Kuri AES Re ici 4 Ironwood 1 800 404 0204 ELECTRONICS ene ironwoodelectronics com Phone 719 520 5323 Fax 719 520 1867 Box 60039 Colorado Springs CO 80960 BASIC Compilers for PICmicro E
180. ur website to learn how picoPower can help you hammer down the power consumption of your next designs PLUS get a chance to apply for a free AVR design kit http www atmel com picopower _ AIMEL ee s Everywhere You Are 2008 Atmel Corporation All rights reserved Atmel logo and Everywhere You Are are registered trademarks of Atmel Corporation or its subsidiaries Other terms and product names may be trademarks of others LPC514x DEVELOPMENT RIT The LPC5141 Developer s Kit is a ready to use platform that will let you explore the many features of NAP s LPC514 X microcontroller series in General and the LPFC5141 in particular The kit is perfect for running Linux with its large on board RAM and flash memory network and graphics capabilities Using the kit as a prototyping platform makes it pos sible for you to focus on the value added application The kit includes all the software components needed to get up and running with software development on day one It is easy to transfer the application and the OEM board from the prototyping environment into your final target application The following resources are available at the kit 5 support site a user s manual LPC5141 OEM board schematics LPC51 xx base board schematics LPC51 xx base board component placement links to datasheets for key components a multimedia presen tation about how to get started with the boar d and USB DFU drivers for Windows NAP s Common
181. urce code for the speed tune up algorithm is avail able from Atmel Another pad is centered at the bot tom where you can place an optional RS 232 transceiver This enables you to have the aforementioned six pin connector use a real RS 232 signal instead of a O to 3 V signal The schematics for the HP 20b provided in the system development kit give all the details including the RS 232 level CIRCUIT CELLAR www circuitcellar com shifter s part number ATM3202AR Note that you may also want to break two jumpers JP6 and JP5 to disconnect the RX and TX pins of the serial connector from the main CPU If you don t remember to set the appropriate GPIO pins to pure inputs with no pull up If you plan to use this chip you ll need to turn it on and off using port C s I O 27 This is used to conserve power of course J7 is located on the left of the CPU It is an eight pin pad that pro vides access to the battery voltage power ground and the AT91SAM7L128 s four ADCs They can be used to connect all sorts of ana log equipment to the system They can range from temperature light or even force of acceleration sensors You could turn your calculator into a two direction accelerometer for your car Then you would be able to use it to map your car s power O to 60 MPH time and more The last connector 10 pins pro vides battery voltage ground and eight general purpose I Os which are also multiplexed wit
182. ut it makes this information available to NMS using an SNMP agent An agent is a net work management software module that resides in the managed device SNMP SNMP Version Community string Type Integer Type Octet string Length 1 Length 7 Value 0 Value private 04 07 w e MENO rs Ol ws CS IP Header Application Transport Internet Frame Frame data header Figure 2 The SNMP message application data is typically wrapped in a UDP packet trans port method which is housed within an IP packet for use over the Internet The agent has local knowledge of the data and is responsible for translat ing it to and from SNMP message packets An NMS is an application that monitors and controls managed devices These systems provide the bulk of the processing and memory resources required for network man agement One or more of them may exist on any managed network An SNMP message see Figure 2 is typically wrapped in a TCP or UDP packet which is wrapped in an IP packet see Figure 3 There are only seven message types in the present standard SNMPv2 The Get Getnext and Getbulk messages request data The Set message writes data from the management application The Response message is returned by the managed device A Trap message is used by a managed device to signal an event or condition there is no response An Inform message is simi lar to a trap but it results in a Response bein
183. w com or at www imaginethatnow com R Presuhn et al Management Information Base MIB for the Simple Network Management Protocol SNMP RFC3418 The Internet Society S 2002 www ietf org rfc rfc3418 txt number 3418 OURCES M Rose and K McCloghrie Structure and Identification of Management MIB Browser iReasoning Inc Information for TCP IP based Internets RFC1155 http tools ietf org WWW ireasoning com html rfc1155 esign E Prototype Production We add value to PCBs eU C gt when others just sell it En D Designing Service 3D Enclosure Designing Virtual Assembly PCB Design I i Iz ic iq ig t J Corn yo nants giydyyins sisgerieby OTTES A Conil Component ia ic i ro p E P www EzPCB com Email pean com November 2009 Issue 232 www circuitcellar com CIRCUIT CELLAR mJ UJ B X Co m A a o1 NS 6 co Oo ik NES N Across Down 5 Pole 1 Cot two words 8 Instruction to move ahead or back in a program 2 An ALU performs arithmetic and what Oe Cuttent limiter Cone Spiral 11 GUI widget for item selection 4 The Board type at http bbs circuitcellar com phpbb 13 Address for a device on an Ether net network 6 Time from submission to completion I5 iransimit clectrcity 7 Time from On to Off two words 16 Abnormal end 10 Eleven sided 17 To release gas 12 Doesn t conduct insulates 18 An old c
184. w rate Now let s look at cabling and connection error Of course any type of cabling adapters and connectors need ed to connect the counter to the start of the signal path and the end of the signal path you are trying to measure will add error to your delay measurement in the form of increased time The cables adapters and connectors also add loading affects to the start and stop signal changing the slew rate and amplitude of the start signal versus the stop signal which in turn adds to the time error of the measurement When measuring the delay through high speed logic any effect the logic circuits have on the signal s slew rate and amplitude will again cause timing error between the start and stop signal REDUCING SYSTEMATIC ERRORS You can reduce systematic errors in cables by zeroing out their effects Simply connect your start and stop cabling together along with your input signal and perform a time interval measurement to characterize the delay of your cabling Then just subtract that measurement time from the final measurement time of the cabling plus the signal path you are characterizing CIRCUIT CELLAR www circuitcellar com Triggers at 3 V or 50 d Triggers at 3 V or 7096 of rise time of rise time Start event Stop event Figure 2 Measuring propagation delay through high speed digital logic Many counters have built in offset capabilities that allow you to zero out the effects of cabling
185. wer upsInputTable 5 Table 1 Beginning on the left is the first of three groups below the standar d upsMIB node 1 5 6 2 1 55 upsObjects It has nine sub Groups below it beginning here with upsldent Note that upsldent has six objects below it starting with object upsldentM anufacturer Each object in the MIB has its own unique path sequence which is its shorthand dotted identifier m CIRCUIT CELLAR e www circuitcellar com compact but it doesn t lend itself to human readability Therefore each manufacturer prepares an MIB text file covering the objects supported by their product The text file describes each object using ANS 1 notation Each object consists of five fields describing the textual name variable type textual description read write access type and status In Listing 1 the read only object named upsIdentManufacturer isa string of up to 32 characters that contain the name of the UPS manu facturer Other information here identifies this as the first object in the upsIdent group under the upsObjects group of the upsMIB This object and all the other objects in the RFC1628UPS MIB txt file aren t merely for your perusal The text file also performs as a template At the managed device end of the network the manufacturer uses the MIB txt file so that the storage loca tion of the data variables will be known by both the SNMP agent and the embedded application The agent
186. which is the JTAG interface JTAG is an industry standard system for devel opment You can simply connect a standard 2 54 mm SMT header to the pad and start developing In addition the JTAG connector is placed exactly at the center of the recessed area of the HP 20b s plastic case located below the battery door That area was designed as a place for your engraved name You can easily remove the recessed area with a cutting tool e g an Exacto knife This enables you to have a closed unit with the JT AG pin sticking out for development purposes Basically instead of using one of the traditional large shabby look ing when not on an engineer s desk development boards you can perform development on a small device Once you are done for the day or need to excuse your self for a little while you just unplug the JT AG and November 2009 Issue 232 DN Nn November 2009 Issue 232 FIQ IRQO IRQ1 PCKO PCK2 CLIKIN PLLRC XIN XOUT VDDIO1 VDDIO1 NRST NRSTB FWUP VDDIO1 DRXD DTXD SEGOO SEGS39 COMO0 COM9 DOVOWHADODHO AD DO d xxO J0ZJUOO00AUUCOCODAUU D ARM7TDMI Processor Memory controller Emp OM Address as memory decoder Abort status Misalignment detection Flash memor 64 128 KB Peripheral controller bridge Peripheral data controller 11 channels psc rss PDC m USART1 2 KB back up 4 KB core Fast flash programming interface E83 ES
187. xt to the screen and Shift keys Use the screw driver to remove the bottom two clips After that you should have no problem opening the calculator with your hands alone Decreas ing the use of the screwdriver reduces the chances of damaging the calculator s finish PROBE THE PCB The AT91SAMT7LI128 is a low power ARM7 SPU SoC that can run at up to 36 MHz It has 128 KB of flash ROM a 400 segment screen driver as far as I know this is the first commercially available ARM7 CPU with a direct LCD driver 6 KB of RAM and the standard slew of peripherals Refer to Figure 1 for more details The AT91SAM7L128 has a lot of advantages for this application it has a built in LCD controller it s low power it has its own power supply allowing it to work directly from the 3 V battery without any external power regulation circuitry it has a charge pump for driv ing the LCD and it has quite a lot of flash ROM for application storage and future upgrades It also has its own internal 32 kHz and 2 MHz oscillator Thus if your application doesn t rely on accurate timing i e less than 1096 you don t need to use an external oscillator which simplifies the system even more However you can con nect an external crystal to achieve high accuracy if nec essary The AT91SAM 7L128 is all about options You will notice other things on the PCB mainly unused pads The most important of them is the 16 pad connector at the bottom of the PCB
188. y affects the application in terms of mobility A fixed non mobile instal lation can take advantage of direc tional antenna for maximum gain and efficiency But if the receivers move around an omnidirectional 66 The black maaic of RF is found in the antenna qain factors which depends on a variety of factors including both the type of antenna and implementation issues You don t have to be a rocket scientist to imagine there s a difference between a trace on a PCB and a satellite dish 99 November 2009 Issue 232 ep EA November 2009 Issue 232 Pin 1 Mark Pin 1 Mark 1 Ground 1 Ground 3 Ground 3 Ground POWERCAST P1100 Pin 1 Mark Ground DC Out Ground POWERCAST P1200 Vset Figure 1 Designing in the PowerCast harvesters is really simple hang an antenna 50 Q on one side and the load on the other antenna is the call Implementation issues include things like cable and connector losses and impedance matching Maximum power transfer occurs when the transmitter and antenna including intervening connectors and cable have the same impedance A mismatch will cause a portion of the energy to be reflected back to the transmitter rather than sent over the air Besides loss of efficiency in the worst case e g if you forgot to attach an antenna the amount of reflected energy might actually damage the transmit ter Thus the PowerCast transmitt
189. your surface mount is designs X Bon s Cx sil iu Hae m Wo ees Barse Eu am e nnnm Custom Laser From 25 Meo E L E a m DN i fam E a b Cu Cut Your A n chassis ry fronepenels and m or November 2009 Issue 232 UJ EA UJ N November 2009 Issue 232 Photo 3 This is the close up view of the MOSFET s gate drive at 5 V with a O 5 A load The load is light so the MOSFET s gate drive is not reqular The gate drive is just enough to keep the voltage at 5 V and the current at 500 mA MOSFET conducts it stores energy in the inductor As the MOSFET ceases to conduct the energy is released to the secondary winding Also note that the power transformer or inductor has windings that are out of phase True transformers have their windings in phase and do not store any energy unlike the power transformer of a flyback regulator A omia Embedded Linux NI E e 200 Mhz ARM9 CPU e 70 700 Mb Ethernet Schottky diode D6 converts the square wave AC to a pul sating DC A Schottky rectifier is needed because of its fast recovery time As you know an ordinary diode does not stop the flow of current in an instant as the voltage reverses in polarity A TL494 U1 voltage mode PWM controller is the heart of this Flyback mode power sup ply Inside this IC is an oscilla tor with a sawtooth waveform output two error amplifiers a compara

Download Pdf Manuals

image

Related Search

Related Contents

Catalogue  Webdyngate Modbus User`s Manual    Trumatic C 3402 C 6002  Samsung B7620  CIE-H12 User Manual  User Manual - realmediashop.de  Le contrat didactique Bernard Sarrazy  Guia de instalação - Epson America, Inc.  continued - Lochinvar  

Copyright © All rights reserved.
Failed to retrieve file