Home

EMBEDDED PROGRAMMING

image

Contents

1. Author s note Caution If you build the pulse generator described in this article remember that there is a capacitor inside charged at 500 VDC even if the output signal is a low power 50 Q signal The 500 VDC could be significantly harmful or even lethal so please take care Robert Lacoste lives near Faris France He has 18 years of experience working on embedded systems analog designs and wireless telecommunications He has won prizes in more than 15 international design contests In 2005 Robert started a con sulting company ALCIOM to share his passion for innovative mixed signal designs You can reach him at rlacoste alciom com Don t forget to write Darker Side in the subject line to bypass his spam filters FILES To download code go to ftp ftp circuitcellar com pub Circuit_Cellar 2009 225 ees T Engdahl Time Domain Reflectometer 2007 www epanorama net circuits tdr html Hewlett Packard Application note 1304 2 Time Domain Reflectometry Theory 1988 http materias fi uba ar 6209 download HP AN1304 pdf F Sischka TDR Measurements and Calibration Techniques Agilent Technologies 2002 http eesof tm agilent com docs iccap2002 MDLG BOOK 1MEASUREMENTS 71TDR 1TDRCalibration pdf J Williams Application Note 47 High Speed Amplifier Techniques A Designer s Companion for Wideband Circuitry Linear Technology Corp
2. _ www stx 04 com ate Apex Embedded Systems MAAE EEE o astio com 608 256 0767 x24 ezL D The Smart Display 4 A y makes integrating a GUI ez gt Of et 5 CAN232 Features g es aami ree i regs CANUSB Features rajar e ir Froe Activex component PC MAC amp Linux support ton Bandwidth up to 125K A gown 11 amp 29 bit ID support G Both S29bit MD support Uppa 32 Message Receive FIFO ee Works up to 1Mbit CAN All accented l OO O e Simple ASCH protocol Sannie moans n C CEE VE Versatile Programming CD module T Max 230Kbaud RS232 Re EOR PTE USB SPI R5232 Interfaces A repeti eare Works up to 1Mbit CAN Bright 250 Nit LED Display 800 x 600 E OS independant Spone ET ruas Integrated Touch Screen 5 D Free USB drivers LUA Scripting Language capable 7 e For stand alone embedded apps E Memory 3 8 MB 5D to 2G a ezLCD s are also available in 2 7 Mp 3 5 5 6 6 4 10 4 a AAAS eit ACL all for Custom Display Configurations The PLC with everything you ever wished for Lead the Green Revolution with our Smart Buildings control model From the Programmable Logic Controller specialists who brought you the Super M s ries now The Ultim ate Triangle kanri F series international free 12 Relay Outputs 24VACIDC or 250VAC Infra Red Remote Control OEM Prices sis aaa telnet AV equipment control below S400 i Jaig aiy mai icia 12 Analog I Os
3. 12 bit 0 10V E I C f 3 j a t 4 Super Outputs PI p ed eT i PWM Steppers Light dimmer ETHERNET Modbus TCP a 16 Digital Inputs AVA or DC Internet Programming Emails PLC to PLC l NG 3x hi speed encoders XBEE Socket for ZIGBEE Interface Option alten Eak Real Time Clock www circuitcellar com CIRCUIT CELLAR Pin WW ei phyCORE eee COTS Single Board Computers shorten time to market reduce development costs forgo substantial design istut and risks Windows Embedded CE and Linux Board Support Packages processor dependent E 170 unit benchmark price at 1K for ARM S based SEC phyCORE LPoasad MX31 ARM 11 LMX27 ARMS LPC3250 ARM LPC3180 ARMO LPC2294 ARM XScale pxag20 PXAZ70 PXA255 MPC5554 MPCS200B MPC565 MPC555 ColdFire mcrsaes Slack ADSP BF537 E Rapid Development Kits start at 399 E include SEC Carrier Board software docu as well as kit specific cables adapters and LED E SBC module casily ports from Carrier Board to user target hardware E Carrier Board serecs as target reference design WWW pnytec com m a WWW phycore com C SMBus Bus Monitors Protocol Fi a A Analyzers a ENA e rost FJ 5 Adapters Multiplexers Battery Applications Software Tools Micro Computer Control PC a trademark of Philipa aparan NEW USB Zigbee Stick offers an easy way to Zigbee enable PC s Ap
4. trbpr width trbsc period break width www circuitcellar com CIRCUIT CELLAR TOTALPHASE geti N All products include Windows Linux and Mac OS X support free software free API with language bindings for C C C NET Python VB6 VB NET and LabVIEW www totalphase com 408 850 6500 sales totalphase com 7 April 2009 Issue 295 N April 2009 Issue 225 Photo 2 In addition to plugging wires into the head ers you can create a variety of modules that plug into them Here you see the pod with my LED work bench module which is used to characterize RGB LEDs A raster display lower left and a JTAG adapter lower right are also shown other serial port The actual protocol to use depends on the firmware pro grammed into the R8C allowing great flexibility in customizing it for whatev er purposes the pod is used for I did what everyone does first with circuits like this I made a blinky light But before I discuss my application let me take a moment to discuss what goes J Expand with Sealevel PCI vse and PC 104 boards for robust communications backed by We Listen Think And Create eee com gt gt sales sealevel com gt 864 843 8067 on behind the scenes Each piece of hardware needs a board support package BSP which includes all the ancillary sup port routines that are specific to your hardware e g how to set up the s
5. Serial R 0 3 o N Measure V ee ts Parallel C o N Measure V oO Serial C 0 3 o N Measure V eaa o a Parallel L o N Measure V Serial L o N Measure V 8ns 10ns 12ns_ 14ns Time 8ns 10ns 12ns_ i4ns Time 8ns 10ns 12ns_ 14ns _ Time 8ns 10ns 12ns_ 14ns _Time 8ns 10 1ns 12ns_ 14ns Time 10ns 12ns 14ns _ Time Figure 3 These are the results of the QUCS simulation of the reflected shapes for the six elementary impedance mismatches parallel and serial R C and L CIRCUIT CELLAR e www circuitcellar com With compilers that cut power consumption Your MCU can go green p HI TECH C PRO ANSI C Compilers featuring Omniscient Code Generation OCG OCG is a new whole program compilation technology that cuts power consumption by reducing interrupt latency and increasing speed while simultaneously reducing code size It s a win win for your project and the environment HI TECH C PRO compilers for Microchip PIC10 12 16 18 32 MCUs and other microcontrollers Denser code better performance www htsoft com ocg E OCG www htsoft com sales htsoft com 61 7 3722 7777 All trademarks are the property of their respective owners Nn April 2009 Issue 295 CIRCUIT CELLAR a back issues available as Searchable Archives on CD ROM CD ROM 12 2007 Issues 19
6. ie hi a S 7 ees a i BS i 1 Specidliz ing ir Mainflingen signal in Hesse Germany Enter 54 911227 5 279997 for the National Physical Laboratory which trans mits the Anthorn station in London Eng land Enter 46 408500 6 252500 for the HBG transmitter in Prangins Switzerland Danilo Consonni www_enigma lycos it is an electronic engineer who lives in Italy where he studied electronics at the Politecnico di Milano He develops circuits and writes for several publications based in Furope Danilo has been active in the com puter security field for more than 15 years You can contact him him on the web at http xoomer virgilio i www_enigma Po ECT FILES To download code go to ftp ftp circuitcellar com pub Circuit_Cellar 2009 2 2 5 S OURCE PIC16F628A Microcontroller Microchip Technology Inc www tmicrochip com COM MQuickturn Proto s Internet pioneers with 15 years experience Instant online Quotations amp Ordering From Singlesided to 6 layers ML Leadtimes from 48 hrs Full DRG included on all orders High Quality prototypes at LOW cost s Simply send your layout files and order online TollFree USA 1877 3908541 var GEE A Wn orad _ GraphiGede LEME 9 Electronics EJ Easy PC Em Ba www pcb pool com Email sales pcb pool com A April 2009 Issue 225 Nn April 2009 Issue 295 HE DARKER SIDE by Robert Lacoste Time Domain
7. which avoids interference and steadies data throughput Scheduling also minimizes superfluous radio activity and allows the node to sleep most of the time extending battery life version of the ZSTAR software back in 2006 Three Axis Foursome Circuit Cellar 191 It was fine for getting up and running and playing around a bit but certainly nothing to write home about But it s apparent that the Freescale folks have been hacking their hearts out in the inter im because the ZSTAR3 software has a lot of new features to exercise the hardware and show off applications ideas Not that the version 0 2 3 0 of the software didn t come with some quirks and head scratching I had to poke at it a bit to get the sensor linked in and bumped over some dubious error message potholes from time to time but nothing that was a showstopper The splash screen aggregates the 16 sensor display with tabs at the top to exercise various features see Photo 2 The RF Overview and Control tab enables you to manually or automati cally select the RF channel frequency and shows the energy in each band A dynamic RSSI display is useful for evaluating signal strength and range which are well known challenges for to compensate for variations such as mechanical misalignment and tem perature drift Naturally there s a Scope display that traces accelera tion in real time and also offers the 2 4 GHz radios with
8. Notice change No now change Swich up down Error ID 1 2 3 Leap second Is Is no Swich up down Enter lt RESTART gt Swich up down lt LIGHT ON OFF gt If problems occur during reception a warning message will appear The most common errors reported on the display will have to do with the ini tial header of the first or second group HD 1 and HD 2 rather than the noncorrespondence of the control parities of the byte of the informa tion received P1 P2 and PA To be honest during my frequent tests I found that the reception problems had been limited I must point out that the coded SRC hourly signals which are broad cast in the middle of the day must sometimes be broken or incomplete for several technical reasons causing the abortion of the reception Usual ly there are no problems with signals that are broadcast just before the news or at midnight because an ade quate space for a corrected transmis sion is allotted After a positive reception the decoder s display shows a clock per fectly synchronized to a millisecond Because the clock s functionality is based on the PIC16F628A s internal oscillator don t forget that it won t be precise 24 h after the synchronization The use of an external 10 MHz quartz doesn t ensure that all of the prototypes we make have the same precision For example some inex pensive quartz may have a margin variance in the frequency of 50
9. The Vendor Directory at www circuitcellar com vendor is your quide to a variety of engineering products and services Full Speed t writes your USB Code NEW HiDmaker FS for Full Speed FLASH PIC18F4550 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 NEW Developers Guide for USB HID Peripherals shows you how to make devices for special requirements Both PC and Peripheral programs understand your data items even odd sized ones and give you convenient variables to handle them PIC18F Compilers PICBASIC Pro MPASM C18 Hi Tech C PIC16C Compilers PICBASIC Pro MPASM Hi Tech C CCS C PC Compilers Delphi C Builder Visual Basic 6 HIDmaker FS Combo Only 599 95 DOWNLOAD the HiDmaker FS Test Drive today SYSTEMS Ince Electronic and Electro mechanical Devices Parts and Supplies Wall Transformers Alarms Fuses Relays Opto Electronics Knobs Video Accessories Sirens Solder Accessories Motors Heat Sinks Terminal Strips L E D S Displays Fans Solar Cells Buzzers Batteries Magnets Cameras Panel Meters Switches Speakers Peltier Devices and much more www allelectronics com Free 96 page catalog 1 800 826
10. Zeroplus LAP 16032U Logic Analyzer 16 channel 1OOMHz USB 2 0 1 20 SPI i2c UART 7 segment 2 free additional protocols Open Source Hardware Arduing Freeduino S eeeduing boards Arduinge Shields BlinkM Arduino Duemilanowe 30 WAS CELECTAONCS COM Be SESS MAOL OI TT or Lenn GH ie QUALITY PRODUCT FAST DELIVERY COMPETITIVE PRICING Aluminum Backed PCB Single amp Double sided SMOBC RoHS LPI mask Through hole or SMT Nickel amp Gold Plating Routing or scoring Electrical Testing Artwork or CAD data Fast Quotes Flex Circuits Fax 847 233 0013 microinginecring abs Onc Development Tools for PIC Microcontrollers LAB K Experimenter Boards p Pre Assembled Boards mee Available for 8 14 18 28 a and 40 pin PIC MCUs 2 line 20 char LCD Module 9 pin Serial Port Sample Programs Full Schematic Diagram Pricing from 79 95 to 349 95 ii Double Sided with Plate Thru Holes W Circuitry for Power Supply and Clock j Large Frototype Area Boards Available for Most PIC MCUs a Documentation and Schematic USB Data Acquisition ADU208 USB Relay I O Interface Complete SDK Online at Ms Oe Pane ae E m a D S aa iia Tia r l _ONTRAK S 1 ADUZOB a O ig i E p al al FEATURES 8 5 4MP relay outputs 8 ISOLATED digital inputs PortPowered AuxSVOCoutput 189 00 QTY 1 Other Models ADUZO0 4 Channe
11. lt S_ the plat form is traveling in a nearly straight line and you can use the method from Lucas s paper without approximations as tS og 25 ag SxS 9 b Ax AS cos 0 _ Ay AS sin 0 _ If S S lt S the platform is pivot ing around its own vertical axis with out moving Thus A Ax Ay 0 SOFTWARE ARCHITECTURE Figure 3 shows the overall software architecture for the dsNavCon board s control procedures and navigation strate gies The most important logical blocks are the four PID controls They are shown in a three level nested control loop Starting from the top level the Distance PID controls the robot s mean speed toward the target every 50 ms The Angle PID corrects the orientation to point the target every 10 ms by adding or subtracting a DeltaV to the mean speed to make the vehicle spin around its vertical axis By combining the outputs of the Angle and Distance PIDs you can determine the setpoint for the most internal level the Speed PIDs Each of the PIDs controls the speed of its wheel every 1 ms to maintain the value set by outer loops see Figure 3 By com bining the output of Angle and Distance PIDs you can obtain the setpoint for the Speed PIDs see Figure 3 The three lev els are nested But fortunately the dif ferent PIDs speed orientation and dis tance are independent of each other simplifying the K parameter s calibration procedure They can be set o
12. P6 4 wo wo P6_5 P3_0 TRAO P3_1 TRBO P3_3 SS P3_4 SDA SCS P3_5 SCL SSCK P3_7 SSO i D P6_6 NT2 TXD1 i P6_7 INTS RXD1 VSS AVSS R8C 20 Figure 1 Note the simplicity of the circuit Most connections go between the R8C U5 and either the USB chip U2 or the headers The rest of the circuitry is mostly for power control There are also LEDs and jumpers for C pull ups www circuitcellar com CIRCUIT CELLAR April 2009 Issue 295 m m ithe various I O ports on the jd QO April 2009 Issue 295 headers according to its pro Listing 1 This is a simple pod application that toggles out put pins gramming The headers include power and ground so the pod can power your project and talk to it The headers accept stan dard 2 2 gauge solid wire just like a solderless breadboard Or you can make modules that plug onto the headers like a daughter board to add additional circuitry or change the connec tor pinouts depending on the project see Photo 1 I chose a small board just over 2 x 1 so it could be used more like a pod and less like a board It s small enough to be consid ered part of the USB cable One end of the board is the USB connector and power management circuit followed by the FT232R chip The other end is the R8C chip surrounded by headers The wiring also follows this flow the USB connector is wired to the FT232R and power circu
13. distance and direction This value is algebraically cumulated in a vari able every 1 ms and sent to the supervisor at its request After the value is sent the variable is reset Speed is measured at every encoder s pulse Every 1 ms it calculates the mean speed by averaging samples exe cutes a PID algorithm and corrects the motor speed according to its result changing the PWM duty cycle see Photo 1 For a detailed description of the C30 PID library application refer to the following Microchip code example CEO19 Proportional Integral Derivative PID Controllers amp Closed Loop Control A link is provided in the Refer ences section at the end of this article Speed variations of the motors are executed smoothly accelerating or decelerating with a rising or falling slanted ramp to avoid heavy mechanical strain and wheel slippage that could cause errors in odometry Deceleration is faster than acceleration to avoid bumps with obstacles during braking see Photo 2 IC2 input capture is used to measure the time elapsed between two pulses generated by the encoder i e when the wheel moves a fixed distance Connected in parallel to QEA it captures elapsed time on the rising edge of the encoder s signal TIMER2 is used in free running mode At each IC2 interrupt TMR2 s current value is stored and its previous value is subtracted from it This is the pulse peri od The current value then becomes the previous value
14. documentation renesas com eng products mpumcu rej09b 0250_r8c2021hm pdf S OURCES GNU Binutils Free Software Foundation Inc http sourceware org binutils FT232R USB UART IC and MProg 3 5 EEPROM Programming utility Future Technology Devices International www ftdichip com Products FT232R htm Newlib Jeff Johnston http sourceware org newlib R8C Microcontroller Renesas Technology Corp www renesas com en r8ctiny GCC Operating system The GNU Compiler Collection http gcc gnu org r _ ADVANCED PIC MICROCONTROLLER PROJECTS n C From USB to ATOS with the 5 Programming 16 bit PIC 18F Serje Microcontrollers in C Leaming to Fly the PIC 24 By Dogan Ibrahim ISBN 9780750686112 By Lucio Di Jasio ISBN 9780750682923 49 95 939 95 Look for the latest titles from Newnes Press to help you maintain your competitive edge at newnespress com or wherever fine books are sold WWwWw newnespress com Newnes www circuitcellar com CIRCUIT CELLAR Stop by booth 1806 at ESC West to check out these titles and more Save 20 when you buy at the show April 2009 Issue 995 April 2009 Issue 295 INTELLIGENT ENERGY SOLUTIONS Solar Data Logaer Part 1 PCB Layout Inductor Saturation and Other Troubles Every engineer Knows projects don t always work out as planned Ed s goal was to build a data collection board that could automatically character ize a solar panel record
15. n value it can save time by not stopping twice in an already dis covered target and it can find the best path to reach a given coordinate and more DEAD RECKONING BY ODOMETRY Let s consider the general dead reckoning algorithm needed for a DSC or microcontroller based system Once you have the information about the distance traveled by each wheel in a discrete time update odometry you can estimate the robot s position coordinates with the same periodicity without any external reference dead reckon ing Refer to G W Lucas s aforementioned paper for information about the mathematics In the following equations I used Lucas s symbols and terms o t amp a 0 x t x ro in Ue Yu 3 n o 0 n BAE t Figure 2 shows the terms used in the formulas for a turn ing platform For each discrete time interval the system measures the number of pulses generated by the encoders Know ing the distance represented by a single encoder tick you can calculate the distance traveled by the wheels S S in time t Note that velocity distance time Ve VL R Ee Pe According to Lucas D April 2009 Issue 225 t t o btv _ bS S 2 Vp 7 vi 2 Sr T S Ad S S You can calculate b Ax R sin A 9 _ sin _ Se S x t x R sin Se S R L 8 sin Ay R cos 9 _ cos Ad Dy Sk S By performing
16. A aa Long Range Modules FCC PRE CERTIFIED amp ready to customize for your application Function Modules OEM Products Handheld TXs POOR SBT LAI TOYE LOW COST LONG RANGE I A REMOTE CONTROL TRANSCODER Ic Direct serial interface Up to 8 inputs Bi directional control Transmitter ID output f Automatic confirmation Secure 2 possible addresses Latched and or momentary outputs Low power consumption PLL synthesized architecture amp RSSI and power down functions W Compact surface mount package No extemal RF components except antenna wi TECHNOLOGIES WIRELESS MAGE SIMPLE 800 736 6677 159 Ort Lane Merlin OR 97532 www linxtechnologies com www circuitcellar com_ gt CIRCUIT CELLAR there is contact with the bumper you should provide a rou tine to back away from the collision and try a different route VIRTUAL DASHBOARD Debugging feedback was one of the topics covered in the first part of this series With the wireless link and control coming from the Liberty BASIC application running on the PC the issue of tethering and access to the Create s sensor data is no longer an issue The BAM eliminates the need for a tether and because all variables are local it is easy to dis play anything Photo 2 shows the dashboard I used with this application I added some computed items that show the Create s dead reck oning X Y position in relation to the charging ba
17. One it passes com mands from the Bluetooth Adapter Module BAM to the Create by filtering all communications through a Microchip Technology dsPICSOF4011 Two it provides a framework for adding external sensors such as a compass or ultrasonic ranger to the system and access ing them with Open Interface Extension OIE commands April 2009 Issue 225 Nn for debugging the PC and SPI lines are free to operate normally The microcontroller s basic func tion is two fold to handle the serial traffic between the BAM UART2 and the Create UART1 and to interface with any sensors added to the system The microcontroller I call it Me and each UART Create and BAM will have two ring buffers associated with them one for TX and one for RX for a total of six Both of the UART s RX buffers are automatically filled by RX interrupt routines when data is received Any thing placed in either UART s TX buffer is automatically transmitted by TX interrupt routines Any data coming from the Create in the UART1RX buffer as well as any data coming from the microcon troller in the MeRX buffer must be melded together into the BAM the UART2TX buffer Most OI data does not have any kind of wrapper therefore I had to interleave data from the microcontroller into a response from the Create To keep the Create s data packets as a single entity I needed to know how many bytes to expect For most commands
18. P2 and P6 expose all 8 bits to pins on the chip while two P3 and P4 expose only 6 of the 8 due to the limited number of pins Port P6 is used for the seven UART signals DTR goes to nRESET leaving 1 bit to control an on board LED Ports PO P1 P2 and P3 are brought out to standard 0 1 headers Two of the P4 pins are used to make up for the missing P3 bits Two of the remaining P4 pins are used for the ADC reference voltage and the clock I chose this chip because it has sufficient I O pins to do nearly anything I can imagine PO has eight ADC inputs P2 has full three phase motor control capabilities P1 offers six interrupt inputs four more ADC and a dual mode synchro nous and asynchronous serial port P3 has an SPI P C inter face and two timer outputs As you can see there are a lot of peripherals for project specific interfacing and intelligence THE USB GPIO POD Given what I have covered so far the pod almost designs itself The FT232R chip lets the host talk to the R8C either to program it or to communicate with it The R8C controls VDD f VOCIAVCC MODE P4_2 VREF P4 3 P4 4 P4_5 INTO P1_O KIO ANS P1_ 1K 1 ANQ P1_2 KI2 AN10 P1_3 KIS AN11 P1_4 TXDO P4_6 XIN P4_7 XOUT P1_5 RAXDO TRAIO INT1 P1_6 CLKO P1_7 TRAIO INT1 P6_O0 TREO P2_0 TRDIOAO TRDCLK P2_1 TRDIOBO P6_1 P2_2 TRDIOCO P2_3 TRDIODO P6_2 P2_4 TRDIOA1 P2_5 TRDIOB1 P6_3 P2 6 TRDIOCI P2_7 TRDIOD1 EN es N M wo E
19. STMS2 microcontroller which is available in three families targeting cost effective high performance or USB based applications Available devices have flash memory ranging from 16 to 512 KB The STM32 Primer2 is available for 49 _ x a s a os 4 ii _ E peee ie STMicroelectronics Inc www st com NPN CIRCUIT CELLAR www circuitcellar com yt allel ail DIGITALLY PROGRAMMABLE The LT5554 is a broadband digitally programmable gain IF amplifier featuring a 48 dBm OIPS output third order intercept at 200 MHz The amplifier has low noise enabling high dynamic range performance in wireless communication receivers and signal processing systems Its gain is digitally controlled from 2 to 18 dB by a bit parallel word producing the finest O 125 dB steps gain control Granularity of any amplifier available The amplifier settles in less than 5 ns from a gain change producing low glitch noise and supporting fast and accurate AGC per formance Its output stage has robust capability to drive into 50 Q loads with low distortion and noise Unique to the LI5554 is its OIPS performance which remains consistently high over a wide varying signal level range In contrast the closest competing solution is limited to only a narrow 1 dB signal level range With today s new generation of wireless technology such as LTE Long Term Evolution and WiMAX which use modulated signals with a 12 dB crest factor
20. Scope of Tilt n T Y L if f HA fe W ay ber ea lA l vi L Photo 4 A little signal processing goes a long way to filter noise as demonstrated by this electronic level demo reliability safety and health applica tions A neat feature is the software takes a decent stab at determining the distance of the fall based on the elapsed time see Photo 5 Before you get carried away keep in mind the 5 000 g maximum spec which is less than it sounds the Drop Test spec is 1 8 m beyond which perma nent damage may occur The demo works fine if you drop the gadget onto something soft all the better to be safe than sorry Similarly the Shock tab has demos of interest in blue collar appli cations such as shipping and han dling For example how many pack ages have you received with a This Side Up label Wouldn t it be inter esting to actually know if and when and where it got tipped upside down along the way Finally the Digital tab pops the hood on the chip so you can probe and configure all of the accelerometers registers and options ONE FROM COLUMN A So there you have it the recipe for your next killer app Like the menu in a Chinese restaurant all you have to do is choose one item from col umn A one from column B and one from column C Column A is an MCU There are so many delicious choices here you can t go wrong everything from 50 ce
21. and is available in eight different pressure ranges When placed between contacting surfaces it instanta neously and permanently changes color directly propor tional to the actual pressure applied The precise pressure magnitude psi or Kd cm is easily determined by compar ing color variation results to a color correlation chart con ceptually similar to interpreting Litmus paper Pressurex can also be scanned through one of Sensor Products s opti cal imaging systems The film which is available in eight dif ferent pressure ranges is used in the design manufacture calibration and quality control of many products Pressurex is flexible which enables it to conform to curved spaces It is ideal for invasive intolerant environments and tight spaces that are not accessible to conventional electronic Er E 2a transducers as A 270 mm x 3 m roll of Pressurex costs 698 Sensor Products Inc www sensorprod com For Any PCB GHZ Bandwidth BGA QFN Sockets RF Modules GSM GPRS From Part 15 to Part 90 Compliant M2M Solutions qu Narrow Band FM UHF Multi Channel GSM GPRS modules and modem series vs Quick Goch y st E E ww se on any existing PCBs f Boer ye obo i eit Cu aoe Ae No mounting holes e No soldering Industrial Bluetooth Data Loggers Patented placement OEM Modules Wireless Device Servers RS 232 Stand Alone and Long range options low cost Wireless Mesh Networking Logge
22. and the day of the week The second segment transmits the year and two interesting technical parameters Data is transmitted through the bina ry coded decimal BCD coding and not with a binary sequence as you might think As you can see in Figure 2 the bit values are placed according to the positions in the transmitted code For the remaining technical informa tion SE SI refer to the tables in CIRCUIT CELLAR e www circuitcellar com Figure 2 A detailed analysis of the two afore mentioned parameters shows that the first SE warns when time changes from standard to daylight savings time and vice versa The sec ond SI sees to the warning for the so called leap second In brief the leap second represents the power to add or take away 1 s to compensate for varia tions in the speed of the Earth s rotation If nec essary this compensa tion is inserted at the end of June or December after 23 59 59 UTC From the introduction of the leap second in 1972 up to the last update on January 1 2009 a total of 34 s have been added to the time scale TAI The decision to use or not use the leap second is made by the International Earth Rotation Service www iers org It does so according to the measurements made by the metrological laboratories that it refers to To a casual listener the SRC RAI hourly signal sounds like a shrill modulated 1 5 s sound that s fol lowed immediately by five s
23. jars paicrocontrol fe st E TE Features Wir dows i he Man SES placement Da osi on gates ates swap optimization lt RX S Highly co nfi guroble desig rules X N 2S for scher See nteractive econ nin B layout Polygonal and split power planes Sri Ecircuit simulation id dss shape HAEN Co simulation of PIC AVR 8051 and ARM7 omatic mitre onmie commands amp Basic Stam microcontr roller r firmware Industry standa a CADCAM amp ODBr opt Integrates with MP LAB and AVR Studio Integrated 3D Viewer v fith 3DS ond DXF export Ove w SS xO S QJ All levels of the Proteus Design sune now include a worldiclass fully inte Bi shape baso jasi duiorovienaimo addiional osi a prices erri omoi S 249 00 m i jmd A CIRCUIT CELLAR e www circuitcellar com SENSOR FILM MEASURES LOW CONTACT PRESSURES Pressurex Zero is an easy to use tactile pressure indicating sensor film Pressurex Zero char acterizes contact surface pressure down to an extremely low 7 2 psi 0 5 kd cm It is simply placed between contacting or mating surfaces to instantly and accurately measure and map pres sure magnitude and distribution Variations in contact surface pressure are imme diately visible by the impression made on the film The range for Pressurex Zero is 7 2 to 28 PSI 0 5 to 1 97 kd cm Pressurex comes in the form of a thin plastic sheet 4 or 8 microns physically similar in thickness to paper
24. 16 bit velocity and 16 bit radius values as byte values with the MSB first Not only does the velocity value need to be broken down into two high and low byte components but it is a signed value that uses direction to determine whether the value should be posi tive forward or negative backward The radius value is also a signed value In this case the 16 bit values are predefined as RadCwW RadCCW and RadStraight It has no response At some point we need feedback to determine when to stop either because we ve driven far enough bumped into something or are about to topple down the stairs CndSen sors would be appropriate This command requires one addi tional byte beyond the command byte d 142 We need to ask for a sensor response using a Packet ID The sensor Dis tance PacketID 19 would appropriately respond with a 16 bit signed number indicating the distance traveled forward or backward since the last request You will need to keep a run ning tally of the total distance traveled to determine if it s time to stop or not If you remember from last month the sen sor command is also capable of returning the status of groups of sensors Packet IDs 0 6 return the status of multiple sensors Every sensor will return at least 1 byte with some sensors returning 2 bytes as in the aforementioned distance sensor Responses are handled by the command routine that makes the request Any routine that expects a response does a
25. 5432 www circuitcellar com CIRCUIT CELLAR www TraceSystemsinc com 301 262 0300 G N PC to FC C Adaptor 3 Separate Buses 5V amp 3V Simple ASCII Interface Cross Platform All OS USB Add USB to your next project it s easier than you might think e USB FIFO up to 8 mbps e USB UART up to 3 mbps e USB Microcontroller boards pre programmed with firmware e 2 4GHz ZigBee amp 802 15 4 RFID Reader Writer Absolutely NO driver software development required www dipdesign com DLP Design Embedded Ethernet ONLY 98 xt 10Base T Ethernet gi 186 Processor 40 MHz IS DOS wi Flash File System 16 Digital I O 5V DC Console Debug Port Hardware Clock Calendar 2 16 bit Timers Socket for DiskOnChip Watchdog Timer 512K DRAM amp 512K Flash 3 75 x 2 50 Development Kit Includes 1 2 g picoFlash Controller Borland C C 4 52 Pewee TCP IP PPP amp Web Server System Serial Driver Library AC Adapter and Cables picoFlash 2 Serial Ports Call 530 297 6073 Email sales jkmicro com On the web at www jkmicro com JK microsystems April 2009 Issue 295 m Q m April 2009 Issue 295 o Free Training for Rabbit Developers Learn More at Rabbit U com LV MaxSonar Ultrasonic Ranging is EZ LV MaxSonar Products e High quality Low cost e Low power 3V 5 5V lt 4mA avg e Easy interfacing Serial
26. And if a glitch lies around the corner rather than presently before him a good engineer must be able to troubleshoot that potential complication before it rears itself up As with most embedded design related skills the science of trou bleshooting both existing and potential problems takes time to master It is typically developed over the course of dozens of projects and nur tured by adept mentors such as Circuit Cellar authors Like our founder Steve Ciarcia many Circuit Cellar authors have excelled at trou bleshooting existing and potential design problems as well as real world problems fixable with embedded design applications over the course of many years In this issue a group of stand out authors unites to present useful articles that highlight their wide range of skills Lack a parallel port No worries In a series titled Construct a USB GPIO Pod DJ Delorie shows you how to address this problem with a general purpose input output module that plugs into a USB port This month he presents the module p 16 Encountering trouble while build ing your first solar data logger Columnist Ed Nisley describes how to assess your mistakes regroup and move forward p 24 Wondering how to program that motionless robot sitting beside your workbench Don t let software problems keep you from realizing your design goals In the second part of his series Robot Navigation and Control Guido Ottaviani explains how to write and
27. Communication to Devices with RS485 I F p a a a a ot bo fiw fe FL eat Se A hal So AE n 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 1500mA LAN cable Etc DIP Switch 485 Baud Rate setting LED Power Network 485 Port transmission signal iLbank Diem in Bieri ILbank Gateway to Eiecironice MP3P DIY KIT Do it Include Firmware Full source Code Schematic qty 100 qty 1 i ICbank Dateuimy tn Powerful feature MP3 Encoding Real time decoding 320Kbps Free charge MPLAB C Compiler student edition apply Spectrum Analyzer Application Focusing for evaluation based on PIC Offer full source code schematic Microchip dsPIC33FJ256GP710 16 bit 40MIPs DSC VLSI Solution VS1033 MP3 CODEC NXP UDA1330 Stereo Audio DAC Texas Instrument TPA6110A2 Headphone Amp 150mW 320x240 TFT LCD Touch screen SD SDHC MMC Card External extension port UART SPI 12C 12S Powerful feature Play MP3 Information Reward forward Vol Focusing for MP3 Player SD Card interface Power battery offer full source code schematic Specification MEU Atmel ATmeg
28. Defining a maximum field dimension of 5 m x 5 m you obtain a 2 500 cell matrix 50 x 50 Each cell is R r b 2 Figure 2 This is a definition of the terms used in the formulas for a turning platform www circuitcellar com CIRCUIT CELLAR defined with a nibble with a total memory occupation of 1 250 bytes Sixteen different values can be assigned to each cell e g n 00 unknown cell n 01 10 cell visited n times n 11 obstacle found n 12 target of type A found n 13 target of type B found and n 14 target of type C found The robot can start from any position in the field Note that 0 0 is the reference coordinate in its refer ence system To translate robot reference system coordi nates to a 50 x 50 matrix index pair the values must be normalized in a 0 to 49 range Xnorm Xrel 50 mod 50 and Ynorm Yrel 50 mod 50 Index is the remainder of division in a range of 0 to 49 A range check must be performed in advance to avoid overflow if the field is greater than 5 m x 5 m To create a 50 x 50 nibble matrix you need to define a Struct see Listing 1 It fills up 1 250 bytes Eliminat ing heap space not needed if dynamic memory allocation or file I O library functions are not used leaves enough RAM to work with Field mapping is useful for finding the best exploring strategy in an unknown field The robot can direct itself to the less explored portion of the field lower
29. a few Italian robotics groups where he shares his experiences with other electronics addicts and evangelizes amateur robotics Dos FILES To download code go to ftp ftp circuitcellar com pub Circuit_Cellar 2009 225 ee 1 Microchip Technology Inc Microchip code examples CEO19 Propor tional Integral Derivative PID Controllers amp Closed Loop Control 2005 www microchip com stellent idcplg IdcService SS_GET_PAGE amp nodeId 2 620 2 M Palmer AN545 Using the Capture Module DS00545D Microchip Technology Inc 1997 3 J Borenstein H R Everett and L Feng Where Am I Sensors and Methods for Mobile Robot Positioning University of Michigan 1996 www personal umich edu johannb position htm 4 D Walters Implementing Dead Reckoning by Odometry on a Robot with R C Servo Differential Drive Encoder 2000 www seattlerobot ics org encoder 200010 dead_ reckoning article html 5 G W Lucas A Tutorial and Elementary Trajectory Model for the Dif ferential Steering System of Robot Wheel Actuators SourceForge 2001 http rossum sourceforge net papers DiffSteer DiffSteer html 6 Wikipedia PID Controller http en wikipedia org wiki PID_controller 7 J Borenstein and L Feng UMBmark A Method for Measuring Com paring and Correcting Odometry Errors in Mobile Robots 1994 www personal umich edu johannb umbmark htm i a G Ottaviani www
30. as both branches are in parallel Just add the last 17 Q resistor in series and you are back to 50 Q Magical isn t it So you could build a 50 Q splitter just with three resistors but it is far easier to achieve good per formances with an off the shelf split ter especially when manipulating sub nanosecond signals The only dis advantage of such a resistive splitter is that a 6 dB loss is incurred in each of the two branches but that s life 1 NS PULSE GENERATOR Unfortunately there is a problem with TDR techniques If you need a good distance resolution then you must generate and detect quick puls es Consider a standard transmission line with a velocity factor of say 0 8 The speed of light is 30 cm ns in free space so it is 24 cm ns i e 0 8 x 30 Photo 2 I soldered the pulse generator transistor directly on the output con nector and added a reused CFL backlight DC AC converter with a 1N4007 recti fying diode and a small 1 000 V ballast capacitor to provide a 300 VDC supply In fact 100 V would be enough added a small heatsink on the transistor just in case but it seems useless Or April 2009 Issue 295 Nn N April 2009 Issue 295 Photo 4 Check out my TDR setup The custom pulse generator drives a three way PY cee 1 Fdseaii 1 at Far lt fad pee dT pe Ci a Praci SUT pee Ris 6208 Photo 3 This is the output of the avalanche genera
31. be some changes and at the end of the month a leap sec ond will take place As you can see in Figure 6 the menu enables you to control the display light and perform a reset TEST SOFTWARE DELPHI The decoder for the SRC RAI time signal is equipped with some of the most refined programming technolo gy that can be squeezed out of one small PIC16F628 microcontroller To thoroughly test your project without having to wait for the signal to be broadcast refer to the Test IEN SRC exe file on the Circuit Cellar FTP site To use the software you need a PC running Windows XP and a sound card The program s main screen is shown in Photo 3 After you set all the necessary parameters the signal is ready to be transmitted in an entire block You can then manually enter the beeps at 1 000 Hz for the transmission The software includes a wave for mat recording of a broadcast time signal You can use it to test your cir cuit as well Please consider this soft ware as a mere test program with no control procedure Good luck hunt ing for signals and then decoding and validating the received data al www circuitcellar com CIRCUIT CELLAR Author s note You can enter GPS coor dinates at www gpscoordinates eu show gps coordinates php to see images of _ the time signal transmission facilities via satellite Enter 45 0150537 7 659654 for the IEN IRITI in Torino Italy Enter 50 016000 09 007600DCF 77 for the
32. calen dar which autonomously looks after the correct display of the time and the punctual date change for leap years included between 2000 and 2 035 After 2035 this device will probably be considered only as a piece of history However an undoubtedly interesting feature is the display of the second intercalary leap second which will be able to display the virtual 60 s as soon as the leap second happens Its display will happen at 1 A M not at mid night because the Italian time zone is 1 GMT USER MANUAL By now you should be persuaded that using the decoder is easy to use and highly reliable You just need to decide if you want to use a common AM FM radio or a satellite TV receiver The former is easier and readily available but imperfect fre quency tuning may blanket the reception Don t worry A lot of work has been made on the software in the microcontroller in an effort to mini mize mistakes as much as possible A special routine calculates and judges the signal s quality to identify data that is also in the presence of reception noises On the other hand a TV satellite decoder offers excel lent output signal quality but limits portability When switching on the device a welcome message appears on the dis play You re then asked to choose the source of the signal lt RADIO gt or lt SAT gt By selecting the satellite you tell the device that the source of the signal will be taken from a sat
33. com a April 2009 Issue 225 WwW qa SN SARGE Ka April 2009 Issue 225 by Guido Ottaviani Robot Navigation and Control rar 2 Software Development Guido built a navigation and control subsystem for an autonomous differential steering explorer robot Here he describes the software development phase of the project n the first part of this article series I described how to build a robotic platform with Microchip Technology dsPIC con trollers Now I will describe the software loaded on the board that manages wheel speed closed loop control with a PID algorithm dead reckoning by odometry in both theoretical and practical forms field mapping navigation motor control MC and more The software is modular so all the pieces can be examined as stand alone black boxes I ll focus on the Microchip dsPIC30F board so you can better understand every block You ll find the detailed comments in the code to be extremely helpful FIRMWARE The philosophies of MC and supervisor programs are similar Both involve the recycling of numerous portions of the code The programs are described step by step in the code The name of the MC s DSC program is dsPID The program in the supervisor is dsODO The source code MPLAB project and detailed flowcharts are posted on the Circuit Cellar FTP site Both programs dsPID and dsODO are fully interrupt driven At start up after the initializa tion of the supervisor a
34. com http forums parallax com _ A virtual toy box for For great conversations programmers the visit the Propeller P Bi Propeller Object Discussion Forum n Dunu Exchange contains With 15 000 registered IT SOurce code objects users you may browse in high level Spin threads anonymously or Assembly and C Find sign up to join in the talk objects created by both It s a great place to get eee Parallax engineers and your questions answered customers for data storage displays motor control by Parallax staff and other knowlegeable users share communciation protocols math functions and more your projects and find inspiration http www parallax com propeller Our main web site Parallax com is the place to go for the latest downloads including the Propeller Tool programming software the Propeller Manual and datasheet videos and our latest education text Propeller Education Kit Labs Fundamentals Propeller web site http www parallax com propeller o 5 Discussion Forums http forums parallax com Propeller Object Exchange http obex parallax com Propeller Parallax and the Parallax logo are trademarks of Parallax Inc www par d dxX com
35. complement of sensors and how they can be accessed using the Open Interface OI with the Command Module CM accessory The CM contains an Atmel microcontroller that you can program in C or C using your PC The resultant code is downloaded onto the CM with a USB interface I demonstrated how you can use Atmel s AVR Studio to write your application in assembly language Yup some of us still like to get our hands deep into the bits and bytes I also examined how the USB tether used in downloading could provide real time debugging feedback Obviously you can t have a robot running around the floor with a long tether Another accessory for the Cre ate is the Bluetooth Adapter Module BAM The BAM gives you a wireless link to your PC The only catch here is that it uses the same cargo bay connector that the CM requires This means you must choose between either wireless communica tion or an on board programmable microcon troller Something s wrong with this picture This month I will discuss how to replace the CM with a Microchip Technology PIC microcon troller that has two full serial ports so the BAM can be used along with the PIC But first I want to explain why I took this approach If you remove the CM s plastic top you will find an Atmel ATmegal68 microcontroller This flash memory microcontroller has a UART that s used for two functions sending OI commands to and receiving data from the Create through the cargo bay c
36. days Sure you can measure tilt with a single axis accelerometer but the problem is that the g output is quite non linear over the range of 0 to 90 see Figure 2 Getting a feel for this phenomenon is as easy as dropping and giving me 10 push ups Consult your doctor first Now stand up and lean against a wall at a slight angle and give me 10 more A lot easier huh By adding an extra axis you can use whichever sensor is in its sweet spot for better resolution across the full range and espe cially near the extremes i e 0 and 90 The accelerometer I used back in 1995 had an analog output albeit thankfully signal condi tioned to provide a decently high level signal By contrast the MMA7456L is fully digital with on board 10 bit ADCs and a SPI In my book digital is generally preferred because it minimizes sus ceptibility to noise and enables smart features However there C E0675 Soy freescale Photo 1 The ZSTARS evaluation kit provides a quick and easy way to taste test Freescale s wireless sensor recipe and the price is right at just 99 The network supports up to 16 sensors Additional sensor boards using the digital MMA7456L or analog MMA7361L are available for 59 PTGO BKGD MS PTA1 KBI1P1 PTAO KBI1PO PTB7 AD1P7 PTB6 AD1P6 PTBS AD1P5 oO oO 00 vI PTA3 KBI1P3 PTA4 KBI1P4 PTA5 KBI1P5 7 PTA6 KBI1P6 PTA7 KBI1P7 VDDAD Flag openi
37. debug software to get the job done p 30 Jeff Bachiochi s article on page 58 includes infor mation about application development for a basic robotics system Having issues with the signal processing aspect of a design or more specifically decoding a particular signal You re in luck Two authors focus on demystifying the topics of signal processing signal reflection and signal analysis Danilo Consonni explains how he decodes hourly signal transmissions p 40 He built a digital decoder to analyze the Italian SRC RAI time signal If you re confused by the topics of signal reflection or impedance mismatching turn to Robert Lacoste s article Time Domain Reflectometry p 50 He describes how to detect and measure an impedance mismatch in a transmission line and more Tom Cantrell wraps up the issue by explaining why acquiring a healthy mix of MCUs sensors and wireless technologies to keep on hand can lead to the creation of exciting new killer apps p 66 With a nice variety of cutting edge parts on tap you can push the innovation envelope and quickly solve any number of menacing design problems C Mhil cj circuitcellar com A April 2009 Issue 225 THE MAGAZINE FOR COMPU TER ARE Rie 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 circuitcellar com ADVERTISING REPRESENTATI
38. gosub LGetPacket to handle single and multiple byte responses The GetPacket routine routes Packet IDs of 7 42 to the appropriate SaveSensorData routines that capture the response data using gosub ReadData and then saves it into the local variable which the application will use With Packet IDs of 0 G the GetPacket routine uses for next loops to capture the response data from multiple sensors in the proper order APP WITHIN THE APP Although all of these routines are certainly part of the appli Or N cation as a whole the real app is in having the Create follow some commands My future application s task will be to go exploring and try to map what it thinks is out there This sounds easy enough but remember that right now all we have is the ability to bump an object and respond and to dead reck on position where the error between your position and where you think you are grows larger the farther you move If you have experience in mapping or terrain learning I would like to hear from you I went for something simple I backed the robot out of its charging base a short distance turned it around and started exploring with the cover demo While the Create explored I continually monitored the battery and prepared to change to the cover and dock demo if the battery s charge fell to 50 so it would return it to the charging base Listing 1 is the mini app within the application to com mand this behavior
39. of May Issue 220 June Issue 227 Theme Measurement amp Sensors Deadlines Space Close April 13 Material Close April 20 Battery Charge Measurement A State of Charge Lead Acid Battery Meter Construct a USB GPIO Pod Part 2 USB JTAG Module Theme Teach an Old DOS New Tricks A Flash Drive Reader for MCUs Works for DOS A i Communications Transformerless Power Supply Bonus Distribution Atlantic Design amp Manufacturing Show LESSONS FROM THE TRENCHS FAT File System Review Part 2 C Code for the File System Call Shannon Barraclough FROM THE BENCH A World Without the NTSC NTSC to VGA Conversion Made Simple now to reserve your space 860 875 2199 SILICON UPDATE Whistle While You Work A Look at a Modern DSP Na o e mail shannon circuitcellar com mI April 2009 Issue 225 www circuitcellar com CIRCUIT CELLAR RIORITY INTERR by Steve Ciarcia Founder and Editorial Director Print Is Dead Long Live Print I one of those good guys who goes shopping with his wife and doesn t complain Our trips include both mutual and independ ent destinations She rarely accompanies me into RadioShack and I wouldn t be caught dead in Joann Fabrics or Michael s On those occasions I don t pout or honk the horn after 10 minutes Instead I tell her to take her time and I read magazines The bad news is that the pile in the car keeps getting smaller Aside from 32 page trade journals and half sized Wired and Fo
40. ppm 0 005 This is why programming an EEPROM memory location 38 Hex with an adjustment value has been allocated By changing this value when developing the PIC it is possi ble to adjust in advance or later the internal routine which is in charge of the clock s adjustment Your internal clock is also fully equipped it updates the complete date even for leap years until 2035 it automatically updates the time when passing from standard time to daylight saving time and vice versa and it is a perfect display of the sixti eth second in case of a leap second at 1 A M sharp Central European Time CET in Italy is 1 h ahead of Green wich Mean Time GMT All the other parameters can be displayed using the two special keys on a keyboard You can page through CIRCUIT CELLAR www circuitcellar com AJIEN SRC Test Signal File About Warning Mon 1 9 Surn Day Month Year Palel Es SAL Signal Exit fi fi fi fo Beep 1000Hz Hours Minutes Leap Secon Paes Time i Standard C Summer MTTP ADOmer Alice it www_ENIGMA i HoLeap Second C Leap Second Delay 15ec C Leap Second Delay 15ec Notice Change Time Day 0 7 T No Change 0 Change Now IEN SRC Test Signal Photo 3 This is a principal panel in the test software to the next submenu You will then know if it is a standard or a daylight saving time If in the following seven days there will
41. pulse width amp analog voltage outputs e Reliable and stable range measurement No dead zone LV MaxSonar EZ e Choice of beam patterns e Tiny size lt 1 cubic inch e Light weight lt 5 grams LV MaxSonar WR1 P67 e Industrial packaging e Weather resistant e Standard fitting e Quality narrow beam www maxbotix com SCIDYNE Offers a Full Line of Innovative Modules for PC 104 Applications ADIO 104 16 Analog Inputs 5V Power a8 AnalogOutputs Pulse Accumulator 24 Digital VO lines Open Drain Outputs B Ei 95 Bi Directional Digital Channels input Output and Strobed VO functions Uses Familiar 82C55A Chips XIO RO8 Add eight High Power relay outputs to any digital port BOQYNE rr WWWese idy ne com Add a color touch interface to your yuisddu J High level R5232 Low cost interface In stock a Easy to program Add color graphics to any 8 16 bit embedded system Easy fast and flexible Up and running in hours RZAClH TECHNOLOGY INC www reachtech com 510 770 1417 5 mg 842 Boggs Avenue Fremont CA 34539 Se World Leading Driver Free Win Mac Linux USB Chips AID VO SPI 2C BASIC programming USB Status amp Control USB DAQ USB DAQ FileSys sensing amp logging USB to UART 2C SPI and I O expanders No microcontroller programming required Add USB to your products in a day www hexwax com Mouser Farn
42. stratosphere or breaking the bank with other methods Digital Plus enhances the print magazine experience with special features that we can only do online Articles in Digital Plus may include video demos and downloadable supplements Even the ads can include see before you buy video demonstrations The best part is that Digital Plus will be less complicated to view than most other online magazines Of course if you are still an EE loyalist you won t even have to download a special program like Zinio to view it offline Like our former electronic magazine you can still simply download a PDF of the whole issue So what s the damage for all this Not as bad as you think For us it s about serving the community and increasing our online presence without sacrificing print to do it Other electronic magazines might immediately raise prices while giving less but we plan to do it incrementally if at all For starters the April issue of Circuit Cellar Digital Plus will be free to everyone including print EE subscribers and lurkers so you can see what I m talking about We ll bump all paid digital subscriptions to make up the difference for any free months we offer The one year price of the electronic edition subscription was 15 If you are a print subscriber you could get it for 5 per year Right now you can extend either subscription or start a new Digital Plus subscription at those same prices until May 31 2009 After that the Di
43. the first time Maximum Power Point The standard solution requires a DC DC converter drawing whatever current will produce the maximum power at whatever voltage the panel supports while producing a more or less con stant output voltage That raw DC feeds the application cir cuit s power supply much as line voltage feeds an ordinary PC For example an 80 W solar panel might produce 4 5 A at 18 V in full sunlight That current will decrease as the illumina tion changes so the MPP controller must adjust the current going into the DC to DC converter while maintaining a con stant output voltage by tweaking the duty cycle That requires monitoring the actual panel current and output volt age while adjusting the switching lev els a process known as MPP tracking The simple boost mode converter circuitry on the left side of Figure 1 can do exactly that albeit on a small scale and with relatively low efficiency Tran sistor Q1 switches current through inductor L1 and then dumps it into C3 through D1 The Maxim Integrat ed Products MAX4372T high side cur rent amplifier has a gain of 20 to pro duce 1 V 100 mA of panel current the pair of comparators in U2 set the high and low current limits and a simple R S flipflop built from the NAND gates in IC 1 turns Q1 on when the current falls Y April 2009 Issue 225 N April 2009 Issue 295 0 00s 50 02 0 00s ti 77 00us t2 108 0us At 31 00us
44. the international system the second then became SI the duration of 9 192 631 770 periods of the radiation corre sponding to the transition between two hyperfine levels of the ground state of the cesium 133 atom Photo 1 This is the IEN SCR RAI decoder CIRCUIT CELLAR www circuitcellar com The Newest Embedded Technologies New Products from J B WLAN NETWORK NOT R i D e an T Er T E T ALL EN j q L J J A q J ee congatec the rhythm of embedded computing k conga B945 COM Express Modules ePIR Zdots Single Board Computer JSLM2 UHF VHF Telemetry Radio The ONLY New Catalog Every 90 Days Experience Mouser s time to market advantage with no minimums and same day shipping of the newest products from more H T ed yr s ie Be ER b s e z2 Se ee than 390 leading suppliers ConnectCore 9C ARM9 based Module a tti company The Newest Products For Your Newest Designs www mouser com Over A Million Products Online 800 346 6873 Accelerate your Design Time with EmbeaaeaDeveloper com Speed up your design time during the critical evaluation phase of your project by avoiding locating and comparing devices from different manufacturers We make it easy just one visit to EmbeddedDeveloper com will shave hours or days off your schedule 7 Embedded Developer s simple navigation and intuitiv
45. the need to maintain linearity perform ance over wide operating levels is paramount for producing consistent base station performance The LT5554 is a full differential input and output amplifier Its differential outputs can drive directly into 50 Q loads The amplifier may be over driven and can recover quickly in less than 5 ns Additionally the amplifier has excellent reverse isolation These characteristics make the L15554 an ideal ampli fier to drive high speed high res olution ADCs where the input sampling noise can couple back to the RF and IF circuits The LT5554 starts at 4 40 each in 1 000 piece quantities Linear Technology Corp www linear com QUICK CONNECT WIRING SYSTEM The new M16 powerfast wiring system is specifically designed for machine power distribution and motor control The quick connect M16 powerfast system provides a time and cost saving replacement for traditional hard wiring installations and com plies with NFPA 79 Electrical Standard for Industrial Machinery These two three and four pin connectors and tees provide up to 18 A in a compact form factor The cordsets are offered with Tray Rated exposed run PVC flexlife cable All con nectors deliver IEC IP 67 protection and are rated for 600 V and up to 18 A Tees are available with simple connectors or with branches Like most TURCK cordsets the M10 powerfast line offers male or female options straight connectors standard and custom len
46. the op amps MPP LETDOWN The boost mode DC to DC converter on the left side of Figure 1 stores energy in inductor L1 when transistor Q1 is on then dumps that energy into C3 when Q1 switches off The microcontroller can set the minimum and maximum inductor current limits to bracket the Maximum Power Point current so that the average current is reasonably close to the ideal value The voltage across an inductor is proportional to the deriv ative of the current through it according to the familiar equation ae 1 When Q1 is on it applies essentially the full panel voltage Q0 across L1 with the DC current limited only by the panel s power output and the current sensing resistors The current should therefore increase at a rate set by the equation di V d L 2 The Spice simulation in Figure 3a shows the results for a 17 4 mH inductor The inductor current rises from 100 to 200 mA in about 300 us showing that the applied voltage is _ 100 mA 300 us 3 When Q1 opens the inductor current charges C3 as it declines toward the lower current setpoint Because the out put voltage changes only slightly the current decreases near ly linearly I picked 17 4 mH because that matched the inductance of a common mode power choke I found in my parts heap In normal use a common mode choke has two windings con nected to the AC line input so that the circuit s load current produces opposing magnetic fields with no
47. this is a fixed number of data bytes When a command byte comes from BAM its value is used as an offset into a look up table Each potential command 128 255 has two entries the number of data bytes that follow the command and the number of data bytes returned in response to the command The microcontroller uses the second entry ResponseLength to keep data from the Create in one piece or packet Figure 2 depicts how the upstream responses flow The first table entry DataLength helps the microcontroller know how many data bytes to expect after a command This keeps the communication in sync and unmingled There are however a few commands that can have a variable number of data bytes following the com mand These exceptions are treated a bit differently When an exception is encountered the DataLength from the table indicates where a length byte can be found usually it s the next byte fol lowing a command When the byte is transferred it is also reloaded into S April 2009 Issue 295 Create has data to send Me is in process Create is in process Move data from Create s RX buffer to BAM s TX buffer Create s response complete Create is not in process Create is in process Me is in process Move data from Me s RX buffer to BAM s TX buffer Me s response complete Me is not in process Figure 2 The PassDataUP flowchart shows how responses from the Create and Me ds
48. three pins of the CAS and CASR models and a different primary footprint that enables higher creepage and clearance distances of 8 2 mm Moreover this additional primary pin allows a con figuration of the CKSR NP model for a nominal current range of 1 5 ARMS Pricing for the transducers is All CAS CASR and CRSR transducer models have been designed for direct 11 05 each in 500 piece mounting onto a PCB for primary and secondary connections and operate from a quantities single 5 V supply The CASR and CRSR models provide their internal reference volt aqe to a VREF pin An external voltage reference between O and 4 V can also be LEM S A applied to this pin www lem com TEMPERATURE RH LOGGER WITH LCD The new USB 502 LCD is a cost effective solution for long or short term logging applications It features an LCD window for viewing temperature and humidity information The stand alone data logger measures and stores up to 16 579 relative humid ity and 16 379 temperature readings over the O to 100 RH and 535 to 80 C 31 to 176 F measurement ranges and it calculates dew point The high contrast LCD shows a variety of temperature and humidity measurements as well as logger status information At the touch of a button users can turn on the LCD and cycle through the most recent the maximum and the minimum logged temperatures and relative humidity read ings Flashing LEDs indicate logging status A user replaceable long life li
49. to the headers I have three he i js a Pa i al a ae ob Ab S modules I made for my pod see Photo 2 One module is an LED Work bench that lets me experiment with red and RGB LEDs One has an 8 x 8 grid of red green cells The third which I ll cover in the second part of this article series is a JTAG adapter Each module s design starts with a schematic for the connec tors and a PCB layout that places them to mate with the pod Thus I can quick ly design a new pod module as needed The LED workbench includes eight red LEDs controlled by port 2 and an 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 expresspcb com RGB LED controlled by port 1 The RGB LED has adjustable limiting resistors to help you determine the ideal resistors for a good white bal ance The ADC inputs monitor the LED voltage drops as well as the volt age across the resistors Three 10 Q resistors and three op amps let the pod monitor the current through each LED This lets me test and character ize various RGB LED offerings The pod software monitors the ADCs dis ables the LEDs if excessive current is detected and scales all the values to sensible values It includes a com mand line interface so any terminal emulator program that can talk over the serial port is sufficient to talk to the pod I can also experi
50. was published in January 2001 but the tutorial example of the engineering thought process detailed in the article hasn t Archiving past issues of Circuit Cellar into an engineering reference library is the norm not the excep tion for our readers I think of Circuit Cellar as a community not just a business enterprise While I m completely aware that there is a significant cost savings in distributing a virtual magazine versus printed paper I also know that Circuit Cellar s status and credibility was built on print and it will be over my cold dead Sorry I get carried away Basically we re caught between a rock and a hard place when it comes to content expansion While other pubs have been biting the dust Circuit Cellar s overall circulation and popular ity has increased There has been a demand for more Circuit Cellar articles not less Under the heading teaching an old dog new tricks the undeniable path to cost effective content expansion is a new and bet ter digital presence that we call Circuit Cellar Digital Plus Digital Plus replaces our Electronic Edition EE and adds a lot more Like our former EE Digital Plus is an exact online replica of the print magazine with additional full length Circuit Cellar quality con tent along with project shorts in a special bonus section Our objective with Digital Plus is to provide more space for good authors and great applications without raising our subscription prices into the
51. www circuitcellar com if you can offload some of the logic to the pod and do a lot more than just turning a bit on and off this project gives you the flexibility to define the I O functionality you need Next month I ll show you how to offload an entire application to the pod and feed only its data files over the USB link Stay tuned l DJ Delorie dj delorie com who has Been designing electronic circuits since high school earned an ECE degree at Clarkson University After holding jobs designing PC motherboards and network management software he now writes embedded development tools for Red Hat DJ is also the creator of DJGFP and one of the contributors to the gEDA project P ECT FILES To download code go to ftp ftp circuitcellar com pub Circuit_Cellar 2009 225 Programming 32 bit Microcontrollers in Exploring the PICIA Lucio Di Jasle By Lucio Di Jasio ISBN 9780750687096 LASSE PROGRAMMING 8 BIT PIC MICROCONTROLLERS m C Winn Interactive Hardware simulation By Martin Bates ISBN 9780750689601 59 95 39 95 R EFERENCE 1 D Delorie Easy R8C M16C M32C Flash Programming 2 008 http people redhat com dj m32 c flash guide pdf R ESOURCES D Delorie USB GPIO Project Page www delorie com electronics usb gpio GNU Operating System Free Software Foundation Inc www gnu org Renesas Technology Corp R8C 20 Group R8C 21 Group Hardware Man ual 2008 http
52. 00 120MHz USB 14 bit ARB F non contact SAW digital rotary torque event time or pulse counting data pressure 3 axis accel sensors current loop data logger 49 E conductance voltage amp power modes M with USB RS 232 LAN GPIB transducers with integral electronics USB to 12C FTDI USB ICs CAN USB ial i i PSoC Starter 12C Xpress W a o b 2 x lt 3 gt 5 3423 KLARI MOD APSIN3000 RF Testing EMI Tents P MSR145S RWT320 iaia EL USB 1 2 3 4 DG3061A 3101A 3121A FT232RL CAN USB PSoC Starter Dropin solution connects PC toffi Popular UART and FIFO chips Intelligent CAN connection ff Network serial product easily without i Fantastic array of stock and i Get going quickly with PSoC I2C SMBUS 32 I O lines 89 Mi Upgrade Legacy designs to USB M from PC s USB port 299 i aPC using this 28 cable 89 fff custom switching devices visual design environment Keyboard Simulator Instant Ethernet Ethernet lO FPGA Systems PoKeys55T IZ110SR W5100 USB board adds 55 I O and 5 x No OS needed TCP IP offload UDP IP controlled 24 digital i Ready to go out of the box FPGA DSP E Analog input bluetooth wireless ff 10 bitA D inputs 1 x 10 bit analog O P ICs improve system performance I O board 3 x 8 bit TTL ports designs for beginners and experts J modules 433 868 915MHz NET Board Easy OLED Display RF Modules RS232 to 422 485 UPSICAP DLP TH1 uOLED 96 G1 AWM6XX TX RX KK S
53. 1 At 32 26kH2 Figure 2 The upper trace shows the voltage at the top of R29 R30 the 0 5 Q2 current sense resistor tracking the O to 3 V control input in the lower trace Turning on peak capture mode reveals the hash generated by the microcontroller through the power supply The middle trace in each screen is the current feedback voltage from U4 below the minimum and off when it exceeds the maximum The firmware can read the panel voltage and current through the microcontroller s analog inputs compute the corresponding power then set the high and low current limits to bracket the MPP and regulate the output voltage As you might expect there are all manner of patented MPP tracking schemes It s worth mentioning that MPP tracking can t produce something from nothing A load that exceeds the solar input power will draw down the boosted DC supply from the panel simply because there s not enough power available to support the output The load must be smart enough to adapt itself to varying power inputs full power in full sun reduced power on overcast days and sleep mode overnight Boost mode converters have an obvious failure mode that s often not obvious until the smoke appears Notice what hap pens should Q1 stay on for a protracted time a high power solar panel will roast R14A B L1 and probably Q1 A real life imple mentation must include an interlock that holds Q1 off until the firmware gains control and sets the appro
54. 1991 www mit edu 6 331 an47fa pdf eee WaveRunner 6100 Oscilloscope Lecroy Corp www lecroy com 2N2369 Transistor Multicomp www farnell com Distributor Quecs project Qucs http qucs sourceforge net www circuitcellar com CIRCUIT CELLAR SMA BNC adapters bot Celebrating Our 10 Year Anniversary Get All Your In A Quick and 20 Sale On Entire Selection Of X Test Equipment Oscilloscopes Probes Digital Multimeters Function Generators Voltage Testers Capitance Meters Analog Multimeters Test Leads amp More DesignNotes com What Tour Glectronic Aopiry Stores Used To He 1 800 957 6867 www lesignNotes com www renesas com USB Oscilloscope for 169 50 Logic and Spectrum Analyzers Generator WWW HobbyLab US el Og ee yp ae A April 2009 Issue 295 Q ml Nn QO April 2009 Issue 295 ROM THE BENCH by Jeff Bachiochi Programmable Robotics partz Application Development When Jeff couldnt add a Bluetooth adapter module to iRobot s Create because it used the Same cargo bay connector as the Command Module he did what any good designer would do he built his own This month he explains how to replace the Command Module with a two serial port microcontroller ast month I introduced you to iRobot s Create robotic platform which is based on the successful series of cleaning robots I discussed the Create s
55. 5022S PDS6062T DS1000E DS1022CD PD 1022MN HDS2062M PS2104 PS2105 PoScope with Probes PS2203 4 5 R1040 TGR2050 EMC Spectrum Analyzer I really like this scope adapter it s really meant for teaching electronic experi ments but it s ideal for engi neers too Testgear Ee b B12 480 500AG LAP 16128U RF amp EMC Spectrum PSA2701T Packet Master USB 1 1 2 0 Intuitive full featured 16 ch 4MB f SPlandnonstandard 4wireand3wie i RF amp EMF Spectrum Analyzer fi Handheld Palm PC based Aan EOwnE analyzers and generators 699 200MHz sampling memory 299 serial protood interfaces up to 50 Mbps 1Hz to 7GHZz for WiFi mikes etc mf 2 7GHz Spectrum Analyzer Saelig CEO CAN Gateway RF Generator U M eine Calg con I2C Xpress Automotive Testing USB2 0 speed 16 bit digital pattern Versatile USB 2 0 12C ste Kits turn your PC into vehicle Pj Janz Full featured standalone f High res extremely low noise Portable RF test enclosures amp or arbitrary waveform generator exerciser and analyzer electrics diagnostic tool fanless industrial Linux PC portable 3GHz RF generator i shielding tents with extemal frame Wireless Data Loggers Multiparameter Loggers USB Logger Electronic DC Load 60 100 120MHz AWG a Configurable patented USB output Log and display temp hum volt Mini logger with built in temp hum i Standalone USB temp hum volt E Const current resistance i 60 1
56. 8 209 CD ROM 11 2006 Issues 186 197 CD ROM 10 2005 Issues 174 185 CD ROM 9 2004 Issues 162 173 Order Online www circuitcellar com Or Call 6U 6 5 2199 Make sure you re signed up to receive Circuit Cellar s monthly electronic newsletter News Notes will keep you up to date on Circuit Cellar happenings Stay in the loop Register now It s fast It s free www circuitcellar com newsletter a FOR COMPUTER APPLICATIONS 500 m idiy 10 m ofst 281 500 mvidiy 10 m ofst G27 base 10 00 ns Trigger RIS 2 50 ns divi Stop 2 060 5 00 k8 200 GSifsfEdge Positive base 10 00 ns Trigger RIS 2 50 ns div Stop 2 060 5 00 k85 200GS sfEdge Positive Photo 8 Experimental TDR waveforms with a a 22 pF parallel capacitor or b a 22 pF series capacitor in the middle on a microstrip transmission line Just compare these shapes with the corresponding theoretical shapes provided in Figure 5 the vertical sensitivity of the oscillo scope and was easily able to see it Refer to the top curve in Photo 9 Next I inserted an SMA to BNC and BNC to SMA adapters pair between the SMA cable and the same SMA load The result is the bottom curve in Photo 9 with the same vertical settings Do you see a difference I conclude that you shouldn t use BNC connectors for high frequency designs if you re look ing for good impedance matching WRAPPING UP I covered some of the potential appli c
57. 8 9 10 11 12 13 14 15 ID ID Code segment AN Year SE Notice change time 11 1 No change 1 1 0 Change within six days 00 1 Change within one day 0 0 0 2 A M Change to the summer time or 3 A M change to the standard time SI Notice leap second 0 0 No leap second 1 0 Leap second delay 1s 1 1 Leap second delay 1 s PA Parity check Second segment of the date code wide catastrophe Fortunately no big problems occurred But to prevent a potential catastrophe numerous tests were conducted on devices for thousands of hours Today many systems are automatically synchronized through Network Time Protocol NTP servers on the Internet To supplement its divulgation activities the INRIM has two NTP free access servers which are set with the institute s UTC IEN time These servers are found at the following addresses ntpl ien it 193 204 114 232 and ntp2 ien it 193 204 114 233 THE SRC RAI SIGNAL IEN In an international community transmitting the time signal via a radio signal is common The German DCF77 signal which works on 77 5 kHz covers a large part of Europe including all of England and ranging from part of the Scandinavian countries down to near the North African coasts 2 000 km The similar Swiss Prangins HBG signal is compatible with DCF77 signal coding The only difference is that the emissions frequency for the HBG signal is 77 kHz Like the German signal it also has a considerable range of 1 500 km
58. 9 a ie See pe i gt a aa lg chassis front panels and more 1 877 7 POLOLU M P Ww w pololu com 6000 5 Eastern Ave 12D Las Vegas NV 89119 www circuitcellar com CIRCUIT CELLAR E April 2009 Issue 295 jmd N April 2009 Issue 295 ADVANCED TOUCH LIBRARY FOR AVR MICROCONTROLLERS Atmel has announced the availability of its advanced Touch Library that resides on the microcontroller instead of a separate chip resulting in a highly cost effective solution The library consists of precompiled and verified binary files which can be configured individually as discrete keys or combined at will as groups to form wheels and sliders A complete development environment makes it easy to develop a touch system based on the AVR microcontroller The AVR core combined with QTouch technology provides the industry s most robust touch solution particularly in demanding applications This has multiple advantages for the designer such as a high signal to noise ratio that improves the systems design margin increases EMC performance and provides high ESD tolerance In addition designers can address applications where reliability is required such as stove tops wall ovens and automotive applications as well as where high ATmega88 ATtiny88 Almega88PA Almega168P and moisture levels are present ATmegas2 P respectively The Touch Library is currently available for download at the The Touch Library is av
59. B Flash amp 64 MB RAM 2 USB 2 0 Host Ports amp 1 Device Port 410 Bit A Ds amp 6 16 Bit Timer Counters gee icrosott 2 6 KERNEL indows he SoM 9G20 uses the same smalSODIMM form factor utilized by other EMAC SoM modules and is the idealiprocessor engine for your next design All of the ARM9 processor core is included on this tiny board including Flash Memory Serial Ports Ethernet 125 Audio Interface PWMs Timer Counters A D digital I O lines Clock Calendar and more Like other modules in EMAC s SoM product line the SoM 9G20 is designed to plug into a custom or off the shelf Carrier board containing all the connectors and any additional I O components that may be required The SoM approach provides the flexibility of a fully customized product at a greatly reduced cost ae unit pricing starts at 150 i PL i he ag ot ae ee ETE ay Ie al if i pase Th sean i P j gii B r B 4 mo LET iiir F i ing it a T 25ta ay p i cn ot ee eS a E a since 1985 OVER YEARS OF SINGLE BOARI L SULU TIONS _ s EQUIPMENT MONITOR AND CONTROL Phone 618 529 4525 Fax 618 457 0110 Web www emacinc com NA April 2009 Issue 295 Jeff Bachiochi pronounced BAH key AH key has been writing for Circuit Cellar since 1988 His background includes product design and manufacturing You can reach him at jeff bachiochi imaginethatnow com or at www imaginethatnow com D source iRob
60. B based FLASHing tool Run ning it downloads blinky elf to the pod sudo uflash uflash blinky elf USB devices are not normally writable by users so the sudo command gives me permission to access it The uflash tool talks to the bootloader in the R8C chip to program it When fin ished it resets the chip back into nor mal mode and my blinky program runs Plug a few LEDs and current limiting resistors into port 1 s headers and you ve got blinky lights Big deal you say Well I did something more inter esting and made the pod interactive I created a pod program that offers eight output signals on port 2 eight digital input signals on port 0 four analog inputs on port 1 and a clock output on port 3 All of these are con trolled by the host PC The more complex pod program is in Listing 2 The call to setup_hardware con figures all the I O ports and peripherals It s handy to have a copy of the R8 amp C 20 Group R8C 21 Group Hardware Man ual on hand because there are many complex peripherals For example in this case Timer B drives pin P3 2 but the pin can t be driven in standard timer mode so configure it for function generator mode That also lets you control both the period and the duty cycle These details along with the myriad control registers that configure them are all detailed in the manual All pod programs need some sort of loop forever in main because there s noth
61. C You may remember the 2005 Renesas M16C Design Contest The R8C is the M16C s little brother available in packages with as few as 20 pins It has two characteristics that make it ideal for this project One it can run off either 5 or 3 3 V enabling it to interface to a wider range of projects Two you can pro gram it using nothing more than a serial port and two GPIO signals one for nRESET and one for MODE H I used DTR to control nRESET CBUS2 for MODE and feed the UART lines into the R8C s serial port By doing this you can use the USB connection to program the R8C and communicate with that program so no additional program ming connectors are needed How does this work Well the R8C and M16C and M32C as well has two flash memory blocks One is for the user program which is the flash mem ory that is described in the chip s hardware manual The sec ond is a small flash memory block that includes a simple bootstrapping program When the chip comes out of reset the nRESET line goes high it samples the MODE pin to 14213 FDN336P MCP1700 3 3V L1 60 ohm 100 MHz ferrite bead determine from which flash memory block to boot Normal ly MODE is pulled high and resetting the chip runs your program If MODE is low the bootstrap program runs instead enabling you to download a new program The specific R8C chip used here is the R8C 20 chip in a 48 pin TQFP It has six byte wide I O ports Four ports Ports PO P1
62. E MAG AZ INE FOR COMPUTER AP PLIC lime Triggereg Systems 7 is your chance to e Read Circuit Cellar BONUS ARTICLES not available in print pa this series of ari a explains his re a Mike takes a cl and presents an Ea oe see Y ea ii gered sys O USing them ESS e Enjoy audio video enhanced project articles e Archive Circuit Cellars print magazine as a PDF for your ecently an Overseas Mternship sty joined my gro ect It was Planned th ae dent Phil ranei 7 illi athe ana eight week resear i nd a lo l i Proj TOtessor design library Bring your friends to this limited time public preview of Circuit means more content super fast als O Catt e Univer about a month ie Musical yo NOises f me i ical Oated i moving fast down t Sheed S0Ing on an Analo cae Sor looked like ag SP Capabilities a Cellars new venue delivery of your favorite publication and many additional features As a current reader you re entitled to special introductory pricing subscription services S BONUS on Act now to receive the April 2009 preview bonus material which launches with Time Triggered Systems Co Operative Schedulers 101 by Circuit Cellar feature author Michael Smith S Cia j ARCUIT CELLAR DIGITA PLH ssue 99 Photo 1 The 4 S April 2009 _ 1 To access the preview edition visit www circuitcellar com and click on the April issue icon on our home page Active E
63. Finally in England since 2007 the National Physical Laboratory NPL has transmitted the English official signal MSF from the Anthorn station through 17 kW of power work ing on 60 kHz Unlike the aforementioned signals the SRC RAI sig nal is not generated and directly transmitted on air It is April 2009 Issue 295 a G 20 10 8 4 2 012 3 4 5 6 7 8 9 10 11 ne ii eae f 2 Wak fa 5kHZ 1 40 20 10 8 4 2 1 480 ms lt ID AN SE SI Ig0 40 20 10 8 4 2 1 E OE P1 ME 10 8 4 2 1 20 10 8 4 2 1 4 2 30 ms 30 ms SE Notice change time 11 1 No change l 1 Change within six days PA 0 0 1 Change within one day 0002A M Change to the summer time or 3 A M change to the standard time SI Notice leap second 0 0 No leap second 1 0 Leap second delay 1 s 0 1 Leap second delay 1 s 23 4 5 6 7 8 9 10 11 12 13 14 15 Figure 2 These are details about the two blocks of the IEN SRC RAI signal coded and sent to the Radio Televi sione Italiana RAI station which broadcasts through its own radio network My IEN SRC project cannot com pete with the progress of the hourly signals or with Internet and the NTP service But the purpose of this proj ect is to study one of the oldest oper ating signals of sample time see Photo 1 Even if the signal s mode of transmission is obsolete the IEN in Torino is still at the forefront in IN SRC Signal D 2 VPP MAX zai ole
64. I extensions could be created for any sensor handled by the micro controller The microcontroller would play traffic cop and choose to keep an OIE command but pass through all original OI commands BIG PICTURE I assumed my future application would require a lot of computing power not to mention a potentially large data base Therefore I would write and exe cute it on a PC The BAM wireless inter face feeds the Create platform with com mands and receives sensor data Although the Create is autonomous it does not have to carry around its brain I can write and run an application from my recliner outfitted with the appropri ate beverage 7 3728MHz www circuitcellarcom gt CIRCUIT CELLAR The Create has a built in application for finding its charging dock and replen ishing its power pack so it should never be found dead somewhere The applica tion can monitor battery capacity and send the Create home when necessary Because I was redefining the CM there was no particular reason to stay with the ATmegal68 Not that there is anything wrong with it if you want to stick with an Atmel part I chose a Microchip Technology dsPIC30F4012 a part that I hadn t used before It operates on 5 V comes in a DIP 40 package has two hardware UARTs and executes at close to 30 MIPs dsPIC While the flash memory microcon troller has an internal 7 37 MHz RC oscillator that has been trimmed to 2 I added an external crysta
65. I used RealTerm to check the connection and test its range For application programming I used one of my favorite programs Liberty BASIC This let me program in BASIC and enabled me to get off to a running start The BAM was used as a serial link Photo 1 shows my prototyped circuit plugged onto the Create s cargo bay connector with BAM going along for the ride Like all Bluetooth devices it first must be linked to the host before it can be used To do this make sure it s powered and allow the host to search for discover Bluetooth devices Next select BAM which will have the name Element Serial Pair the devices using passcode 0000 When you refresh its services you should see a Ser ial Port Profile SPP Check this service to enable it Don t forget to make note of the COMport You need to use the port number to communicate with the Bluetooth wireless link from the applica tion program in Liberty Basic When I plug the Bluetooth dongle in one of the two USB ports located on the front of my desktop PC the service is available at COM21 on one USB port and COM23 on the other This is a far cry from the COM 1 4 that we all used years ago with just hardware serial ports LB APP Before getting into any application there are a few routines that will aid in simplifying any future code All of the Create s constants are defined so the description names can be used instead of CIRCUIT CELLAR www circuitcellar
66. L TIME CONTROL The Piccolo controlSTICK helps you evaluate and learn Two new USB based tools for Piccolo 52 bit about Piccolo MCUs Packaged in a small USB stick form TMSS20F2802x MCUs make it easier for designers to evalu factor it features an onboard USB JTAG for quick and easy ate Piccolo MCUs and develop more energy efficient real Project evaluation Access to all control peripherals is provid time control applications such as solar power microinvert ed through header pins A 52 KB limited Code Composer ers LED lighting white goods appliances and hybrid auto Studio IDE and example projects are available to help speed motive batteries development Also available is the Piccolo USB Experimenter s Kit which features a prototyping area and onboard USB More energy efficient JTAG emulation with connection for external emulator applications with kidas TMS320F2803x F2802x Wixi Piccolo MCUs and power supply The Experimenter s Kit offers the next step in development by enabling you to prototype and develop full Piccolo MCU based projects quickly and easily It also provides access to all the Piccolo pins t Microcontrollers iio The Piccolo controlSTICK costs 39 The Piccolo USB Hi verre Experimenter s Kit costs 79 and includes the 49 Pic TMS320F2803x 2x s colo controlCARD Microcontrollers i WF TENS as db aman Texas Instruments Inc E www ti com MS gees PEELE mes LELLI 5 320F2803 2
67. O 1 OUT OC Sync S Down L terms of precision and technological research Thus this project is an excellent starting point for studying a signal s time and frequency If you re in Europe you can receive the radio RAI signal via satellite Try Hotbird 8 13 0 E 11 804 00 MHz vertical polarization or Astra 1L 19 2 E 11 567 50 MHz vertical polarization Let s examine how the SRC RAI time signal is made First note that it is a modulated frequency shift keying pra pra pra ra ra ra z Of Lael LeS Ea Lea Leri Lee ie L Enter Figure 5 This is the decoder circuit used a PIC16F628 iN April 2009 Issue 225 FSK signal in an audio fre quency band This means that it is an audible signal As you can see in Figure it consists of two groups of bits that are transmitted on sec onds 52 32 bits and 53 16 bits of each minute Every bit has a fixed duration of 30 ms The bit is 2 000 Hz if it is a O or a 2 500 Hz tone if it is a 1 A third tone of 1 000 Hz is used for the last six audio synchronization signals At the head of the group of bits is the ID field ID 1 and ID 2 which identifies the bits that follow Bits 16 and 31 of the 32 bit group P1 and P2 and bit 15 of the 16 bit group PA are parity bits that allow you to verify the pre liminary accuracy of the data received through the no pari ty method The first segment of code transmits the time the entire date
68. P are sent to the BAM TX buffer without being intermingled DataLength Thus DataLength is cor rected on the fly enabling the correct number of data bytes to be transferred Figure 3 shows the flow of the down stream command and data Extended OI commands can be devel oped which when received from the BAM will be redirected to the micro controller where the appropriate func tion will be executed to control or gather new sensor data and reply if necessary While no commands have been written at this point the OI leaves plenty of room as it uses only command bytes 128 to 158 BAM Element Direct manufactures a num ber of accessories for iRobot products including the Roomba and the Create That s right If you own a Roomba sweeper you can take control of its internal microcontroller and experiment a bit with some of Element Direct s offerings www elementdirect com The BAM gives the Create a roam ing radius of up to 100 m which is plenty for most buildings Element Direct also offers a Bluetooth don gle the other end of a Bluetooth connection I already have a few of these hanging around I can use a USB Bluetooth dongle on a PC or laptop Any application that has access to a serial port can take advantage of this connection Using the RealTerm terminal emulator I connected to the BAM and sent and received OI com mands Although I couldn t request and analyze commands and respons es fast enough
69. Reflectometry Detect and Measure Impedance Mismatches Robert demystifies the topic of time domain reflectometry which enables you to detect measure and locate any impedance mismatch in a transmission line To do so he explains the theory behind it and presents some practical experiments Fast pulse generator Impedance mismatch High speed oscilloscope Figure 1 A time domain reflectometer TDR includes a fast pulse generator and a way to display the reflected pulses usually a high speed oscilloscope Thanks to a signal coupler the oscilloscope enables you to display both the initial pulse and any reflected signals AC Inverter elcome back to the Darker Side We all have favorite topics One of mine is impedance matching I know I have already brought it up in previous columns while discussing antennas filters or microstrips but this month I promise I will present it from another angle time domain You may have read sentences such as When match ing is not perfect a part of the signal is reflected back to the source This may seem strange for engineers not used to high fre quency effects Imagine the worst case of an impedance mismatch a wire grounded at one of its ends Do you think there could be any signal reflected or not in such a wire Of course and I will show it to you Signal reflection is in fact at the heart of an old but inter esting measurement technique time domain ref
70. TC competition I mentioned in the first part of this article series Like a washing machine timer it schedules the robot s behavior by execut ing a series of primitives The sequence is written in some arrays and it is synchro nized by external events Some higher priority events e g obstacles found by external sensors can override scheduling TIME TO GO ROBO There are plenty of affordable robots on the market Plus the MPLAB devel opment environment is free You can design the schematic and PCB with the freeware version of CadSoft Computer s Eagle These tools are versatile enough for a wide variety of applications Affordable electronic and mechanical components are also widely available on the Internet Do some reseach before shelling out a lot of cash for an expen sive kit No more excuses You are now ready to design build program and test your own robot il Guido Ottaviani guido guiott com has worked with electronics and ham radios for years After working as an analog and digital developer for an Italian commu nications company for several years Guido became a system integrator and then a technical manager for a company that develops and manages graphic prepress and press systems and technologies for a large Italian sports newspa per and magazine publisher A few years ago he dusted off his scope and sol dering iron and started making autonomous robots Guido is currently an active member in
71. TX enable 1 RB2 4 Generic chip select2 RB3 5 6 7 8 9 TX enable 2 RB4 1 ms Heartbeat RB5 VSS OSC1 OSC2 Serial 2 TX Serial 2 RX LED 1 Clock out for Motor controllers EMUD2 LED 2 Serial 1 TX Serial 1 RX U1ATX U1ARX VDD EMUD2 RB6 AVSS AVDD Table 2 These are the pins used on the Microchip dsPIC30F3015 state machine getting bytes from the buffer and decoding the command string see Table 3 This layer controls timeout and checksum errors as well as packet consistency correct header correct length If everything is fine it allows the Parser routine fourth layer to decode the message and to execute the required action This routine sets the appropriate error flag if the message code received is unknown TMRI generates a 1 000 Hz timing clock the program s heartbeat On each TMRI1 s interrupt internal timers are Easy Embedded Linux 1 69 sl i 16MBFLASH 32MB RAM Qty 1 elie n 200Mhz Arm9 CPU 16 Digital I O Audio Watchdog In Out 2USB 2 Serial Ports 10 100 Ethernet 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 wit
72. The LM3445 maximizes the light output for systems while maintaining ENERGY STAR power factor requirements in a typical application positioning it among National s Power Wise family of energy efficient products Today s TRIAC wall dimmers are designed to interface with a resistive load such as incandescent or halogen light bulbs Since an LED bulb does not appear as a resistive load to the TRIAC wall dimmer dimming an LED bulb using a conven tional TRIAC wall dimmer does not yield optimal dimming performance The LM5445 overcomes this challenge by translating the TRIAC chopped waveform to a DIM signal and decoding it for a full range of uniform flicker free dimming The driver s patent pending control architecture maintains constant ripple through the LEDs which extends the life of the LEDs The LMS5445 LED driver enables the direct LED bulb replacement of existing incandescent or halogen bulb sys tems connected to standard TRIAC wall dimmers In addi tion the driver allows master slave operation enabling con trol of multiple strings of LED bulbs A complete LED system featuring the LM3445 can be created in minutes with the WEBENCH LED Designer The LM3445 costs 1 75 in 1 000 unit quantities National Semiconductor www national com ETHERNET CARD FOR THE HYDRA SYSTEM The Hydra EtherX is an Ethernet card designed to inter face to the Hydra system via the expansion port The card is built around Wiznet s W5100 hard
73. Up to this point I haven t mentioned a couple of the routines in Listing 1 The Move and Turn routines are where the robot s intelligence begins to take shape These are variations using the CmdDrive command Notice the setup prior to these commands Distance for move and Angle for turn These provide limits to the movement CmdDrive can actually do both at the same time i e it can combine forward or backward movement while turning at some radius To simplify dead reckoning calculations turns Listing 1 These are the Basic commands for the mini app to leave the charging base roam around until it needs a charge and then go get recharged rem Create is in it s charging cradle gosub CmdStart rem Wait for Create to be fully charged LCheckForFul 1 d ChargingState gosub LCmdSensors if ChargingState lt gt NotCharging then goto CheckForFul1 rem Back up 100mm BackOutOfCharger Direction Backward Velocity 200 Distance 100 Radius RadStraight Gosub Move rem Rotate 180 degrees LTurnAround Direction Forward Velocity 200 Angle 180 Gosub Turn rem Go explore Explore Gosub Cover rem Wait until we need gas CheckForlovV d Voltage gosub LCmdSensors if Voltage gt 10000 then goto CheckForlOoV rem Find Home Home Gosub CoverAndDock rem Wait until we re Home CheckForHome d ChargingSourcesAvailable gosub CmdSensors if ChargingSourcesAvailable lt gt HomeBase then goto Chec
74. VE Shannon Barraclough Direct 860 872 3064 E mail shannon circuitcellar com ADVERTISING COORDINATOR Valerie Luster E mail val luster circuitcellar com Cover photography by Chris Rakoczy Rakoczy Photography www rakoczyphoto com PRINTED IN THE UNITED STATES CONTACTS Information www circuitcellar com subscribe E mail subscribe circuitcellar com Subscribe 800 269 6301 www circuitcellar com subscribe Circuit Cellar Subscriptions PO Box 5650 Hanover NH 03755 5650 Address Changes Problems E mail subscribe circuitcellar com 860 875 21 99 Fax 860 871 0411 E mail info circuitcellar com Editorial Office Editor Circuit Cellar 4 Park St Vernon CT 06066 E mail editor circuitcellar com New Products New Products Circuit Cellar 4 Park St Vernon CT 06066 E mail newproducts circuitcellar com UTHORIZED RE T F T 860 875 2 H Authors e mail addresses when available are included at the end of each article 199 E mail reprints circuitcellar com CIRCUIT CELLAR THE MAGAZINE FOR COMPUTER APPLICATIONS ISSN 1528 0608 is published monthly by Circuit Cellar Incorporated 4 Park Street Vernon CT 06066 Periodical rates paid at Vernon CT and additional offices One year 12 issues subscription rate USA and possessions 23 95 Canada Mexico 34 95 all other countries 49 95 Two year 24 issues sub scription rate USA and possessions 43 95 Canada Mexico 59 95 all other countries 85 All subs
75. WO912 99 INDID MMM Build a USB GPIO Pod p 16 Robot Navigation Software p 30 am Decode Signal Transmissions p 40 GIRGUIT CELLAR THE MAGAZINE FOR COMPUTER APPLICATIONS 225 April 2009 EMBEDDED PROGRAMMING A Recipe for a Killer Embedded Application Time Domain Reflectometry A 1 Explained A SWatch tty yse o out p2 b tty reac break E case 1 M More on Programmable Robotics inpi p05 Solar Data Logger Design iy samy esig 21 tty time 0 4 gt aS gps Crbpr gt gt ie eytrosc 74470 7534900 r W Pat 5 95 U S 6 95 Canada y a break AY Low cost Need a custom solution Customize with the NetBurner SB7OLC Development Kit for only 99 Customize any aspect of operation including web pages data filtering or custom network applications Kit includes platform hardware ANSI C C compiler TCP IP stack web server e mail protocols RTOS flash file system Eclipse IDE debugger cables and power supply Kit enables communication with peripherals that use SD MMC Flash Card including SDHC SPI I C or the general purpose digital I O interface The NetBurner Security Suite Option jie em includes SSH v1 v2 and SSL support E bi i Nee b y E ol n i D EE 9 aE 4 g J is T r Ju aS e ale SECURE SERIAL TO ETHERNET SOLUTION The complete secure hardwar
76. a dee Typeslin Started Stape20 na Witered Bend Step 7o amp Microsinp Ter Micrgatip Crees lt Cr Microsinip Mi r sitrip Open ap 8 Microstrip Vie Goplana Line ifa Photo 6 QUCS makes it easy to simulate a TDR experiment A pulse generator drives an ideal three way resistive Signal splitter made with three 17 Q resistors One output drives a transmission line here two 1 m lines with a parasitic parallel capacitor in the middle The other drives a virtual voltage probe me after working patiently for 30 minutes so it should work for you too The power supply section of the design is not critical The entire assembly can fit in a small shielded box see Photo 2 Just make sure the output wire from Q1 to the output connector is as short as possible FIRST EXPERIMENTS I am sure you want to know about the actual performance of this 5 avalanche generator Photo 3 was taken with a high end 1 GHz Lecroy WaveRunner 6100 digital oscillo scope which provides no less than 10 Gsps single shot and 200 Gsps equivalent sampling speed for repetitive signals using 50 Q input impedance The pulse rise time was measured at 244 ps including the rise time of the oscilloscope itself which is specified at 400 ps so the pulse generator may be far quicker The pulse width is around 0 5 ns which is not bad Such a pulse has frequen cy components up to 1 GHz or so so it could be a helpful generator for num
77. a long perfect cable that is grounded at its far end On the other end of the cable connect a voltmeter and a cur rent limited 10 V power supply and switch on the power supply What will happen If you don t consider the cable length then of course the power supply will be short circuited to ground through the cable and the voltmeter will simply read 0 V But there is no way to immediately know that the other end is grounded The electrical signal will need to propa gate through the cable up to the end to see that it is grounded Then some information will need to return to give 0 V on the voltmeter Practi cally speaking if you replace the voltmeter with a fast oscilloscope you will effectively see that the line voltage will at first be 10 V It will www circuitcellar com CIRCUIT CELLAR drop down to 0 V only 2T later with T being the time needed for the electricity to travel through the wire You can also interpret this phe nomenon as if the 10 V input signal was reflected back from the grounded end as a 10 V signal giv ing O V as soon as both signals are summed up and this is effectively the case In more complex applica tions there may be several impedance changes through the wire and each will reflect back a signal The shape of the reflected sig nal will be characteristic of the mis match Its time position relative to the initial pulse will be directly pro portional to the distan
78. a summation of each delta x in x variable y t Y R cos 8 cos 0 and each delta y in y variable you know the current coor dinates position and orientation of the platform Note that at time t the differences with the coordinates To avoid computational errors divide by zero and wasted Left rotary encoder Motion feedback ULUL B QEB QEA IC mmnm A JEEN QEI Mode 4x digital Input capture gt encoder filter 13 us pulse period t PulsesL Cycle 1 ms VelMesL Modul VelDesL odule H Bridge 2 Current sensing Motor controller 2 DistL KL x PulsesL Odometry Coordinate Xmes 1 Ymes 9 mes odes VelDes DistMes Sdes f Xdes Ydes Xmes Ymes 2 des XDes YDes 2 XDes DistR KR x PulsesR Supervisor YDes ADC Current sensing Module VelDesR PNM H Bridge 1 PWM Module mummun VelMesR Motor controller 1 otor controlle Cycle 1 ms PulsesR Right motor QEI Mode 4X digital Input capture gt encoder filter 13 us pulse period t QEB QEA IC ULUL A l Motion feedback Right rotary encoder Figure 3 These software logical blocks govern the robot s navigation April 2009 Issue 295 QJ o gt CIRCUIT CELLAR e www circuitcellar com controller time both the S and S vari ables must be checked in advance Defining a quasi zero value S_ which takes care of minimal eich cal and computational approximations you get the following If S S
79. a128L MP3 Decoder VSi002 VS1003 WMA IDE Interface Standard IDE type HDD 2 5 3 5 Power 12V 1 54 LCD 128 x 64 Graphic LCD Etc Firmware download update with AVR ISP connector Powerful feature Play MP3 Information Reward forward Vol Focusing for full MP3 Player Without case IDE Interface Power Adapter Offer full source code schematic www icbank com pit TT S a PTT eT A B a aa a a PTT Pe EE TT 1 Across Down Network s nerve One Joule per second 2 Bypass system security l 3 Oil drop experiment 4 5 Program of repeated commands 6 x y notation 7 Sends electromagnetic signals 8 dF dA 8 yy notation 9 4 yy notation 11 Switch that protects damage 10 1 000 000 BTU Is oe mn ok 13 CLK lien 20a 145 LO 16 Dangles off for protection 17 0 01 kg lS Fe my The answers are available at www circuitcellar com crossword April 2009 Issue 295 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
80. ailable at no additional cost product web page together with the AVR QTouch Studio roy alty free front end software supporting the two available Atmel Corp demonstration boards TS2080A and T52080B supporting www atmel com HAND HELD PROTOTYPING TOOL FOR SMALL COMPUTING DEVICES The latest STM32 Primer2 is about the size of a cell phone and comes with a 128 x 160 pixel color touchscreen a joy stick push button and an extension connector It is preloaded with sample applications There is also a built in USB port a MicroSD card slot and other features e g an accelerometer and an infrared transmitter receiver that enable users to quickly add numerous extra functions to their appli cations All of these components are easy to manage through the built in software frame work the open source CircleOS o u Besides providing a turnkey solution that s 2 ready to run sample applications the device comes with Raisonance Ride application development software and the GNU C com piler This enables embedded designers to use the platform for the complete develop ment of complex end products Necessary design resources such as source code for the preloaded applications and software libraries for peripherals are included The STMS2 Primere also has a 20 pin external connector that makes it easy to connect external circuit boards The STMS2 Primer2 enables product developers with diverse skills to access the power of the advanced 32 bit
81. ar Modem GPS and DOS based embedded controller in a single rugged enclosure you can capture and transmit your data quickly easily and at low cost Inexpensive development kits including Borland C C and PowerBasic are available now Call or email us for more details Call 530 297 6073 Email sales jkmicro com On the web at www jkmicro com JK microsystems The supervisor drives both MCs through the UART1 communication port sending commands and reading infor mation space speed and motor current It estimates the robot s position using that information dead reckoning by odometry and creates a map of the path obstacles and so on This is done with the help of the dsPIC30F s trigono metric capabilities programmed with the C30 compiler The peripherals used on the supervisor include UART1 to communicate with the MCs UART2 for telemetry with the remote PC PC to communicate with the main board and OC simple PWM to generate the clock for both MCs see Table 2 dsODO The peripherals UART1 through UART2 are used to communicate with the MCs and for telemetry with a remote PC respectively They are used the same way as the MCs similar ISRs similar functions The protocol used for the handshake is also the same The physical layer independent protocol is used with the PC bus as well as to communicate with the main board The dsPIC peripheral interface controls the first layer Frame or overrun errors UART or co
82. atches standard electrical 0 750 pipe fittings 14 NPTS The LV motor control applications MaxSonar WR1 detects objects from O to 254 6 45 m and provides sonar range information from 12 out to 254 witha 1 resolution The interface output formats included are pulse width analog voltage and serial digital The pricing structure of the MaxSonar WR1 sensor makes it the lowest cost sensor in its class The LV MaxSonar WR1 retails for 99 95 Special Offer Includes the J Link J Link GDB Server and MaxBotix Inc the J Link Flash Download WWW maxbotix com www segger us com ncu html jJ Link Non Commercial NCU Bundle UNE www segger com www circuitcellar com CIRCUIT CELLAR April 2009 Issue 995 bd April 2009 Issue 295 in TRIAC Dimmable LED Driver TRIAC Wall LM3445 Dimmer TRIAC Dimmable LED Driver Accepts universal line voltages Full range DIM capability e Uniform dimming without flicker z A POWER TRIAC DIMMABLE LED DRIVER The LM3445 is a constant current controller that enables off line uniform flicker free dimming of high brightness LEDs with a conventional TRIAC forward or reverse phase control wall dimmer The dimmable LED driver enables a full 100 1 range of dimming capability It can maintain Greater than 1 A of constant current to large strings of LEDs in a variety of residential architectural commercial and industri al applications
83. ations for TDR Even with a poor man s pulse generator and a good oscil loscope you can easily pinpoint imped ance matching problems on cables and transmission lines Moreover a quick look at the shape of the reflected pulse will enable you to qualitatively get a good idea of the kind of defect I read that TDR engineers working on the maintenance of submarine lines can easily guess if a problem is related to water ingress corroded con tacts or something similar just by looking at the TDR shapes You now know why I haven t discussed the mathemati cal aspects of TDR This may be the subject of another interesting article particularly because a simple fast Fourier transform FFT of the TDR signal can bring you back in the fre quency domain You can then deduce the line s band pass simply by look ing at its TDR shape at least if there aren t any losses As a TDR setup works only by looking at reflections it may not detect a signal absorbed in a line and not reflected back I hope this journey into TDR has been enjoyable Don t hesitate to test it play with it and send me the results of your experiments TDR is no longer on the darker side for you lil CIRCUIT CELLAR www circuitcellar com Photo 9 The vertical scale is increased to show the difference between the parasitic reflections with an SMA 50 Q load top and with the same load connected through two tom Conclusion don t like BNC
84. awaiting the next interrupt TMR2 s flag must be checked www circuitcellar com CIRCUIT CELLAR The ADC continuously measures motor current storing values in its 16 position ADCBUF buffer When the buffer is full an interrupt occurs and a mean value is calculated This happens approximately every 1 ms The UART receives commands from the supervisor and sends it the results of the measurements The communica tion portion of the program runs as a state machine Status variables are used to execute actions in sequence Simple and fast interrupt service routines ISRs get or put every single byte from or to a buffer and set the right flags to let the proper function be executed TX I O is disabled at initialization If an I O pin is set as an input pin it enters into a three state mode meaning a high impedance mode which enables you to use parallel pins This is the default configuration This setup enables you to connect both MCs TX ports together They will be enabled one at a time by the supervisor with INT1 The same program is in both MCs Each MC is identified by an ID code to enable the supervisor to send commands to the proper motor At start up the program loops before the main idle loop waiting for a supervisor s enable sig nal through CN5 I O port After that the correct ID is assigned The start up ID is 9 for both MCs vf Fi Pe i _ Photo 1 This test set verifies H bridge and PID parameters T
85. ble developers and manufac turers to come together Your robot can use any manufactur er s device With RDS you can model and simulate things before handing your application over to your robot If I get enough reader interest in the RDS I ll devote a future col umn to it MAPPING As I previously mentioned I am looking forward to exper imenting with a mapping application While our ultimate input sensor is our eyes our other senses certainly add to the way we perceive the world I am amazed by how those without the gift of sight use their other senses to fill in what most of us would consider a huge void It s obvious that the absence of this ultimate input isn t a showstopper So this is really about learning Is there a limit to what a robot can learn Is learning based on its sensing abilities I believe that if robots are to become more useful to us they must be capable of learning Otherwise we won t put up with them That s why robotics has yet to live up to its hype We seem to be constantly pushing for more bigger faster solutions Maybe we need to step back and look at it from a more simplistic point of view ll System on Module Internet Applifnce Engine Atmel ARMS 400Mhz CPU 6 Serial Ports amp 2 SPlis Up to 60 Digital GPIOs 10 100 BaseT Ethernet SODIMM Bus Expansion e 550 125 Audio Interface Linux with EclipseliDpe Real Time Clock Calendar D MMC Flash Card Interface Up to 512 M
86. bridge Enable Serial TX U1ATX s PWM1H PWM Serial RX U1ARX lt i PO PWMIiL PWM to determine if an overflow occurred in the 16 bit register If one occurred the dif ference between OxFFFF and the previous sample has to be added to the current value Samples are algebraically added in the IcPeriod variable The _UPDN bit of the QEI register is set or reset if the wheel is rotating forward or backward The value of each sample is algebraically cumulated so it s added if the bit is set or subtracted if reset to measure the actu al space covered This is one of the sug gested methods in Microchip s application VDD i oo AVSS note AN545 _ hk D Velocity measurement IC2 AVDD Table 1 These are the pins used on the Microchip Technology dsPIC30F4012 enables this see Table 1 Peripherals on the MCs include QEFI to calculate the covered space input capture IC2 to calculate speed an ADC to read motor current enhanced PWM to drive the motors and a UART to communicate with the supervisor dsPID The same program dsPID is loaded in both of the MCs and the supervisor assigns them a different ID at initializa tion to address each one later Speed and position meas urements are executed simultaneously by both MCs when an external interrupt occurs from the general timing signal provided by the supervisor A QEI module determines the wheels
87. ce from the source This is TDR which is an invaluable technique for locating faults e g in underwater communica tion lines and similar applications and pinpointing impedance matching issues e g on high speed PCB tracks TDR can be performed with either a step signal as an excitation as in my previous example or with a quick pulse I will use the latter in this article because the interpreta tion of the signals is a little simpler The basic setup for a pulse based TDR sys tem is shown in Fig ure 1 A generator provides a sharp and short pulse which is sent to the transmis sion line to be tested through a signal splitter enabling you to connect a high speed oscilloscope while not perturbing the impedance of the wire The oscilloscope will then display both the initial pulse and any pulses reflected by the wire Note that the length of the cable between the split ter and the oscilloscope doesn t mat ter because both the initial pulse and the reflected pulses have to support the same delay through this cable Let me write a few words about 50 Q signal splitters Such a splitter can be built with three 17 Q resistors in a star configuration The 17 Q value enables you to keep a 50 Q imped ance on all branches Why Because each of the two output branches are supposed to be connected to a 50 Q load so each will have a 67 O imped ance i e 17 50 thanks to the 17 Q serial resistance This gives 33 5 Q
88. ch part is semi tailored to fit three different wireless protocols At the low end Freescale offers their own Simple MAC SMAC solution Supporting basic point to point and star networks SMAC easi ly fits in an MC13211 Stepping up a notch is a full IEEE 802 15 4 MAC that supports all that standard s fea tures such as fancy topologies e g mesh and tree and bulletproof secu rity 128 bit AES encryption Finally at the top of the stack so to speak is Freescale s BeeStack fully ZigBee 2006 compliant platform Note that the SMAC source code is available for adding your own proprietary pro tocol tweaks while 802 15 4 and Zig Bee are delivered only as object code The MCU and radio work well together For example because the radio needs a precise clock it uses a 16 MHz crystal and a trimmable oscillator In turn the radio s clock can be output to a pin for use as the MCU clock so only a single crystal is required Besides flash memory and RAM the protocol software consumes some of the MCU I O resources e g using some of the timer channels for scheduling radio activity That leaves plenty of MCU I O resources e g SPI PC UART 8 x 10 bit ADC GPIO and more free for your appli cation www circuitcellar com CIRCUIT CELLAR Just add a 16 MHz crystal a single voltage thanks to on board regulators 2 to 3 4 V power supply an antenna and a few discretes and you ve got a compl
89. click on a mouse There is a set of registers to adjust the pulse threshold and timing like you would with the mouse control panel on your PC see Figure 3 In applications that need it pulse detec tion is a big time and power saver for the MCU which would otherwise be burdened having to constantly be on the lookout for properly formed pulses Low power is all the rage and the MMA 7456L obliges by sipping a mere 0 5 mA during normal opera tion The chip has separate digital and analog power rails but you can run both from a single supply any where between 2 4 and 3 6 V Thanks to the low power and wide voltage range powering the MMA7456L from an MCU output pin is a viable option There s also a standby mode that slashes power consumption to CIRCUIT CELLAR www circuitcellar com just a few microamps Do keep in mind there s a bit of latency entering and exiting standby up to 20 ms each way ON THE AIR With a sensor in hand now we need an MCU and a radio to pull it all together Freescale makes that especially easy with their MC1321x which combines an S08 flash memo ry MCU with their 802 15 4 compati ble 2 4 GHz radio on a single chip see Figure 4 The MC1321x line up comprises three parts that differ only in the MCU s flash memory RAM capacity with the MC13211 offering 16 1 KB the MC13212 32 2 KB and the MC13213 at 60 4 KB Besides addressing applications of different scope and complexity ea
90. com Call DataFromBAMRX BAM has data Y to send Y N DataForCreate process N N Call Call Call DataFromBAMRX N Y__ DataLength Table entry at command value s offset Decrement DataLength Data for Me Data for Create Command Call DataToMeTX Call CheckForSpecialCase DataLength 0 L Y SpecialCase Command not in process DataLength Data Got Serial etwork a Se Wireless Qty1 199 a Volume Discounts Available t Qridconnect www gridconnect com 1 800 975 4743 www circuitcellar com CIRCUIT CELLAR Figure 3 The PassDataDown flowchart shows how a command and any associated data is routed either to the Create if it s an Ol command or to Me dsP if it s an OIE command trying to remember values such as right bumper sensor BumpRight bit or the radius value to drive straight RadStraight 32 768 I ve been refining a COM select routine for some time now This routine attempts to open each COM port from COM1 to COMmax and look for a comm error Ports with errors are flagged as unavailable Then a pop up window displays all of the COM ports as radio buttons with the COM ports flagged as unavailable disabled You can choose any of the enabled ports This is where you must select the service port that you made note of earlier Assuming that you ve chosen the proper port you now have a wireless connection between this a
91. cription orders payable in U S funds only via Visa MasterCard international postal money order or check drawn on U S bank Direct subscription orders and subscription related questions to Circuit Cellar Subscriptions P O Box 5650 Hanover NH 03755 5650 or call 800 269 6301 Postmaster Send address changes to Circuit Cellar Circulation Dept P O Box 5650 Hanover NH 03755 5650 Circuit Cellar makes no warranties and assumes no responsibility or liability of any kind for errors in these programs or schematics or for the consequences of any such errors Furthermore because of possible variation in the quality and condition of materials and workmanship of read er assembled projects Circuit Cellar disclaims any responsibility for the safe and proper function of reader assembled projects based upon or from plans descriptions or information published by Circuit Cellar The information provided by Circuit Cellar is for educational purposes Circuit Cellar makes no claims or warrants that readers have a right to build things based upon these ideas under patent or other relevant intellectual property law in their jurisdiction or that readers have a right to construct or operate any of the devices described herein under the relevant patent or other intellectual property law of the reader s jurisdiction The reader assumes any risk of infringement liability for constructing or operating such devices Entire contents copyright 2009 by C
92. d 16 16 bit ADCs Up to 277 VAC 5A a 40mA draw per coil Up to 100Ksps 10us a E to 30 VDC 5A a O jumpers 1KB ADC RAM FIFO KARR oer rere ret N D I oo si eesotsa si 4 ADC voltage ranges ecces ou laweo 4 Se es ee ee Prog pacing clock Externally triggered 4 inputs 1 output 4 ee aaa S La 4 oe es a i iT l KELLI Sepe de 4 16 bit counters ri oT 3 op a 4 ok an ar ri B d see our website for x86 SBCs peripherals and option details 33 Technologic a Systems We use our stuff Visit our TS 7800 powered website at www embeddedARM com Troubleshooters Unite ure workarounds are great It s clear that a nifty workaround can be helpful when you re in a tight bind particularly when a client or project manager is breathing down your neck But there s no working around the fact that a workaround is nothing more than a temporary fix a fix that if left unattended can trigger a project wide disaster I know you probably have a story about how you saved the day with a brilliant workaround on a day when failure was just over the horizon I applaud you for that success because we here at Circuit Cellar value ingenuity in all its forms But at the end of the day you must agree that a solution always trumps a workaround at the workbench The process of tailoring a solution to an embedded design problem requires a talented engineer to troubleshoot complex circuitry and code glitches of all sorts
93. d require a far more robust active load which I ll leave as an exercise for the interested reader The Arduino board runs with V o 5 V and its ADC inputs must not exceed that level so the resistor pair R18 R19 pres ents 25 of the panel voltage to the microcontroller The R16 R17 pair does the same thing to the transistor s collector voltage The open circuit voltage of both my panels is under 10 V but the booster circuit described below can reach nearly 20 V so some headroom is in order Characterizing the panel requires applying a series of load currents and measuring the resulting panel voltages This cir cuit can t quite produce a true short circuit load because the voltage drop across D1 plus Q2 s saturation volt age plus the voltage across the cur rent sensing resistors adds up to about a volt but there s a way around that As you saw in December the power drawn from a solar panel depends on the incident illumination and the load current One specific current extracts the maximum power from the panel for a given illumination level drawing a higher or lower current produces less power Because solar power is so hard to come by there s a strong motiva tion to always run the panel at its I www circuitcellar com_ CIRCUIT CELLAR Photo 1 The solar data collector fits atop an Arduino Diec imila microcontroller board The spillover on the solderless breadboard shows that not everything works correctly
94. d the R8C allowing fast communication with the host Finally you can use the R8C 20 s internal oscillator which is the equivalent of a 20 MHz crystal but is not as precise CIRCUIT CELLAR www circuitcellar com On the other side of the R8C I just connected each pin to one of the header pins Because P3 is missing 2 bits two of P4 s bits fill in providing 32 I O pins in four groups of eight Additionally four ground and four power pins are provided in the headers Because I use PC a lot I included two PC pull up resistors and jumpers to enable them There is also an on pod LED connected to pin P6 3 which can be used for diag nostics The pod s host side serial port driver in my software uses this LED to reflect the flow control status between the host and the pod PROGRAMMING amp OPERATION The pod can be used in one of two modes Programming or Operation In both modes the R8C is reset by tem porarily dropping DTR Because the Linux built in FTDI drivers do this automatically when the data rate is set to zero it can be done easily whether you use the built in drivers or the FTDI library Note that the FT232R has pro grammable polarity for the serial port signals I programmed the DTR line to be active high so the chip is reset when DTR is dropped and runs when DTR is asserted DTR is always driven so no pull up resistor is needed In Programming mode the R8C MODE line is held low during reset by usi
95. e _and software solution e Simple Ethernet connectivity for serial devices e Works out of the box no programming is required e Enable data encryption to prevent unauthorized monitoring e Customize to suit any application with development kit Features 10 100 Mbps Ethernet e SSH SSL TCP UDP modes e DHCP Static IP support e Web based configuration e lwo TTL serial ports karl NNDK JEG urner com a4 7 E a a i a Overseas Manufacturing Dele matey Dlele s mE Delivery Imagineering Inc enjoys the reputation of being one of the most experienced amp successful PSohificant offshore PCB suppliers Price Saving CAM USA Our Illinois based DFM office has eight fully staffed CAD CAM stations Within hours of receipt of new Gerber files our highly experienced DFM engineers conduct thorough and precise analyses Quick Turn Production Imagineering offers small volume production in 5 6 days and medium to large volume production in 2 3 weeks ie evoke amp 6 Overseas Ss Manufacturing A Pe x T ay d E gt 22 22222 i 2 d d A d d Ald ae a a a Capabilities Up to 30 Layers Shipping Logistics With Imagineering there is no X need to deal with multiple as Blind Buried Vlas Suppliers language barriers a pe gt We WA Ws 9 2 2 2 A Di Electric Thickness customs headaches and
96. e data rate up to 12 Mbps and power needs with the host The FT232R has an internal EEPROM that contains config uration information such as device identification and power needs I programmed mine to be named usb r8c and I asked for 250 mA using utility software available at FTDI s web site Once the power is negotiat ed CBUS3 is pulled low to activate Q1 supplying power to the R8C chip and headers The connections between the FT232R and the R8C are fairly straightforward The UART signals go to P6 except DTR which is used for nRESET I took care to match the Tx and Rx pins so the R8C s internal UART can be used to communicate with the FT232R CBUS2 is used to control the MODE pin CBUS4 provides a 12 MHz clock from the FT232R to the R8C An external crystal is not required Because the R8C runs at up to 20 MHz you can use a separate crystal to increase its performance Twelve megahertz is just the fastest clock available from the FT232R that doesn t exceed the R8C s limits You could also use an 18 432 MHz crystal if you need accurate UART signals because 18 432 MHz is 160x faster than 115 200 bps and thus is the fastest clock under 20 MHz that results in an exact divisor in the UART clock control register The UART needs a clock 16x faster than the data rate and 115 200 x 16 x 11 is 20 275 MHz However running off the FT232R s clock enables you to coordi nate data rate divisors between the FT232R an
97. e search engines help you quickly locate COmpar and evaluate thousands of different microcontrollers from different manu facturers without knowing part numbers HEARS T business media EnDeveoPeR GE FIND COMPARE BUY Compare all devices by their performance and features in seconds download a data sheet find and buy development tools or link to a distributor for an RFQ or chip sample without ever leaving the site Embedded Developer is the only site in the world where youre only a few clicks away from buying the right device or tool for your next job So fasten your seat belts and log in today we guarantee this site will put you in pole position inthe time to market race ConWergence PROMOTIONS 0 96 s First segment of the data code MI OE Pi ME GM GS 2010 8 4 2 1 40 2010 8 4 2 1 10 8 4 2 1 20 108 4 2 1 4 2 1 0123 4 5 6 7 8 9 10 11 een ii Gan f 2k Hz f 2 5k Hz 30 ms 30 ms ID ID Code segment OR Hours MI Minutes OE Standard time 0 Daylight savings time 1 PI Parity check P1 ME Month GM Day of the month GS Day of the week P2 Parity check P2 Figure 1 This is the complete IEN SCR RAI signal After that numerous metrological laboratories adapted to the new technological concept For instance since 1970 The National Electrical Institute IEN in Turin Italy has had its own coordinated universal time UTC that is based on cesium beam atomic cl
98. e to a fre quency slippage which is typical with AM receiving In the same routine several checks are made to verify the correct lambda reading as well as to reject frequen cies that are too high caused by spikes or frequencies that are too low no incoming signal The first routine using READ_FREQ is the one that reads the principal header made up of one bit 0 followed by one bit 1 The correct reading of this part of the code is fundamental for all reading all of the data The routine takes into consideration the exact length of the signals and then esti mates the quality through a noise parameter rather than reading errors In fact if the decoding activity is stopped as soon as a simple defec tion in reading occurs it would become impossible Bearing in mind the nature of the incoming signal source you cannot expect to have a signal that is totally accurate The noise value then becomes an important parameter to value the signal s quality Higher parameters mean more signal interferene Beyond a certain cluster point an error in reading occurs and an ID1 ERROR message appears The wide margin based reading technique and the quality of the read data are also made possible by the fact that there are only three frequencies to be read and their spacing When designing the signal standard it is likely that the IEN had already considered the most adequate frequencies to get a data transmission with the lowest
99. eering System of Robot Wheel Actuators by G W Lucas Simplified algorithms are also in these se 2B2C o Factory on Your Fingertip 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 MVMachinePIER Tel 408 421 9840 Email sales machinepier com Website http www machinepier com CIRCUIT CELLAR www circuitcellar com Sequence Name Range Note 1 Header ID 0 9 ASCII A Z ASCII CmdLen 1 MAX_RX_BUF F Number of bytes following checksum included Data Checksum 0 255 Obtained by simply adding up in an 8 bit variable all bytes composing the message checksum itself excluded Table 3 This is the structure for the command packets Each one contains all the bytes shown documents You can find the correct compromise between precision and computing speed by using the trigonometric capability of the dsPIC30F series Every few milliseconds after the current position elaboration Listing 1 To create a 50 x 50 nibble matrix you need to define a EruUct typedef struct unsigned char Low 4 unsigned char High 4 _ Coordinate Coordinate MapxY 25 50 field mapping divides the unknown field in a 10 cm x 10 cm cell grid
100. ell Digikey Amazing PIC programmer Most devices supported M ICSF SQTP amp copy limits H at Digikey PA 32 ES F ie www flexipanel com Actual siz patents pending Embedded Standalone C C Programmable Low Cost User Interface with Ethernet USB CF RS232 ADC DAC I Os Relays U Drive 5 7 QVGA TFT CAN Ethernet CF ADC DAC 60 Low Cost Controllers with TFT ADC DAC UARTs 300 I Os solenoid relays Compact Flash LCD Ethernet USB motion control Custom board design Save time and money NTERN 1950 5th Street Davis CA 95616 USA INC Tel 530 758 0180 Fax 530 758 0181 www tern com e sales tern com Program in Assembler BASIC C and Forth wee PIC MCU C Compiler Version 4 100 e Optimized String Handling e IDE Compilers include NEW Menu Manager Supports NEW PIC16 Opcodes Prices start at 150 262 522 6500 x35 sales ccsinfo com www ccsinfo com 16NEW CIRCUIT CELLAR e www circuitcellar com Solve complex signal _ acquisition problems positioning amp contre environmental transients pressure vibration sonar GPS Linux Driver rr W e a t h e r Guaranteed in stock Many newly added features 16 bit analog inputs and outputs ns t ru m e n ts Million sample FIFO eliminates interrupts Wide analog input and output ranges for PCs 40 C to 85 C Standard con EENE 2 e Order 24 7 fast and easy electr nica
101. ellite receiver with a calculated average delay of about 240 ms which will be automatically adjusted by the soft ware in the microcontroller This enables perfect synchronization with absolutely no problem Once you connect the source of the input signal and feed the cir cuit check the signal s volume To access the test routine hold the Enter key for 2 s immediately after you switch on the device A graphic slider moves each of the three fre quency samples 1 000 2 000 and 2 500 Hz to be recognized Then adjust the input volume The bar moves a bit toward the right or left every time one of the three frequen cies used for recognizing the SRC RAI signal i e on 1 000 2 000 or 2 500 Hz is identified If the volume is too low the bar on the display won t move and will have to be turned on Once you have termi nated the check phase press Enter again The device with the display off will wait to receive a good SRC RAI signal As soon as the first two segments of information are received they will be decoded and displayed A bar placed in the lower part of the display will move forward synchro nized by six 1 000 Hz beeps A April 2009 Issue 295 A QO April 2009 Issue 295 Welcome message Figure 6 These are the menus Yes TESTVU Meter Source signal lt RADIO gt lt SAT gt Radio or SATSRC signal IN Swich up down Time standard summer Swich up down
102. er ae shown with optional A D 2000 configurations I converter Compact Flash and RS 485 Fanless no heat sink SDRAM up to 128MB Flash up to 128MB onboard 10 100 Ethernet up to 2 ee ee ee a S DIO lines up to 55 a SD card misg er ee option 2 USB ports a VGA video COM ports up to 10 a options include LCD ready onboard temperature sensor A D Converter 8 channel 12 bit Extended Temperature Battery Backed Real Time Clock USB Flash USB WiFi Programmable FPGAs Linux Real Time extension Debian 7 Over 20 years in business 7 Custom configurations and designs w Open Source Vision excellent pricing and turn around time Never discontinued a product P Most products stocked and available A Engineers on Tech Support for next day shipping Design your solution with one of our engineers 480 837 5200 Featured Products and PC 104 Peripherals TS TPC 7390 200MHz ARM9 Touch Panel Computer Low Power Industrial Quality Design Mountable aluminum frame 64MB SDRAM 128MB opt 512MB Flash w Debian Linux Programmable FPGA 5K LUT 7 Color TFT LCD Touch Screen 800x480 customizable video core Dedicated framebuffer 8MB RAM Audio codec with speaker Boots Linux 2 6 in about 1 second Unbrickable boots from SD or NAND Runs X Windows GUI applications Runs Eclipse IDE out of the box TS RELAY8 TS ADC16 Eight Software Controlled Relays ADC DAC and Digital I O a 8 SPDT relays a Software controlle
103. erous exper iments Keep it on your bench www circuitcellar com CIRCUIT CELLAR just in case It is time to show you my first actu al TDR measurement The test setup is in Photo 4 The pulse generator is connected to an off the shelf Greenpar three way 50 Q resistive splitter obso lete One of the outputs of the splitter is connected to the oscilloscope through a 50 Q cable The other is connected to a 1 5 m open ended SMA cable see Photo 4 Switch on the oscilloscope set the trigger voltage high enough to syn chronize only on the initial pulse and you get Photo 5 As expected there is a reflected pulse 15 66 ns later than Photo 7 I reused the microstrip test board presented in my Circuit Cellar 223 article added a parasitic serial or parallel 22 pF SMT 0805 capacitor in the middle of the line to compare the theoretical TDR behavior and an actual one the original signal Assuming a veloci ty factor of 0 7 and keeping in mind the factor of two for back and forth directions this means the discontinu ity was 1 64 m away i e 0 7 x 3 x 108 x 15 66 10 2 m Not too far from the actual 1 5 m cable length the differ ence is probably due to the delays in the splitter itself or to a slightly differ ent velocity factor Moreover the shape of the reflection signal is useful Remember my first example of a shorted wire which gave a negative reflected signal The line is open ended and in such a case
104. es www keil com CIRCUIT CELLAR www circuitcellar com LONG WIRE LEAD THERMISTOR gt f The Thermo String temperature sensor is an enhanced thermistor fitted with long O O U wire leads up to 150 mm so it can be placed close to hot spot areas Utilizing the Robotics and Electronics NCP series surface mount NTC thermistor line to provide accurate temperature l measurement over wide temperature ranges the Thermo String NAF series proffers a 2 7 Robot Kits a convenient leaded package to reduce costs because there is no need to design Line followers a new thermistor from scratch Robot arms Aside from the benefits of long wire leads and cost savings the Thermo String offers iy ee proven performance in a small package With a maximum head size of only 2 mm the sensor provides operating temperatures in the range of 40 to 125 C Suitable Dpi R b 4 for lead free soldering the sturdy thermistor is resistant to mechanical vibra pi yer tions and shock and it meets ELV UL requirements Due to its numerous attrib High performance C programmable ATmega168 utes the Thermo based robot with Arduino support String is ideal for use in a variety of applications e g battery cells servers PCs power tools measuring instruments med ical equipment and heating and ventila tion and air condi tioning HVAC The Thermo String is available for 50 16 to 0 24 in volume otor controllers ervo controllers Mura
105. ete wireless gadget aka Wad get What could be easier WELL ROUNDED What could be easier indeed How about just heading over to the Freescale web site and ordering the ZSTAR3 evaluation kit see Photo 1 In addition to the wireless accelerometer versions are available with the digital MMA 7456L or the analog MMA7361L the kit includes a USB plug in wireless hub and some cool PC based utility software The ZSTAR3 wireless scheme sup ports up to 16 sensors simultaneously each delivering data at 30 Hz The protocol is based on the aforemen tioned SMAC upgraded with some new timing related features for effi cient scheduling see Figure 5 I experimented with the original No other PCB design tool gives you more value per dollar Boards designed under EAGLE are developed in one man businesses or in large industrial companies Most of the top companies are our customers The crucial reason for selecting EAGLE is not usually the low price but rather the high end functionality along with the ease of use And EAGLE users appreciate the outstanding level of support which at CadSoft is always free of charge and is available without restriction to every customer These are the real cost killers Version 5 is even easier to use especially for beginners due to an enhanced user interface Version 5 Highlights Stand alone schematic editor available Automatic signal contact cross references using frame coo
106. external navigation command via the serial interface telemetry or via the PC inter face main board Different strategies can be applied A Free running is movement at a given speed in a given direction VelDes 0Des B Cartesian is movement toward a given coordinate XDes YDes C Polar is movement for a given distance in a set direction Dist Des 6Des In mode A with the logical control switches in position 1 only the PID control Angle PID is used on the super visor see Figure 3 This combines the desired angle Des with the measured angle 8Mes computed by the odometry procedure to obtain the value of the rotation angular speed w of the vehicle around its vertical axis needed to cor rect the orientation error The DeltaV value is proportional to It s added to VelDes to obtain the left wheel s speed and subtracted from Learn CPLDs Sess the fun wa with Pe o plete kit comes with everything you need to take you from mystery to mastery with CPLDs and programmable logic Learn to turn software into hardware PIC SERVO MOTION CONTROL e controller chips controller boards se o ET www picserve 4 SX JEFFREY KERR LLC THE SERIAL PORT LIVES COM ports USB virtual embedded systems Second Edition Jan Axelson Everything you need to know about a COM ports amp f asynchronous serial ports for f lt Hardware amp software for RS 232 amp RS 485 Wire
107. g hard to find parallel ports on computers especially on laptops Even when you can find one it is not always compatible with today s 3 3 V logic The USB port has taken the top spot in popularity In the first part of this two part article series I ll show you how to make a general purpose input output GPIO pod that plugs into your USB port see Photo 1 Next month I ll describe how you can use it to program a CPLD USB OVERVIEW There have been plenty of articles about USB so I ll just cover the basics USB is a high speed serial port with a power feed and only four wires two for data one for 5 V and one for ground A packet protocol is used to communicate between the host and the devices much like PPP or Ethernet is packet based In addition the USB host can provide up to 500 mA on the 5 V line as long as the device has requested it and the host has agreed to provide it This makes USB a much more flexible connection but more complex to inter face with Fortunately there are interface chips that hide this complexity and offer a standardized interface The pod s first major component is a Future Technology Devices International FT232R USB to UART interface chip On the USB side it handles the physical and logical interface to the USB serial lines and manages power to the remainder of the device if needed On the UART side it provides a standard asynchronous serial port with full flow control and five add
108. gital Plus prices will be higher And before you e mail me asking if print only subscribers are now second class citizens i e no access to the bonus section please note that we ve fixed that too Print sub scribers can go to our web site and see all of the bonus sections posted for free although on a delayed basis So I admit to being an old dog learning some new tricks but that doesn t mean I have to be radical about it We re not dump ing the old We re just trying to create a happy medium by implementing something new Go take a look at Circuit Cellar Digital Plus available from our home page and join our latest venture into tomorrow a We _ Steve ciarcia circuitcellar com X CIRCUIT CELLAR www circuitcellar com jore Channels 36 More Memory 4x Advanced Match circuits 8 6V Adjustable Threshold x2 by Cascadable Sequencers 4 a r ee ee ee ee PAP 000 00045 ISDE PONIES PATTER NEEN PIODO RPO RIBS a ole 9 hig irs Cen ber ee Trp teen 1 at i I a 4 Msstiaeg T pe Lf meee Diei ERE CE E a a 1 a 7 i A ele a so N um m aam i osa aa T e 0 Ae Ww B JA Fa We r uf a a ha aM b Professional Ce See ee 5 ed e ee el E H lardware Capture E lea pers Software Analvsis eos 4 Automatic Real time Hardware PATTERN Compression eliminates the neec to reduce resolution Our newest versior staate makes dead time in
109. gths and pigtails or extensions To complete the system fully encapsulated mating receptacles with nickel plated brass housing and 0 5 to 14 NPT 0 375 to 18 NPT M18 and M20 mounting threads are available Prices are dependent on the configu ration please contact TURCK directly TURCK Inc www turck usa com www circuitcellar com CIRCUIT CELLAR Standards Make 4 Sense Standards improve quality and enable designers to share components across different projects Today ARM Cortex M profile processors combined ith the Cortex Microcontroller Software Interface Standard CMSIS and optimized middleware from the _ industry s largest ecosystem are setting the hardware and software standards for microcontrollers These standards enable leading vendors such as Luminary Micro NXP and 4 STMicroelectronics to supply advanced microcontrollers while maximizing code reuse across multiple platforms Cortex M3 Microcontrollers Make Sense STM32 microcontrollers revolutionize the market by combining high performance and low power with a scalable product range that fits every developer s needs Daniel Colonna Microcontrollers Division Marketing Director yy For more information visit www onARM com i o Di The Architecture for the Digital World ARM Ltd AD158 01 09 are April 2009 Issue 295 j es April 2009 Issue 295 JUMP START 32 BIT REA
110. guiott com Rino index html Roboteck Discussion Group http it groups yahoo com group roboteck Italian or http groups yahoo com group roboteck_int English Robot Italy www robot italy com ae Eagle Software CadSoft Computer Inc www cadsoftusa com dsPIC30F3013 Digital signal controller dsPIC30F4012 motor controller and dsPIC33FJ64MC802 microcontroller Microchip Technology Inc www microchip com CIRCUIT CELLAR e www circuitcellar com Lb uh a uf Let your geek shine Meet Michael Cooper adrenaline junkie and SparkFun enthusiast With SparkFun s WiTilt and a bit of ingenuity Michael was able to hack the product s firmware and measure the force his body endures during a BASE jump Whether your goal is to record the data from a 400 foot free fall or simply to make an LED blink SparkFun products and services are here to help Take the leap and let your geek shine too sparkfun LECTRONICS Sharing Ingenuity WWW SPARKFUN COM 2009 SparkFun Electronics Inc All rights reserved Be safe out there Michael A LRU by Danilo Consonni Digital Decoding Decode Periodic Signal Transmissions Danilo s digital decoder decodes the SRC RAI signal the Italian official hourly signal With this device you can learn how one of the oldest operating signals of sample time is made and how it works en have been interested in the topic of time and how to measure it for centur
111. h a fully integrated Clock Calendar puts the OmniFlash ahead of the competition Call 530 297 6073 Email sales jkmicro com On the web at www jkmicro com JK microsystems is April 2009 Issue 225 updated the watchdog is cleared and a flag is set to enable the function that requests the MC s distance Every 10 ms an All Parameters_Ask function speed position and current is enabled The same clock is used through a pulse on RB5 to synchronize MCs for PID and position elaboration PWM output Compare 1 is used to obtain the oscillator frequency for the MCs The OC simple PWM I O peripheral is set to have a PWM at 50 duty cycle with a 7 3728 MHz frequency the same as the supervisor crystal PWM_period PRx 1 4eTOSC TMRx_prescale_value With Prx 3 prescale 1 7 3728 MHz is obtained again at output With this output both MCs can be driv en in EC 16xPLL mode This way all three DSCs have exactly the same clock and some components are saved on the board With data coming from the MCs the supervisor per forms field mapping For more information about the topic of dead reckoning by odometry refer to the follow ing works Where Am I Sensors And Methods For Mobile Robot Positioning by Johann Borenstein Implementing Dead Reckoning by Odometry on a Robot with R C Servo Differential Drive by Dafydd Walters and A Tutorial and Elementary Trajectory Model for the Differential St
112. he motor under test is mechanically joined with a similar motor This one is loaded on a power variable resistor to easily simulate a varia tion in mechanical load for the first motor April 2009 Issue 295 QJ N April 2009 Issue 225 Photo 2 This is one of the first tests during the calibration of PID Darameters It shows the measured speed after a remote request to switch from 50 to 500 cm s and back to 50 cm s Note the rising ramp with less slope than the falling one The supervisor will assign the definitive ID subsequent ly enabling each MC In normal operation both MCs simultaneously receive data sent by the supervisor but only the addressed one with the correct ID decodes the message A message with ID 0 broadcast is decoded by both MCs If an error occurs during reception i e UART checksum parsing errors the status variable is set to a negative number and the red LED illuminates to indicate the fault condition Cellular and GPS capable e Flash file System e 4 Chan 12 Bit A D e 7MB SRAM 512KB FLASH e 4 isolated Inputs e 4 Hi Current Outputs e 2 External RS 232 e 2 Internal RS 232 Bat Backed C k Cal e Cell Modem Option nternal GPS Option e Metal Case Option e 7ma Standby Option It s easy and cost effective to do mobile or solar powered data collection and asset monitoring with the JK micro s Data Mover With the ability to integrate a Cellul
113. hort syn chronizing signals A final signal is transmitted that corresponds to sec ond 00 As I mentioned the INRIM s SRC RAI signal is directly transmit ted on a dedicated frequency to the RAI s headquarters and then broad cast in the normal radio RAI pro gram This is why it can be received at different times and places on all three RAI stations in both amplitude AM and frequency FM modula tion The signal s broadcast usually takes place 15 times per day some times 20 or more times in different time bands Signals at midday mid night and generally before the evening news cannot be eliminated If the transmission can t be received directly from Italy the same radio RAI signal can be received throughout Europe with a standard digital satellite TV receiver In that case you can can obtain the signal www circuitcellar com CIRCUIT CELLAR Photo 2 This is the PCB via the audio output on the back of the receiver For more information about the SRC RAI time signal refer to the INRIM IEN web site www ien it tf time index html SYSTEM DESIGN This project was created for edu cational purposes I developed the circuit to study the SRC RAIT signal generated by the IEN in Turin see Figure 3 I don t pretend the circuit is highly accurate or perfectly syn chronized Bear in mind that the signal is transmitted via radio or TV satellite In addition to being an old technology it produces a dela
114. i 67 19mVv Figure 3a The simulated booster circuit ramps between 100 and 200 mA at the di dt rate set by the 17 4 mH inductor b The oscilloscope screenshot shows something s amiss the actual inductor current has abrupt peaks due to core saturation Trace 3 shows that the MAA4372 current amplifier can t Keep up with the core flux collapse CIRCUIT CELLAR www circuitcellar com I weai g Com Color LCD Scope Amazing 7 in 1 Scope 180 CircuitGear CGR 101 is a unique new low cost PC based instrument which provides the features of TE standalone USB 2 ch 1GSa s 25GSa s equiv M 25MHz 2 ch 16 logic scope SEVEn devices IN ONS USB powered compact box bench scope 325 599 50 100 MHz scope 595 795 ff and logic analyzer 699 2 ch 10 bit 20MSa sec 2MHz oscilloscope 2 ch spectrum analyzer 3 MHz 8 bit arbitrary waveform standard function generator with 8 digital I O lines It also a R 20011z2 ch 10btsoe 2chspecumfey functions as a Network 7 10 25MHz USB powered scope in a fil analyzer 16 ch 8MHz logic analyzer Anal YZer a Noise probe Up to 100MS s 193 308 J 5 ch sig gen 8 ch pattem gen 1999 Generator and a PWM Low Cost Scope 1 2GHz RF Generators ixed Si Output source all for r i less than 180 What s more its open source i software runs with Windows Linux and Mac E Sees ee ge OS s Only 180 range with 5 10 25MHz 297 USB Bus Analyzers EMC Spectrum Analyzer
115. ices simply produced a TTL output signal There are a few obvious disadvantages associated with these circuits the need to have different selective stages one for every frequency to be found the need to use laboratory instruments oscilloscope or frequency counters for the calibration phase and a proven instability due to the noises often present in the input signal Noises in the AM frequency vanish ing noises and the less invasive FM frequency over modulation are the major causes for unsuccessful decod ing with the old decoder circuits My project features a digital circuit where the task of selecting the FSK tone as well as its quality is dele gated to the only microcontroller In terms of functionality you have notable advantages calibration isn t required you have stable selectivity and you have an inexpensive com pact project The PIC16F628A microcontroller s software was developed with pure assembly code High level languages weren t used This refined approach enabled me to use the 2 KB of memo ry and maximize the part s full poten tial I used an alphanumeric integrat ed display that contains a Hitachi HD44780 with a reduced pin nibble A April 2009 Issue 295 amp April 2009 Issue 225 Figure 4 This is the READ_FREQ routine LAMBDA 0 STARTUP FREQ_OK 0 FREQ_OK 0 FREQ_BIT 1 000 LAMBDA 2 000 FREQ_OK 0 NO RECOGNIZED FREQ co
116. ies Famous philosophers and scientists such as Albert Einstein have studied every aspect of this peculiar physical concept Through his theory of relativity Einstein introduced essential concepts about the regular flow of time These matters continue to puzzle us today For instance it is impossible to synchronize two watches that are not in the same condition Think about the GPS satellites orbiting the Earth at an m tin aS Tttttscee E ee wal i AMARA TITTA ence af oom we 4 t April 2009 Issue 295 approximate altitude of 20 000 km Believe it or not between the two atomic clocks one on the satellite and one at sea level there is a daily difference of about 38 9 us It s a difference we cannot ignore that s due to differ ent gravitational pulls acting on the orbiting clock and its displacement velocity which is 12 times greater than the one on Earth Therefore GPS satellite systems are usually adjusted before launch in an effort to minimize such effects When it comes to time a temporal scale of reference is important The old definition of a second as a division of the 86 400 parts of the mean standard day is inadequate In 1967 the scientific community acknowledged the new definition of second Back in 1955 English physicians Louis Essen and J V L Parry created the first cesium beam atomic clock at the National Physical Laboratory in England In
117. ing to return to In this case the peripherals are doing all the work so my main loop is used to wait for data from the host The protocol is simple A command byte is followed by zero or more data bytes and it may cause zero or more data bytes to be sent back to the host The 0 command is followed by a byte which is then sent CIRCUIT CELLAR e www circuitcellar com What s the difference Electronic components work no matter what price you pay Jameco carries everything you expect at prices below what others charge But the price savings don t stop there Jameco offers additional savings with its array of house brand and factory overrun products The Jameco difference begins with the industry s highest quality catalog and is backed by the industry s longest warranty plus much more Over 100 000 skus AM ECO e 99 of catalog products are in stock right now ELECTRONICS Low price guarantee 1 800 831 4242 21 lt lt Order your FREE catalog today at www Jameco com Price N N April 2009 Issue 225 to port 2 The I command causes the pod to read port O and send the byte back to the host The a command is fol lowed by a byte that selects one of the four ADC inputs on port 1 reads the ADC value as an 8 bit value and sends that back to the host The t and T commands are followed by 1 or 2 bytes that get programmed into Timer B PODS AND MODULES In addition to connecting wires directly
118. iques picoPower microcontrollers help you reduce your applications power consumption without compromising system performance Visit our 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 T A 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 FLUXGATE TECHNOLOGY REDUCES TRANSDUCER SIZE The CAS CASR and CKSR family of transducers is intended for AC and DC isolated current measurement from 6 to 50 ARMS nominal up to three times the nominal values for the peak measurement and a bandwidth up to 300 kHz 3 dB These new transducers were designed to respond to technology advances that require better per formance in areas such as common mode influence thermal drifts response time levels of insulation and size Using closed loop flux gate technology the transducers offer high accuracy and affordability without compromising any of the advantages of its LIS family such as size dynamic performance and wide measuring range Although the new transducers are 50 smaller than the existing LTS family their insulation performance can withstand use in industrial appli cations without a special layout of the PCB The CKSR model has one more primary pin than the
119. ircuit 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 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 e Priced for volume applications Minilore RLS Fo Buy now at 1 888 411 7228 rabbitwirelesskits com 2900 Spafford Street Davis CA 95618 April 2009 Issue 295 April 2009 Embedded Programming Construct a USB GPIO Pod Part 1 No Parallel Port No Problem DJ Delorie Robot Navigation and Control Part 2 Software Development Guido Ottaviani Digital Decoding Decode Periodic Signal Transmissions Danilo Consonni zaad PEPCELI Li an jinaceee s sl Ola T A O aa ee Moar evs SE oggun TETE i pm PTE TrT EF Ener Trn a te oe INTELLIGENT ENERGY SOLUTIONS ABOVE THE GROUND PLANE Solar Data Logger Par
120. it quantities J Link Flash Download is a module used to download your program into flash even if your debugger does not have a flash loader jJ Link Flash Breakpoint permits you to set an unlimited number of cape ly breakpoints while debugging in flash J Link SDK is a standard DLL that extends the full functionality of the J Link to your proprietary application Analog Devices Inc www a nalog com ALL ENVIRONMENT ULTRASONIC SENSORS The MaxSonar WR1 ultrasonic sensors are designed for either indoor or outdoor use while maintaining very low cost The sensor will work in many industrial appli cations such as presence sensing distance measurement outdoor mounting peo ple and proximity detection snow measurement and tank level detection The We also rugged packaging and narrow beam width of the WR1 means that these sensors E ja can be used for mobile robotics applications such as room mapping where a preci can be used to JTAG Isolator l target hardware and the J Link This The LV MaxSonar WR1 features a 53 to 5 5 V low power requirement and pro is essential when the development vides very short to long range detection and ranging It is designed to meet IP67 na ba hE AAO mie sani water intrusion criterion and it operates over a wide temperature range from 40 useful to protect the development to 85 C The sensor is packaged in a robust PVC housing and offers a mounting Surin came ae aches system that m
121. itional user assignable I O pins CBUSO through CBUS4 FTDI provides two libraries that can be used to interface to these chips The first treats the chips strictly as standard UARTs The second provides access to the chip s full capabil ities The libraries are available for both Windows and Linux but the UART library usually is not needed Both operating systems recognize the chips and automatically load UART drivers for them when a USB device is first plugged in R amp C OVERVIEW The second major component in the GPIO pod is a Renesas Technology R8C microcontroller It is a 16 bit microcontroller that can run at either 3 3 or 5 V at up to 20 MHz with built in flash memory RAM and a wide variety of built in peripherals While the FT232R chip has user controllable I O pins using a microcontroller gives you much more Photo 1 The pod can be used to interface your host PC to a project Here it provides input data to a CPLD project CIRCUIT CELLAR www circuitcellar com speed and flexibility For example the R8C has an ADC so you can use it for measuring analog signals You can also download software into the R8C to turn it into a smart I O pod which will enable you to optimize the USB serial datas tream Next month I ll explain how I downloaded an entire JTAG programming application into the pod and sent the compressed CPLD bitstream to it through the serial port There are a couple of reasons why I chose the R8
122. its the FT232R talks to the power circuits and the R8C and the R8C connects to the headers see Figure 1 include bsp h main unsigned char j Configure port 1 for all GPIO output pdl b Oxff while 1 J ey Write the new value out to port 1 jumper controls power to the FT323R s UART pins the R8C chip and the headers The jumper s output is switched with a P MOSFET controlled by the FT232R so the FT232R can keep the R8C powered off until it and the host agree on power requirements The FT232R chip manages the USB connection When you plug in the USB cable it negotiates Pls 5 wait_ms 100 The USB connector provides 5 V of power to the device However there are some rules about using this power The device is limited to 500 uA in sus pend mode and 100 mA during USB negotiation If the device and host agree the device may use up to 500 mA although the pod is rated for only up to 250 mA The pod has a 3 3 V regula tor Ul and a jumper to choose between 3 3 or 5 V operation The GENERAL CIRCUITS CO LTD CHINA PCB SUPPLIER QUALITY PCB amp SERVICE PROTOTYPE TO PRODUCTION instant online quote shopping cart ordering system China competitive prices free electrically test web _http www pcbcart com E mail sales pcbcart com Tel 86 571 87013819 Fax 86 571 87036705 Add No 76 GuCui Road Hangzhou China WWW PCBCART COM th
123. kForHome goto CheckForFull CIRCUIT CELLAR www circuitcellar com iRobot Create Ver 0 9 COM RUN Position Referenced to Home Sensors Distance Y axis Bumpers 47 mm E Left Right Rotation Degrees Distance lt axis 30 358 mm Cliff Left Front Left Rear C Right Front Right Rear Power Voltage 14 973 V Current Buttons 1 231 mA E Play Advance Home Base F Force Field Red Buoy Charging State Battery Temp C 18 Green Buoy Battery Charge Battery Capacity Not Charging 2 698 mAh 0 272 mAh ICom21 is Open Running Photo 2 This is the dashboard It is a real time display of many sensor values will be made in two steps rotating in place and moving in a straight line These routines do more than just determine when the robot has reached its destination They also check sen sors for additional and potentially dangerous input These can include bumper contact cliff sensors excessive wheel cur rents button pushes battery status and digital analog inputs Each sensor input might have a routine associated with it that would be executed if necessary For instance if WIRELESS MADE SIMPLE BRING YOUR PRODUCT QUICKLY AND LEGALLY TO MARKET RF Modules Low Cost TX RX ATRX Modules i Add INSTANT wireless analog digital capability to your product Multi Channel Modules BLN aF et hf ve i 4 a
124. kind of converter used for CFL display backlights With D1 and Cl this is a convenient inexpensive way to generate a 300 VDC voltage Yes 300 V This voltage is then used to charge the small C2 capacitor 1 5 pF through R1 And this is where the magic happens At a given point in time the voltage on C2 exceeds the avalanche breakdown voltage of Q1 usually around 60 to 80 V Q1 then briefly conducts and discharges C2 through R3 This generates a pulse on the output The pulse s duration will be roughly propor tional to C2 But more importantly the pulse s rise time will be short because the avalanche phenomenon is fast due to the underlying physics Intuitively with such a high voltage the electrons will have a lot of energy and will be able to jump over the transistor s barrier very quickly Some transistors are better than others for this application The old 2N2369s are fine so I have one If you need longer pulses just increase C2 WHERE ARE YOUR MAGNIFYING GLASSES Figure 2 is simple but you need to be careful as you build it Its performance will depend on the parasitic component values Any useless wire in the critical sec tion of the design i e between C2 Q1 R3 and the out put connector will inevitably introduce parasitic induc tances which will drastically degrade the pulse genera tor s performance You need to build it as small as possi ble Surface mount versions for C2 and R3 will at least yield bette
125. l Version withRS232 3739 00 ADR218 Solid State Version 8 Channel 225 00 ADU100 3 CH 16 Bit ISOLATED Analog Inputs PGA 4 digital V0 RS232 and 5 4MP Relay Output 199 00 ONTRAK CONTROL SYSTEMS INC PH 705 671 2652 Fax 705 671 6127 WWW 0ontrak net SPECIAL OFFER 10 PCS 3days 1 or 2 layers 249 10 PCS 5days 4 layers 695 up to 30sq in ea includes tooling artwork LEL mask amp legend 9901 W Pacific Ave Franklin Park IL 60131 Phone 847 233 0012 Www pulsar inc com sales pulsar inc com Q Phone 719 520 5323 Fax 719 520 1867 Box 60039 Colorado Springs CO 80960 BASIC Compilers for PiCmicro Easy lo Use BAS C Commands Windows 9w Me 2KRXP Interface LA PICBASIC Compiler 99 95 1 BASIC Stamp 1 Compatible Supports most 14 bit Core PiCs Built In Senal Comm Commands PICBASIC PRO Compiler 249 95 32 bit signed variables and math operations supports Microchip PICO PiICT2 PICTA PICT6 PICT and PICT8 microcontrollers Direct Access to Internal Registers supports In Line Assembly Language Interrupts in PICBASIC and Assembly Built in USB l2C RS 232 and More Source Level Debugging see our full range of products including books accessones and components af www melabs com CIRCUIT CELLAR e www circuitcellar com 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 77 AAG E
126. l to give spot on data rate generation The 4x 8x 16x PLL can give the source frequency a real boost putting it far above the speeds that RB1 AN1 RB2 AN2 RB3ANS RB4 AN4 RBS ANS RB6 ANG RB7 AN7 RB8 AN8 PWMi1L REO PWM1H RE 1 PWM2L RE2 PWM2H RE3 PWM3L RE4 PWM3H RES OSCHT CLKI OSC2 CLKO RC15 TX1 RC13 RX1 RC14 INTO RE8 INT2 RD1 INT1 RDO RD3 RD2 VSS AVSS I ve become used to Refer to Figure to see how the dual UARTs are used All communication signals are TTL level uninverted Between the microcon troller the Create and the BAM no RS 232 level shifting is necessary I added connections for the ICD2 emulator so execution can be easily debugged Although it has not been implemented both SPI and PC interfaces have been included for whatever sensors I might add i e compass and ultrasonic ranger The SPI and PC interfaces share some of the same signals with the in circuit programmer ICP so I implemented some buffering that should enable these to coexist The SPI and PC clocks have separate enables so the bus can be recon figured and appropriately enabled when necessary The ICP needs control to pro gram the part One aspect of program ming is the ability to reroute some sig nals to and from alternate pins I chose to use alternate pins for the in circuit debugger ICD By using alternate pins a 74LS125N 6 IC IC2 8 lt a 2 74LS125N Figure 1 This circuit serves two purposes
127. lectometry TDR TDR enables you to detect measure and locate any impedance mismatch in a transmission line In this article I ll explain the theory But more importantly I ll present some practical experiments to demystify these techniques You will just need a good oscilloscope TDR BASICS Nothing can go quicker than c 3 x 10 m s the speed of light in free space except guys Figure 2 You can build a sub nanosecond pulse generator for 5 or less using an avalanche mode generator A high voltage genera tor here built using a CFL backlight power supply drives an NPN bipolar transistor in its avalanche region which generates a fast pulse on the output CIRCUIT CELLAR www circuitcellar com Photo 1 The flying SMT technique required some patience but it enabled me to build a compact pulse generator without any specific PCB thereby minimizing any parasitic inductance or capacitance jumping from black hole to black hole if you trust some science fic tion authors The speed of an electri cal signal going through a wire is a little lower than c due to the veloci ty factor of the transmission line which is always slightly below unity Imagine that you have an infinite wire or a sufficiently long wire ter minated in its proper impedance matching load which is equivalent Any signal will flow through the wire and will be absorbed by its matched load No problem no reflec tion Now imagine you have
128. lectronic Edition subscriptions have been automatically replaced with Digital Plus subscriptions at no additional cost nalog Deyi Sten evice Porting basic ay de ana pe i valuation board js C EmonStrations CIR i YCUIT CELLAR WWW W Circ April 2009 Issue 295 o gt o gt ILICON UPDATE ZOTAR Trek by Tom Cantrell A Healthy Mix of MCUs Sensors and Wireless Technology With a combination of MCUs sensors and wireless capabilities the Z5STARS evaluation kit could be a great starting point for your next project In addition to a wireless accelerometer it includes a USB plug in wireless hub and handy PC based utility software hat are three of the tastiest ingredients in an embedded designer s pantry The first is that modern age miracle worker the MCU packing the intelligence needed to give formerly ho hum applications a silicon enhancement Thanks to the fact Moore s law continues to deliver on the promise of more for less ever better MCUs are finding their X axis Transducer Y axis Transducer Z axis Transducer way into practically any gadget with moving electrons On another shelf we find ever smarter sen sors that give those fancy MCUs some real world data to chew on After all it s the sen sors that single handedly enable or not potential applications It s game over if you can t sense because then you can t control at least very
129. lectronica LLC 22 ExpressPCB 15 77 Lemos International Co Inc 14 R4 64 AP Circuits 29 ezPCB 63 Linx Technologies 5 63 Rabbit A Digi International Brand 13 ARM 76 FlexiPanel Ltd 77 MCC Micro Computer Control 76 Rabbit A Digi International Brand 75 All Electronics Corp 18 General Circuits 34 MachinePIER 76 Reach Technology Inc 77 Apex Embedded Systems 61 Grid Connect Inc 76 Maxbotix 57 Renesas Technology 7 Atmel 55 HI TECH Software LLC 78 microEngineering Labs Inc 27 Saelig Co 33 CWAV 57 HobbyLab LLC 41 Mouser Electronics 76 Scidyne 69 CadSoft Computer Inc 75 2CChip 78 NKC Electronics 20 Sealevel Systems 32 Calao Systems 72 73 Cbank Inc C2 NetBurner 9 SEGGER Microcontroller Systems LLC 48 Comfile Technology Inc 1 Imagineering Inc 37 Nurve Networks LLC 39 Spark Fun Electronics 78 Crossware Products Inc 15 Ironwood Electronics 78 Ontrak Control Systems C3 Tech Tools 76 Custom Computer Services Inc 32 34 JKmicrosystems Inc 49 PCB Pool 2 3 Technologic Systems 75 DLP Design 75 JKmicrosystems Inc C4 Parallax Inc 76 Technological Arts 57 DesignNotes 21 Jameco 77 Phytec America LLC 76 Tern Inc 64 EMAC Inc 37 Jeffrey Kerr LLC 78 Pioneer Hill Software 19 Total Phase Inc 77 Earth Computer Technologies 10 Keil Software 11 Pololu Corp 75 Trace Systems Inc 23 Elsevier 37 Lakeview Research 61 PROPOX Sp z 0 0 77 Triangle Research Int l Inc 42 Embedded Developer 77 Lawicel AB 78 Pulsar Inc DEVIEW ATTENTION ADVERTISERS
130. less options and more Serial Port Complete ISBN 978 1 931448 06 2 39 95 Lakeview Research LLC _www Lvr com__ From the author of USB Complete April 2009 Issue 295 WW mJ Ww QO April 2009 Issue 295 VelDes to obtain the right wheel s speed in order to keep the heading corresponding to the Des value while the center of the robot is still moving at the VelDes speed In mode B with the logical control switches in position 2 the desired speed VelDes is calculated by the PID control Dist PID and it is used as in mode A This means the mean speed decreases proportionally to the distance from the target It becomes zero when the target is reached The measured input for this PID DistMes is computed as a function of the current coordinates and the destina tion coordinates The desired orientation angle Des also comes from the same procedure and it s used as reference input for Angle PID The reference input for Dist PID is 0 meaning that the destina tion is reached With and VelDes avail able the wheels speed control runs as it does in the first mode In mode C with the logical control switches in position 2 the destination coordinates Xdes Ydes are computed once at the beginning as a function of input parameters DistDes 0Des After that everything operates as it does in mode B A sequencer is also available to per form some specific paths for UMBmark or something like the R
131. llisions PC are detected by hardware setting the appropriate flag ISR rou tines handle the second layer They fill the RX buffer with the bytes received from the interfaces They also detect buffer overflow and command overrun UartRx or UartRx2 functions manage the third layer These routines act as a gt Embedded amp Network h en Technologies m 1 4 i Fd h l i j r CA AO iai T iaaa ee a a Embedded Computer Tinycore form factor 36 x 41 mini ATMEL AT91SAM9G20 400MHz gi g 256MB NAND Flash 8bits d 64MB SDRAM 32bits 133 MHz USB Device Serial DBGU amp 2 Expansion Ports bs __www calao systems com CIRCUIT CELLAR www circuitcellar com USBee Test Pods Programmable Multifunction Logic Analyzers Oscilloscopes Signal Generators and Protocol Analyzers www usbee com USBee DX Inspired by engineers Xew AS 0 enba Feared by bugs E ion Max NE USBee Suite For the USBee SX AX ZX and DX me OUS div 262m Aaea 26 649792m aA ppp a MISO FAFA UAA I a i COMI SICn p TE USBee Test Pods starting at 139 www USBee com USBee Powerful Debugging Small and Portable HI USB based Electrical Engineer Pin name EMUC2 Pin name Pin number MCLR Usage Usage PGD SCL PGC SDA VSS VDD U2TX U2RX RB9 OC1 PGD also lC clk PGC also I C dat 1 2 Generic chip select 1 RB1 3
132. lse is positive and exponentially decreasing with a time constant proportional to the capacitance Based on this simulation it is easy to simulate all the other classic disturbances The results are pro vided in Figure 3 All corresponding QUCS simula tion files are posted on the Circuit Cellar FTP site if you want to play with them Figure 3 shows that a parallel resistor gives a reflected pulse shape similar to a short circuited line a negative pulse but with a smaller amplitude than a full short circuit Similarly a series resistor is a small open circuit with a small positive reflected pulse You can also see that a series inductor gives a shape similar to a parallel capacitor but with an opposite polarity Parallel inductors and series capacitors also have a dual behavior REAL LIFE VS SIMULATION Let s compare simulation with real life I ll begin with a parallel capacitor Note that I reused the small S shaped 50 Q microstrip PCB that was built for my February 2009 article Microstrip Tech niques Circuit Cellar 223 I soldered a 22 pF 0805 SMT capacitor in the middle of the microstrip line with its other end grounded see Photo 7 I connect ed the microstrip board at the end of the SMA cable used in Photo 4 connected another 1 5 m cable at the other end of the microstrip test board and finally used a 50 Q SMA load to provide proper matching So the test setup is a 3 m 50 Q line with a 50 Q load at its end bu
133. ment with various LED control algorithms with the eight red LEDs Another module is a raster of red and green LEDs creating an 8 x 8 grid of red green pairs Yes that s 128 LEDS along with eight transistors and 16 resis tors in a 1 square space This forms a 64 pixel micro display with port 1 con trolling the rows port 2 controlling the green LEDs in each column and port 0 controlling the red LEDs in each col umn I use this as a scrolling mar quee display for monitoring data from my PC The pod software main tains an 8 x 8 array of what should be displayed 1 byte per LED The timer interrupt iterates through each row enabling a single bit in port 1 and out putting appropriate data to ports O and 2 according to the desired intensity of each LED in that row Meanwhile data from the host PC is used to fill in new columns of data When a column has been received the data for the dis play is shifted one column over pro viding a scrolling marquee style dis play with data provided by the host but LED control handled by the pod In addition to these you could use the pod to interface with SPI PC 1 Wire or serial devices The R8C s inter nal ADC could be paired with a D A chip or two The pod has a fully func tional and programmable computer chip on it so the possibilities are endless YOUR TURN If you need to turn a bit on and off this isn t the fastest way to do it But CIRCUIT CELLAR e
134. n you ll see how to get it right Honest Steve THE BIG PICTURE As you saw in my February 2009 column characterizing a solar panel requires measuring the panel s voltage while N A ABOVE THE GROUND PLANE by Ed Nisley applying a known load Solar Measurements Circuit Cel lar 223 My manual measurements used voltmeters amme ters and a pair of old potentiometers so automating the process requires putting those functions on a circuit board under computer control To that end the schematic in Figure 1 has three main sec tions a microcontroller interface a constant current load and a boost mode switching converter Careful inspection of the small circuit board clamped in Photo 1 shows that the board an early prototype doesn t quite match the schematic The PC board plugs directly atop an Arduino Diecimila microcontroller board through a quartet of pin strips The Diecimila features an Atmel ATmega168 microcontroller with digital and analog I O a regulated power supply and a USB serial interface to a host PC The open source Arduino IDE runs on both Windows and Linux with support for sever al different boards and chips The two op amps on the right side of the schematic form a voltage to current converter that acts as a variable load for the solar panel The current through Q2 a Darlington power tran sistor matches the voltage produced by the ATmega168 with an overall gain of 100 mA per volt R12A a
135. nd MCs the programs enter a simple main loop acting as a state machine In the main loop the program checks flags enabled by external events and enters in the relative state see Figure 1 Because it s a kind of simple cooperative real time operative system RTOS each routine has to be executed in the shortest possible amount of time to free up the system to han dle frequent tasks There are no delays in the code Interrupts are used whenever possible particularly for slow operations like the transmission or reception of strings of characters MCs use the C30 s PID library to control the speed and position of the wheels The feedback from the encoders on the motors axes dsPID swe Enabled by supervisor Y USART and ISR Setting Y Char received UART Rx al String ready UART Tx to TX INT 1 ms from supervisor LED Blinking Figure 1 A dsPID main loop is simple because most of the program is interrupt driven Main loop CIRCUIT CELLAR e www circuitcellar com Usage Pin name Pin number Pin name Usage MCLR INT1 TX Enable ADC Reference VREF INTO Timer 1 ms from supervisor Motor current reading AN1 PGD EMUD PGC EMUC Chip select from supervisor CN5 VSS Quadrature encoder QEA VDD Quadrature encoder QEB VSS RE4 LED 2 OSC1 Oo OnN OO 1 fF wo nwpoi RE3 LED 1 O RE2 H
136. nd R12B which form a 0 5 Q current sensing resistor set that gain along with the 20 1 voltage gain in U4 U3 forces Q2 to sink enough panel current to make the feedback voltage match the control input voltage My panels can produce at most a few hundred milliamps in full sunlight and with a peak power output around 1 W that CIRCUIT CELLAR www circuitcellar com I A J1 D 0 7 PWM3 PWMS5 PWM6 TX RX gt a zZ z a w gt a Ww o w T oc T x 1 L1 4 3mH powerline choke Series 17 4 mH J1 2 Solar om gee 100k 10 LM339N Panel voltage Panel current Output voltage Output current Panel temperature Board temperature zZ LM335N A J2 AIN O 5 LM3352 on panel D1 1N5819 R17 10k Output voltage Q2 TIP110 A BCE Heatsink Av 20 300 mA gt 3 0 V F4HCOOD ICG F4HCOOD Figure 1 As with most analog circuits getting anything done requires plenty of parts The boost circuitry on the left runs the panel at its optimum current while the current sink on the right dissipates the collected power as heat in the load transistor The Arduino microcontroller represented by the four connectors at the top provides PWM volt age setpoints to control the booster and load then reads analog data from the sensors This circuitry does not match that shown in Photo 1 for reasons described in the text power transistor won t get very hot at all Characterizing a larger panel woul
137. ne at a time starting from the bottom The motor controllers appear as dark boxes that take care of the wheels www circuitcellar com CIRCUIT CELLAR speed The supervisor sends them the reference speed VelDesxX desired veloc ity and the input capture modules of the microcontrollers get pulses from the encoders connected to the motor axis and derive the rotational speed of the motors VelMesX measured velocity By combining the values in the PID control Speed PID every 1 ms you can obtain the necessary PWM value in that condition to keep the desired speed of each wheel In PID terminology VelDesX is usually called the setpoint or control reference VelMesX is the measured output or process variable PWM is the control output manipulat ed variable or simply output The Quadrature Encoder Interface QEI modules get both the A and B pulses from the encoders They receive the traveling direction and the number of pulses in 4x mode counting the ris ing and falling edges of signal A and signal B 2 x 2 4 to the supervisor Multiplying the number of pulses by K which indicates the distance trav eled for each encoder pulse you can determine the distances traveled by right and left wheels every 10 ms The supervisor combines this traveling information and applies the dead reck oning procedure to determine the robot s position coordinates Xmes Ymes and Mes orientation angle The supervisor receives an
138. net field the nor mal mode current sees essentially zero inductance Com mon mode signals usually caused by electrical noise pro duce fields that don t cancel and therefore encounter an inductance that tends to filter out the noise The two windings each had 4 2 mH of inductance so their series connection was 17 4 mH remember that inductance varies as the square of the number of turns The windings appeared to be 20 AWG copper suited for currents of several amps The ferrite core was a pair of C shapes with a small gap so I assumed saturation wouldn t be a problem with a few hundred milliamps of DC current The scope shot in Figure 3b shows the catastrophic error in that assumption The upper trace actually consists of two overlaid traces the differential voltage measured across R14A B and the output of U1 The lower trace is the base drive signal from ICIC I set the current limits to 50 mA and 300 mA but the current obviously isn t changing linearly The current rises more or less linearly to about 60 mA skyrockets to the 300 mA peak and collapses almost instantly when Q1 switches off Eyeballing the flattest part of the curve roughly the first half of the lower part marked by the cursors where the slope seems to be gop lOmV 0 50 4 25 us Applied through a 17 4 mH inductor that gives a voltage of about 14 V more than a factor of three higher than the 4 V I was carefully using Obviously the inductor isn t wo
139. nfiguration The microcontroller manages the display and backlighting The PIC16F628 s software is posted on the Circuit Cellar FTP site I must point out one thing about the only output signal connected to the open collector phase managing the TR2 which is responsible for transmitting a 3 s pulse dead on sec ond 00 of every hour This signal pulse may occasionally help when connecting an external device to be synchronized with the aid of your SRC decoder Finally note that the circuit includes a voltage regulator A tested FREQ_BIT 2 000 FREQ_BIT 2500 OVERFLOW FREQ_Ok 1 RECOGNIZED FREQ LM7805 voltage regulator supplies an adequate level of stabilization FIRMWARE amp DECODING I consider the software to be the most innovative part of this project As you can see in Figure 4 and Figure 5 the decoding section of the three sample frequencies 1 000 2 000 and 2 500 Hz represents the most inter esting portion of the firmware The READ_FREQ routine is responsible for this activity It can synchronize on the leading edge of the input signal establishing its period lambda If the lambda value is included in an expected frequency range 1 000 2 000 or 2 500 Hz the routine exits and advises which incoming frequency has been recognized The range of lambda values that define the fre quencies to be recognized has been given a 3 margin to avoid errors in the recognition mainly du
140. ng PTG1 XTAL PTG2 EXTAL CLKO RESET PTCO TXD2 PTC1 RXD2 PTC2 SDA1 PTC3 SCL1 PTC4 oO N LOXL OALd LAXY HILd may be scenarios where an analog version still makes sense An obvi ous one is when you re connecting to an MCU that has unused ADC inputs Some applica tions may require higher resolution and are will ing to trade off band width and signal pro cessing MIPS to get it Also an analog part can work stand alone in hardwired applications that don t need an MCU Letting you have it your way Freescale also offers the MMA7361L a part that s similar to the MMA 7456L except it has analog outputs with a healthy 800 mV g swing But it s the digital smarts offset correction and programmable threshold motion freefall and single dual pulse detection that set PTB4 AD1P4 7 2 o gt MC1321x PTB3 AD1P3 PTB2 AD1P2 PTB1 AD1P1 PTBO AD1PO PTD7 TPM2CH4 PTD6 TPM2CH3 PTD5 TPM2CH2 55 54 5 2 51 50 PTD4 TPM2CH1 PTD2 TPM2CH2 ATTN VDD GPIO1 GPIO2 GPIO3 GPIO4 SM Flag opening NC RFIN_P RFIN_M CT_BIAS VDDA Figure 4 The two die System in Package MC15215 looks like a typical SO8 MCU just one that happens to have a complete 2 4 GHz radio built in the MMA7456L apart The pulse detection feature is particularly use ful for user interface applications as the shaken not stirred equivalent of single and double
141. ng the FTDI library to set CBUS2 low putting the chip in Bootstrap mode Normally the CBUS2 pin is tris tated so a pull up forces the chip into normal running mode when the FT232R is initially plugged in Thus only the programming software needs to know about the extra functionality Once in Programming mode the pro gramming utility talks to the bootstrap firmware over the standard serial lines to download the new software into the R8C flash memory It can then raise CBUS2 and reset the R8C to normal running mode Once the R8C is programmed a host side utility talks to the R8C using either the FTDI library or more likely a standard serial port emulation In Linux for example plugging in the pod causes a device like dev ttyUSB2 to be created which can be accessed like any Listing 2 This is a more complex pod application showing how to interact with the host PC and the on chip peripherals main i int period width channel setup_hardware while 1 switch tty_readc case o output bits p2 b tty_readc break case i input bits tty putec p0 b break case a sample ADC channel tty_readc amp 0x03 8 tty_putc read_ade channel break case t timer period tty_readc trbpr period 2 trose period 1 2 break case T timer with width control period tty_readc width tty_readc
142. ns i e Nintendo Wii as well as pardon the pun shaken up existing ones i e Apple iPod Nano shake to shuffle Indeed low g accelerometers have www circuitcellar com CIRCUIT CELLAR a a E x E l EN EEEE HH tit eet ER og e Arccos Ay Arctan Ax Ay 180 Tilt angle degrees come full circle now back on the road in active suspension systems reunited with their high g airbag ancestors I got my feet wet with a first gener ation low g MEMS accelerometer way back in 1995 A Saab Story A Tale of Speed and Acceleration Circuit Cel lar 57 Since then it s been the usual silicon story with the newest genera tion parts such as the Freescale MMA 7456L see Figure 1 offering better specs more features and above all a much lower price just 2 87 in 1 000 unit quantities In the beginning accelerometers measured a single axis X followed Pulse detection time window Latency time window second pulse ignored here Figure 3 Configuring the MMA7456L single and double shake i e pulse detection feature E T 5 S kes S T ae ee OOO yY Y Y Y a a a py A FNA F E a a AOO yF yr SF N Aa N Figure 2 Measuring tilt with a single axis accelerometer is complicated by the fact that sensitivity varies with the tilt angle and is poor at the extreme Using a second axis and a bit of trigonometry sensi tivity is boosted and linearized across the
143. nt 8 bit appetizers to MIPS laden 32 bit entrees Column B is the radio Here you have a choice of standard favorites like ZigBee Wi Fi and IEEE 802 15 4 along with a variety of boutique alternatives Options cover the spec trum from low speed point to point wire replacement to emerging smart dust mesh networks with hundreds or thousands of nodes You can spice up your wireless offering with cellular broadband RFID or GPS for a new and improved taste Finish off with dessert always my favorite part of the meal by choosing a sensor from Column C Or for that matter why not indulge with two or three of them Thanks to the march of silicon your designs can be both less filling and taste great l 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 eee 1 K Tuck AN3461 Tilt Sensing Using Linear Accelerometers Freescale Semiconductor Inc 2007 S OURCE MC13213 MCU and IEEE 802 15 4 Radio MMA7361L accelerometer MMA 7456L accelerometer and ZSTAR3 accelerometer evaluation kit Freescale Semiconductor Inc www freescale com Ny April 2009 Issue 295 ICbank 3 PORT INTERFACE al j i W a F r ify F aa or A F j j RS 485 to Ethernet Converter Powerful feature Protocol converter RS485 between Ethernet Offer TCP IP
144. number of potential errors Immediately after reading the main header HD 1 the following bits are decoded which constitute the first segment in a quick succession one after the other The generic READ BIT routine carries out this activity depending on the preceding READ FREQ for the frequency identification CIRCUIT CELLAR www circuitcellar com RTCC 15 ms Call Read_FREQ Ye FREQ_OK 2 000 REQ_OK 2 500 LAMBDA 0 FREQ 0 LAMBDA 0 FREQ 0 INC Noise Figure 5 This is the READ_BIT routine Bit 2 000 Bit 2 500 No D l NO RECOGNIZED FREQUENCY All of the data which are read in the first segment will be stored and considered all at once after reading the second segment When the 32 bits constituting the segment are avail able there is a final check which consists of testing the control of the odd parity residing in the code every 16 transmitted bits It is useful for auditing the received data After the last check on the first segment the second segment is read with the same procedures and soft ware routine The second segment is made up of 16 bits which is half of the previous one The use of specific routines and the technique based on orderly and recursive calls represents a typical example of a productive way of programming The remaining www circuitcellar com CIRCUIT CELLAR software routines don t show any particularities apart from the
145. ocks With the introduction of the cesium fountain atomic clock in 2 003 the Institute now called The National Institute of Metrological Research INRIM has been at the forefront of time measurement This type of clock has a precision of 10 5 which means a 1 s error in 30 million years pro vided that it would work for such a long time To coordinate the ever increasing amount of data pro duced by the atomic clock equipped labs throughout the world we now refer to the International Bureau of Weights and Measures BIPM in Paris which has calcu lated the time since 1988 using the UTC times of accred ited centers such as the so called International Atomic Time TAI which has become the scientific communi ty s official point of reference for time measurements In this globalized computerized world we cannot ignore the importance of having a universal temporal scale of reference Think about the financial and stock transactions that are quickly transferred through the telecommunication networks and may change their val ues in only seconds Time synchronization is important in everyday life as well If you think I am exaggerating let s go back for a moment to New Year s Day 2000 when a simple time change was supposed to trigger a world www circuitcellar com CIRCUIT CELLAR 0 48 s 00 Second lee eee ends Acoustic reference impulses ID AN SE SI PA 80 40 20 10 8 4 2 1 ULL EEEE 012 3 4 5 6 7
146. ogy at work in demo applica tions such as PDA scrolling or switching a display automatically between portrait and landscape modes There s a Filtered Tilt demo that highlights the ability of some simple signal processing to boost accuracy see Photo 4 Using raw accelerometer data there s a noticeable jitter in the tilt reading on the order of 2 to 3 But all it takes is a little bit of filtering i e moving average to cut the jitter to a fraction of a degree Likewise the Motion tab demonstrates how you can use the threshold feature to give applications longer battery life i e using motion as an on off switch and antitheft security For instance office equip ment could be designed to sound an alarm if it s moved in a suspicious way or at an unusual time The Freefall tab exercises a feature that could prove useful in a variety of Freefall Demo The board looks for Freefall along the X Y and Z axes Freefall Detected Approximate length of Free Fall Length of Fall 4 15cm Time of Fall 92 00ms Higher precisison 120Hz Photo 5 Today the I ve fallen and can t get up lady has to tell someone she s in trouble verbally Err kind of hard to do if you re unconscious Tomorrow an electronic fall detector will make the 911 call for her www circuitcellar com CIRCUIT CELLAR Mormal Filtered i af Ny Tt La A 1 il a Y H me HE y 4
147. on nector and programming the microcontroller through a USB port The paths to and from the UART are multiplexed externally and controlled by the microcontroller I looked for a way to cleanly interrupt the data to the serial to USB chip FT232 so I could replace the USB port with an alternative cargo bay connector onto which the BAM could be connected However this could not be accomplished without wrecking the CM I decided to prototype the idea But when I started thinking about how I might use this I realized that at some point my application would surely exceed the flash memory available no matter the size At that point I sat down and thought about the features that interested me most I came up with three items limitless computing power expand ability and wireless connectivity It looked like even with successful surgery I would accomplish only the wireless feature I was looking for by using the CM My ideal design would not depend on the CM for program storage and execution but merely use the CM as a way to expand the capabilities of the Create i e providing additional sensor capabil ity via SPI PC or other interfaces something the Create s analog and digital I O was not capable of CIRCUIT CELLAR e www circuitcellar com In reality I needed two UARTs With the BAM on one port and the Create on the other port the microcontroller could pass OI commands from one UART to the other Additional com mands O
148. ot iRobot Create Open Interface Specification 2006 www irobot com filelibrary pdfs hrd create Create 200Open 20Interface_v2 pdf eee ATmegal168 Microcontroller Atmel Corp www atmel com Create Mobile programmable robot iRobot www irobot com dsPIC30F4011 DSC Microchip Technology Inc www microchip com Robotics Developer Studio Microsoft Corp http msdn microsoft com en us robotics default aspx RealTerm Terminal emulation software RealTerm http realterm sourceforge net Liberty BASIC Shoptalk Systems www libertybasic com A N AP CIRCUITS As low as 9 95 each Two Boards Two Layers Two Masks One Legend Unmasked boards ship next day www apcircuits com VISA Master ard Paral aaa La oo l ELECTRONICS INDUSTRIES eau CIRCUIT CELLAR www circuitcellar com oe Sigal Transmissions p 40 EL P P uh hs yi GIKGUIT C EMBEDDED PROGR Recipe for a Killer Embedded Application j Time Domain Retlectometry Explained More on Programmable Robotics Solar Data Logger x Design K x on Event Circuit Cellar Digital Plus launch Date March 23 2009 April 30 2009 i CIRCUIT n QY You hold in your hands a ticket to access ARIGI Circuit Cellar magazine s new edition Co Operative Scheduyl co Ba F a iti eS Love e ak e k yl ii me i L A pS 4 TH
149. pplication and the BAM the PIC interface and the Create To support the present OI commands there are four routines that will be used in all applications writing to the serial COM port reading from the serial COM port interpreting each command and interpreting each response The simplest OI command is a single byte command like CmdStart To send OI CmdStart using LB do a gosub CmdStart This routine simply sets d 128 and does a gosub WriteData and then returns It has no response USA 609 323 7568 EUROPE 00 5 58 712 8058 400MHz ATIISAMI260 AT9ISAMIGZO 210mhz 400mhz OSB 2 0 Full Speed HOST and DEVICE Op to 64MB SDRAM Memory Up to 46B NAND Flash Memory Op to 64Mbit DataFlash Memory 12 Connectors 2 pes MicroSD Card Slot Ethernet 10 100Mbit RJ45 Power Supply Alloved 8 35VDC A S c n SPOR o com DESIGNING OF ELECTRONIC DEVICES CNC MACHINING CAD CAM COMPOUND OF ELECTRONIC COMPONENTS DESIGNING AND MANUFACTURING OF PCB CONTRACT 2 7 W 6 E i 3 7 5 7 hi E ra T April 2009 Issue 295 April 2009 Issue 295 Photo 1 l built the Create Commander circuit to the same dimen sions as the CM It fits on the cargo bay connector and provides I O expansion and Bluetooth wireless connectivity A more complicated command like CmdDrive must not only send the command byte d 137 but also
150. priate current limits but I ll leave that as another exercise for the interested reader Pop Quiz design such an interlock Hint a charge pump from a program toggled bit may be helpful Booster Simulation However the firmware can turn Q1 on measure the panel s short circuit current then turn Q1 off before the smoke appears particularly for the low power panels in my collection So that was the plan characterize the panel using the current sink warm up Q2 by running the panel at its MPP and dump its measurements through the USB serial port to the host PC What could possibly go wrong CURRENT SINKHOLE The single biggest mistake I made was attempting to squeeze everything into the same board footprint as the under lying Diecimila microcontroller That size works perfectly well for digital projects as shown by the many Arduino shields but poses problems for two layer analog circuit boards As you can see in Photo 1 the hulking inductor really takes over the board and forces the remaining parts away from their microcontroller connections The natural layout put the solar panel input at the blue ter minal block on one end of the board and the current sink tran sistor on the other forcing return current from R14A B to travel the length of the board past all of the op amps and comparators Although I poured a copper ground plane into all the unused b LLBSO OU 21850 00 3 1V 4 SV 0 005 20 08 Pk 4 STOP ViC
151. r epoxy system 0 32mm larger than IC FA ai f per side jill ea T Hi Bandwidth to 40 GHz e 0 3mm pitch amp up GPS ligbee Pro OEM Modules and USB ZigBee Sticks OEM Modules and USB ZigBee Sticks Mesh Networks Mesh Networks eS a ie Wi Fi RS232 422 485 to Wi Fi Adapter e Connect Data Acquisition Equipment through Serial Port to Wi Fi network Ironwood ELECTRONICS 1 800 404 0204 www ironwoodelectronics com l EMO www lemosint com i 00 343 300 7 INTERNATIONAL sales lemosint com www circuitcellar com CIRCUIT CELLAR O April 2009 Issue 295 jm oO p April 2009 Issue 295 s rat by DJ Delorie Construct a USB GPIO Pod rart 1 No Parallel Port No Problem Unless you ve been in a cave for the past decade you Know that the parallel port has been eclipsed by the USB port In this article DJ describes how to design a general purpose input output GPIO pod that can plug into your USB port Now you will have the flexibility to define the I O you need have been fiddling with electronics since before the arrival of the PC In the early 1980s it was easy to add custom electronics to a computer The S100 and ISA busses were easy enough to interface with but for ease of hook up nothing beat the parallel port with 13 output pins and five input pins which was directly addressable in software and TTL compatible These days it s gettin
152. r results than classic packages however I don t know if there are good SMT equivalents for the 2N2369 You may design a custom SMT PCB for the gen erator But on my side I used an unusual assembly tech nique which I don t recommend for more complex designs or for trembling engineers Let s call it the flying SMT technique or FST see Photo 1 The idea is to use SMT components for all passives and to solder them directly to the 2N2 369 leads It works well but it is a lit tle annoying to build because these nasty SMTs don t want to stay where you ve soldered them It worked for Fig 250 raldi Aulo 390V SO0kKh 200GRslidge Posie i j0pe Ae I me 1A 15 70 ng Gal MHI Photo 5 When a TDR is connected to an open ended transmission line there is a positive reflected pulse The amplitude of the reflected pulse is equal to the incident pulse but here the resistive three way splitter induces a 6 dB loss Thus the voltage is theoretically divided by two here a little more due to additional losses CIRCUIT CELLAR www circuitcellar com mr ty Prgjects Transmission 4 Terrrinal Line Transmission Lir T Conant Tested Fair Comdal Line RAO O te aS Ohn omponments Substrate hMicrostnp Line oF er e ay Louped Microstrip i Microsiip Comer Tiz0 Line T2 0 8ns a gt Microsiip Wicrosmip hat ee R 17 Ohm J3FFF FEF Line ci Une2 250 Ohm Cazt pr 550 Ohm L 1000mm L 100 mm
153. rdinates Right mouse click for more consistent Windows UI User definable attributes for parts Schematic sheet management Hiding approved DRC and ERC errors PRINT preview and text searchable PDF output Improved search engine for help And much much more Light Standard Max number of 1 99 schematic sheets Max board size 4x3 2 inch 6 4x4 inch Max of signal layers 2 4 Layout or Schematic Editor 249 Layout and Schematic Editor Layout Editor and Autorouter Layout Editor and Schematic Editor and Autorouter 498 498 747 Cadsoft Computer Inc EAGLE Version 5 Schematic Capture Board Layout Autorouter ndows Linux Mac re at aa 7 Wi i Bss Gp ee Professional 999 standard and Light Editions have full functionality except 64x64 inch for the limitations mentioned 16 in the table 498 You can use EAGLE Light for evaluation and non commercial applications without charge Download it from our web site 996 996 1494 800 858 8355 194620 Pines Bivd Suite 217 Pembroke Pines FL 33029 April 2009 Issue 295 o gt m April 2009 Issue 295 Slave 0 Slave 1 Master Tx Rx MCU SMAC Interrupts ZStar3 RF Protocol typical period Figure 5 One advantage of centralized i e hub network control is the ability to schedule activity efficiently Each ZSTAR3 node sched ules radio activity i e transmit receive windows
154. ril 2009 Issue 295 m mJ m QO April 2009 Issue 295 SpectraPLUS 5 0 Audio Spectrum Analysis Features Sound Card based I O FFT sizes to 1048576pts 1 96 Octave Up to 24 bit 200kHz sampling rates 3 D Surface and Spectrogram Digital Filtering Signal Generation THD IMD SNR Transfer Functions DDE Macros Data Logging Vibration Analysis Acoustic Tools FREE 30 day trial www spectraplus com Pioneer Hill Software PH S 360 697 3472 voice pioneer telebyte com ARM7 MODULAR TOOLSET Add support for Atmel NXP or STMicro ARM7 variants to Base Package to suit your requirements and budget O C C a Code Wizards a Debugging a Simulation Advanced software tools since 1984 www crossware com info crossware com Tools for Embedded Development Order online at www melabs com USB Programmer for PIC MCUs 7 RoHS Compliant Programs PIC MCUs incluain low voltage 3 3 devices 89 95 Ineludes Software for Windows 98 With Accessories for 119 95 Ade 2k 2 XP Includes Programmer Software USB Cable and Programming Adapter far amp to 40 nin DIP Serial LCDs 2 line x 16 39 95 4 line x 20 49 95 Quantity Discounts Available a i RIGOL W nKC ELECTRONICS Bayond Meas 7 Rigol Technologies DS1000E series Up to 1GSa s and 1Meg memory SOMHz and LOOMHz models TFT LCD USB Advanced triggering Edge Pulse Video Slope Alt
155. rking nearly as well as I expected Oops My February 2008 column described how to measure transformer core characteristics and that technique works equally well for chokes and inductors Transformers Cir cuit Cellar 211 I set that circuit up again and found that the CIRCUIT CELLAR e www circuitcellar com I choke core began saturating at about 8 kG roughly what you d expect for ungapped ferrite Evidently that gap was much smaller than the visible line led me to believe The test setup showed that a mere 50 mA through both windings in series pushed the core into saturation which roughly agrees with Figure 3 and shows that the choke is completely useless for this application In retrospect none of this is surprising In its original application the choke windings must support the expected load current but equal current in the opposed windings pro duces no net magnetic flux in the core The only common mode current comes from line noise but most applications shouldn t see that much CM signal in the first place Finally a ferrite core provides useful inductance at much higher fre quencies than laminated silicon steel and doesn t need an explicit gap for this application As an interesting sidelight the MAX4372T high side cur rent amplifier has a 3 dB bandwidth of about 275 kHz That would suffice for the original design with its relatively slow ramps but falls behind the core flux collapse when Q1 switches off a
156. rtable system designers to better man age energy consumption by precisely allocating power for a given system function and reserving unused power for other uses The ADXL345 also measures dynamic JTAG J Link acceleration resulting from motion or shock and with a 10 000 g shock rating is a SEGGER gt well suited for applications such as hard disk drive protection in personal comput USB to JTAG ers Featuring resolution Fast 720kb s Download Speed of 4 md LSB across all q ranges single tap and ADXL345 Digital 1MEMS Motion Sensor Serial Wire Debug SWD Support a Multicore Debugging Support Auto JTAG Speed Recognition The J Link can be coupled with a number of available software modules to fit your application needs J Flash is a stand alone application double tap detection activity and inactivity detection free fall detec tion and user programma Ultra low power 25 to 130 pA used with the J Link to program ble threshold levels the Up to 13 bit resolution internal and external flash devices new accelerometer also 3 Link RDI permits the use of the 32 level output data FIFO J Link with an RDI compliant i 2 E D eee ane SPI and C digital interfaces Le depuuuer and four wire SPI digital a Ta J Link GDB Server is a remote interfaces and a voltage gt server for GDB range of 1 8 to 5 6 V The ADALS45 comes in a small thin 14 lead LFCSP It costs 3 04 in 1 000 un
157. rtune magazines two biggies on my parking lot reading list US News and PC Magazine have gone digital Should I take this as a sign that it is a brave new world or that I m just the last of a dying breed A lot has been written lately about the reasons Dan Costa a columnist for PC Magazine wrote an editorial titled Print is Dead Long Live Print 12 11 08 He explained that ceasing the print magazine after 27 years was inevitable and necessary Besides the economic pressures he suggested that because anyone can publish these days true but that doesn t mean it s quality article content printed magazines are an environmental nightmare and all these computers aren t Dan that print delayed news and product reviews can t compete with a real time web true if that s what you are looking for that traditional print publishing is dead The real epiphany in the editorial was his conclusion about the other side of the coin Print businesses aren t dead They just need to change Printing should be reserved for archival information artifacts you ll hold onto for years instead of hours or days Thank you Dan Costa and welcome to our world Unlike newspapers and trade journals Circuit Cellar content is not time critical and our readers aren t conventional Rather than read Circuit Cellar and then give it to someone else our readers hoard every issue and archive them for years The chips may have evolved since an application
158. s shown by that perfect straight line declining at about 12 kA s from the peak Although the booster circuit did work sort of it s certain ly not operating according to the original design CONTACT RELEASE You can generally recover from one blunder and a few minor goofs on a prototype circuit layout but two big ones We add value to PCBs when others just sell it ments 3 Mriyi aby piny ADi Ly Consumit www EzPCB com I www circuitcellar com_ CIRCUIT CELLAR means it s time for another revision With better power sup plies a different layout and a beefier inductor I ll be able to talk about what works rather than what didn t All that sounds remarkably like a plan though We shall see Fd Nisley is an EE and author in Poughkeepsie NY Contact him at ed nisley ieee org with Circuit Cellar in the subject to avoid spam filters PROJECT FILES RESOURCES Arduino project http arduino cc E Nisley Transformers Circuit Cellar 211 2008 SOURCES Gnuplot Plotting utility Gnuplot www gnuplot info LTspice IV Design simulator Linear Technology Corp www linear com designtools software Itspice jsp Arduino Diecimila Microcontroller SparkFun Electronics www sparkfun com commerce product _ info php products_id 666 l Prototype ay Prod uction Designing Service sure Designing Virtuel Assembly PCB Design NENES Keypads Email sales ezneb
159. se This pro vides an indication of dead reckoning and you get to see how it relates to the Create s actual position over time The Power items monitor power consumption The Sensors checkboxes show when a sensor changes states For debugging purposes I use a separate debugging window in which I can print the receipt of sensor data as received This window can also hold any computational information that would help with the application program s debugging process Liberty BASIC has its own debugging resource which is a useful feature RDS Microsoft Robotics Developer Studio RDS 2008 is a Windows based environment for hobbyists academics and commercial developers for creating robotics applications with a Expand Your I O with Rabbit RIO Versatile Device with I O Options Sy Add functionality without costly processor changes Mi Progr ammas 10 Rit Multiple Processor Interfaces Add 38 1 0 Configure I O for PWM TRIAC input capture or decoder Rabbit RIO Programmable 1 0 Application Kit for 5299 DABEI eaae AA April 2009 Issue 295 Oo w variety of hardware platforms It includes a lightweight REST style service oriented runtime In addition it has a set of visu al authoring and simulation tools as well as tutorials and sam ple code to help you get started I mention this because the Create is one of the presently supported robotic platforms The idea behind RDS is to ena
160. shipping mawee a en 4 J S zk A Impedance e Control DR ESE logistics We do it all for you ee 5 E Plated Edge Holes and deliver door to door Up to 6oz Copper 6 mil Laser rill a i l 9 i ar 2 i P 2 Significant Price Saving ii E a S ewe SET a Conauctive Epoxy alea Mas 7 lh T ll A et Gore Our global buying power c wy JZ N AUmINUMm ue Tal OTe ice and many with the capabili oi oF Our overseas ITAR Iso O 9001 manufacturers translate into tremendous savings to our customers iis iise Y Over the past 5 years 70 000 ages have been successfully delivered from overseas iS Over 5000 customers MS 847 806 0003 works AEK com email sales PCBnet com 23 YEARS IN BUSINESS AND STILL GOING STRONG Embedded Single Board Computers High End Performance with Embedded Ruggedness TS 7800 500 MHz ARM9 Low power 4W 5V 128MB DDR RAM 512MB high speed 17MB sec onboard Flash oc 12K LUT programmable FPGA aon Alii A e XY gt 7 lt lt R Internal PCI Bus PC 104 connector a fe a 2 host USB 2 0 480 Mbps Gigabit ethernet a 2 SD sockets 10 serial ports a 110 GPIO 5 ADC 10 bit a 2 SATA ports Sleep mode uses 200 microamps and backward compatible with TS 72xx Boots Linux in lt 2 seconds Linux 2 6 and Debian by default Low Price Low Power High Reliability using Linux development tools 200 MHz ARMY Power as low as 1 4 Watt TS 7200 8 boards ov
161. signal from U4 in the mid dle trace The actual voltage across R12A B in the top trace however wears some fur throughout its entire range Switching to peak detect mode reveals over 50 mV of noise on the signal That noise turns out to be high frequen cy digital hash from the microcontroller that s entirely unre lated to its PWM outputs Much the same noise appears on the other two traces where it s barely visible as a slight thickening at 1 V div Isolating digital and analog circuitry on a single board requires careful attention to power distribution and ground ing The Arduino Diecimila 5 V regulator supplies power to both the ATmegal68 chip and the analog circuitry with ground return paths through only three pins in the pin head er strips Although the Diecimila board has plenty of gridded areas its compact layout chops up the ground connections My layout didn t fare much better While I managed a broader connection between the ground pins on each side of the board that lower impedance simply routed more digital hash from the Arduino board through my circuitry My revised layout will use a somewhat larger board that puts the relatively high current areas outside the Diecimila footprint and the relatively delicate circuitry in a separate ground area Ill also regulate 9 and 5 V supplies from a wall wart transformer with a single point ground connection to the Arduino That should reduce much of the hash and stabi lize
162. significant a ef dge and Patterr Triggers n all models aneren a Advanced Mog al also includes Range ETE b lt beT i i l P lt anc St ab IG Me ater E with Las r Duration ang 4 flexible cascadable sequencers with pass counters L oF E ittern Searches with Match amp Duration specialized Sequential Searches YE Serial and State Mode Signals Display PC Synchronous SPI Asynchronous RS 232 State Boolean Bus and Analog Data Single or Dual Waveform Views Re f solutior Zoo om r W Va ave ALC WS Sp ecia ized E Xp sorts trom Date Tables and List Views Multi Signal Data Tables Drag amp Snap Markers Click to Center function Snap Previous Next function Print or Save Images with comments USB 2 0 480 Mbps USB 1 1 compatible 12 Mbps See our Memory Emulators from 179 0 UitechiTools www tech tools cor 212 27 12 EXE p sales tech tools com i tH Very Flexible easy to configure Advanced triggering PICmicro MCU Programmer 3 Multi Function In Ci Taty amp C ane Operatior Ne f QuickWriter An entire community under one hat With eight 32 bit processors in one chip and deterministic control over the entire system the Propeller microcontroller is just plain inspiring With our free online community support and resources progress is only a click away http obex parallax
163. t 1 PCB Layout Inductor Saturation and Other Troubles Fd Nisely THE DARKER SIDE Time Domain Reflectometry TASK MANAGER AL Detect and Measure Impedance Mismatches Troubleshooters Unite Robert Lacoste C J Abate ia as Programmable Robotics Part 2 y y Application Development CROSSWORD 4 4 aaa INDEX OF ADVERTISERS 4 SILICON UPDATE May Preview ZSTAR Trek PRIORITY INTERRUPT S O A Healthy Mix of MCUs Sensors and Wireless Technolagy Print Is Dead tLong Live Print Tom Cantrell Steve Ciarcia CIRCUIT CELLAR www circuitcellar com 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 develooment 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 we 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 techn
164. t with a parasitic 22 pF parallel capacitor to ground at the middle I switched on the oscilloscope and pulse generator and voila I got what you see in Photo 8a Comparing it with the theoretical shape for parallel capacitors Photo 6 shows that the overall shape is similar with a first negative pulse then a smaller positive one There are other small pops probably due to other imped ance mismatches i e far from perfect ground con nection of the capacitor nonideal capacitor and non ideal connectors and more But once again the overall shape is similar Do you want another test This time I hooked the same capacitor in series with the line just by cutting 1 mm or so out of the microstrip and soldering the 22 pF capacitor across the gap The result is Photo 8b Once again it is similar to the theoretical shape for a series capacitor but with additional bumps in par ticular at the beginning of the pulse Another interesting use of TDR techniques is the evaluation of the performances of connectors in par ticular at high frequencies TDR will easily show you defective or any less than ideal connectors I performed a simple test by hooking a good 50 O load at the end of a test 50 Q cable Theoretically a 50 Q load shouldn t reflect anything But because the load and the SMA connectors were not 100 per fect there was a small reflected pulse I increased X April 2009 Issue 295 Parallel R o N Measure V
165. ta Electronics North America www murata com COMPACT FANLESS COMPUTER IN AN INDUSTRIAL GRADE ENCLOSURE ALA The PL 60590 is a compact fanless appliance in a rugged compact aluminum microcontroller chassis 8 7 W x 8 5 D x 3 5 H The small device is designed for kiosk digital Signage vehicle gamind entertainment and industrial automation applications The Solder Paste Stencils enclosure is sealed from environmental intrusion and is designed for antivibration for high reliability Use our low cost D2 The scalable unit is powered by a choice of Intel Core 2 Duo Core Duo Celeron Bana aae M processors supported by Intel 945GME and ICH 7R chipsets The Intel 905GME chipset supports dual independent displays with CRT DVI and 24 bit LVDS technol ogy An Intel 82575L Ethernet controller provides support for two GbE LAN ports FRG EE es The robust unit features four COM ports six USB 2 0 ports dual GbE VGA a ss i Se aa a ae PS 2 port and one MIO module that can be used for the expansion of I O functions The unit supports a 2 5 hard disk for high capacity storage and one DDRII 533 667 A DIMM socket for up to 2 GB system memory The RoHS compliant product is cur rently available Unit pricing for the PL 60590 begins at 448 in OEM quantities Linux Windows Embedded XP and FreeBSD are supported programming connector 20 MHz clock THEE WIN Enterprises Inc www win ent com x r F rile 29
166. tack initialize memory program timers and more All of the support files needed for this board are posted on the Cir cuit Cellar FTP site I won t cover them further in this arti cle but assume that each pro gram I cover here needs to be linked with the BSP files My first pod program is in Listing 1 First I had to compile this from source format into a bina ry format that my programming tool would understand I used the freely available GNU toolchain specifically GNU s GCC and Binutils and Red Hat s Newlib because it runs on Linux my platform of choice Instructions for obtaining and building the GNU tool chain for the M32C family posted on the Circuit Cellar FTP site Each tool s name is prefixed with m32c elf to Industrial Computing PCI and PC 104 Serial Solutions Provide 1 2 4 8 and 16 Port Models RS 232 RS 422 and RS 485 Interfaces Data Rates to 921 6K bps 128 Byte FIFOs for Error Free Communication Design Control and Long Term Availability Extended Temperature Versions FOCUS On Success Cal Today 7 h indicate that it s for cross compiling to the M32C family and produces ELF format binaries which is the most popular embedded file format these days The Makefile posted on the Cir cuit Cellar FTP site uses m32c elf gcc to build the blinky c into blinky elf The programming tool is called uflash for US
167. teensy PCB antennas see Photo 3 General Sensor Tasks start with calibration i e zeroing out XYZ off sets while the sensor is motionless BE rsTan3 a E BE Overview and Control General SensorTeskes WF TH Motion fd Eroehsl E Shock Digital ESL Links Semana Mertala Freer all Detect Indertece Digtal IC AN are 25TANI DA PortNum MMATASGL YArs uE a on Raw 43 Tik 45 7 aa RS a RSSI Raal U btg Til 14 7 r USE Marui mde i kal i Raw 38 Tilt 38 97 anani Raal 0 60g DSE G coa 7 Saje t ys pranm Data Aate MHz scale Raw 19 Real 0 30g pueeactl Lig ataf ata OH Log Filo Enable iz Lon Ont Falis sf m y E Mr ON F E wE amp P b i e e i USER 0 360 Kbpe USE Te O08 Kbps Selected Sensor 0 MMASAbel Active Sensas Gounl 1 te Bolla aM Vy start Chw Photo 2 The Z5TARS evaluation kit s PC GUI software provides a complete set of MMA7450L hardware utilities and demo applications CIRCUIT CELLAR e www circuitcellar com RSSI Sensor 0 Photo 3 Range for low cost 2 4 GHz radios using passive PCB trace antennas can be limited Even the device s packaging e g batteries can block the signal The ZSTARS RSSI utility makes it easy to monitor signal strength in real time and experiment with installation specific alternatives ability to log data to an Excel file The Tilt tab demonstrates the technol
168. the panel s output over the course of several days and then com pare the results to his manually collected data Unfortunately he experienced some prob lems Read on to learn why you should always have a proper sized board teve Ciarcia s fundamental requirement for my columns right from the first issue has always been that the projects must work If I didn t build it and verity the results I couldn t write about it With that in mind the plan for this column started simply enough build a data collection board that could automatically characterize a solar panel record the panel s output over the course of several days then compare the results to my manu ally collected data Along the way I would describe the ana log circuit problems that come with low level measurements near digital circuitry As Publius Syrus put it back in the day Homo semper aliud fortuna aliud cogitat which my atrophied Latin trans lates as Man always has intentions but Fortune intends oth erwise The Yiddish equivalent has more punch If you want to make God laugh tell Him your plans Basically the board I designed not only didn t work it resisted some protracted debugging Rather than bluff my way through I ll begin by describing what I wanted to accomplish then explore what went wrong You ll certainly learn some thing along the way perhaps what you shouldn t do in similar circumstances In my next colum
169. the reflect ed signal is positive If you have a step generator rather than a pulse genera tor the reflected signal will add to the incident signal and will double its amplitude as both have the same sign This is normal because the voltage on an open ended 50 Q generator is twice its voltage when loaded with a matched 50 Q load LET S SIMULATE IT Before going on the test bench or even in the field with your basic TDR system it is nice to have a list of reflected pulse shapes for the different usual impedance mismatches increase or decrease of the resistive impedance parallel or series parasitic capacitor or inductance and more I could have built a dozen different test benches and measured the actual behavior but using simulation is a wonderful time saving tool The only issue is that a classic analog linear simulator like Spice can t easily han dle line length effects so it isn t appropriate to simulate TDR effects Fortunately you can use the free Quite Uni versal Circuit Simulator QUCS which I used in a previous column The QUCS simulation of a parasitic par allel capacitor in the middle of a transmission line is shown in Photo 6 When a pulse is applied to a capaci tor this component first behaves as a short circuit giv ing a negative reflected pulse similar to a short circuited line Then the capacitor slowly loads and the reflected April 2009 Issue 295 Nn ee pu
170. thium battery is included which typically allows up to one full year of logging The USB 502 LCD logger is supported by the USB 500 Series Data Logging Applica tion software included with the package This user friendly intuitive software is used initially to configure the logger and program alarm thresholds logging rates start times measurement units and more When the logger is retrieved from the field the soft ware provides simple one click access to download display and export the data The data can also be downloaded to a text or a CSV file The software and data loggers are compatible with Windows 2000 KP Vista The USB 502 LCD sells for 97 Measurement Computing Corp www measurementcomputing com NEW PRODUCT News Edited by John Gorsky 00 April 2009 Issue 295 CIRCUIT CELLAR www circuitcellar com POWER EFFICIENT MEMS MOTION SENSOR The ADAL345 three axis digital MEMS accelerometer is the lowest power device in its class achieving an 80 power savings compared to competing three axis inertial sensors The ADALS45 also incorporates an on chip ADC that dramatically reduces power consumption requirements in wireless handsets personal navigation devices and other mobile applications The ADALS45 ultra low power digital accelerometer has an output data range that scales from 0 1 Hz to 5 2 kHz unlike competing devices that have fixed 100 H2z 400 Hz or 1 kHz data rates This enables po
171. tilt angle range later with dual axis XY versions It is not surprising that the latest and greatest like the MMA7456L have upped the ante with full three axis KYZ capability Remember that even appli cations that can get by with a single or dual axis part can take advantage of an extra axis to enhance features relia bility and ease of use For instance in A Saab Story I described how I used the accelerome ter as the basis for a time speed dis tance display i e using time and acceleration to calculate speed and distance But the gadget would work only on a reasonably level road lest a change in the Z axis orientation be falsely interpreted as acceleration in the X axis Traveling at a fixed speed going up hill would appear faster and downhill slower than on a level road With a Z axis I could have dynami cally compensated the speed calcula tions based on the pitch i e heading Pulse detection time window for second pulse Time window greater than 0 for two pulse detect Note there is up toa 1 6 ms delay on the interrupt signal is simply a matter of setting up registers that define the threshold and timing April 2009 Issue 295 mJ Q 0 o April 2009 Issue 295 up or down hill information Another more is better situa tion is using an accelerometer as an inclinometer to measure tilt as in the electronic levels you ll find in the tool depart ment these
172. tor grabbed on a 1 G z digital oscilloscope The pulse rise time is measured at 244 ps far below the oscilloscope s specified rise time The pulse width is less than 0 5 ns in this wire Because the signal must go back and forth you will need to be able to manage I ns signals to get a 12 cm distance resolution There are two issues oscilloscope and generator As for the oscilloscope I can t help you Of course if you just need to locate a problem within tens of meters a low cost 50 MHz oscilloscope will be fine But if you need to work with tens of centimeters you will need a high end oscillo scope 500 MHz or even 1 GHz or more If you have a tight budget look for an old Tektronix 7000 series on the Internet As for the generator I can help you build a high speed sub nanosecond pulse generator for less than 5 As you can see in Figure 2 it can t be simpler right Well I must admit that I had to read it twice when I first saw this con cept in an old National Semiconductor application note It is quite unusual to see a transistor with a grounded base generating anything and ultra high speed pulses in partic ular K1 is simply a DC AC high voltage converter the 50 Q2 splitter an old Greenpar model in this case One output of the splitter on the bottom is connected to the oscilloscope through a 50 Q coaxial cable The other drives the system under test which is a simple 1 5 m unterminated SMA cable
173. well Internal OSC Clock gen X cs S lt SDO ROC 8PI X 12C xX SDA SDI SDO XK SCL SPC NZ E X lt INT1 DRDY Control logic interface X INT2 Figure 1 Add some e motion to your designs with a Freescale Semiconductor MMA7456L smart three axis low g MEMS accelerometer CIRCUIT CELLAR www circuitcellar com Tilt sensitivity and change in angle TULL P E O 0 Ke fe gt 2 D c 2 ke Thanks to these high integration easy to use MCUs and sensors wiring up a new design is simple It s even simpler if you skip the wiring part altogether by taking advantage of low cost radio chips that are proliferating like bunnies Combine all three ingredients and you can cook up an endless variety of innovative embedded applications This month let s take a look at an excellent example of the trend cour tesy of Freescale Semiconductor Read on and I think you ll agree that mix ing MCUs sensors and wireless together seasoned with a healthy dash of designer creativity is the recipe for success XYZ Tust ask the Axis He knows every thing The Jimi Hendrix Experience Bold as Love Axis Bold as Love MCA Records 1968 There is no better example of It s the sensors stupid than the MEMS accelerometer From their humble high g airbag roots low g accelerome ters have emerged to single handedly enable vast new applicatio
174. wired TCP IP Ethernet chip and interfaces to the Hydra using SPI The Hydra allows designers to develop games graphics and media applica tions with the Propeller Dowered game console The Hydra EtherX card comes with a complete eBook describing how the sample Ether card driver works from the ground up The manual covers SPI Ethernet and Inter net protocols IP TCP and UDP With this Knowledge designers will be able to write their own drivers for the W5100 or expand on the previously written sample driver The Software driver includes an easy to use API with K z a Development source code examples tutorials and detailed explanations You can use the An ARM Company The Leader in Microcontroller Development Solutions CIC Development Kit including ULINK Adapter best in class compilers genuine Keil for target debugging uVision and royalty free RTX RTOS and Flash programming Keil RTOS and Middleware components are specifically optimized for embedded systems and include TCP IP Flash File system USB and CAN support Call 1 800 348 8051 for a free demo CD Tools Ether card to turn the Hydra into a web server access a file server or play games over the Internet The Hydra EtherX Card costs 59 99 The Hydra Game Development kit costs 199 99 Parallax Inc www pa rallax com Out of the box support for more than 1 400 Microcontroller devic
175. y in the propagation that cannot always be defined and that is often similar to other systems transmit ting the hourly signal see Photo 2 However the sources of informa tion contained in the SRC RAI coded and received signal are exact Therefore you can use them as a point of reference Let s move on to the electric dia gram It is separated into two differ ent sections The first part hinges on the analog integrated circuit LM311 a classic single supply comparator which surrounded by a few passive components starts processing the input analog signal This entire first phase basically supplies a TTL squar ing of the signal to send it directly to the microcontroller which handles the entire decoding process The core is a Microchip Technolo gy s PIC16F628A microcontroller Compared to the well known PIC16F84 this microcontroller has 2 KB of program memory and more independent timer registers which can be used for programming The PIC16F628A han dles numerous tasks it reads the header decodes the input TTL signal manages the display including the display light and drives the open collector synchro nization output Many previous FSK sig nal decoder designs used a selective circuit as an A D inter face that is an integrated circuit e g LM567 based on a PLL sample frequency which literally captured the allocated frequency Once the sample frequency was found in the signal these dev
176. ystems USB COM Quantum Small 2 2 x 2 2 lowest cost NET Compact economical smart OLED with Simultaneously transmit composite 9p 9p or 25p 25p self pwrd Add 1 16 COMports via your Quickly add capacitive touch Micro Framework dev system fi graphics drive from USB or RS232 video and stereo audio signals f isolated RS232 RS422 485 PC s USB Port easily on off amp X Y sensing ICs me of our best selling unique 7 H anny wireless boards Leo ting security dongles video E y S DSP filters PLCs Remote A www saelig com often for s N April 2009 Issue 295 areas and stitched the top and bottom planes together the effective resistance was high enough to induce offset and feedback voltages where they did the most damage I added a husky 16 AWG shunt wire directly from the resistors to the terminal block that somewhat reduced the problem Despite that I simply couldn t stabilize the current sink op amps which continued to oscillate regardless of their compensation I finally switched to LM324 op amps which have a much lower gain bandwidth product and moved the whole assembly to a solderless breadboard Surprisingly it worked fine regardless of my usual dislike of that method of construction The oscilloscope screenshot in Figure 2a shows the current sink in operation The low pass filtered PWM signal in the bottom trace ramps from 0 to 3 V which is precisely matched by the current feedback

Download Pdf Manuals

image

Related Search

Related Contents

  BroadSoft Partner Configuration Guide Yealink SIP    Milwaukee 2470-20 Use and Care Manual  PDFファイル - 医薬品医療機器総合機構  NEC LCD6520P-BK-AV User's Manual  ADC® Otoscope / Ophthalmoscope Instrument Set  es_bis50    FICHA TECNICA DE SEGURIDAD  

Copyright © All rights reserved.
Failed to retrieve file