Home

INTERNET & CONNECTIVITY

image

Contents

1. E _ I i PVR gu NevorkDisply B Scanner RAD Es Electronic Scale Reader pm lt CEES STB elii a P Qu SK Aw g Internet Printer K lt 2S E Automation E iU LED Display Air Conditioner E CUETE Access conii Serial GPIO ZigBee to Ethernet Metering E Parallel to Ethernet USB to Ethernet Ethernet Gateway Dongle DVR Network p WIZn et www wiznet co kr dows visit http winavr sourceforge net download html The firmware for the Internet pass word manager requires the installation of avr gcc and avr libc a C library for the ATmegal68 Before downloading the firmware it is necessary to config ure the device for an external crystal by programming the device fuses accordingly All the software has been developed in a modular and hierarchical way in C language so maintenance and improvements are fairly simple to do see Figure 5 A description of the modules and the functions included in every module is posted on the Circuit Cellar FTP site PROTECT YOURSELF The need for Internet security has increased dramatically due to a variety of fraudulent activities such as identi ty theft phishing attacks and so on My handy device allows you to pro tect valuable information and it gives you the security needed to perform transactions online successfully T double sided pth 2 Days You have learned how to enter alphanumeric information with a multiplex
2. Down Across CERE 2 A bright glow in the sky caused by the interaction 1 A small keyboard often containing just numeric keys between the Earth s magnetic field and charged parti and a few symbols cles from the sun 4 Released in 1982 the breadbox shaped PC used a 1 02 MHz 3 A poor design that is often hastily put together processor u m l 5 The American physicist 1855 1938 who discovered 6 A measure of the ability of a circuit to increase the the potential difference on opposite sides of an electri power or voltage e cal conductor where an electric current is flowing An 10 Someone who posts chronological electronic journal effect an element a voltage and a resistance are entries of their thoughts A dcl after him 12 A composite made by combining two different elements 7 A recently released multimedia device that incorpo 13 An electronic device that decreases the amplitude or rates an Internet enabled phone and an MP3 player PANE Tao vaian Lietoving i waveform 8 A large computer that has vast computational power 15 A social networking site that was originally developed fon cdita applications for college students l 9 An agreed set of rules on the transmission of data 17 A process used in calculations or logical operations E UO T that is applied to data l l 11 A computer virus that actively seeks out an antivirus 18 Software that converts data being sent to it or received program and attacks it from it into the require
3. Command Separator bes Start of command character Figure 1 A typical command format using only numerical data CIRCUIT CELLAR Line feed that can perform MP3 decompression interface to a memory card SD type I think interface to the Internet and run the uC OS real time operating system So I settled on Freescale Semiconduc tor s NNDK MOD5234 KIT There are several to choose from You can also start with the Freescale CPU if you ve got the resources to build your own boards It s available in a ball grid array BGA package that must be sol dered onto a PCB Freescale has other evaluation boards available and they even list the NetBurner products The MOD5234 has a Coldfire CPU with 147 MHz 2 MB of flash memory 8 MB of SDRAM and an Ethernet interface This is almost 150 million operations per second MIPS The NNDK kit contains a baseboard that has RS 232 485 interfaces a real time clock a power supply a prototype area and displays I m feeling my way through this description since I just received that unit last week Check out the web site for all the detailed information that comes with the kit I ve left off listing all the software that comes with the kit As we go through this next series of articles all the available Netburner software should be covered GETTING STARTED What s the plan I would like to get this board up and running using a serial port interface I have not made up
4. N 32 145 3 6 us you must choose any Vector power 16 2N N 32 80 2 us peripheral interrupt to be Proportional integral derivative PID 30 N 1 30 0 75 us either a CPU or a DMA C number of columns N number of samples M number of taps S number of sections R number of rows request A DMA request Complex FFT routine inherently prevents overflow Table 2 This table will give you a feel for the execution times you can expect when using the DSP algorithm library The PID function is the latest to be included in this free library 78 Issue 204 July 2007 CIRCUIT CELLAR will be arbitrated with any other coincident requests If the channel www circuitcellar com wins the transfer will be completed dur ing the next cycle The DMA controller retrieves the source and destination addresses from the active channel s reg isters DXAxSTA DMAxSTB and DMAxPAD Block transfers are also supported When the transfer counter reaches a user defined limit a CPU interrupt can be initiated to signal the CPU to process the newly received data The CPU and DMA controller may simultaneously read or read write to any dual port SRAM or DMA ready periph eral data register The only conflict occurs when the CPU and DMA con troller simultaneously write to the same address The CPU write will win and a DMA fault trap exception will be ini tiated If the DMA controller writes
5. Reads s i ze gt bytes of data from the current file OPW name Opens file lt name gt for writing with WRF WRF size Writes s i ze gt bytes of data to the end of the current open file CLF name Closes file lt n ame gt for writing DLF name This will delete the file from the current directory and free up disk space VPF lt name gt Plays an MP3 file Sends file to SPI then returns REN lt n1 gt lt n2 gt Renames a file or directory Management commands n6 Switch to the short command set ECS Switch to the extended command set IPA Input data values in ASCII IPH Input data values in Hex SUD Suspend the disk when not in use to conserve power The disk will be woken up auto matically when a disk command is sent to it WKD Wake disk and do not put it into suspend when not in use SUM Suspend monitor and stop clocks FWV Get firmware versions FS Returns free space in bytes on disk Table 1 Some of the monitor s DOS like disk and management commands are shown in this table Additional commands that manage devices attached to the other USB port not used in my examples are listed in the firmware guide available at www vinculum com 60 Issue 204 July 2007 CIRCUIT CELLAR Photo 2 Take a look at a Vinculum development board interconnecting a USB to serial cable with a flash memory drive In this confi
6. The FIN212AC costs 1 49 BGA and 1 30 MLP Fairchild Semiconductor Corp www fairchildsemi com www circuitcellar com TILT SWITCH BOOSTS SENSI TIVITY TO SMALL CHANGES The DSAO0I is a new combina tion tilt sensor switch The DSAO0I which is triggered when tilted beyond 10 of the horizontal brings unique sensitivity to small angle changes Engineered to replace mercury and pendulum switches the DSAO1 is environmentally friendly and contains no mercury In addition the switch features a sealed body construction that ensures high con tact reliability The switch is cylindrical meas uring 29 3 mm in length and with a diameter of 11 5 mm An optional PCB adaptor is available to simplify the assembly The PCB adaptor eases mounting by securely hous ing the DSAOI The DSAOI tilt switch is a sin gle pole single throw maintained circuit It has an On angle range of 10 to 170 and an Off range of 190 to 350 allowing 500 ms of settling time between states The resistive load is 0 1 A at 12 VDC The mechanical life and electrical life are rated at 100 000 operations minimum The DSAO0I housing is construct ed of PBT material Rubber rings are nitrile butadiene rubber The contact balls and terminals are brass with nickel plating The oper ating temperature range is 10 to 70 C The switch is rated to with stand 90 humidity for 96 h at 40 C NKK Switches www nkkswitches com www circuit
7. The WIZ100SR and WIZ110SR are less than 20 The WIZ200USB costs less than 25 The WIZ800MJ costs less than 10 in 1 000 piece quantities WiZnet Inc www wiznet co kr damage the SeaI O 270U includes the patent pending SeaLATCH locking USB connector design to prevent the accidental cable disconnection of both upstream and downstream USB ports The hub provides up to 1 500 VAC protection from harmful voltages injected on USB peripheral cabling Status LEDs on the hub indicate external power con nection to the host and fault conditions The hub is housed in a rugged metal enclosure and each of the seven USB downstream connec tions provides a full 500 mA of power suitable for all USB peripherals SeaI O 270U hubs are supported in Win dows Linux and all other operating systems that recognize USB Simply provide power to the hub using the included power supply plug the hub into an available USB port with the included cable and the hub is automatically recognized Standard SeaI O 270U hubs operate between O and 70 C Designers can special order extended temperature range 40 to 85 C hubs SeaI O 270U hubs are available now The SeaI O 270U costs 379 and up Sealevel Systems Inc www sealevel com www circuitcellar com NEW PRODUCT NEWS 16 PORT T1 E1 J1 TRANSCEIVER The DS26519 is the industry s first 16 port T1 E1 T1 long and short haul transceiver At 16 ports this single chip
8. www arm com developersconference Plus through the combination of track sessions presentations and company design centers you will be fully immersed in leading strategies and methodologies for building complex designs with the ARM architecture And Finally Conference Delegates who pre register before September 10 receive the conference proceedings on a 4 GB iPod Nano to take home 0 Located with the Portable Design Conference amp Exhibition move across the table their individual locations are recorded in a history buffer Each of the ball s history buffers is 4 s and allows history trails to be drawn on the screen to allow the user to review their shot OBSTACLES Changes in lighting from different environments had a drastic effect on our system It caused our predeter mined thresholds to be invalid The thresholds therefore needed to be recalculated when the system was moved Differences between two sim ilarly colored balls i e orange and red also made it very difficult to dif ferentiate between the two balls Another problem we encountered was an effect called keystoning This happens when the camera is not per fectly perpendicular to the surface of the table making the rails appear nonperpendicular The imperfection caused the ghost ball aiming algo rithm to be less accurate Implement ing a software correction may help this problem but we decided to opt for the easier solution and move the
9. CIRCUIT CELLAR port Library libc 1 4 Full Configura tion May 1993 as the foundation but they also include libraries for hard ware found on the prototype board including the OS This is where one would go to find out how the int read int fd char buf int nbytes procedure would work or what the define FD_ISSET represents If you study this carefully you ll gain a great understanding of the support provided with your compiler and sys tem You ll also see how the experts have implemented various functions In main in main cpp after the system is up and running I call InitDebugComBuf This sets up all the variables needed for serial commu nications Then I enter a while 1 loop This is an endless loop that runs forever In that loop I call Debug ProcessCmd That routine waits for an entire line of serial characters to come in The asterisk character signifies the start of a command The carriage return character signifies the end of a line The call in Debug ProcessCmd is at line 224 and it reads done cp gt GetLine Let s break this down cp is a pointer to a structure of COM DETAILS And in the definition of COM DETAILS CciBiSeri al h line 63 you see a place to hold the get character routine INT8 GetLine void Thisisa pointer to a function that takes no parameters and returns an INTS8 In the Ini tDebugComBuf routine you set Debug GetLine DebugGet Line So you star
10. New Service E e vital time on design errors in dvance of receiving your Prototype L3 high resolution photographic images of your PCB during each pro duction stage Be one step ahead use ir realtime PCB monitoring service VWW PCt POOL com pu 32 Issue 204 July 2007 CIRCUIT CELLAR ATmegal68 Microcontroller Atmel Corp www atmel com a EM E if he de a irae 4 i m 1 www circuitcellar com p C CO rr infinite possibilities e ne t Expansion port fae optional fan control i support for sual feedback mple USB connection with all software E ti play system information tegrated remote r MATRIX N WWW MATRIXORBITAL COM ORBITAL WIN And that s in addition to the industry best pricing you already get at Jameco every day You already know about Jameco s best in the business low pricing Now we re out to get a new message across Major Brands at Jameco pricing To dramatize the point we re giving you an additional 15 discount on two different major brands each week From now through the end of May And that s on top of our everyday discounted pricing We wanted to make this so good a deal that you just couldn t pass it up So Want to know which save extra big on this week Just head to the website JAMELU zc FEATURE ARTICLE by Albert Tran Andrew Kwan Kevin Brown amp Jason Vangil
11. PIC24FJ64GA002 Microcontroller dsPIC30F2010 DSP and dsPIC30F2020 DSP Microchip Technology Inc www microchip com www circuitcellar com LESSONS FROM THE TRENCHES by George Martin From Hello World to Big Iron It s time for the big iron George shows you how to start writing code and building a project with an NNDK MOD5234 development kit He got his project up and running using a serial port interface the mid 1980s I designed a gate array for a character recognition proj ect with a 2 000 gate device built on 2 um technology I entered the design using text constructions not graphi cally or even HDL via a modem to the engineering VAX at General Elec tric at Research Triangle Park North Carolina The VAX churned for about 8 h depending on the workload and then gave me an error report I soon discovered that if I waited until Duke North Carolina or N C State were playing basketball I could have the VAX an IBM mainframe and a CRAY all working on my design with a turn around time of 15 min or less Now that s what I call BIG IRON Gate arrays have come a long way since then In a previous article I wrote about putting the NIOS proces sor into one of Altera s gate arrays G Martin Designing with the NIOS Parts 1 and 2 Circuit Cellar 167 and 168 June and July 2004 The design tools for that all run on a PC in a reasonable amount of time The particular array family I
12. Qty 1 174 95 Oty 10 FrontPanel Software API Windows XP Mac OS X Linux C C Python Java Configure FPGA and communicate with your design The easiest way to integrate USB into your product Use for image capture control test equipment etc Up to 38 MB s transfer rate 5 off with Coupon Code CKTCLR73 Valid for first order only Void 30 days after issue publication e o Visit us online at 2 Opal Kelly www opalkelly com ValueCAN The High Value Tool For Controller hYTEB DLL with examples Network e USB to CAN e Simple software analyzer included for custom applications e PC isolated from CAN e 100 bandwidth at 500Kb Only 295 www intrepidcs com CIRCUIT CELLAR WEL Willies Lanpater Solare o 3 Extremety easy to install and use Oisiances up to 100 asr maters 329 feet Aluetocih Serial Por Profile ac Communicates with Bluetooth enabled PDAs Laptops Smartphones amp Computers ilo programming or special software needed Professional serial communication libraries amp development tools eFC PCMCIA USB Universal PCI amp ISA multiport R5232 Rs422 amp Rs485 cards Bluetooth USB Dongles USB Host Stack USB 2 0 EHCI OHCI UHCI ISP116x ISP1362 ISP176x ARM ColdFire Hub Mass Storage Modem Mouse Keyboard Printer Serial Converter Low Cost Royalty Free Full Source
13. m using is in the 12 000 to 15 000 LE logic ele ments which contain many gate equivalents range with 256 Kb of RAM RAM was a separate IC in the mid 1980s My PC is an Intel 3 2 GHz Pentium 4 HT I bet I m at least within an order of magni tude in computing power to HS Unit ID in case of multiple units my 1985 environment even on game day The performance of a modern Cray midrange CPU www circuitcellar com is reported at 2 to 10 GigaFlops Oh by the way the Sony PlayStation 3 is cal culated at over 2 TeraFlops One Ter aFlop is 1 trillion 10 floating point operations per second Perhaps that s BIG IRON We ve already looked at the Texas Instruments MSP430 family in the earlier parts of this project They cost less than 1 even in small quantities Now let s turn our attention to a processor away from the low end but not so far away in price I m referring to Freescale Semiconductor s Coldfire family of processors NNDK MOD5234 KIT The source I m using for these devices is NetBurner which has core modules that consist of a CPU and memory The modules plug into a base board that can have a wide variety of different interfaces and development kits which contain a CPU a baseboard and supporting software I need a unit Carriage return Fourth parameter Separator Third parameter optional Separator Second parameter optional Separator First parameter c Separator
14. A Look at Microchip s Family of 16 Bit Microcontrollers Microchip Technology and Circuit Cellar have teamed up to bring you the Microchip 16 Bit Embedded Control Design Contest Jeff introduces Microchip s 16 bit microcontroller and digital signal controller DSC families Are you up for the challenge T will come a time when no matter how well you optimize your code your favorite 8 bit microcon troller just won t get the work done That s why Microchip Technology wants you to consider switching to one of its 16 bit MPUs If you ve ever attended one of Microchip s local seminars you real ize as Microchip does that gaining hands on experience is an effective way to learn something new While the articles presented in Circuit Cellar offer this experience to readers who later reproduce the featured projects on their own the magazine also recognizes the power of incentives That s why Circuit Cellar runs design contests There are numerous incentives for entering a contest The most obvious incentives are cash prizes and notori ety But let s be honest the best part is the excitement of creating a project I m sure you ve read an article or two in Circuit Cellar that was written by a past contest winner Now it s your turn to shine Circuit Cellar and Microchip Technology have teamed up for the magazine s first contest of 2007 the Microchip 16 bit Embedded Control Design Contest Are you up for the challenge In this ar
15. C void UserMain void pd This is telling the C compiler that this is C code and to build interfaces accordingly The file was generated automatically by the IDE s new proj ect command I added the header files for serial support the prototypes files for my serial routines and the calls to my serial routines Issue 204 July 2007 83 In the USerMain routine I added lines 55 57 and 60 to 63 They all ini tialize the serial code and process seri al data as it arrives One word of caution you can t place any breakpoints before the sys tem is up and running That implies the code must get past line 50 before breakpoints are valid I added line 55 OSTimeDly 20 just to be sure the OS was happy and my breakpoints would have some significance As you look in file CciBiSerial cpp you ll see the header files a structure definition for COM DETAILS and the variable int fdDebug The structure COM DETAILS is a place to hold infor mation about the serial interface The NetBurner board has two serial ports and the processor has support for other types of serial ports in both the hardware and the software So it s not uncommon to have three or more seri al ports in a system today It would be very tedious to write dedicated code for each port I plan to create a struc ture for each port in use and fill the structure with the appropriate values Then as data comes in each port I will process that data using the stru
16. Either mode may be configured to use the first rising or falling edge as a reference For frequency measurement a 16 bit counter keeps track of how many puls es occur during the sample period With more than one input pulse sampling ends with the 32 ms rollover of the 16 bit timer Otherwise sampling ends with either the first pulse or the configurable timeout period from the 16 bit timer and cascaded byte The frequency or rate is pe constant x T count I pulses per unit X period in microseconds Data acquired in these modes can be directly displayed or passed through the interpolation routine for further manipulation EXCEL ERATED CONFIGURATION While I was working on scaling fac ADC Select CIRCUIT CELLAR DIM IN CAPCOMO IN CAPCOM 1 IN tors with Microsoft Excel I wanted to import data into the source code With the ability to create graphs trend lines format data and hex and decimal con versions this worked well and provided a worksheet to test view and modify sensor parameters The final seven sheet Excel configuration file consists of three sheets for entering configuration data two for internal formatting one parame ter output sheet formatted for compiler and one parameter output sheet for seri al downloading The basic parameter edit sheet contains general operating analog and digital parameters The ADC linear interpolation table provides ADC calibration function graphing and tab
17. Peripheral pin select PPS does away with this limitation by allowing certain peripherals to be dynamically mapped to a group of I O pins Although a single pin can be shared among peripherals you should be careful This opens the door for some pretty tricky configura tions Because this is a dynamic func tion some safeguards are implement ed to lock the configuration registers and report if a malfunction illegal change in configuration occurs Change of state inputs have been a standard peripheral on microcon trollers for some time now They are practical for implementing a wakeup on key press functions COS on the 16 bit microcontrollers is now imple mented with dynamic mapping Each pin mapped for COS can enable an internal pullup reducing the need for external components DSP Support is a key issue when using the DSP To eliminate the extensive development time a set of speed optimized functions for the most common digi tal signal processing DSP applications is included in the DSP library see Table 2 Most functions are written in assembly language and make extensive use of the DSP instruction set and hardware resources The library provides vector matrix filtering transform and win dow operations FIR filter functions include lattice decimating interpolat ing and LMS filters IIR filter functions include canonic transposed canonic and lattice filters Transform functions include in place out
18. S86Drive P300 ETAT a i m wis Sora iari 7 bi AUL DAL A m e 586 Drive control board P300 expansion board e AMD SC520 processor 250 program in C C DEM quantiles e 4 RS232 485 ADC DAC Solenoid Drivers OPTO e CompactFlash and FAT16 file system support e Hardware TCP IP stack for 100M Base T Ethernet 50 Low Cost Controllers with ADC DAC solenoid drivers relays PC 104 CF LCD DSP motion control 10 UARTs 300 TA Custom board design Save time and money 1724 Picasso Ave Suite A Davis CA 95616 USA INC Tel 530 758 0180 Fax 530 758 0181 CIRCUIT CELLAR aaa fae www lern com e REESE com Issue 204 July 2007 89 blectrical Design Wechanical Design software PC Layout Prototyping Services k n Your Path to Profit VIME 1 Corporation t014 Ford Road Uait A Bristol FA 1907 Tel 215 785 5156 365 4135 4907 Fux 215 7854 5362 www imetcorporaution caom 1 600 Products www Design Notes com 1 800 957 6867 Front Panels ue te ae 74 LL LAS wie TCP com v2 0 R5232 to TCP IP software selling CAN interfaces in over 30 Plus TOPAP to RS232 countries B9 WinWedge RS232 or TCP IP data direct into any Windows app Excel Access etc SAPE v USD j P f i Lanthic Technologies Ine te ch 403 878 2202 www zanthic com CAN 4 USB FX USB to CAN Interface USB 2 0 Hi Speed 480Mbps Other companies may claim USB 2 0 but if it isn t Hi Speed
19. s jurisdiction The reader assumes any risk of infringement liability for constructing or operating such devices Entire contents copyright 2007 by Circuit Cellar Incorporated All rights reserved Circuit Cellar is a registered trademark of Circuit Cellar Inc Reproduction of this publication in whole or in part without written consent from Circuit Cellar Inc is prohibited www circuitcellar com SuperH Flash Microcontroller Reaches Speeds up to 160MHz Superscalar performance high speed on chip flash memory access and much more SuperH No 1 supplier of microcontrollers in the world A inizi proudly introduces the SuperH family of superscalar flash devices With T60MHz superscalar performance high speed access to on chip flash memory and up to 200MHz CPU operation from SH 2A devices the SuperH family allows you to incorporate all of your brilliant ideas into super high performance applications The SuperH RISC engine and the SH 2A core are establishing new pertormance standards in the industry The SH 2A core is geared towards systems that demand real time high precision control and require a combination of high performance CPU and high speed flash Integer Fipating Unit LosdStere paimi SuperH MCU Roadmap IErhumictic Timer 1 betel x Bn H16 bil x ach 15 rd x Jor sH7206 2n00MHz Superscalar Performance Two instructions are executed per cycle gt 160MHz World s fastest embed
20. stored and a buffer over flow check must be per formed every 8 data bits HID Implementing a USB device that conforms to the human interface device HID specifica tion is particularly use ful if you develop for PC computers Every ven dor class device requires a kernel driver but the HID class driver is built into Windows This means that you do not need an installer or a custom driver Since Internet password manag er devices try to emulate the keystrokes of a stan dard keyboard you don t need special software on the host computer The main advantage of a HID compliant device is you don t need a custom kernel driver on Windows This means that you can start the control ling software application without installation by an administrator Since other operating systems also include a kernel driver for USB HID devices this advantage is not just for Windows It allows the use of an Internet password manager in other environments The main disadvan tage is the added complexity because you need to understand how report descriptors are built and you must conform to the framework defined by the HID specification Writing your own driver gives you much more flexibility and less com plexity but you must install a kernel driver on Windows For more informa tion visit www usb org developers hid page The idea behind the HID specifi cation is to define a wide range of sen sors buttons and lights that you mig
21. that I could easily remember Unfortu nately I learned that this was not the best solution and I was putting valu able information at risk To prevent those situations I wanted an external device I could attach to my PC through a convenient interface that could securely store all pair combina Photo 1 This is the Internet password manager in action Just plug it into your PC s USB port insert your smart card and you will have Internet login information at your fingertips 22 Issue 204 July 2007 tions of usernames and passwords and keep them readily available Although there are already several solutions on the market they are mostly software based and can be easily counterfeited with spyware or worms In this article I ll describe how I designed an Internet password manag er see Photo 1 The system can store many usernames and passwords in a Java Card smart card which is one of the most secure methods of storing confidential information Whenever a dialog box requests a username and password in an application or web browser security features can be found on the externally attached device that will automatically complete the username and password fields for you as if you were entering them JAVA CARD APPLET In my article Mobile Phone Book I described the internal workings of smart cards Circuit Cellar 190 2006 I focused on the SIM smart card which is used in many mobile phones Other useful smart
22. the applet performs any cleanup or bookkeeping work before it is inactive The JCRE then selects the new applet with the Select method The applet performs any initialization necessary in the Select method After a successful selection each APDU including the SELECT APDU is delivered to the active applet via a call to its Process method The Process method is an essential method in the applet class It processes APDU commands and provides an applet s functions see Table 1 The Install Select Deselect and Process methods are applet entry point methods They are invoked by the JCRE at the appropriate state of applet creation and execution The base applet class provides only the default behavior for these methods An applet needs to override some or all of these methods to implement its functions PS2 OR USB I first thought about using the PS2 interface to connect the device to the computer because it is easier to use than the USB port from the develop Method Description Figure 1 The applet running inside the Java Card is developed using a subset of the Java programming language from Sun Microsystems The development tools are freely available from the Sun web site www sun com er s standpoint However the brand new computer models that are ship ping today lack this interface In fact the PS2 port is found only on legacy computers So it was clear that if I wanted to use this device in every computer I
23. the command set but my Issue 204 July 2007 81 egi dies Serial interrupt routine requirements of a command and must be a unique XGAMESTATION Receive all characters ignoring lt LF gt characters character I also permit line feed lt LF gt DO IT YOURSELF VIDEO GAME SYSTEM Buffer received characters Inspired by the yg NM characters This lets the user create a list Atari 2600 Apple Il amp d a Keep track of received lines Commodore 64 aaa of commands in a text file and transfer P that file using HyperTerminal or a simi Command processing routine requirements Check to see if new command is received lar program to FOUT embedded Pyare sExtrastihe compieie commandiihe lt LF gt characters make the file printable Parse command line into its following components I just ignore them as they are received 1 Valid start charact 9 a E _ First let s consider only numerical 3 First parameter parameters for the commands This ace pond palamcte will exclude alphanumeric values such 3 Third parameter s 2 p as file names but we can revisit this Assembled XGS Micro Edition Unit D o Complete Development Kit i 7 Lastparameter decision at a later date This command Tools Demos amp Utilities PR i eBook on Designing the XGS Console Execute the command definition creates a set of requirements Cables and Power mr nie for the serial interrupt
24. 15 4 Wi Fi 802 11 Remote Terminal Unit RTU 49 GPIO 35 GPIO Building Automation 6 Serial Ports 6 Serial Ports Data Acquisition Order Your Kit Today Development kits include everything to start your development Dynamic C software wireless RabbitCore module development board programming cables and accessories 2900 Spafford Street Davis CA 95618 Tel 530 757 8400 www rabbitkits wireless com 4 TASK MANAGER A Look Back and Forward in Tech Time Wore did you start surfing the Net began using it years ago when first started college At the time was living in an old building and shar ing a room with two other students who didn t have much experience on the Net either The building was pretty low tech in comparison to many of today s 21 century setups Our study room had one light one phone jack no cable and our door actually had a lock and key I didn t have one of those fancy access cards that students now carry on their key chains To keep sane during the first week of the semester we took turns playing video games on a small TV But as you can imagine that got old quickly That s when we began using the Net for entertainment during our late night study breaks We d look for sports scores the day s news and info about our favorite musicians but that was about it When went to London in 1998 found myself shot back a few years in tech time The room was living in
25. 204 July 2007 THE MAGAZINE FOR COMPUTER APPLICATIONS WOI AJCLJIIVINIAITI MMM MiniEmail Client Internet Password Manager Motion Tracking amp Analysis Are You Ready for 16 Bits P AJ L A JU TP rm 7 25074 75549 9 4 95 U S 5 95 Canada e att Lu wa ud T pg n LG DE ai ai dans ELE au cx Cu Announcing a complete hardware and software solution from NetBurner The NetBurner MOD5234 ETHERNET CORE MODUTCTE with empi 99 Qty 100 NetBurner MOD5234 Ethernet Core Module Features INDUSTRIAL TEMPERATURE RANGE 40 C to 85 C PERFORMANCE AND MEMORY 32 Bit CPU Freescale ColdFire MCF5234 147 Mhz 2MB Flash Memory BMB SDRAM DEVICE CONNECTIVITY 10 100 Ethernet 3 UARTs 16 channel eTPU C SPI CAN 47 Digital I O 16 bit Data Bus SD MMC Flash Card Support Qi 1 f die mi HI H l B sad JE 1 1 ni Trim Order the MOD5234 ite Kit deer No NNDK MOD5234 KIT Product No MOD5234 100IR Information and Sales sales netburner com etBurner Web www netburner com freescale Networking in One Day Telephone 1 800 695 6828 Alliance Member eal ixed Signal rogrammobility Get PSoC Because change happens PSoC flexibility enables changes anytime at concept through production in the field Specifications change constantly Yet pressures to differentiate minimiz
26. 3 I have a PSoC that reads image files off a flash memory drive using a Vincu lum and the PSoC displays this image If a matching MP3 file is also present on the flash memory drive the Vincu lum plays it using VMUSIC s VLSI VS1008 codec This could be music or a person speaking A PC creates images and MP3 files which are copied onto the flash memory drive The PSoC Vinculum based player then runs the show The download package includes the source code as a PSoC Designer project This will allow you to cus tomize the examples to match your require ments Cypress has over 100 application notes that describe building blocks which can be used in your design The PSoC could scan but tons which could use Two input channels CIRCUIT CELLAR CapSense technology The applica tion program would use these but ton inputs to navigate through the images and MP3 files Or the PSoC could support a touchscreen with a few of its configurable analog and digital blocks This could be a sim ple resistive screen overlay or a more reliable CapSense implemen tation An active photo frame is the base example but an interactive display which could be used in stores museums product demon strations and art galleries is a straight forward design extension A series of flash memory drives in English Span ish Japanese and more could be used to create a more universal solution The size of the graphical display will determ
27. CCS C High quality ZIF sockets device Gold plated test points slut Delphi C Builder In circuit test your SMT IC s with logic analyzer or scope Simply solder SMT package emulator and attach probe board Also Quick Turn Customs Request our HiOmaker FS Combo Only 588 85 Free Catalog CD today wwwW ironwoodelectronics com Developers Guide for USB HID visual Basic 6 Peripherals shows you how to make devices for special requirements www TraceSystemsinc com USB Data Acquisition ADU208 USB Relay I O Interface Complete SDK Online at www ontrak net ak Lek Lek Serre ttt TL FEATURES 8 5 AMP relay outputs 8 ISOLATED digital inputs PortPowered Aux5VDCoutput 189 00 QTY 1 Other Models ADU200 4 Channel Version with RS232 139 00 ADR218 Solid State Version 8 Channel 225 00 ADU100 3 CH 16 Bit ISOLATED Analog Inputs PGA 4 digital O RS232 and 5 AMP Relay Output 199 00 ONTRAK CONTROL SYSTEMS INC PH 705 671 2652 Fax 705 671 6127 z 7 Phone 719 520 5323 Order onlinea micro Singinecring abs Opo fees je 4 www melabs com Development Tools for PIC Microcontrollers Colorado Springs CO 80960 USB Programmer 89 95 LAB X Experimenter Boards BASIC Compilers for PlCmicro amp Pre Assembled Boards Easy To Use BASIC Commands as shown i y bi S MCUs 1 H Available for 8 14 18 26 Au Windows 9x Me 2K XP Interface Ors P 9 4 and 40 pin P
28. Code Standalone or RTOS Device and OTG Available Fa Micro Digital Inc RTOS Innovators www smxrtos com usb www circuitcellar com CHINA PCB SUPPLIER O DIRECT SALE FROM CHINA D PROTOTYPE TO PRODUCTION instant online quote shopping cart ordering system China competitive prices E free Electrically test pb nno Caen Dope bos emu eT COT Tec Ah fH ERIS JA Mo 2 Flute Plur Flangrhas PIT Chir SAVE N enter coupon code CC al checkout CABACOMdirect com Deo tal 1 416 236 3858 Tax 1 416 236 BAGG MYLYDIA INC Layout Gerber Prototype Making QUICK TURN PCB amp Turnkey The Best Prices Tel 800 695 9342 WWW MYLYDIA COM www circuitcellar com When contacting our advertisers tell them where you found their ad a tell them Circuit Cellar sent me ABACOMdirect com tet 1 4 16 226 3858 fax 1 418 2368 8868 High level RS232 Interface Easy to program Add color graphics to amy WTE hit embedded system acy tasi and Flexible Up and runeimg in hinas Iz 2 Gli minc Pom e 510 770 1417 PA Bapgrwerue Fremen CA Bas ER TTD LM extend yourd over LUST tens of miles in both a oe gital pis B feet up to directions wilh tha 16 0 SSRT HF transceiver modules SAVE Fh UU EE ene deti ABACOMdirect com lek 1 416 236 3858 fax 1 418 238 BBG 586 Generation Industrial Control
29. FORMAT Call for current rate and deadline information Send your disk and digital submission sheet to IDEA BOX Circuit Cellar 4 Park Street Vernon CT 06066 or e mail adcopy circuitcellar com For more information call Shannon Barraclough at 860 872 3064 The Suppliers Directory at www circuitcellar com suppliers dir is your guide to a variety of engineering products and services phyCORE OEMable Single Board Computers XScale PxA270 PXA255 ARM LPC3180 ARM9 LPC22xx LPC229x AT91 ARM7 PowerPC MPC5554 MPC5200B MPC565 MPC555 ColdFire MCF5485 X8 6 Elan SC520 C166 XC16x ST10 8051 CAN E Blackfin BF537 7 4 Faster to Market Save time by EE S integrating a PHYTEC Single j X A i Board Computer Module into E iau Y your target circuitry t Make or Buy Why make E PHYTEC off shelf solutions T cost effective to 1000s units year Integrated Support Services Let PHYTEC assist you in the design of your end product from tools and RTOSes to production Our hardware is bundled with leading compilers Keil IAR CodeWarrior RTOSes WinCE Linux and debuggers Immediate Support Talk to PHYTEC technical staff with every call No waiting for answers Your OEM solution With 20 years design production and integration experience PHYTEC is your OEM partner PHYTEC America LLC 203 Parfitt WaySW G100 W Bainbridge Island WA 98110 USA www phytec com m 800 278 9913 m www phycore com USB ICP
30. It is used for writing mail and reading it in Read only mode where no alteration of the text is possible Therefore it has to be as easy to use as possible I imple mented all the basic features you would normally take for granted in an ordinary text editor but when you try to write such routines for the first time it is much more involved than you d expect The text editor supports the dynam ic word wrapping and scrolling of the text using the arrow keys You can also use the Page Up and Page Down buttons if you want to browse through the text quickly A scrollbar on the right border indicates the cursor s position in the text You can choose between Overwrite and Insert modes and there is a simple method to cut and paste text blocks During text editing the entire LCD is used to display the text so up to 168 characters can be shown at a time That isn t much One of the first items on my to do list is adding a larger display WRITING MAIL With respect to the firmware send 18 Issue 204 July 2007 ing mail is much easier than reading it so let s first focus on the Compose Mail menu The first item in the menu starts the text editor so you can enter the body of your letter You then enter the recipi ent s mailing address and the subject of your e mail just like you would do when sending e mail from your PC Additional fields such as CC or BCC are not included but since this requires only one more l
31. LM3S811 based SD Card Display Controller enables you to input data to portable devices This system regularly reads the temperature and relative humidity from an on board sensor The host device is a tablet PC that runs a picture slideshow program Sylvain Davaine France davaine_s yahoo com Timecode Signal Generator The well designed Timecode Signal Generator supplies the audio signal for syncing recording machines The compact system creates an audio signal that conforms to the SMPTE standard generates MTC and is capable of being synchronized with an external refer ence video Fabian de la Fuente Argentina fdelafuente speedy com ar To see these projects and more visit www circuitcellar com designstellaris2006 FEATURE ARTICLE by John Hyde Flash Drive Connection Add a Flash Drive to Your Next Design Interfacing flash memory drives just got a lot easier with the Vinculum ASIC The 48 pin LQFP includes a DOS like command line interpreter that can read and write USB flash memory drives T flash memory drive is probably the most successful USB product Its capacity has increased exponentially over the past few years while its price has fallen at a similar rate You can buy 1 GB drives for less than 10 Up until now they have been excluded from embedded projects due to the complexity of interfacing them but this article will change all that My web site receives many requests from readers who just wan
32. Look at lines 180 and 182 The first is the one that s coded for this example Line 182 is commented out but it defines a routine that is a pointer to the COM DETAILS structure Using that definition you could have data come in on one serial port and output it to another again without customiz ing the code just by modifying the tables Well we ve got a simple command processor up and running on a pow erful board This should give you a peek at how to get started on such a project Next time I would like to expand on the processing of strings We will write a file conversion pro gram that reads pick and place data outputted by the CAD program and writes a file that the pick and place machine can use lal George Martin gmartin circuitcellar com began his career in the aerospace industry in 1969 After five years at a real job he set out on his own and co founded a design and manufacturing firm www embedded designer com George s designs typically include servo motion control graphical input and output data acquisition and remote control systems George is a charter member of the Ciarcia Design Works Team He s currently working on a mobile communications system that announces highway information George is a nationally ranked revolver shooter To download code go to ftp ftp circuitcellar com pub Circuit Cellar 2007 204 NetBurner Inc Embedded Eclipse IDE 2007 www netburner com NNDK MO
33. MAn SS 2007 Cypress Semiconductor Corporation All rights reserved PSoC is a registered trademark and PSoC Express is a trademark of Cypress Semiconductor Corporation All other trademarks are properties of their respective owners Link Instruments PC Based Test Equipment Digital Oscilloscopes e2 Copes Oscilloscope e 500 MSa s max single shot rate e Mpt sample memory 250 MSa S Dual channel 512 Kpts 500 MSa S Single channel 1 Mpts e Only 9 oz and 7 x 3 5 x 1 5 e Portable and Battery powered e USB 2 0 e FFT Spectrum Analyzer DSO 8202 200MSa 128K 799 DSO 8502 500MSa iMPt 950 DS50 8500 i iit Logic Analyzer amp Pattern Generator e Logic Analyzer 32 channels e Pattern Generator up to 32 channels e up to 400 MSa s e Variable Threshold e 2 External Clocks e SPI output and disassembly e IC output and disassembly eup to 2Msamples ch IO 3208A 750 IO 3232A 899 IO 3232B 1399 Link Instruments 973 808 8990 l pea kl k Ji a AE i AL UA LM j k i ribs _ E k En S hn f bie ea Y ee 2m pd dl i j z M www Linkins4 com Next Generation C Go Wireless am Go Rabbit Aa Check out our new Wi Fi and ZigBee core modules the latest additions to our pin compatible family 72 99 Applications RCM4500W Family RCM4400W Family Industrial Control ZigBee 802
34. Move display cursor key to the right N Display next character of the key Figure 2 The algorithm used to enter alphanumerical data is a replica of the behavior found on the keypads of many mobile phones It allows you to enter lower case uppercase and special characters within a very intuitive user interface Display numeric value of the key B Key released Move display cursor to the right CIRCUIT CELLAR the selected ID is shown it is possible to send the username and the pass word to the requesting dialog box by pressing the pound key Pressing the function key labeled B also referred to as Find menu enables you to search for a specific ID in the card It is not necessary to write the full ID name Typing the first characters is enough Pressing the function key labeled C also referred to as Edit menu brings up a submenu that enables you to enter a new ID in the card or delete the previously stored IDs By pressing the A key if there is space available in the smart card the device will ask for the new ID label username and password It will then save the new record which will be the default selected ID the next time you browse through the different IDs On the other hand by pressing the B key you can delete a complete record but it is necessary to write the full ID to ensure that accidental deletions are prevented Pressing the function key labeled D also referred
35. Note that the compiler will run as a full compiler during the contest and will then revert to the function limited student edition Additional documen tation on the CD includes datasheets and reference manuals for all the parts plus application notes programming specifications and other goodies If you choose to use special offers and purchase a demo board you will be pleased with the level of hand hold ing provided to get you started Every demo board comes with a tutorial that takes you from project creation through debugging so you are familiar with the process All of the necessary tutorial source code is provided so you can hit the ground running SMPS FOR 750 Although Microchip includes four dif ferent 16 bit microcontrollers in its con test kit all are 28 pin DIP parts the effective use of any of these could bring you home some serious cash There are three main prizes first place 5 000 second place 3 000 and third place 1 750 Judging of the top three entries is based on technical merit effective use of on chip resources usefulness effective use of bonus parts originality and cost effectiveness Cover these and your entry will be sure to collect points from the judges In addition to the top three honors prizes will be awarded for the top picks in seven categories Most do not have a particularl6 bit part associated with them and any 16 bit device can be used in your design for these cate gori
36. RJ 45 interfaces A configura tion program is available that allows users to con figure all the parameters of the modules and con trol them through the Ethernet connection The WIZ200USB is a USB to Ethernet module for use with various USB devices such as USB HUB WITH LOCKING CONNECTORS A fee ws The SeaI O 270U is a seven port optically isolated USB 1 1 2 0 compatible hub which protects computers from damaging power surges spikes and ground loops commonly found in industrial and OEM applications The SeaI O 270U offers system designers an effective tool for interfacing USB peripherals in virtually any environment In addition to protection from electrical ELERE IL LI ud LR ask 8 Issue 204 July 2007 CIRCUIT CELLAR TN M m arreire LI in Edited by John Gorsky mass storage CDC and USB printers It supports both USB 2 0 full speed and OTG and can act as a host or device The WIZ800MJ is an all in one module that can pro vide a one stop solution for Internet connectivity to exist ing embedded devices In this module all Internet enabling components such as an Ethernet controller a transformer a MagJack and TCP IP stacks are included It supports a memory bus and an SPI for microcontroller shat 3 Pu E JLILILILS Eee interfacing Anyone can implement Ethernet functionality by adding the WIZ800MJ without changing the existing microcontroller in an embedded system
37. Remote 8 bit I O PIC24 MCUs Expander High integration 16 bit MCUs that Designed for two line bidirectional bus IC meet real time control demands 2 5V to 6V VCC operation and provides general purpose remote I O expansion for most MCU families via the C interface mouser com ti a INSTEOMENTS mouser com microchip a B6TS Capacitive ewest Touch Sensing poe ICs Capacitive touch V Ye The Semiconductor E highly tolerant of its workin OMRON Products For Your ofrsworking OMRON N ewe st D e S i g n S mouser com omron a LAN91C111 Ethernet Controllers Facilitates the implementation of third generation Fast Ethernet P sms connectivity solutions ear for embedded applications mouser com smsc a The ONLY New Catalog Every 90 Days NEWEST Products amp Technologies Over 800 000 Products Online Vinculum VNC1L FTDI VNC1L 1A 0626 Embedded USB host controller IC with two independent USB2 0 low speed full speed a tti company and USB host slave ports More Than 330 Manufacturers No Minimum Order The Newest Products e Fast Delivery Same day Shipping j For Your Newest Designs mouser com 800 346 6873 mouser com ftdi a The NEWEST Semiconductors Passives Interconnects Power Electromechanical Test Tools amp Supplies from Mouser Electronics Mouser and Mouser Electronics are registered trademarks of Mouser Electronics Inc Other pro
38. Technology Devices a pio neer and advocate of the idea that you don t have to fully understand USB to use it has introduced an application specific integrated circuit ASIC called Vinculum which pro vides a DOS like command line inter preter front end to a flash drive This single 48 pin LQFP part encapsulates all of the functionality required to read and write standard USB flash drives Internally it is implemented as a microcontroller with specialized I O devices running embedded firmware but you do not need to know this see Figure 1 Vinculum s command line interface is accessed via a UART an SPI or a FIFO It actually supports two USB ports Each can be programmed to be a host or a device but my first series of examples will assume a single host port with a connected flash drive The Vinculum ASIC is available on several preassembled modules which speed up development A VDIPI plugs into a 0 1 prototyping board see Photo 1 The 24 pins provide access to the three interfaces and two CIRCUIT CELLAR jumpers select the interface The UART interface is the eas iest to use It runs at 9 600 bps although this can be increased to as much as 3 Mbps at run time with monitor commands For even higher serial perform ance the SPI can be selected The Vinculum is an SPI slave and your application processor can clock it at up to 12 MHz The FIFO interface is selected for the highest throughput The bidirection
39. The biggest problem currently fac ing our system is the detection of noncircular objects This is the most limiting factor in the overall robust ness of the system A better algorithm needs to be developed to reject the detection of these objects i CIRCUIT CELLAR Authors note We would like to thank Dr Michael Smith at the University of Calgary for supervising our project and for the work he did throughout the year We would also like to thank Warren Flaman for creating the expan sion port interface and various techni cal support help Hernan Vassolo sup plied the video camcorder We also want to recognize the members of Dr Smith s other design group Henry Chen Simon Cheng Maggie Zhang and Chris Blauel for their help with this project Finally many thanks go to Analog Devices Mimi Pichey and Bob Meissenhelder for providing the ADSP BF561 EZ KIT Lite and various other hardware components Albert Tran alctranQucalgary ca has a b Sc in Computer Engineering He is currently working toward an M Sc in researching high speed algorithms used in magnetic resonance imaging at the University of Calgary His interests include DSPs and embedded system designs Andrew Kwan is a graduate student studying software defined radio algo rithms at the University of Calgary He holds a Bachelor s degree in Com puter Engineering You may e mail him at akckwan ucalgary ca Kevin Brown holds a B Sc in Software Engin
40. The reality of life is that while the architecture of an off grid battery backed PV system could accomplish this the Connecticut Clean Energy Fund doesn t provide rebates toward such a configuration and it would be a lot more expensive going it alone guess my 14 kW diesel generator gets to stay as my main electrical backup for a few more years The aim of the CT rebate program is to take some of the load off the present electrical grid instead of simply adding another power plant The objective is to replace some of the demand with personal renewable energy generating systems such as PV The subsidy here is only for a professionally installed grid tied PV system where you and the utility share the electricity you produce Contrary to what said before call it media brainwashing your electric meter doesn t necessarily rotate forward or backward That really only pertains to older analog electric meters which at least in CT are always digital for grid tied PV The two digital readings represent what you use and what you produce Simple subtraction decides who gets the money While suppose should be upset that I m not going to be crawling across a hot roof in July not personally digging 7 deep mounting holes and not lug ging 33 Ib solar panels up a ladder there will be lots to document and interfaces to be designed as the installation progresses The CT rebate program dic tates the PV architecture and the approved list of installers d
41. While on vacation synchronize the time on your digital camera with the Garmin GPS tracker attach a flash memory drive and place the tracker in your camera bag As you travel around taking pictures the tracker 2x AA Batteries 3 3 V reg PIC16F88 Figure 4 This block diagram of DLP s VLOG development kit shows the resources available on the board This complete kit including software design tools and a CCS C compiler was designed to make it easy to learn and use the Vinculum chip 62 Issue 204 July 2007 Real time clock Temp humidity sensor Flash aa Vinculum Display Figure 3 The PhotoFrame can be implemented with the smallest eight pin PSoC The firmware uses a single UART and dynamically switches its connections between the I O pins records your X Y and Z coordinates When you get home import your photos and the GPS data into your PC and use software such as GPS Photo Link WWMX or RoboGEO to match your photos to a location using the time stamps Use Google Earth to display 3 D maps of your vacation with your photos This presentation will make viewing vacation pictures a memorable event ACTIVE PHOTO FRAME The first example showed how ASCII data could be logged onto a flash memory drive using a Vinculum The second example is a binary data example but it follows the same design philosophy My example is an active photo frame but it can evolve into an interactive display see Figure
42. You will be restricted to using an SMT part for many applications that require a microcontroller with high I O counts 8 bit PIC10 18 16 bit PIC24 16 bit dsPIC30 33 I O 6 to 80 pins 18 to 100 pins 18 to 100 pins Program memory 384 bytes to 128 KB 12 to 256 KB 12 to 256 KB Data memory 16 bytes to 3 968 bytes 1 to 16 KB 1 to 16 KB EEPROM 0 to 1 KB 0 to 4 KB Speed Up to 10 MIPS Up to 40 MIPS Up to 40 MIPS Communication peripherals UART SPI FC CAN USB LIN UART 1 to 2 SPI 1 to 2 IC 1 to 2 CAN 0 to 2 UART 1 to 2 SPI 1 to 2 PC 1 to 2 CAN 0 to 2 Display peripherals LED LCD Control timing peripherals Capture compare PWMs counters timers watchdog timers Capture compare 4 to 8 PWM 2 to 8 counter timer 3 to 9 watchdog timer Capture compare 4 to 8 PWM 2 to 8 counter timer 8 to 9 watchdog timer Analog peripherals ADC comparator op amp brownout detector low voltage detector tem perature sensor oscillator voltage reference DAC ADC 1 to 2 comparator 2 to 3 brownout detec tor low voltage detector oscillator voltage refer ences ADC 1 to 2 brownout detec tor low voltage detector oscillator voltage references Additional peripherals CRC generator DMA RTCC JTAG CRC generator DMA RTCC JTAG codec 0 2 DSP Cost quantity Less tha
43. and Mac OS X Integrates into PSoC Designer IDE and other PSoC development tools LL _ SS LL C LL Ve m E NN mJ d E Z CYPRESS S O F T W A R E PSoC is a registered trademark of HI TECH Software LLC PERFORM Cypress Semiconductor Corporation 6600 Silacci Way Gilroy CA 95020 USA PSoC Designer is a trademark of Cypress Semiconductor Corporation Ph 800 735 5715 Web http www htsoft com gram The USB implementer forum s universal serial bus HID usage tables specify hundreds of usages HID does not necessarily mean keyboards mice and joysticks Any device that requires only a moderate transfer rate can be designed as a HID The HID deal is a two way bargain Both the HID device and the Windows application must agree to use particular USBDrvasm S USBDrv c IS07816 c ATmega168 Microcontroller Figure 5 The module hierarchy in the software design is fairly sim ple There are different layers of complexity Each microcontroller peripheral has its own driver in a separate source file DOWNLOAD our free CAD software DESIGN your two or four layer PC board SEND us your design with just a click RECEIVE top quality boards in just days 4 exbresspcb com 30 Issue 204 July 2007 CIRCUIT CELLAR codes in the HID specification Like most complex specifica tions the HID documentation is rough going You need to under stand only about 1 of the spec ification
44. and a serial to GPS receiver that operate independently with HyperTerminal I replaced the PC with a microcontroller that has two serial ports a significant cost savings and replaced HyperTerminal with some firmware on the microcontroller I chose a Cypress PSoC for my tar get microcontroller because it has firmware configurable hardware that enables me to solve a wide range of problems with a single device I devel www circuitcellar com op and debug with a high end PSoC that has ample analog and digital resources Near project completion I can select a less expensive device with in the same family For the first exam ple I used the Cypress PSoC evaluation board with a VMUSIC board and a GPS already attached see Photo 3 This development board uses the feature rich Cypress CY8C29466 PSoC device I configured two serial ports inside the PSoC and wrote a small program that fil ters the GPS reports and then writes the data to the flash memory drive First I initialized the GPS to reduce the num ber of reports it sends During runtime the PSoC spends most of its time in a low power sleep state It periodical ly wakes up and checks if a flash memory drive is present If one is not present it powers down since there is no point collecting GPS data if there is nowhere to store it If a flash memo report once the position status is valid The GPS sends a report every second but I record the data at a sl
45. are highly cost effective solutions GET STARTED IN 3 EASY STEPS Learn all about our 16 bit products in only 20 minutes Our FREE 16 bit web seminars highlight our 16 bit architecture and comprehensive support suite that includes low cost development tools a variety of software libraries many free application notes reference designs and more 2 Take advantage of FREE resources for download Our MPLAB IDE Integrated Development Environment and a full featured trial of the MPLAB C30 C Compiler from our web site gets you up and running fast Get hands on technical training for as low as 491 Fr Attend a half or full day 16 bit course ata a Microchip Regional Training Center to take your designs to the next level Attendees also receive deep discounts on related development tools Purchase and program your 16 bit PIC24F devices and related development tools at Flash KE PIC24FJ64GADOB PIC24F 6464008 PICZ4F 6464010 PIC24FIS6GA006 PIC24FJS6G4008 PIC24FJ96GA010 Pins PICZ4FI128GA006 64 PICZAFIT28GAODS amp eDo PIC24F1I128GAO10 100 Visit our web site for more information about additional 16 bit devices with higher performance and added features like DSP and enter our 16 bit Embedded Design Contest today 64 54 64 B6 a6 BB 128 128 128 microchi DIR WIL IT rien Danh is HO DPI PIC24F Family Features 8 KB RAM Parallel Master Port 5 16bit Timers 5 Output Compare PAM 5 Inp
46. are known The most optimal pocket for each cue colored ball pair is found by calcu lating the relative posi tions of the cue ball tar get ball and the dis tance to each pocket We define the optimal pocket by using several criterion First is the shot in question physically possi ble for the determined pocket For example if the cue ball is positioned in between the target ball and the target pocket then the shot is impossible with out first rebounding off a rail Second the distance from the target ball to each pocket is evaluated to select the easiest shot shortest path for the user aat Sei 4 I b l RE Moju Handheld THs Social spit HR GC Chips or TECHNOLOGIES CIRCUIT CELLAR P s OEM Products m I ld An fe nnas From ceramic chips fo gain Fogis z koylass aniy ip Verr f If an optimal pocket is found and the cue ball is present then the center point of the ghost ball G G is cal culated by solving the system of equa tions which is derived from Figure 6 G mG b 0 G 1 m G 2bm 2T 2mT T T 4R 21b The pocket location P P target location T T the line slope m and y intercept b can be determined You must be careful when evaluating line slopes and roots of the quadratic equation because division by zero or square roots of negative number exceptions may be present Solving this quadratic equation yields two r
47. calendar Cyclic redundancy check Direct memory access DMA Functions for controlling an external LCD via I O port pins Table 4 This is a table of functions used to set up and control the operation of all the peripheral modules available in the PIC24xx and dsPICxx devices The peripheral library serves as a convenient layer of abstraction over the specific details of the peripherals and their associated control and status registers your best friend Microchip is including a voucher for 5096 off a one time purchase of select tools Note that you can get a development PCB and an ICD2 for 99 No purchase is necessary to submit an entry to the contest Although Microchip and Circuit Cellar are looking forward to your design entry you will be a winner even if you only use this con test as an opportunity to learn about Microchip s 16 bit microcontrollers or one of their external peripheral parts After experiencing the process of devel oping for one of Microchip s 16 bit microcontrollers you ll feel comfortable using any microcontroller in its com plete line After all your comfort level has a lot to do with choosing a device for a future design project al Jeff Bachiochi pronounced BAH key AH key has been writing for Circuit Cellar since 1988 His background includes product design and manu facturing He may be reached at jeff bachiochiQcircuitcellar com SOURCES
48. day and night In this article I will present a new solution My MiniEmail system is a compact microcontroller based mail client see Photo 1 The silent easy to use system doesn t require a lot of power and it is immune to mail worms Another advantage is the sys tem s short start up time If you want to write a quick e mail but your PC is off you can simply switch on the miniature e mail client and start writ ing without having to wait for your PC to boot up and load the necessary appli cations All you need is an Ethernet connection and the MiniEmail system HARDWARE The hardware for the MiniEmail system is inexpensive It cost me about 50 The LCD is the most expensive part To keep things simple I left the sys tem s power supply 5 to 3 3 V conver 14 Issue 204 July 2007 sion crystals and latch out of Figure 1 The main components are an Atmel ATmega232 microcontroller and a Microchip Technology ENC28 60 Eth ernet controller Because a mail client is a piece of complex software you need a fast microcontroller that has a consider able amount of program space The MiniEmail system uses almost all of the ATmega32 s features including the SPI internal EEPROM and SRAM counters USART interface sleep modes all 32 I O lines and most of the 32 KB of program memory The ENC28J60 is a stand alone Eth ernet controller that provides basic functionality for transmitting frames over an Ethernet conne
49. for background frame block transfers avoid ed bus collisions and maintained full bus use You should also consider making sure each of the L2 buffers is placed in different memory pages to avoid con flicts between the MDMA fill and core accesses during processing DRAWING ALGORITHMS Drawing algorithms were necessary to overlay lines boxes and circles on the screen We performed simple cal culations to find the correct location of the pixel values and modify the proper Y Cr and Cb values To provide user feedback each detect ed ball was highlighted by drawing a box around it Rather than using the slower floating point operations by calculating the lines using the standard formula y mx b slope calculation algorithm we used the high speed Bresenham s line drawing algorithm The algorithm s advantage is that only integer arithmetic is used to calculate pixel locations between two points on a line This approach is optimal for the integer based Blackfin processor Also required by our ghost ball prediction algorithm more on this later was the need to draw cir cles An eight way symmetry circle drawing algorithm was implemented to reduce the number of pixel location calculations needed to draw the circle SYSTEM CALIBRATION System calibration needs to take www circuitcellar com place before ball tracking can begin During calibration the boundaries of the table cushions and the locations of the pockets wer
50. for making cyclic redundancy calculations PIC24H For a higher performance H series parts can provide 40 MIPS at 3 3 V In addition to the PIC24F s enhanced peripherals the PIC24H includes CAN a high speed 10 to 12 bit ADC capable of multiple simultaneous sam ples and a 2 KB dual port RAM buffer for the DMA transfer of most peripher al data When applications include col laboration from multiple sources the PIC24H series can provide code guard protection so that each can have inde pendent security over its code NEED DSP In reality most signals start out and may very well end up as an analog signal However to make use of digi tal signal processing they are convert ed into a digital representation of the signal by sampling with an ADC or they are returned to analog via a DAC The sequence of samples is in the time or spatial domain Algorithms can be used on the sequence to meas ure or filter it The DSP is specifically designed for computational efficiency and throughput of data A typical DSP application might include audio pro cessing image processing or compres sion as well as data processing analy sis and control of industrial processes The dsPIC series integrates a DSP engine into the 16 bit PIC24 series of microcontrollers Today the dsPIC series consists of two families the dsPIC30 and the dsPIC33 families dsPIC30 33 The dsPIC30 series is for those of you in need of 5 V of operatio
51. in Figure 1 the 16 bit parts with DMA have a separate and dedicated bus for DMA activity The CPU communicates with conventional SRAM across the data space X bus and to DPSRAM port 1 It talks to the peripherals across a separate peripheral data space bus shown in light blue The DMA controller communicates with port 2 of the DP SRAM and the DMA port of each of the DMA ready peripherals across a dedicated DMA transfer Function Cycle count equation Conditions Number of cycles Execution time at 40 MIPS bus shown in dark blue Complex FFT N 64 3 739 93 4 us Complex FFT N 128 8 485 212 1 us Microchip s 16 bit archi tecture allows the CPU Complex FFT N 256 19 055 476 4 us Block FIR 53 N 4 M N 32 M 32 1 205 30 1 us and DMA to complete Block FIR lattice N 32 M 32 7 337 183 4 us the transfer of a byte or Block IIR canonic 41 N 4 7M 36 N 8 7 S N 32 S 4 1 188 29 7 us word every bus cycle Block IIR lattice 46 N 16 7 M N 32 M 8 2 350 58 7 us across its dedicated bus Matrix add 20 3 C x R C 8 R 8 212 5 3 us Since either the CPU Matrix transpose 16 C 6 3 R 1 C 8 R 8 232 5 8 us or the DMA controller Vector dot product 17 3N N 32 113 2 9 us can respond to a periph Vector max 19 7 N 2 N 32 229 5 7 us eral interrupt request Vector multiply 17 4N
52. kit also includes the source calls for a whopping 6 KB or so back test that has the Pilot command code for the Pilot and Point APIs and Note that minimal hosted Point appli ing the Sensor Point to output a volt as mentioned earlier the Pilot is quite cations have the option of reducing age which the Actuator Point in turn a bit more complex But it s all rela host MCU overhead even further by captures converts and publishes back tive considering the Point API dismissing the API altogether and sim PCB Certified By UL ISO And Over 1 000 Customers ENS ooi Supplier e ICAO TW ii Serving the Electronic industry for over 25 years with New and Surplus Electronic Parts Kits LCD s LED s Audio Parts Meters Switches Power Supplies Fans Relays Tools etc Come On Down and Visit Our Internet Store at www bgmicro com or you can call our toll free number for a live person E 3 e amp We ll be Expecting you WWW BGMICRO COM 1 800 276 2206 lt m B www ezpcb com sales EzPCB com www circuitcellar com CIRCUIT CELLAR Issue 204 July 2007 73 ADVANCE PROGRAM HOT CHIPS 19 A Symposium on High Performance Chips August 19 21 2007 Memorial Auditorium Stanford University Palo Alto California TITTTTTTTTTTTTT C H I P S HOT CHIPS brings together designers and architects of high performance chips software and systems Presentations focus on up to the minute real developments This
53. m running the default application created by the Net 503 743 3194 Turner OR USA Burner tool set The CPU is stopped in Thread 2 main cpp at the OST i meD 1 y instruction 82 Issue 204 July 2007 CIRCUIT CELLAR www circuitcellar com Listing 1 Here are some straightforward methods to declare and reference character arrays have found these useful in small embedded controller applications GO arrow runs the CPU until the next breakpoint INT8 buf 100 bufL0 21 buf 99 INT8 p Lg p amp buf 0 p buf buf 0 A buf This is a message strepy buf This is a message copies the string into the array work in the requirements area than in the code area Coding should be the final phase of the process JUMP IN Enough lecturing let s jump in and do something I installed the tools from the NetBurner CD and that went on without a hitch I created desktop icons for three programs that I ll be using fre quently IP Setup Tool Dev C and NetBurner Embedded Eclipse IDE The IP Setup Tool does just that When you plug the NetBurner devel opment board into your network this tool finds the board and lets you launch a web page contained in the board The web page is the MOD5234 factory demo program that shows dif ferent examples of supported features The Dev C is an integrated devel opment environment IDE distributed under the GNU general public license The en
54. microsystems 64 Issue 204 July 2007 CIRCUIT CELLAR www circuitcellar com Oscilloscope Logic Analyzer 2 Analog and 16 Digital Signals Up to 24Msps 100 Million Samples LE Dual amp bit ADC L0V inputs a zi E oN BUS Decoding Tamim REM ET CK ETT AL vis di ASYNC CAN USB Low and Full Speed Tae npn gon np Ss gn v PE LEE eae eae LRL eee eet I RU tat eat ean I25 SM Bus 1 Wire PS 2 E ae Se Sie Sib Sie ie ai ie ete Se ear ieee Ss Digital Voltmeter UE PTT 10V B bit ADC Logging Data Logg f al T and 16 Digital gas PlusTimestamp Digital Signal Generator 16 Digital Outputs Up to 24Msps ise Width Modulator 16 User Controlled PWM Channels Frequency Counter 16 Channel Counter to 24MHz www usbee com Frequency Generator U ia H gt e Generates Sets of Com mon Frequencies Control I2C Devices Using Simple Text ew Fura bog Brno anl Remote Controller Easily Control Your Hardware Using Your PC MN i em fetal iss Pulse Counter 16 Channel Pulse Counter With Gating Control plus the USBee Toolbuilder Source codeand Library Data Extractors Optional Software Modules for the USBee AX Pro and USBee DX Continuous Real Time Embedded Bus Data Streaming Store Bus Data to Disk or Send to Your Custom Application j H Captire and Process Entire Test Sequences Parallel Serial 126 USB ASYNC CAN SMBus vga 125 Ez Wire 951 693 3065 U S Bee CO i support usbe
55. most demanding microcontroller projects Y P P i b oO pO We p Vision Project Manager C C Compiler Macro Assembler RTX Kernel Linker Locator py Vision Debugger Device Simulation Target Hardware Step 4 Download to Flash and Test Application Once your application is runs in simulation use the Keil ULINK USB JTAG Adapter for W Flash programming and final application testing Components of Keil Microcontroller Development Kits Keil makes C compilers macro assemblers real time kernels debuggers simulators evaluation boards and emulators Over 1 200 MCU devices are supported for B 8 bit 805 and extended 8051 variants B 6 bit Cl66 XCl66 and STIO B 32 bit ARM7 ARMO9 and Cortex M3 Download an evaluation version from wwwW keil com demo PRIORITY INTERRUPT by Steve Ciarcia Founder and Editorial Director Keeping the Lights On Reality Time Ox admit it I m a tech junkie and it s been a few years since was focused on a large project The truth is that every once in a while need the excite ment of ripping the place apart and building something entirely new Its only been a few days since decided to do this but if it can be installed at my location without clear cutting half th
56. needed to use the ubiqui tous USB interface At this point I had several options for implementing the USB interface on my password manager device On one hand I could use one of the many commercially available chips that deal with the USB port as if I were dealing with a standard RS 232 port On the other hand I could choose an advanced microcontroller with built in USB support Both options had the disadvantage of increased complexity and therefore an increased price I went with a USB implementation into a low cost microcontroller through emulating the USB protocol in the microcontroller s firmware The main design challenge was obtaining sufficient speed The USB bus is quite fast with a low speed of 1 5 Mbps a full speed of 12 Mbps and a high speed of 480 Mbps The Atmel ATmegal68 microcontroller is fully capable of meeting the speed require ments of low speed USB only VerifyPIN This method checks the PIN ChangePIN This method allows the PIN of the smart card to be changed ReadRecord This method allows the retrieval of the specified record number UpdateRecord This method allows the specified record number to be updated SeekRecord specified record number This method allows the search of a specific record either forward or backward from the CheckRecord This method allows the search of the first nonblank record either forward or backw
57. of 500 mA The ATmegal68 can be supplied from the Voc and GND The signal wires named Tibbo TECHNOLOGY Programmable in BASIC Optimized for real time applications Rich object set Built in webserver Event driven operation Sophisticated development environment supports cross debugging no ICE needed 26 Issue 204 July 2007 50 MIPS CPU 100BaseT Ethernet port 512K flash disk 4x high speed UARTs FE EE E ee ee Eme iR web www tibbo com CIRCUIT CELLAR Code and debug your Tibbo BASIC application using Tibbo Integrated Development Environment TIDE software EA eli moon Build your next automation project around our EM1000 BASIC programmable Embedded Module High speed parallel slave port Real time clock with backup power 49x general purpose I O lines Development kit available EM1000 SK Write in familiar BASIC language Inspect objects procedures wal vates Code faster with auto completion and code hints Set breakpoints execute step by step etc Monitor the state of variables and stack email sales tibbo com www circuitcellar com Control Your Remote with L 16 bit MCUs Whether your design is a home theater remote or any other embedded application the PIC24F delivers the peripherals performance development tools and software you need With 16 MIPS performance and an extensive peripheral set Microchip s PIC24F microcontrollers
58. required elements for any design are critical when balancing sys tem costs for a particular solution Not only do the number of I O pins mem ory size CPU clock speed and voltage and temperature operating ranges con tribute to a design s cost they also contribute to your ability to eliminate external parts by making good use of the microcontroller s features Microchip provides a line of micro controllers that builds upon a proven core The migration path is cohesive with a wide breadth of products that all use the same user friendly tools This simple premise provides you with a short design to market time frame Although this contest could ultimate ly reward you for your design skills I believe you have an opportunity for something more important Microchip is putting a bunch of parts and all the tools necessary to use them into your hands DIP parts will allow you to easily breadboard a circuit The software tools will allow you to write and simulate code You will need some hardware to program your code into the microcon troller I strongly suggest that you con sider investing in the ICD2 This in cir cuit debugger programmer will become CIRCUIT CELLAR Timers Input capture Output compare Quadrature encoder interface QEI Motor control PWM I O ports and external interrupts Reset UART SPI lC Data converter interface DCI CAN standard and enhanced 10 bit ADC 12 bit ADC Real time clock and
59. sensor The MAF and temperature sensors provide nonlinear outputs between 0 to 5 V The pressure sensor produces a 0 to 5 V linear output and the fuel level sensor a semilinear 12 2 full 73 CQ empty output CIRCUIT CELLAR graph display modes are possible After a format for displaying data was selected the data and its format were determined Sensors used by the ECM include engine airflow coolant and intake air temperature throttle position distributor camshaft posi tion and vehicle speed Other engine parameters and sensors of interest include oil pressure oil temperature fuel pressure fuel injector duty cycle pulse width and an aftermarket wide band exhaust gas oxygen sensor The battery voltage fuel level rear axle temperature and G force were also included The sensors can also inter pret ignition timing in degrees before top dead cen ter BTDC miles per hour and revolutions per minute Measuring these parame ters requires both digital and analog capabilities Most of the analog sensors are based on a 5 V reference supplied by an ECM but others such as battery voltage require something in the 20 V range The temperature and MAF sensor outputs are not linear and require further process ing for a reasonable accuracy over anything but a small window Digital sensors fall into frequency pulse width duty cycle or phase cate gories The digital output voltages ranged from a few hundred millivolts to
60. sensor piqued my interest to monitor them Monitoring estimated horsepower and timing was unique So with fuel pressure and water tem perature filling the last two slots I looked for signals and sensors For fuel and oil pressure sensors I chose a stainless steel Senstronics Storm ST00635 sensor with a range from 0 to 100 PSI 0 to 5 V of output and an operating range of 40 to 125 C The 0 to 5 V temperature out put is an added bonus that may be monitored as well The operating tem perature range could handle fuel pres sure but it would require thermal iso lation for hot oil pressure sensing Some distance from the engine block and a small heat exchanger built from mechanical oil pressure gauge tubing could help bring the oil temperature Serial buffer flag set Cntrl 1 9 character Wait for next address byte Start timeout Address match timer N Send four characters and to serial port Y character Configure processor specific registers xbar Initialize serial port general registers Both buttons held pressed Display PRG start serial code and send serial greeting Jump to programming routine Serial X N Display power on message present Disable UART Keep UART enabled Jump to Operating mode accepting serial commands Jump to Operating mode ignoring serial commands Figure 4 Here are the power up flow and options for entering programmi
61. sys tem to a new house where the ceilings in the basement were higher This makes it easier to place the camera DEBUGGING TOOLS A very useful feature of the BF561 is the background telemetry channel BTC which allows VDSP to read from and write to memory without interrupting the processor cycle This is performed with spare DSP cycles during idle By hooking up the BTC specific global variables we could adjust data on the fly without halting and recompiling the program code This feature made it easier to fine tune threshold or step size values as well as enable and disable ghost ball predictions or history trails We successfully developed an initial prototype system that is able to per form object detection simple trajecto ry prediction and motion tracking Background suppression is a very basic concept for object detection but it worked well for us The ghost ball prediction algorithm combined with the ball history trails helps the begin ning pool player Although time was a www circuitcellar com limiting factor in the progress of the project we met or exceeded most of our design goals In the future we hope to have more time to expand the project FUTURE WORK At this stage of the design we have implemented only predictions of sim ple shots in a half table scenario We intend to enhance the system to include multiple ball combinations or bank shot predictions as well as statis tical calculat
62. time to align to the correct pixel location 36 Issue 204 July 2007 Therefore the viewable resolution of a single video frame is 720 x 480 pixels The ITU R 656 standard requires the 4 2 2 YCrCb format Uncom pressed video requires one luminance Y one red chrominance Cr and one blue chrominance Cb value for each pixel 4 4 4 data format In the 4 2 2 subsampling method every four pixels contains four Y two Cr and two Cb values Since the human eye is more sensitive to changes in luminance than changes in chrominance the loss is relatively unnoticeable The sub sampling method is considered worth while due to a 33 memory reduc tion compared to the minor visual data that is lost That is why the 4 2 2 YCrCb method is preferred over the typical uncompressed RGB red green blue pixel format for video encoding PPI controllers are also designed to receive the ITU R 656 video format with various customizable options They include receiving only active video data V blank data or the entire field active and V blank data Anoth er option for PPI is to use 656 compli ant video formats where the structure of the frame is similar but the number of V blank lines active video lines and active pixels per line can be defined by the user Since we are trying to provide a live feed to an output TV we config ured PPIO to receive the entire field of standard NTSC frames One DMA channel is allocated to tran
63. to as Card menu brings up another submenu that allows the card s PIN to be changed or makes a backup of all the records stored By pressing A again the PIN in the smart card can be changed To do this the password manager device asks for the current PIN and the new PIN the PIN is four digits long The PIN is changed only if the verification of the current PIN is successful other wise the PIN remains unchanged However by pressing B it is possi ble to backup all the records The device waits for another key press to www circuitcellar com start sending the complete list through the USB Because the password manager is emulating a standard keyboard it is possible dede to store the received data with the help of a text editor without a special application You can go back to the main menu at any time by pressing the asterisk key Additionally if you withdraw the card during operation the device will start the authentication process again prompting you to insert the card and verify the PIN again So it is possible to have more than one active smart card and make changes on the fly without restart ing the system This enables you to have one smart card for all passwords used in the office and at home Main menu View menu HARDWARE DESIGN The hardware design is built around the ATmegal68 see Photo 2 Its platform has the small footprint required for this Internet password m
64. with Service Pack 2 Unfortunately the C compiler is not included as a standard feature Howev er it has support built in for the open source avr gcc compiler The avr gcc compiler can be configured easily with the help of the WinAVR 20050214 dis tribution package To download the WinAVR distribution package for Win www circuitcellar com WiZnet released new network modules with W5100 Anyone can implement Ethernet function by adding the WIZ module series without changing existing MCU of embedded system Application Support serial speed max 230Kbps 10 100Mbps Ethernet and auto MDIX Provide Configuration Tool program to be installed in the PC Socket AP F Driver Program Memory Bus I F SPI I F MCU Interface Plug in type module having pin header 12pins Size 50mmx30mmx12mm W x L x H Serial to Ethernet Hardware TCP IP Core Spec is same with WIZ100SR In addition Include the DB9 and RJ45 I F for user s convenience JONG XY XL Ethernet PHY W5 9i 00 Transformer USB to Ethernet Support USB2 0 Full Speed amp OTG WIZ 200USB One stop solution for internet connectivity Ethernet controller Transformer Mag Jack and TCP IP stack are included Support memory bus and SPI for MCU I F All in One Connector WIZ 800MJ Multimedia Data gathering amp Remote Control THT
65. years he left in 2002 to start his own consulting firm John has been involved in many of the prod ucts that you can buy in your local electronics store He has also written several books on USB and is currently working on a USB Projects By Example book He can be contacted via his web site at www usb by example com PROJECT FILES To download code go to ftp ftp circuitcellar com pub Circuit_Cellar 2007 204 SOURCES ICD U40 In circuit debugger programmer Custom Computer Services Inc www ccsinfo com CY8C24223A Microcontroller and development tools Cypress Semiconductor Corp www cypress com uVGA Display 4DSystems www 4dsystems com au TTL 232R 3V3 Serial converter cable Future Technology Devices International www ftdichip com Vinculum ASIC VDIP1 and VMusic modules Future Technology Devices International www vinculum com GPS 18 LVC Tracker Garmin International Inc WWW garmin com DS1302 Timekeeping chip Maxim Integrated Products Inc www maxim ic com PIC16F88 Microcontroller Microchip Technology Inc www microchip com Issue 204 July 2007 67 SILICON UPDATE Pyxos Power by Tom Cantrell If your project is in need of a standard network or has wiring concerns nodes or a complex protocol Echelon s Pyxos FT chip may be the perfect fit Tom explains how it will give you the reliability security and power of wires without the mess Wa all the action on the wireless front
66. 0 kbps 38 kbps 4 9 ms 195 kbps 26 kbps 6 5 ms 198 kbps 20 kbps 8 ms 200 kbps 16 kbps 9 5 ms 201 kbps 13 kbps 11 1 ms 202 kbps 12 kbps 12 6 ms 203 kbps 10 kbps 14 2 ms 203 kbps 9 kbps 15 7 ms 204 kbps 8 1 kbps 17 3 ms 204 kbps 7 4 kbps 18 8 ms 204 kbps 6 8 kbps 20 3 ms 205 kbps 6 3 kbps 21 9 ms 205 kbps 5 9 kbps 23 4 ms 205 kbps 5 5 kbps 25 ms 205 kbps 5 1 kbps 1 Approximate value 2 Sustained average rate Peak rate may be significantly greater Table 1 The bandwidth and latency i e frame time specs for the Pilot and Points depends on the number of devices attached to the network One implication is that a hosted Point may well be able to get by with a bit banged SPI but a Pilot probably requires a host MCU that includes a high speed e g 1 Mbps hardware SPI appear and or fire and forget output updates see Table 2 That leaves plenty of cycles for a Point MCU to handle the local application or for that matter just sleep a lot By contrast it s the Pilot that has to keep track of all the network variables in the system figure out where updates should go and make sure they get there in a timely fashion Furthermore the Pilot is responsible for monitoring the health of the sys tem and intervening if necessary e g resetting or hot swapping a crashed Point Finally the Pilot
67. 100 mA sink driver pro vides four 32 V ESD protected outputs The interface PCB provides room for latching connectors filtering for two push button inputs additional analog buffering and an automatically switching two wire RS 485 driver see Figures 1 2 and 3 SOFTWARE The system s software was devel 46 Issue 204 July 2007 oped with Silicon Laboratories s IDE in assembly language The IDE s software package includes a Keil assembler a linker a compiler and support for in cir cuit emulation and programming capa bilities when used with an EC2 serial adapter device The EC2 acts as the link between the processor and the host PC s RS 232 port The IDE package the EC2 and the evaluation board are part of the C8051F330 development kit I wrote the code in six functional sections main processor configuration analog fre quency pulse width phase duty cycle and programming Three modes may be selected at powerup Simple Operation Operation with Serial Port Enabled and Program ming mode During power up the processor s resources are configured and serial ports are initialized for 57 600 bps 8 data bits no parity and CIRCUIT CELLAR Stop bit From here you have three Options as you can see in Figure 4 Operation with Serial Port Enabled allows you to enter Programming mode a bus master to disable commu nication with all gauges except speci fied and request gauge data for data log ging It also e
68. 15 DATAS 1k 13 DATAS TT DATAN p 9 DATATI 74HC4053 DE ADDR16 z Z DATAEN gt LL i 3 DATATAN RESET d DATAEN LCD Connector LCD_VOUT ARMS _ 40 DATAO ADDRO 12 13 DATAO E AGE 89 DATAT ADDAI 11 14 DATAT 38 DATA ADDR2 10 WS PARADDA ADDR3 9 L DATAS PAS ADCS ae DATA 18 DATAA PA4 ADC4 A9 DATA DATAS PAS ADCS FS DATAEN 25 DATAE PAS Abos L34 DATAS 20 DATAS PAT ADC Eg MN rat td 29 DATA15 PG TOSG2 35 DATAIA PC6 TOSC1 EI PDO RXD PC5 TDI EENEN PD1 TXD PC4 TbO SS DATAT2 T PD INTO PC3 EN PD3 INT1 PC2 TCK 5 os 32 PD4 OC1B PC1 SDA H PD5 OC1A PCO SCL 22 _DATABN PD6 ICP1 PD7 OC2 16 ATmega32 19 ADDR 18 ADDR6 17 ADDRS 16 ADDR4 15 ADDR 14 ADDR2 13 ADDAI 12 ADDRO U1B C13 3 8V 5 int m ce 10u D2 R7 74HCTO8 2 Ma dk C1 U1C DI RB o LEDB gt ve oc pu OSC1 C UNO 2 dl 25MHz C3 74HCTO8 Vsspll ppp 4 T 9 Vddpll L 3 Vddrx 227p F 3 Vsstx MISO TPOUT TPOUT Vddtx 74HCTO8 MOSI SCK LF1S022 RESET J8 5V 3 3V C27 10u Tant C28 10u Tant CIRCUIT CELLAR 69 aw 4 a J7 45 J4 RJ45 10BASE T FILTER C10 c9 0 001u O1u 2kV www circuitcellar com Microchip fO Bit Embedded Control Circuit Cellar magazine and Microchip Design Contest are pleased to bring you the Microchip 16 bit Embedded Control Design Contest This is the perfect opportunity to learn ab
69. 17 Microchip 16 bit Embedded Control 9 SEGGER Microcontroller Systems LLC 86 Cellular Specialties Inc 90 IMET Corp Design Contest 90 TAL Technologies 11 88 Custom Computer Services Inc 87 Intec Automation Inc 92 microEngineering Labs Inc C3 Tech Tools 1 Cypress 88 Intrepid Control Systems 90 Mosaic Industries Inc 48 49 Technologic Systems 86 DLP Design 39 Intronix Test Instruments Inc 63 Mouser Electronics 88 Technological Arts 87 DSP Workshops 92 Ironwood Electronics 89 Mylydia Inc 89 Tern Inc 82 Decade Engineering 64 91 JK microsystems Inc C2 NetBurner 26 Tibbo Technology Inc 90 Designnotes com 34 Jameco 82 Nurve Networks LLC 92 Trace Systems Inc 85 EMAC Inc 37 Jeffrey Kerr LLC 92 Ontrak Control Systems 88 Triangle Research Intl Inc 66 ESC Boston 95 Keil Software 88 Opal Kelly Inc 88 WCSC Willies Computer Software Co 87 Earth Computer Technologies 3 LabJack Corp 32 PCB Pool 31 Wiznet 80 Efficent Computer Systems 37 Lakeview Research C4 Parallax Inc 90 Zanthic Technologies Inc 25 Elprotronic 87 Lawicel AB 86 Phytec America LLC Preview of August Issue 205 ATTENTION ADVERTISERS Theme Embedded Development September Issue 206 Embedded Scripting Deadlines High Performance Motor Controller Space Close July 11 Text Adventure Gaming Material Close July 19 Handheld Multifunction Scope Theme Electronic Bicycle Design Data Acquisition Build a PHP Components Database 1 Wire in the Real World Part 1
70. 2 T T 2 L wh Ea nn Led if Fa j 1 New FlashPro CC and GangPro CC l ITE us SEAS dee i 7 uu Er T Hs MEA A i USB Flash Programmers for CC series devices ChipCon from TE i UT d i 7 m E Y p PES E unc MUS ta C o LI MEM a E x 4 Pra rac dic a p ie w ID errs rcc w elprotronic com F Issue 204 July 2007 25 erate strange data rates this is not a problem for the ATmegal68 which can generate a stable communication speed programming the data rate gen erator accordingly The LCD is a standard 2 x 16 display compatible with the industry standard Hitachi LCD controller It is connected to the ATmegal68 with a 4 bit bus configuration to save I O lines The 16 key multiplexed keypad is used to enter numerical and alphanu merical data when requested by the device In order to save I O lines the keypad is connected to the ATmegal68 s analog input ADC through a resistor ladder The resistor network values are chosen so that the impedance drop is proportionally dis tributed among all keys in increments of 500 O To ensure good keypad reliabil ity choose all the resistors as precision resistors of 196 tolerance Even though the voltage drop is not proportionally distributed between all the keys thanks to the ADC s 12 bits of resolu tion it is possible to distinguish all the keys simplifying the keypad interface Photo 2 A close up view of the Internet passwor
71. C CIRCUIT CELLAR Issue 204 July 2007 61 currents between 50 and 300 mA so I programmed the Vinculum to use Suspend mode that powers the drive only when it is being accessed Deciding when to power the GPS module is a trade off depending on the period between samples It will also vary depend ing on your application If the period between samples is long you can save battery power by turning it on only during its satel lite data acquisition phase My application waits for a valid position report and then powers down the GPS I have used this design in a variety of GPS applications The most obvious design recording a vehicle s move ment was easy to implement Just attach a battery and a flash memory drive and insert it into the vehicle to be tracked Later remove the flash memory drive and insert it into a PC that is running Garmin map software Data from the flash memory drive can be imported into the map and a histo ry of the vehicle s movements is dis played If you have a fleet of vehicles such as delivery trucks you can hard wire the design into the vehicles so you don t have to deal with the volt age generators Each week you could swap out the flash memory drive and the recorded data could be used to analyze delivery routes with a goal of optimizing your fleet s travel The dig ital tachograph would pay for itself in fuel savings My favorite GPS application how ever is GeoTagging my photographs
72. C cut your own custom chassis front pane rl and moe i 1 877 7 POLOLU www pololu com 6000 S Eastern Ave 12D Las Vegas NV 89119 Issue 204 July 2007 71 Pilot Application Options Manmum number al Paints Alererved hmeslots e g 1 3 4 H Plat source code apimizali ns M Include statistics functions Use ancdemand TOM mode Support only hardwired Points Enable unhasted Poirt support Enable suppait lor Protocol Analyzer callbacks Disable clock out pn Descnpten The EWE Pitot application supports three poris 1 n unehosbed Pant called the HanoPont 2 tma Painl supporting 3 analog sensors Memory management options Advanced options Use heap for memory management Number of frames belone mant hG Maximum Points of thes ype 3 Fiegister bulter size bytes T Manuell overide number of limeslols Humbe of imera gt Maximum number al Points of this ype E Help Delaks Cancel Save and Oor Photo 3 Another step in creating a Pyxos FT project is defining the basic characteristics of the network e g the number of Points and timeslots as well as embellishments such as statistics gathering e g for dynamic error recovery and a protocol analyzer feature i e network logging for debugging log input voltage Moving down the ladder of cost and includes i e lights and switches it includes an ADC for capturin
73. D5234 Network develop ment kit NetBurner Inc www netburner com MSP430 Microcontroller Texas Instruments Inc www ti com CIRCUIT CELLAR Order Online www CcCircuitcellar com or call 860 875 2199 www circuitcellar com back issues available as CD ROM 11 2006 Issues 186 197 CD ROM 10 2005 Issues 174 185 CD ROM 9 2004 Issues 162 173 Oe 27 Vox Bi 11 110 0 FD e x86 200MHz CPU Compact SIB Quantity 1 Since 1985 OVER 22 YEARS OF SINGLE BOARD SOLUTIONS CIRCUIT CELLAR Server In a Box Starting at 170 00 SERVER 5 e 128MB SDRAM On Board e 512MB CompactFlash e 10 100 Base T Ethernet e Reliable No CPU Fan or Disk Drive me fe e Two RS 232 amp Two USB 1 1 Ports e Optional Wireless LAN amp Hard Drive e Optional On Board Audio e Dimensions 4 5 x 4 5 x 1 375 115 x 115 x 35mm 2 6 KERNEL e EMAC Linux 2 6 Kernel e Menu Drive Configuration Utility e Eclipse Development Environment e HTTP and FTP Servers e PPP Dial In Out Server amp Client e Telnet Server EMAG inc EQUIPMENT MONITOR AND CONTROL Phone 618 529 4525 e Fax 618 457 0110 e www emacinc com Issue 204 July 2007 85 IDEA BOX THE DIRECTORY OF PRODUCTS AND SERVICES 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
74. DDRI6 again sets the direction of the LCD access read or write DI describes the type of instruction sent to the LCD EN is the enable signal for read and write cycles For the keyboard you need only two pins KEY DATA and KEY CLOCK The clock signal must be connected to an external interrupt pin INT1 One additional wire is needed to switch the latch LE You are left with eight I O pins on the ATmega32 s ports B and D RXD and TXD are connected to a MAX232 an RS 232 level converter that also provides the negative supply voltage needed for the LCD LCD_VOUT in Figure 2 The ATmega32 s USART functionality is used as a debugging interface It isn t needed for normal operation The ATmega32 and ENC28J60 com municate via their SPIs Because you www circuitcellar com need the Atmega32 s SPI pins MOSI MISO and SCK for in system pro gramming they are multiplexed with a 74HC4053 As long as reset is active pins five to seven on port B of the Atmega32 are connected to the ISP10 connector via the 74HC4053 other wise they are connected to the ENC28 60 s SPI The ENC28J60 needs a supply voltage of 3 3 V provided by a 3 3 V voltage regulator U2 but it is 5 V compatible so you can connect it directly to the ATmega32 s outputs In the opposite direction you need a level conversion which is done by a 74HCT08 U1 for the interrupt signal which is connected to the ATmega32 s INTO INPUT pin The rest of the c
75. I wrote the firmware in C language with a few small parts of inline assem bler I used the open source software suite WinAVR which includes the GNU GCC compiler with special libraries for AVR devices and avrdude a tool for the in system programming of AVR microcontrollers The firmware must be compiled using the 0s option which opti Photo 2 Take a look at the circuit board To provide a better overview removed the cables normally connected to it Issue 204 July 2007 15 mizes the code for size This is important Otherwise the compiled code would be about 5096 larger too large to fit in the program memory At the moment the code optimized R16 10k R11 D7 1N4004 SS ATR JP tL c29 ae R17 aH Manual s reset 5V Ca c2 1000u Q 1u c1 22p Q2 C4 16MHz 5V c15 Lt 1u LCD VOUT C16 tu C24 tu Lr 5V BE 1u C26 C25 MAX232 0 1u 1u Figure 2 Here s the complete schematic for the MiniEmail The LF1S022 is the RJ 45 connector for the Ethernet connection 16 Issue 204 July 2007 is 30 KB USER INTERFACE The user interface consists of three control elements menus edit fields and an elaborate text editor A special screen the Mail Menu enables you to quickly browse through your mailbox After power up the system displays a greeting message After a short MISO SCK MOSI 45V 19 DATA6 HATAN R1
76. I O functionality four I Os and one input delivery in all cases e g wire short open so you the designer always have to make a provision to fail gracefully But under normal con ditions Points can be assured they ll get the bandwidth and precise timing they need when they need it Another benefit of the Pilot amp Point scheme is that the asymmetry puts most of the complexity in the Pilot making life easier and cheaper for the more numerous Points Indeed a so called unhosted Point need consist of little more than a Pyxos FT chip by itself see Figure 2 DOWN TO THE WIRE The deterministic bandwidth and latency derives from the Pyxos FT frame see Figure 3 In turn a frame comprises timeslots typically one for each Point Each timeslot gives its associated Point the opportunity to send 8 bytes of data and receive 8 bytes of data This frame scheme has some obvi ous implications for system designers First the overall frame time directly depends on how many timeslots it contains since the latter are of fixed duration Thus the network band width and latency for an individual Point is directly and inversely related to the number of Points in the net work As you can see in Table 1 band width ranges from about 5 to 70 kbps fine for a sensor or actuator but leave your multimedia A V at home The fixed frame and timeslot scheme also dictates that when you design your application you have to de
77. IC MCUs SO Be TM complet a oe JM 2 line 20 char LCD Module M Y We TICBASIC Compiler 99 95 UP Ee E T i 9 pin Serial Port OMP T SOmpaunle Programs Fy ott more j p Supports most 14 bit Core PICs nds sal A i o PIC MOUS Wik NE f Sample Programs ME Built In Serial Comm Commands including i PIENE aito BENI Full Schematic Diagram low voltage E m oie n PICBASIC PRO Compiler 249 95 3 3V devices z E ia ni imaa SS Pricing from 79 95 to 349 95 Supports Microchip PIC10 PIC12 PIC14 oe E Bo eho EFIE PIC16 PIC17 and PIC18 microcontrollers Wind e eue be a Direct Access to Internal Registers MAOA Supports In Line Assembly Language 98 Me NT With Accessories for 119 95 Sorcerer Interrupts in PICBASIC and Assembly 2K and XP Includes Programmer Software USB Cable BEEN Double Sided with Plate Thru Holes Built In USB I2C RS 232 and More Software and Programming Adapter for 8 to 40 pin DIP Circuitry for Power Supply and Clock Source Level Debugging Large Prototype Area Parallel Port Programmer Boards Available for Most PIC MCUs See our full range of products including starting at 59 95 t Documentation and Schematic books accessories and components at Serial Port Programmer starting at 79 95 Pricing from 8 95 to 19 95 www melabs co m 92 Issue 204 July 2007 CIRCUIT CELLAR www circuitcellar com C O o Pt EE TT E P EH t LLL PP See NH CM LLL a a HE Siil
78. OST BALL PREDICTION Ghost ball prediction is a technique Figure 6 The red target ball and grey ghost ball positions are centered at T T and G G respectively Each ball has a radius of R y mx bis the equation that describes the line having a slope of m and y intercept of b The desired pocket has coordinates of P P x www circuitcellar com Photo 2 Here the ghost ball detection is finding five object balls and draw ing the expected contact point on each commonly used by novice pool players to aim shots It is a simple method for estimating where an object ball should be contacted so it follows a desired path A line is drawn from the pocket through the target ball see Figure 5 The center of the imaginary ghost ball lies on this line directly behind the target ball This places the target ball between the center of the ghost ball Wireless Control Application Kit 900 MHz and 2 4 GHz RF b Low power LP3500 Single Board Computer Two MaxStream license free RF Modules FCC approved Software libraries and samples ModBus and PPP support for serving web pages www circuitcellar com Complete Application Kit 7599 1 4 GHr Version 5499 900 MHz Version and the pocket If the cue ball is shot at the ghost ball the target ball should follow the path leading directly into the pocket After the object detec tion phase the locations of the pool balls and the cue ball
79. PES Le ht A areala atm 3 p e TT 32 bit Flash Microcontrollers 32 bit Api ication Processors Up ta 512 KB in system programmable Flash DSP and SIMD instruction sets and 64 KB RAM on chip Low latency interrupts LE 1 DSP instruction set Large number of I O pins OW s inten une Communication interfaces i E eat C D args number of O pins thernet MAC Hi Speed USB Communication interfaces Ethernet MAC USB device amp OTG Man Machine interfaces LCD Camera Audio System extension capability through SRAM SDRAM interface Linux supported by Atmel 210 Dhrystone MIPS at 150 MHz 75 mA at 150 MHz 1 8V a oe d E m Nate for more details about rhe test camditions for performance and consumption please refer to datasheets NEW PRODUCT NEWS NEW ETHERNET ADAPTERS MEET MANY NEEDS WIZnet is now offering several new adapters to meet your Ethernet connectivity needs The WIZ100SR and WIZL110SR serial to Ethernet modules are upgraded ver sions for use in access control medical devices and other industrial and consumer products The newly released W5100 which includes embedded hardware TCP IP Ether net MAC and PHY is applied in these modules to guaran tee better performance stability and a lower cost Both modules support a maximum serial speed of 230 kbps 10 100 Mbps Ethernet and autoMDIX The WIZ100SR is a plug in module with a 12 pin header The WIZ110SR has DE 9 and
80. S SWITCHES TO 2 WEEKS TURNAROUND e VERY COMPETITIVE PRICING e Ex 5 4 switch keyboards for 395 00 e PCB backed switches e Custom metal backplates assemblies e Electronic assemblies graphic overlays e Electronic file transfer capabilities a Picofab Inc 47808 Blvd Henri Bourassa Charlesbourg Quebec Canada G1H 3A7 Tel 418 622 5298 Fax 418 622 9996 Email sales picofab net www circuitcellar com ANYONE Can Now Easily Hand Solder Surface Mount Components Even A 10 Year Old www schmartboard com 168 procesgqor s 13 MHz DOS wi Flash File amp ystem 44 Digital 1 0 limes w CPLO a Congole Debug Serial Port 7 34V DC or 5V DC power 2 Serial Ports Accepts EME DiskOnChip 2 16 bit Timers 512K DARAM A 512K Flash Watchdog Timer Expansion options with Peripheral Boards Flaahlite 185 controller Borland C C ver 4 52 FREE Email Tech Support Serial Driver library r AC Adapter and cable Call 530 287 6073 Email salese kmlicro com On the web at www ikmicro com Weather Instruments for PCs electr nica www aagelectronica com Electronic and Electro mechanical Devices Parts and Supplies Wall Transformers Alarms Fuses Relays Opto Electronics Knobs Video Accessories Sirens Solder Accessories Motors Heat Sinks Terminal Strips L E D S Displays Fans Solar Cells Buzzers Batteries Magnets Cameras Panel Meters Switches Speakers Pelti
81. The Challenges Bonus DISTRIBUTION Embedded Systems Conference East ABOVE THE GROUND PLANE Hearing Clearly now to reserve your space FROM THE BENCH Graphical User Interfacing d ad u e mail shannon circuitcellar com SILICON UPDATE Silicon Secrets 94 Issue 204 July 2007 CIRCUIT CELLAR www circuitcellar com ds Microcontroller Development An ARM Company Tools Only 4 Steps are required to generate efficient reliable applications with the yu Vision IDE and development tools from Keil Step 1 Select Microcontroller and Specify Target Hardware Use the Keil Device Database www keil com dd to find the optimum microcontroller for your application In u Vision select the microcontroller to pre configure tools and obtain CPU startup code Step 2 Configure the Device and Create Application Code The Vision Configuration Wizard helps you tailor startup code to match your target hardware and application requirements Extensive program examples and project templates help you jump start your designs Step 3 Verify Program Execution with Device Simulation High speed simulation enables testing malc oe unm before hardware is available and helps you with features like instruction trace code coverage and logic analysis Keil Microcontroller Development Tools help you create embedded applications quickly and accurately Keil tools are easy to learn and use yet powerful enough for the
82. a smart card into the slot the password manager auto matically requests the verification of the card s PIN to prove that only you can use your card The PIN is four dig its long and entered using the keypad s numerical keys You have three attempts to verify the PIN After the third unsuccessful attempt the PIN is locked and it is necessary to unlock the PIN with the PUK PIN unlock key If PIN verification is successful the password manager device displays the main menu Upon PIN verification the system displays the main menu so that the function keys on the keypad A B C and D are available for you to select an option such as browsing through all the IDs stored in the card finding a specific ID adding or deleting an ID and performing card maintenance e g changing the PIN of the card or mak ing a backup of all your stored records to a PC through the USB connection 24 Issue 204 July 2007 with the help of a text editor After pressing the function key labeled A also referred to as View menu the LCD shows the first ID stored in the smart card if available The username and password are not shown on the LCD for security rea sons You can browse the next and previous records by pressing the A and B function keys respectively Once Keypad algorithm N Key pressed Y Display first character of the key Start timeout Key released Y Start timeout N N Key pressed Y Different
83. able and the cushions are made of the same felt we either had CIRCUIT CELLAR PIC SERVO MOTION CONTROL MOTION CONTROLLERS FOR BRUSH BRUSHLESS AND STEPPER MOTORS controller chips controller boards www picservo JEFFREY KERR LLC JAN AXELSON PRISCA USB Mass Storage Designing and Programming Devices and Embedded Hosts Jan Axelson ISBN 1 931448 04 3 Lakeview Research LLC 29 95 www Lvr com From the author of USB Complete LabJack UES A Available now vAN for only cR 429 qy1 USB Ethernet Data Acquisition amp Control USE 204 1 and Esher T analog cuiputs 11 2 5ill 14 analog pute t te PH 3 digas IAD Beam npubdela sp he RHE Up te z couriers iab Fen wah CWE LabcvIEW e La da G bree Inzudeg DACIFackry Esprass Appr g 3 x2 xd Dieser pides roms 10 bo 85 dag C amp LabJack Corporation Colorado USA infoizlabjack com 203 942 0228 www labjack com Issue 204 July 2007 37 to spend a large amount of time trying to find the exact boundaries of the rails using minor changes of shade difficult to distinguish or take a more straightforward approach We used our Canadian heritage and applied a strip Listing 1 Here we compare the Blackfin assembly code using SIMD and software loop pipelining left with the unoptimized code right Performing on a 720 x 16 pixel block took 110 500 and 138 500 clock cycles for optimized and unoptimized respectively Thi
84. able on the Blackfin the operation was performed efficiently Further optimizations with software loop pipelining and single instruction mul tiple data SIMD instructions make the operation even faster The special hardware instructions that are of interest to us are the BYTEOPI6M Vector ABS and BYTEPACK instruc tions The BYTEOP16M instruction performs a quad 8 bit subtract on a 32 bit register treating each byte of the regis ter as an individual value Vector ABS instructions were used to calculate the absolute value of the individual top and bottom 16 bits of a 32 bit register Finally BYTEPACK combines four 16 bit values from two 32 bit registers into four 8 bit values packed into a single 32 bit register SIMD instructions can be used to execute up to three instructions simulta neously including a logic operation on previously received values and two memory loads of values to be processed There are however limitations on what individual instructions can be paired to make a legal SIMD instruction Also you must be careful implementing soft ware loop pipelining We had to make determined experimentally and has to be changed when the lighting environment is background image was cap Professional Features Exceptional Price 34 Channels sampled at 500 MHz Sophisticated Multi level Triggering Transitional Sampling Timing and State Connect this indispensable tool to your PC s USB l l or 2 0 port
85. achiochi Microchip 16 Bit Embedded Control Design Contest Primer 81 LESSONS FROM THE TRENCHES From Hello World to Big Iron George Martin DEPARTMENTS 4 TASK MANAGER 94 INDEX OF ADVERTISERS A Look Back and Forward in Tech Time August Preview C J Abate 96 PRIORITY INTERRUPT 8 NEW PRODUCT NEWS Keeping the Lights On Reality Time edited by John Gorsky Steve Ciarcia 93 CROSSWORD 6 Issue 204 July 2007 CIRCUIT CELLAR www circuitcellar com M must recharge myy fuel calls D RECHAR ore E i A Don t know the ics You don t need to recharge your fuel calls Wasteman You can have mine More MIPS Less mA AVID T TT mnm sta aaard saeehitar im kath aware tode der T Te AVH32 outperforms industry standard architectures in both performance and code density AVH32 Is designed for low power applications demanding high performance The Harvard architecture and multiple high speed sym buses guarantee exceptional pn Poa pano rmance whilst various sleeping modes and Dynamic Frequency Scaling ensures low power consumption Both UCS3 and Lak sub families arg T ported by Atmel s large range of development tools and the free AVE32 Studio makes it easy to start MELLE developing G C code today nm L1 FI EL mi pm hn T Pa AN LE j a F if Tal ra Taba j rapia J om wi a jie i ai m L i AN g m ir ELTE La hot Ga NEM E s if On Li i W a i 3 F Al E f WW 1i b 2 WO hit Claeh flies P
86. actions are accessible from the Mail Menu You can view the header of an e mail h mark all the e mail as read A and jump to the next new message n CONFIGURATION MENU The Configuration menu enables you to change the settings for the Internet connection and view the version of the firmware you are using Because you probably haven t memorized the IP address of your mail provider you can enter the domain names e g pop3 mail provider net of the mail servers The firmware will resolve the DNS to the IP addresses which are needed for the SMTP and POP3 connections At the moment my system has a hard coded static IP because the DHCP routines which allow clients to be assigned a dynamic IP by a DHCP server in the local network did not fit into the flash memory This is isn t the best scenario but it suffices for normal home use because I typical ly use the same IP address STAND BY MODE The last item in the main menu is the stand by option In Stand by mode the LCD and its backlight are turned off and the MiniEmail checks for new mail on a regular basis When you have new mail a message is presented on the LCD and the LCD s backlight turns on again You can exit Standby mode by pressing the Escape key Any other key displays a message telling you how many minutes you have left until the next automatic mail check is performed CODE BASICS Now that you understand the user interface let s take a clo
87. ake a higher temperature enclosure is probably a good idea An application program to fully utilize the data logging capability is waiting to be written I am still con templating whether to develop some thing laptop based or a dedicated hard ware master node with some type of removable memory I would like to avoid running a laptop in a vehicle 54 Issue 204 July 2007 Photo 3 This is a test panel with room for three more units if needed plan on adding Min and Max buttons probably in a single pair with a rotary switch selector configuration but it would allow more flexibility Currently only one mode of opera tion is possible at a time and they can not be mixed Functions like miles per gallon or quarter mile elapsed time would be nice but they are not possi ble with the current software configu ration Since all but a few bytes of the 8 KB of program memory are used some of the multifunction flexibility would have to go to accommodate the functions Different display colors are possible and easily mixed with the constant current driver but ultrabright green or blue T sizes and seven segment devices are still expensive Even with out multiple colors the programmable bar graph with an expanded scaling and flashing capability works well to get your attention while providing some eye candy There are plenty of other interest ing functions to explore including a boost indicator controller a tachometer wit
88. al at 9 600 bps to show you how easy a Vinculum is to use I used FTDI s TTL R232 3V3 cable because it uses TTL levels rather than RS 232 voltage lev els and provides 5 V to power a device I connected the cable to a Vinculum module called VMUSIC see Photo 2 Ignore the name for now because you won t use the music part until the Command Directory operations second example For now it is a Vincu lum chip mounted on a board with a convenient serial connector Choose any of your flash drives and plug this into the USB A sock et of the VMUSIC board see Photo 2 The board will sign on and offer a D prompt In HyperTerminal enter DIR and presto the contents of your drive are displayed Now enter the following commands OPW testl IPA WRF 12 Hello World CLF testl The command opens a file called testl for writing changes the Input mode to ASCII and writes 12 bytes Hello World is the data that is DIR Lists the current directory MKD name Creates a new directory lt name gt in the current directory DLD name Deletes the directory lt name gt from the current directory CD name The current directory is changed to the new directory lt name gt CD us Move up one directory level File operations RD name Read file name This will return the entire file OPR name Opens file lt n ame gt for reading with RDF RDF lt size gt
89. al byte wide interface is controlled by read write strobes and FIFO full empty signals A 128 byte TX FIFO and a 256 byte RX FIFO can sus tain data rates up to 1 MBps The DIP module also includes a 12 MHz crystal and reset circuitry that enables the monitor to start running at power up The Vinculum is microcontroller based The command line interpreter is implemented by a program running from the on chip 64 KB of flash mem ory The monitor firmware can be attaches here Another USB host or device Photo 1 The Vinculum is available in a variety of modules Here is the 24 pin DIP module that provides access to all three monitor interfaces and both USB ports This module plugs directly into a 0 1 prototyping board Issue 204 July 2007 59 updated using PC software or a firmware update file can be incorporated on the flash drive FTDI has several sets of firmware that match its array of modules check www vinculum com for the latest versions New features are added to the monitor all the time including support of other USB classes such as HID and printer which are included using one of the firmware update methods The mon itor includes commands that allow the detection of attachment and removal of a flash memory drive so your applica tion processor can incorporate the hot swapping of USB devices the exam ples use these features and more I connected a USB to serial cable to my PC that is running HyperTermin
90. ally Optimized crosstalk behavior is achieved with a verti cal transverse to longitudinal direction configuration of the signal pairs and the pairing arrangement of signal and shield contact pairs While the signal contacts are made in SMT the user can select between two terminal options for the shielding depending on the application SMT or THR connection The shielding pins also assure robust strain relief of the connector The length of the connector modules is 27 mm with 50 signal contacts and two shield plates They can be easily lined up with virtu ally no loss of board space Large volume prices start at 9 50 for a mated con nector pair ERNI Electronics www erni com a Ta And Create Industrial Digital Computing SeaLINK USB Serial Adapters Provide 1 2 4 8 and 16 Port Models e RS 232 RS 422 and RS 485 Serial Interfaces Data Rates to 921 6K bps e State Machine Architecture to Reduce Host Processor Overhead Operation as Standard COM Ports to the Host Computer SeaLINK USB serial adapters are the fastest most reliable way to connect peripherals to any USB equipped computer Lifetime Warranty FOCUS On Success EE uw m E oi j F e E sealevel com gt sales sealevel com gt 864 843 4343 CIRCUIT CELLAR 12 Issue 204 July 2007 SERIALIZER DESERIALIZER FOR PORTABLE ELECTRONICS WITH CAMERAS The FIN212AC is the first uSerDes device specifically desi
91. ame Main Suspended Breakpoint hit 3 UserMain at main cpp 29 0x0200017c 2 Topofstackkillfunction at ucosmcfc c 40 0x02005048 1 symbol is not available OxO0000000 gf Thread 3 Prio 40 Name TCP Suspended 3 Thread 4 Prio 39 Name IP Suspended g Thread 5 Prio 38 Name Esnd Suspended g Thread 6 Prio 45 Name HTTP Suspended AS Debugger Process 3 9 07 2 15 PM i C Nburn NBEclipse workspace CciBigIron Debug CciBigIron elF 3 9 07 2 15 PM E main cpp X Be Outline 23 14 R x oe a predef h 1l stdio h E ctype h 9 startnet h a autoupdate h 3 const char AppName CciBigIron J dhcpdient h extern C void UserMain void pd NetworkDebug h Ht UserMain voi serMain voi pd AppName iil s i j InitializeStack E if EthernetIP 0 GetDHCPAddress i IE oe OSChangePr io MAIN PRIO basic overlay board knsbi cu Tpit StartHTTP UserMain Wifdef DEBUG I l i r lucing EAE ee NUNT Vector graphics RIS started n Custom Font Capability gt SPI Or RS 2 32 Interface El Console 23 Tasks Memory m x Ex BE vma mrn M E 8 New configuration NetBurner Launcher C YNburnlNBEclipseyworkspacelCciBigIroniDebuglCciBigIron elf 3 9 07 2 15 PM Video display generator www decadenet com L DEC DE ENGINEER NG Photo 1 This is a screenshot from the Eclipse debugger I
92. amp LCD Demo Kit USB ICP Using a standard USB port USB ICP supports In system Programming both SF and ICFP mode for Philips 8051 LPCHxx and LPO2xxx ARMY microcontroller families In System Programming uses a bwo wire serial interface to program and erase P enabled microcontroller devices without removing them kom the syshem This device is powered over ihe USB connection s0 no external power supply is required 69 00 Veritas LCD Demo Kit Small footprint pocket LCD Demo board with amp character alphanumenc LCD Uses a highly integrated Flash based 806051 device A single CR2025 ay coin cell battery powers lhe entire board and the unit is User Ra Programmable via the ICP connector 49 00 For XA Development Kits and I2C MDIO and SPI tools please visit our website www teamfdi com VISA MC Amex Future Designs Inc 2702 Triana Blvd Huntsville AL 35805 256 883 1240 Fax 256 883 1241 Issue 204 July 2007 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 dlpdesign com DLP j Design PROGRAMMER Contractor Cellular Specialties Inc Manchester NH Short term assignment based in our New Hampshire headquarters office CDMA project focused on the design of new
93. anager HW initialization Internet password manager E Figure 3 Here is a flowchart of the main menu showing the different options available once the PIN of the Java Card has been suc cessfully verified If the card is removed at any time it is necessary to proceed again with a Ar user authentication Y application Because of the low power consumption it is possible to power the design through the USB port so it is not necessary to use an external power supply Or a battery The smart card interface is a spe cial socket needed to interface the smart card to the ATmegal 8 s USARTO see Figure 4 It uses a 4 9152 MHz oscillator to get a communication data rate of 12 711 bps on the I O line of the smart card There is a strange data rate because the smart card communicates at 9 600 bps when it is clocked at 3 57 MHz Even though many UARTS cannot gen TA e s 1 4 81 1 o 1 Tz Te Wireless Madules ZigBee Mesh Networks Range up to ana mile Worldwide approved 2 4 GHz Modules start at 18 E MaxStream eee 866 765 8885 A Digi eana Brno www zigheemedule com cc www circuitcellar com CIRCUIT CELLAR FlashPro430 GangPro430 gt USB Flash Programmers c i for Texas Instruments MSP430 microcontrollers a Reliable and the fastest programmer on the mar Perfect for production usage jnnected to one hee ultaneously AT
94. and command Figure 2 These are serial input requirements processing routines see Figure 2 Does this set of requirements look WWW XBAM ES TATIGN GEM commands typically look like what like a C routine to you Don t worry if you see in Figure 1 you don t know how to code that design The command format gives you a With a little practice it will be second lot of flexibility Keep in mind that nature Could you have written these you don t yet know the specific com requirement using UML Sure you could mands you intend to implement The have The requirements are really simple asterisk character marks the begin and UML would do a fine job of captur ning of a command and must be a ing them I cannot urge you enough to unique character not used as part of start your designs in this manner It s any command Also the carriage good practice and as they get more com return CR character marks the end plicated you ll find it much easier to 2 Debug main cpp NBEclipse IDE File Edit Navigate Search Project MBEclipse Run Window Help 5 E 1 is ri u amp lmie7Z28 wuil s 0 9S 05 5 9 l o o Ej Xs Debug Fgcic Resource Debug 23 Oe wl a 0 5 i gt variables 33 Breakpoints Modules Registers IL M New configuration NetBurner Launcher j st E E x Xe R2 B a NetBurner Standard Debugger 3 9 07 2 15 PM Suspended pd 0x00000000 Thread 1 Prio 63 Name Idle Suspended PS Sg Thread 2 Prio 50 N
95. and watch it pay for itself within hours 500 MHz Sampling Timing Mode Internal clock Interpreters for C SPI and RS232 sure not to place instructions that use the same register consecutively e g operate on register R1 followed immedi ately by storing the same R1 to memo 200 MHz Sampling State Mode External clock Multi level Triggering on Edge Pattern Event Count Group Magnitude Range Duration etc Real Time Hardware Sample Compression Qualified Gated State Mode Sampling Integrated 300 MHz Frequency Counter 6V to 6V Adjustable Logic Threshold supports virtually all logic families Full version of software free to download Mictor adapter available ry That could degrade system perform ance because the execution pipeline would have to be stalled while waiting for the first instruction to finish execut ing the write back process To minimize this two quad byte operations per formed each loop iteration using two independent sets of registers Listing 1 Visit our website for screenshots specifications and to download the STROONTN easy to use software LOGICPORT Intronix Test Instruments Inc 2d Tel 602 493 0674 Fax 602 493 2258 www pcTestinstruments com Issue 204 July 2007 39 www circuitcellar com CIRCUIT CELLAR i Figure 5 Here is the ghost ball prediction method Contact with the red target ball must be made at the imaginary grey ghost ball s location changing
96. ard from the specified record number Table 1 These are the various methods used to implement the APDU commands that the Java Card can understand www circuitcellar com CIRCUIT CELLAR application note on Atmel s web site Another solution was written by Christian Starkjohann of Objective Development Software I chose the Objective Development Software approach because of all the customiz able code that was written in ANSI C which makes it easier to maintain The modular concept made for easy integration into my existing design the performance was very good the standards conformance was well docu mented with a description of limita tions and potential problems and it was freely available with an open source license ALPHANUMERIC KEYPAD When you work with passwords you cannot limit yourself to numeric characters You need to support alphanumeric characters to make it harder for the attacker to guess the password by means of brute force attacks Once again there are multiple possibilities to enter alphanumerical information One solution is to use the PC keyboard but due to the fact that you are dealing with sensitive data the approach is not recommend ed to avoid interference from any spy ware or virus software that could catch the confidential information during the updating process From a security standpoint the best solution is an isolated keyboard But how can you implement an alphanu meric k
97. as 800mA 229 l qty 100 a Fanless no heat sink a SDRAM up to 64MB 259 qty 1 onnoco a COM Ports up to 4 ports orinoco HIiRELESS MET HOA a Ethernet Ports I Win TIRI 11 i Ins f 1 1 J a DIO Channels up to 40 15 5600 Shown with NEED Ma ECL M LEN a PCMCIA II adaptor optional flash modules es it s i 4 5 i Sen SRS TR E E A D RS 485 and i pie E E a 2 Merlin cellular modem mam d Fai a Compact Flash adaptor a options include RS 485 Half and Full Duplex A D Converter up to 8 Channels at 12 bits DAC up to 2 Channels at 12 bits Extended Temperature USB Ports Except on TS 5300 see our website for 33 MHz 386 configurations 7 Over 20 years in business 3 Custom configurations and designs w 3 Open Source Vision excellent pricing and turn around time 3 Never discontinued a product P 3 Most products stocked and available 3 Engineers on Tech Support for next day shipping Design your solution with one of our engineers 480 837 5200 New Products and PC 104 Peripherals Tiny WiFi Controller Intelligent Battery Back up boots Linux in 1 1 seconds we 119 200 MEE a Run your system for days E 249 i Up to 128MB Flash with no external power source qty j Up to 128M SDRAM a 802 11g WiFi a SD Flash Card socket a 1 external USB port a 1 10 100 Ethernet Rugged aluminum enclosure a 3 TTL serial ports measures 1 1 x 4 9 x 3 1 N we ZigBee Wireles
98. c ture for the port If you look in CciBiSerial h you will see the definition for COM DETAILS That structure holds the latest charac ter received a command buffer and a parameter buffer The parameter buffer is the command data separated into the individual components You will also see pointers to routines As each communications port s requirements change I can insert different routines in their structure So each port will call the routine contained in the struc ture Routines don t have to be created for each port In CciBiSerial h I commented out my typedefs for INT8 INT16 and so on lines 27 to 40 NetBurner also defined these and I was getting a warning for the duplication so there was no need to use my typedefs Great minds and all that I commented them out using the Hifdef NEVER and endif pair C uses a preprocessor to go over the input files before compilation This is the Zdefine statement that we have used to define constants A more com 84 Issue 204 July 2007 plete explanation is that the Zdef ine is used to substitute one expression for another It s a good practice to use parentheses to avoid errors Hdefine macro replacement name define LEFT SHIFT 8 x x lt lt 8 define FALSE 0 define TRUE FALSE If you have not defined the macro NEVER then the code between i f def NEVER and Zendi f will not be com piled A good use of the i fdef state ment is to distingui
99. can customize the data and the time interval between samples Don designed the board as an evaluation tool for Vinculum designs but the bat tery operated portable data logger would be a great fit in many projects as is EMBEDDED FLASH DRIVE I hope that I have shown you that projects built around a flash drive are easy The Vinculum ASIC encapsu lates all of the required industry stan dard specifications and presents a sim ple DOS like command line interface that is accessed via a serial port or SPI or parallel FIFO Add your favorite microcontroller with an application program to control the Vinculum I presented a few projects to fuel your imagination Source code for my exam ples using a Cypress PSoC are available on the Circuit Cellar FTP site If desired this code can be ported to a different microcontroller Your project can collect data that will be analyzed on a PC Mac or Linux based system It can also be used to redistribute data that was cre ated on a CPU via lower cost plat forms Project data may be updated by CIRCUIT CELLAR simply swapping flash drives If you can read and write to a serial port then you can read and write data files on flash memory drives with Vin culum I will be interested to hear about projects where you have cre atively used a Vinculum and a flash memory drive Happy developing al John Hyde has been involved with USB since its inception After working at Intel Corp for 25
100. cards are available from manufactures such as Gemalto Oberthur Card Systems and Sagem Orga Essentially Java Card technolo gy enables programs written in the Java programming language to run on smart cards and other resource con strained devices Applications written for the Java Card platform are referred to as applets Java Card applets should not be con fused with Java applets just because they are both called applets A Java Card applet is a Java program that CIRCUIT CELLAR adheres to a set of conventions that allow it to run within the Java Card runtime environment A Java Card applet is not intended to run within a browser The name applet was chosen for Java Card applications because Java Card applets can be loaded into the Java Card runtime environment after the card has been manufactured Unlike applications in many embed ded systems applets do not need to be burned into ROM during the manufac turing process They can be dynami cally downloaded onto the card at a later time Every applet is implemented by cre ating a subclass of the javacard frame work applet class The Java Card run time environment JCRE invokes the methods Install Select Process or Deselect They are all defined in the base applet class when it wants to install select or deselect the applet or ask the applet to process an applica tion protocol data unit APDU com mand The methods that any applet should have are liste
101. cations On the downside centralized con trol means there is a single point of failure If the Pilot dies so does the network and nodes will have to fall back to a limp home mode that can deal with the loss of connectivity That s a significant price to pay but one that delivers sig nificant benefits as well Perhaps most important cen tralized control allows a degree of determinism that s difficult to obtain with distrib uted peer to peer schemes The Pilot schedules network activity so that each Point receives a certain amount of bandwidth with a dependable schedule Figure 1 Consider the Pyxos FT chip kind of a network transceiver on room or in box applica tions Enter Pyxos FT designed 68 Issue 204 July 2007 steroids In addition to differential signaling for range and noise immunity it handles higher layers of the network protocol so you don t have to CIRCUIT CELLAR Of course no networking scheme can guarantee data www circuitcellar com ATtiny13 PB5 PCINTS RESET ADCO dW PB1 MISO AIN1 OCOB INTO PCINT1 PBO MOSI AINO OCOA PCINTO Connect L VDD3 Figure 2a In Hosted Point mode the pins on the Pyxos FT chip implement an SPI for connection to the host MCU b In Unhosted Point C3 100p 50V RST CS DIO2 SCLK DIA MOSI DIOO VDD3 MISO DIO1 INT DIO3 10k Connect so is Pyxos FT 0 1u 16V 10 X7R mode the pins revert to direct digital
102. ccupied Besides the data a Pyxos FT network can be designed to ship power over the same pair of wires The link power scheme is spec ified to use a 24 V AC or DC supply from which each Point derives its local supply e g 3 3 V for the Pyxos FT chip along with any other voltages the Point requires How far you can stretch a link pow ered Pyxos FT network depends on a lot of different factors These include the type of wire whether the link power is 24 VAC or VDC and the amount of power required by the dif ferent nodes A small network of low power devices using the DC option might have a reach of 400 m At the other extreme a fully loaded network of power hogs using the AC option could top out at 10 m The Pyxos FT documentation includes reference designs for link powered supplies giving Points 3 3 V power budgets of 100 mA switching or 15 mA linear Since getting the wires mixed up during installation is a matter of when not if the fact that CS DIO2 Join MD Read timeslot Read timeslot Read timeslot Read timeslot Read timeslot Read timeslot for Pyxos Point B Free timeslots for Points joining the network Point A Figure 3 The Pyxos FT protocol relies on fixed duration timeslots for each Point grouped into a fixed duration frame That means the bandwidth and latency from a Points perspective remains fixed i e deterministic even as the aggregate network loading i e to
103. ce mount serial driver along with through hole discrete and seven segment LEDs www circuitcellar com CIRCUIT CELLAR Issue 204 July 2007 45 R3 only for 0 250V AC input Install R8 on top of R3 for 0 2V LO to 2 5 40V HI R CAPCOMO IN 4 7 H11 only for 0 250V AC input Install R16 on top of R11 for 0 2V LO to 2 5 40V HI CAPCOM1_IN 4 7 ADIN HI ADIN LO 5F R24 __ D4 11 5k 2r KH Is 1 l HA R20 BAV99 10 0k 5F U6 io cs vop Ou SCK PBO i8 w VSS PAO Q U o To Display PCA No Inst 18p IDAC OUT VREF Step 0 255 256 Step Main Connector 5 U5B t vo MCP602 R34 0 gecko a Lue L 6 4 UT1 F D ora Pr X1 18p R22 UART OUT 10 R26 UART IN C8051F330D Switch Input t3 CNe CNS RST C2DAT RST C2CLK P2 0 ISP Debug1 ISP Debug2 Figure 2 The processor board assembly is the meat of the three board sandwich which is packed tight with components on both sides of the PCB ranges lower than 0 to 5 V although fine adjustments become more difficult as gain increases beyond three The 10 bit DAC output current is converted to a voltage to be used as a sensor reference or to provide an analog output of the dis played value Two filtered digital inputs are provided for the reading phase with only one input used for frequency pulse width and duty cycle measurements For the two high and two low alarm out puts a serial
104. cellar com Visit www circuitcellar com npn for more New Product News ISOLATED CURRENT MEASUREMENT TRANSDUCER The Minisens is a miniature integrated circuit transducer for AC and DC iso lated current measurement up to 100 kHz This new component offers full isola tion no optocouplers required and high sensitivity from 20 to 200 mV per amp of primary current with no insertion losses To reduce manufacturing costs it is mounted directly onto a PCB as an SMD Minisens integrates in one mixed signal ASIC Hall effect sensors with a mag netic concentrator to allow direct current measurement without the need for an additional magnetic core The noncontact measurement enables an almost unlimited current level eliminating the need for current flow through the device The only limiting factor is the thermal capacities of the primary conductor The current can be carried either by a track or tracks located on a PCB underneath the Minisens or by a cable or bus bar under or above the IC The unlimited design possi bilities for the primary conductor allow current measurement of 70 A or higher Many parameters of the ASIC can be configured by on chip nonvolatile mem ory adjustment of the transducer s gain offset polarity temperature drift and gain algorithm proportional to or independent of VDD Two outputs are available one filtered to limit the noise bandwidth and one unfiltered to ensure a response time of less than 3 u
105. ch of the example programs included with the SFCLIB sold separately It includes sockets for SO MMC and MicroSD TransFlash memory cards The board also has an MPLAB ICD 2 In Circuit Debugger jack for eas programming amd debugging and a large proto typing area for adding your own circuitry C COMPUTER SYSTEMS City MEE ensa fr y GR DD wor For more inkematioe see aur websie www ECSB7 com sfelib BO 7765 3151 5 Emerson Drive Center Bamsiead NH 3225 80 Issue 204 July 2007 use of a peripheral pin select PIC24FJ64GA002 The new peripheral pin select module allows you to deter mine which of the on board digital peripherals is brought to the external I O pins You can configure or reconfig ure their connections via software reg isters This dynamic selection allows for some very clever configurations The sixth category is for the effec tive use of DSP technology dsPIC30 33 The functionality of a DSP in a microcontroller greatly expands your design possibilities You might show how this added power can be used to eliminate external circuit ry and actually reduce overall costs The last category is for the best use of bonus parts any 16 bit microcontroller The design kit includes a number of bonus parts that can be used to compliment the microcontroller in your design Your design for this cate gory must include the external analog memory or connectivity components THINK ENTER WIN The
106. characters L D S and X see Figure 6 Only one gauge is programmed at a time If more than one networked gauge has a serial port enabled and receives commands to enter Programming mode enabled units will answer and cause conflicts To pre vent this only the gauge of interest should have the serial port enabled Fighting against your PCB Design Software Here s something that will spare your time and your budget Boards designed under EAGLE are found in patient monitoring equipment chip cards electric razors hearing aids automobiles and industrial controllers They are as small as a thumbnail or as large as a PC motherboard They are developed in one man businesses or in larga industrial companies EAGLE is being used in many of tha top companies The crucial reason for selecting EAGLE is not usually the very favorable price but rather the ease of use On top of that comes 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 4 1 Highlights Powerful library management e g move devices between libraries base library for packages generate package variants from other libraries process Copy function in schematic Ratate components in 0 1 degree steps Blind amp buried vias and pads with off center drill j User defined background color i Miter func
107. cide how many Points it supports www circuitcellar com now or in the future For instance if you want to give the network the abil ity to grow i e add Points you ll have to allocate spare timeslots to accommodate future additions Another option is to give the Pilot some extra intelligence i e knowl edge of multiple network configura tions and the ability to switch between them with the understand ing that changing the frame time changes the Points bandwidth and latency Repeatable timing obviously works well in scenarios where data needs to flow like clockwork But what about applications where Point activity is more sporadic perhaps triggered only infrequently by an alarm condition e g temperature over threshold or user intervention e g a switch Fortunately the Pyxos FT chip and protocol offers ways to accommodate notably including interrupt and polling capability The Pyxos FT chip interrupt output with a programmable Write timeslot 0 Write timeslot Write timeslot Write timeslot Write timeslot for Pyxos Point A Write Free timeslot timeslots for Pyxos for Points Point B joining the network for Pyxos trigger condition gives Points the abil ity to sleep until the Pilot actually sends them something INT DIO3 On the other side of Pr the coin polling allows a Point to query for any updates that might have occurred while it was asleep or oth erwise preo
108. ction It has 8 KB of built in SRAM which can be divid ed into transmit and receive buffers as desired and it provides several inter rupt sources e g when new packets have arrived The ATmega32 also has 128 KB of external SRAM connected as well as an LCD which is a standard module with a resolution of 128 x 64 pixels Take a look at the ATmega32 s pin connections in Figure 2 Ports A and C are used as 8 bit wide general I O ports one of which is latched using an Photo 1 The complete MiniEmail system includes an LCD a keyboard and several connections CIRCUIT CELLAR WWW circuitcellar com l l lt gt MAX232 exo debugging Ethernet converter Keyboard Figure 1 This is a block diagram of MiniEmail s hardware The arrows indicate the directions of data flow between the devices The rounded boxes indicate parts that do not sit on the circuit board NXP Semiconductors 74HC573 The two ports provide data connections to the LCD and SRAM U8 For the SRAM you need three additional wires write RAM_WR read strobe RAM_RD and the seventeenth bit of the address ADDR16 The LCD connector CONI uses five additional wires for the signals CS1 CS2 DI EN and RW CSI and CS2 are taken from the general I O port A DATA6 and DATA7 and determine which of the two halves of the LCD is selected i e the two controllers on the LCD module you are talking to RW where you can use A
109. d manager s internal circuitry The hardware is so simple because all the complexity dealing with the display key pad smart card and USB interface has been moved to the software side The USB interface is accomplished through software emulation USB lines DATA and DATA must be wired to the same I O port Line DATA must be wired to bit 0 DATA must also be connected to INTO DATA requires a pull up of 2 2 KQ to 5 V to be identified as a low speed USB device DATA is used as an interrupt source instead of DATA because it does not trigger keep alive and reset states No UART timer input capture unit or other special hardware is required except one edge triggered interrupt Additionally the ATmegal68 must be clocked at 12 MEZ so it is neces sary to specify the speed grade of the microcontroller when ordering it It is also possible to use over clocking with low speed AVR devices but it is not recommended since there are high speed components available at a rea sonable price There is an activity LED to signal data transmission on the I O line of the smart card Finally there is an in system programming port ISP to update flash memory if additional updates or enhancements are planned in the future SOFT USB The USB s physical interface con sists of four wires two for powering the external device V and GND and two signal wires DATA and DATA The power wires give approximately 5 V and a maximum
110. d below in the order in which they are invoked by the JCRE during applet creation and execution The Install method is a static method used to create an instance of the applet subclass The Register method is used by the applet to register the applet with the JCRE and assign the default AID to the applet instance The Select method enables you to inform the applet that it has been selected The Process method enables you to instruct the applet to process an incoming APDU command And WWW circuitcellar com finally the Deselect method is used to inform the current ly selected applet that anoth er or the same applet will be selected see Figure 1 The JCRE calls the Install method to create an applet instance The applet instance Internet password manager applet I decided against develop ing my own soft USB solu tion and integrating one of the proven and freely avail able solutions for the ATmegal68 I am aware of at least two possible implemen tations of the software USB Read record APDU Seek record APDU Check record APDU Update record APDU is registered with the JCRE using the register method peripheral One provided by Igor Cesko is available as an Verify PIN Change PIN APDU APDU When receiving a SELECT APDU the JCRE first checks whether an applet is already selected If one is selected the JCRE deselects the current applet using the deselect method In the Des elect method
111. d format for a peripheral 14 A temporary storage area in a central processor that 19 One way communication where one party is the trans usually has a one word capacity mitter and the other party is the receiver 15 A cable carrying electricity for power 16 A flashing symbol that indicates where the next typed The answers are available at character will be www circuitcellar com crossword www circuitcellar com CIRCUIT CELLAR Issue 204 July 2007 93 INDEX OF ADVERTISERS The Index of Advertisers with links to their web sites is located at www circuitcellar com under the current issue Page Page Page Page 91 AAG Electronica LLC 64 e PCB 40 87 Lemos International 91 Picofab Inc 42 ARM Developers Conf 30 ExpressPCB 2 Link Instruments 88 Pioneer Hill Software 89 Abacom Technologies 73 91 ezPCB 41 Linx Technologies 71 Pololu Corp 91 All Electronics Corp 86 FDl Future Designs Inc 13 Loadstar Sensors Inc 91 Pulsar Inc 87 Apex Embedded Systems 90 Flash Memory Summit 19 Luminary Micro 3 41 Rabbit Semiconductor 7 Atmel 90 Front Panel Express LLC 87 MCC Micro Computer Control 87 Rabbit Semiconductor 73 BG Micro 89 General Circuits Inc 33 Matrix Orbital 89 Reach Technology Inc 47 Bitscope Designs 86 91 Grid Connect 25 Maxstream 5 Renesas 65 CWAV 29 HI TECH Software LLC 86 88 Micro Digital Inc 91 Schmartboard 50 CadSoft Computer Inc 74 HOT Chips 19 Symposium 27 Microchip 12 Sealevel Systems 87 Cam Expert LLC 82 IMAGEcraft
112. d lt lt CS load flash memory at 1800h data unit lt lt chars and inverted C5 Locations from 0 to 1FFF may be dumped Determining timing readout in degrees BTDC required more work To gather timing from the Ford EEC IV sys tem two O to 12 V nominal signals of inter est are used PIP S replies with Data Logging On message then begins outputting dddd dddd dddd unit Esc received which reenters programming mode Figure 6 Communications with the gauge can be performed using an RS 232 to RS 485 adapter and a terminal program such as HyperTerminal running at 57 600 bps 8 data bits no parity and 1 Stop bit Configuration files in text format may also be captured and copied to other units for duplication spark output SPOUT and profile ignition pickup PIP signals With the ECM mounted behind the glove box I spliced into the harness near the ECM connector Since some glove box disas sembly was necessary to reach the ECM I spliced into the ECM V throttle position sensor TPS air charge temperature ACT and fuel injector signals for future measure ments before putting things back together Creating a calibration for the ECT and ACT sensors requires entering the temperature versus voltage transfer function as explained in the Ford shop manual That s all I needed but I investigated further and found that the sensor appears and behaves like a 30 kO at 25 C MS96 material NTC thermis tor
113. de of the enclosure Female 0 1 headers on the processor PCB and male headers on display and interface PCBs provide interconnects and easy assembly interface The display board contains a Maxim Integrated Products MAX7219 64 segment constant current driver and a cadmium sulfide cell to control the display elements The processor PCB holds a Silicon Laboratories C8051F330 microcontroller basic ana log and digital signal inter faces and both 3 and 5 V reg ulators With all segments on at full brightness it burns at about 250 mA Due to the limited physical and heat sinking area available I used a Texas Instruments PT5101 5 V integrated switching regu lator These two boards will provide a limited network input protection and analog operation I used the C8051F330 because it is avail able in a prototyping 20 pin DIP package I also made an MLP 20 to DIP adapter in case the DIP device is discontinued and to see if hand soldering the tiny surface mount MLP with 0 5 mm pitch was possible for future projects which it can be under optimal conditions To use most of the 10 bit 200 kHz ADC a separate low and high input range is available A variable input gain stage using a 256 step digital potentiometer pro vides fine tuning for calibrating the O to 5 V and 0 to 20 V ranges without a screwdriver It can also increase the gain to better use ADC resolution for Figure 1 The display board assembly consists of a surfa
114. ded FLASH with 12 5ns read access time Fast Real Time Control Realater Banks enable 37 5nsec 6 cycles interrupt latency tira High Integration Large on chip flash and on chip FAM Advanced 16 bil PYM timers to drive two motors sirriultaneously 1 25 usec 12 bit A D conversion with 3 sample amp hold circuits F Daviras with FFU FUE Davyicas wih FPU USS and Ethermat Source serine Dataquest Ard 2008 2005 Workiwide Misrmteoabkote Vendor Revenue GJIDG333 Lem Get Started Today Register to qualify for a SuperH MCU Kit i www america renesas com ReachSH d B Siara KE tar SH7211F RORTST21155IKXIBE USS Emulabor HSODOSKCUTTH RenesasTechnology Corp July 2007 Internet amp Connectivity FEATURES 14 MiniEmail 44 Multipurpose Automotive Gauge A Compact MCU Based Mail Client Eric Kesselring Alexander Mann SS MMMM 55 Winners Announcement 22 Internet Password Manager Luminary Micro DesignStellaris2006 Contest j i Caries 20530 59 Flash Drive Connection 35 Motion Tracking and Analysis System Add a Flash Drive to Your Next Design Albert Tran Andrew Kwan Kevin Brown amp John Hyde Jason Vangilst MiniEmail p 14 J ir Add a Flash Drive p 59 COLUMNS 68 SILICON UPDATE Pyxos Power Pyxos FT Evaluation Kit p 68 Tom Cantrell i d aaa 1 76 FROM THE BENCH Are You Up for 16 Bits A Look at Microchip s Family of 16 Bit Microcontrollers Jeff B
115. define overall net work options and specify the network variables associated with each Point The tool uses the completed network specification to automatically generate header and include files that are com bined with the source for the API and your application to create the final code Beyond the obvious such as the number of points in the network Photo 3 shows other options that can be selected The default configuration assigns a timeslot for each Point in the network but it s possible to over ride that by reserving additional timeslots That allows Points to be added to the network without having to change the overall frame timing i e Point bandwidth and latency remains fixed Other options allow the Pilot to monitor the health of the network e g error statistics or take advantage of a protocol analyzer fea ture that enables logging all network activity If you don t have a use for the Pyxos FT chip 10 MHz clock output pin here s where you can disable it to reduce power consumption and noise Once the overall network and Pilot options are defined it s time to move onto the Points themselves see Photo 4 Point specific characteristics include those mentioned above e g statistics gathering clock output disable as well as defining a Points registration method at startup Registration options include automatic the Point and Pilot negotiate for a free timeslot hardwired the Point uses a specific res
116. device is also available in a Preemptive Multitasking software compatible eight port ver Zero Interrupt Laten sion the DS26518 Evaluation kits Easy to Use Start Project with supporting software driver Profiling Support Included source code and reference designs are available for both devices Prices start at 69 96 for the DS26519 and 40 60 for the DS26518 in 5 000 piece quanti ties PE GS ba Maxim Integrated Products Inc www maxim ic com Mi Sete tee i o RTOS profiling viewer GUI emwin 6 16 32 bits 6 DALLAS MALAXILAA D526518 D526519 ANSI C Source Code 2D Graphic Libran Window Manager ets x Simulation uc RTOS Independent Font Converter Image Converter car dashbad J example FILE SYSTEM rio 6 16 32 bits 44 VARISTORS PROVIDE HIGHER SURGE CURRENT CAPABILITY eai Abeid ies The new LS41 and LS42 series of varistors offer a higher surge current capa M5 DOS MS Windows Compatible bility and are designed for surge voltage protection in industrial and consumer AEN Pile System Pretest aah electronics Both series have retained the compact dimensions of the proven RTOS Independent LS40 series 37 5 x 46 mm ET The surge current capability of the JTAG J Link LS41 was increased by 25 and is now ARM7 9 Cortex M3 fa 50 kA at a pulse form of 0 4 us These Fast 720 kb s Download EPCOS L541K1500QP 4 0018 H www circuitcellar com types are designed for rated vo
117. didn t have phone or Internet access To send an e mail or browse the Net had to walk across the street to a hole in the wall Internet caf and pay about 1 for 30 minutes of online time If was in the library had to wait in line in the PC room for a workstation to free up It wasn t until a few years later when was back in the U S that my daily online experience began to resemble what it is today In this issue we present you with two interesting articles about Internet related design projects Both projects prove that with a little effort you can use your design skills to create innovative solutions to common problems Ever need to check your e mail when your PC was off In MiniEmail p 14 Alexander Mann describes how he built a compact MCU based mail client The quiet system which features an Atmel ATmega32 microcontroller and a Microchip Technology ENC28J60 Ethernet controller continually checks for messages and enables you to read them as soon as they arrive On page 22 Carlos Cossio describes a handy password manage ment system You can use the system to enter display and securely store all of the passwords and usernames that you use for various web sites An added bonus is that you can program the system to automati cally complete username and password fields for you when you click on your favorite security protected web site Finally note that this issue is the perfect antidote for anyone who has design contes
118. ducts logos and company names mentioned herein may be trademarks of their respective owners play If it finds 001 MP3 it will play it or it will wait 60 s easy to modify before moving on to 002 img The application incre ments through the filenames until one is not found It then restarts at 001 img To change the photos and music swap the flash memo ry drive The complete PSoC proj ect is posted on the Circuit Cellar FTP site It is easy to expand the design to add functions I plan to add a feature rich alarm clock once I get some spare time It would be easy to make this bat tery powered like I did with the first example however displays consume a lot of power so I would also add a battery charger A battery charger uses a few of a PSoC s analog and digital resources a few FETs an inductor Rs and Cs The design extension is covered in detail in Cypress s application note collection microcontroller so I chose to use one in my third example I didn t like the weird instruction set but my colleague Don Powrie of DLP Design introduced me to the Custom Computer Services toolset which makes PIC designs fun to create I used to be a staunch advocate of using only assembler code for microcon trollers I argued that a compiler would always generate larger object code than my tuned assembler code Now these microcontrollers are available with 16 KB 32 KB and more flash memory So what is the point of savin
119. e Pxyos network events PyxosPointPollPnv Though a Pilot automatically updates network variables that are inputs to a Point this function allows a Point to manually check for updates if necessary PyxosPointUpdatePnv This function initiates the transmission of a Point output network variable to the Pilot PyxosPointIsPnvUpdatePending This function returns true or false indicating whether previously initiated outputs from the Point have completed transmission to the Pilot Table 2 The Pyxos FT network strategy minimizes overhead and complexity for Points as demonstrated by the simplicity of the Point application program interface API leaving the heavy lifting to the Pilot Compared to the mere 10 functions many only needed during initialization that make up the Point API the Pilot API has nearly two dozen functions 70 Issue 204 July 2007 CIRCUIT CELLAR www circuitcellar com Photo 1 The Pyxos FT evaluation kit includes boards covering the likely application spectrum Starting at the bot tom right is the ARM7 MCU based Pilot with USB or optional LonWorks connection to a host PC Headed clock wise you see an ARM7 MCU based actuator Point an AVR MCU based sensor Point and an unhosted Nano Point range of Pyxos FT possibilities a pic ture is worth a thousand words so let s take a closer look At 399 the Pyxos FT kit isn t an impulse buy but you do get a significant amount of gea
120. e behind bil liards is quite simple sink balls into the pockets How ever mastering the game learning the ball physics and trajectories can take years of practice Our system reduces the learning curve for novice pool players by pro www circuitcellar com viding visual feedback Thus our pool tutorial system is an invaluable tool for beginners SYSTEM OVERVIEW To realize our design goals we need ed a powerful digital signal processor DSP capable of handling complex real time video algorithms and inte grating a wide array of peripherals Dr Mike Smith our project supervisor at the University of Calgary gave us an Analog Devices ADSP BF561 Blackfin EZ KIT Lite Targeting consumer multimedia and DSP applications this evaluation kit incorporates onboard audio video encoders audio video decoders and 64 MB of SDRAM around a Blackfin high per formance dual core DSP The ADSP BF561 contains two pro cessing cores in a single package essentially two ADSP BF533 DSPs each achieving clock speeds of up to 600 MHz The BF561 has a wide range of onboard features including two par allel peripheral interfaces PPIs sup Video Camera Figure 1 All the video processing is done on the DSP but the EZ KIT is connected to the PC via the HPPCI ICE for development and debugging CIRCUIT CELLAR porting the ITU R 656 video format two serial ports SPORT a UART controller 12 timers 48 general p
121. e com 1d Instant Decode of Bus Transactions Playback of Logic Analyzer Traces e I2C Controller Create Your Own Applications to Control the USBee DX P P RC Le y UL t Fa ch am X hi x i 4 ra i Cambridge St Beacon Hill Downs town Boston A G Common ow gt b Chinatown un et Theatre District Hes d ex e 1 ESETS A Ape 45 Photo 5 The third example highlights a design kit offered by DLP Design It uses a PIC microcontroller to measure time temperature humidity and two external analog voltages It uses the Vinculum to save these values to a flash memory drive C compiler it includes built in func tions to support a PIC microcon trollers s on chip features A good example is the use RS 232 directive There you specify that you need to use a serial port and give the compiler details such as the data rate and the I O pins that will be used for TX and RX If the chosen PIC has a hardware UART then the compiler will use this for printf and scanf functions or else it will include subroutines to manage the low level bit manipula tions for you Your main program uses printf statements like before The CCS compiler also contains built in functions to drive the on chip ADC and the real time clock This way you can focus on what your program is doing instead of the lower level how Don designed the battery powered data logger to demonstrate the capabilities of t
122. e costs and speed time to market remain the same To stay ahead of the curve you need flexibility programmability and scalability PSoC s unique programmable architecture delivers this and more Futureproof your design make PSoC your agent of change PSoC delivers The configurability of an FPGA the mixed signal integration of an ASIC and the familiarity of an MCU m Reusable IP compatible device families and variable resource options ensure you can optimize design efforts and accommodate changes m The industry5 first visual embedded design tool PSoC Express speeds design time enabling you to generate a complete design without writing a single line of code ao AE _ SS 9 EDEN An m A E p A ee em CO NN 2 C NS s py AX WS caritat Dmm N E al SS sid WDM ADE wha L r VN Pe bee eh EE Meme ce t Tf GET STARTED WITH PSoC NOW Download our Change Happens White Paper and get 50 off a PSoC development kit www cypress com changepaper Download free PSoC Express visual enbedded software www cypress com changesoft Request free PSoC device samples www cypress com changechip Free online training www cypress com changetrain Purchase PSoC development tools www cypress com changetools PSoC includes programmable analog and digital blocks a fast MCU flash and SRAM memory all in a compact package as small as 3mm x 3mm
123. e county I m going to install a photovoltaic power generating system From what can tell so far installation costs border on the insane but the fact that it satisfies my major objective for an independent secure source of power it may trump all the mitigating factors Besides at 0 20 per kWh in CT right now love the idea of selling electricity back to the power company hatched that idea a few months ago when was 1 000 miles away on vacation Now that I m back in CT and have had an opportunity to put my money where my mouth is thought l d give you a status report First of all need to set the record straight I m not a tree hugger and don t believe that either extreme in the environmental debate has the facts straight suspect the answers lie considerably more toward the middle where few dare to reside these days What do put my faith in is good engineering I ve been watching PV technology for many years while it seemed the exclusive province of the off grid crowd and social isolationists Now that PV and other renew able energy systems are becoming more mainstream and with fewer esoteric anomalies photovoltaic power is starting to make real engineering sense for me let s hold the dollars and sense sic question til later Without checking the details of the specific program in CT my first thought was to simply enhance my existing self sufficiency by slapping a few PV pan els on the roof and generating my own power
124. e determined A back ground image a reference image for the system was then captured We developed an easy one button auto mated calibration process to encapsu late the processes from the user Press ing the SW8 push button on the EZ KIT board initiates the calibration process which draws guidelines on the display for the rail detection algo rithm search region see Photo 1 The rails of the pool table must lie within the guidelines in the video camera s field of view Once the camera is prop erly positioned pressing SW8 again runs the calibration algorithms The exact location of each rail is determined by the system The system is designed to work on half of a pool table so we made it capable of searching for the end rail and half of the two side rails The reference color and intensity of the table felt are initialized to be the pixel location in the center of the frame The boundaries of the rails are found by locating pixels with large differences compared to the reference color and intensity Scanning starts at the middle of the frame and progresses outward in the three directions towards the rails A low pass smoothing filter is applied to each of the three rails to eliminate stray pixels that may be caused by noise The final result is three pseudo straight lines representing the bound aries of the playing surface The pocket locations can be determined from the intersecting lines of the three rails Since the t
125. e to the ATmega32 and has twice the flash memory and internal SRAM That will provide enough space for many of my new ideas I want to get rid of the static IP address add CC and BCC fields use a bigger display or a smaller variable width font improve the filtering and display of mail content and attachments and add an address book it would be best in combination with an additional external EEPROM with an SPI such as the AT25256 This project proves rather impres sively that the ATmega32 and the ENC28 60 are a powerful combina tion They can be used for many use ful Internet applications My e mail client system is surely one of the most exciting I can think of many other interesting possibilities At the moment my MiniEmail assembly CIRCUIT CELLAR serves as an online thermometer so I can check my room s temperature from anywhere in the world Let me know if you have any other ideas al Alexander Mann studies Physics at the Georg August Universit t in Gottingen Germany His interests include elec tronics and programming You can con tact him at fuenfundachtzig web de To make sure your e mail gets past the spam filters use the message form at www cip physik uni goettingen de alemann msgforme php PROJECT FILES To download code go to ftp ftp circuitcellar com pub Circuit_Cellar 2007 204 RESOURCES Atmel Corp 8 Bit AVR Microcon troller with 32K Bytes Insystem Pro grammable Flas
126. e with intermit tent communication errors After quite a bit of frustration I discovered the new lower power RS 485 driver did not have a strong enough input pull up for the automatic transmit receive switching circuit The test unit worked fine on the bench with the standard driver but I built six additional units incorrectly because I assumed the new device would require the same pull up After stacking another resistor on top of the pull up all was well again After the configuration data was loaded I checked the operation and accuracy Ignition brought the displays to life The oil pressure gauge flashed a O reading because it is configured to flash when display readings are below the alarm s setpoint Starting the engine showed that all the new gauges closely matched the existing gauges except for the timing gauge because I had the SPOUT and PIP inputs reversed Once I corrected that timing matched the reading from the Crane Interceptor an after market engine management device that connects between the vehicle harness and the ECM The horsepow er function was difficult to verify without a dynamometer but readings of 6 to 16 hp at idle and 40 to 50 hp at 60 MPH were close to the values in the shop manual Some hot weather nighttime driving chased another bug into the light Issue 204 July 2007 53 Occasionally the water tem perature and oil pressure gauge displays would have all the segments lit in Self test m
127. ed into two blocks and used as ping pong buffers see Figure 3 While block 0 is used for video processing block 1 is filled with the next partition by the MDMA controller When video processing is done on block 0 and data transfer is fin ished on block 1 block O is used as memory space for the next section of data and processing is performed on block 1 This allows the Blackfin proces sor to perform instructions more effi ciently because data transfer and video processing are occurring simultaneously When using the dual DMA MDMA controllers maintaining full utiliza tion of the DMA MDMA buses is ES a SSS Current frame Processing Incoming MDMA L2 Memory Background frame L3 Memory Figure 3 While the Blackfin processor is operating on block 0 cur 858 pixel by 525 line video frame Each video frame is 900 KB CIRCUIT CELLAR rent frame and background blocks buffers the MDMA controller is transferring the next set of lines into block 1 buffers www circuitcellar com Photo 1 Guide lines are drawn to help position the camera a Rails are marked in white by the calibration routine b Note that the camera is not perpendicular to the table surface because the system was in Albert s low ceiling room important MDMA controller 1 MDMA1 and MDMA2 each have two channels The two MDMA con trollers share the data bus on odd clock cycles Using MDMAILI for current frame block transfers and MDMA2
128. ed keypad using the micro controller s ADC with a sophisticated algorithm to enter alphanumeric data like you do on your cellular phone You have also learned how to exchange information using a modern USB interface without dedicated hardware based only on the raw per formance of the ATmegal68 il Carlos Cossio ccossio hotmail com has a B S in Physics from the Uni versity of Cantabria in Spain He is a senior embedded systems engineer with more than 10 years of experi ence designing trusted security plat forms In his spare time Carlos enjoys repairing and bringing old electronic equipment to life RESOURCES Atmel Corp AVR309 Software Uni versal Serial Bus 2006 www atmel com dyn resources prod documents doc2556 pdf ATmega 48 88 168 2 007 www atmel com dyn resources prod_ documents doc2545 pdf Z Chen Java Card Technology for Smart Cards Architecture and Pro grammer s Guide Prentice Hall 2000 C Peacock USB in a Nutshell Mak ing Sense of the USB Standard 2007 www beyondlogic org C Starkjohann Objective Develop ment AVR USB A Firmware Only USB Driver for Atmel AVR Microcon trollers 2006 www obdev at products avrusb PROJECT FILES SOURCE To download code go to ftp ftp circuitcellar com pub Circuit_Cellar 2007 204 itaka 16 Sa ihe 90 8 Days 27 Sh Standard PCB Poal Service PLY SEND YOUR FILES AND ORDER ONLINE
129. ee invert ers As expected with any project start these days it is also far more complex than originally anticipated It turns out that to get this much capacity my sys tem will have to have panels on the roof along with two pole mounted arrays There better not be any glitches either A crew of five has been out cutting and removing trees for the last four days can hardly hear myself think over all the chainsaw noise That and all this blinding sun I ve never seen before am putting my money where my mouth is because believe we are at a point where PV and other renewable energy systems are starting to make sense Whether it be a solar heating pump controller a smart load for a wind turbine or a net tied renewable energy monitoring system etc etc invite other authors to join me in creating regular coverage of this technology in Circuit Cellar It s one thing to simply add it to the interest list in our author s guide It s quite another when you see us actively pursuing the technology and doing it ourselves realize that we are on the cutting edge of some very expensive stuff here and it will take time to evolve as a focus but just like Circuit Cellar provides the premiere source of intensive exploratory articles about the hardware and software meth ods for embedded control it is my intention that we do it just as well for renewable energy electronics invite you to join me steve ciarcia circuitcellar com OVER 96 Issue204 J
130. eering He can be reached at kt brown shaw ca Jason Vangilst holds an Electrical Engineering degree from the Universi ty of Calgary You may e mail him at jvangilst hotmail com PROJECT FILES To download code go to ftp ftp circuitcellar com pub Circuit_Cellar 2007 204 SOURCE ADF7020 Transceiver ADSP BF533 Blacktin processor ADSP BF561 Blackfin processor ADV7179 video encoder and ADV7183 video decoder Analog Devices Inc www analog com Issue 204 July 2007 43 FEATURE ARTICLE by Eric Kesselring Multipurpose Automotive Gauge When Eric could not find the right gauges to update the instrumentation in a 1965 Mustang he built his own multipurpose gauge Now he can monitor everything from engine air flow to oil temperature Wien the market doesn t provide you with what you really want you must either compromise or take mat ters into your own hands This was the case when I wanted to update the instrumentation in a 1965 Mustang I knew that replacing the carburetor with a fuel injection system would allow a host of new sensors to be monitored I wanted the increased res olution and the full 270 sweep that mechanical gauges provide instead of the typical 180 sweep generated from electric gauges I later found a few elec tric gauges that provided 270 sweep but few if any of them were directly compatible with the sensors used by the engine control module ECM This meant additional sensor
131. elly Direct 860 872 3064 Cell 860 930 4326 E mail sean circuitcellar com ADVERTISING REPRESENTATIVE Shannon Barraclough Direct 860 872 3064 E mail shannon Q 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 SUBSCRIPTIONS Information www circuitcellar com subscribe E mail subscribe circuitcellar com Subscribe 800 269 6301 www circuitcellar com subscribe Circuit Cellar Subscriptions P O Box 5650 Hanover NH 03755 5650 Address Changes Problems E mail subscribe Q circuitcellar com GENERAL INFORMATION 860 875 2199 Fax 860 871 0411 E mail info Q circuitcellar com Editorial Office Editor Circuit Cellar 4 Park St Vernon CT 06066 E mail editor 9 circuitcellar com New Products New Products Circuit Cellar 4 Park St Vernon CT 06066 E mail newproducts circuitcellar com AUTHORIZED REPRINTS INFORMATION 860 875 2199 E mail reprints circuitcellar com AUTHORS Authors e mail addresses when available are included at the end of each article CIRCUIT CELLARG 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
132. ement weather Lindsay Meek Australia lindsaymeek hotmail com Stroboscopic Pocket Tuner The Stroboscopic Pocket Tuner is a handy tool for fine tun ing acoustic music instruments You use push buttons to select tuned notes and a potentiometer to adjust a note s pitch The LM3S811 based system includes an organic LED OLED display with 96 x 16 pixel resolution Ilya Mamontov Russian Federation illinoys narod ru ArmExe An RTOS for Luminary Micro Stellaris Cortex M3 Microcontrollers The ArmExe is a useful RTOS for the Luminary Micro Stellaris ARM Cortex M3 family of micro controllers and Keil s uVision environment The multitasking preemptable executive uses task priorities separate tasks and kernel stacks and execution privileges It handles all interrupts with priorities supports nested interrupts and implements binary semaphores and events as the resource sharing mechanisms Naubert Aparicio U S naubert aparicio usa net To see these projects and more visit www circuitcellar com designstellaris2006 Multitone Music Keyboard Designed for musicians to experiment with alternative scales this innovative LM3S811 based multitonal instrument features three inexpensive keyboards The TAIT TTY keys are combined in various ways to support 12 19 24 and 31 tone scales m Henry Pfister U S henrypfister hotmail com The Virtual Bicycle The LM3S811 based Virtual Bicycle provides a virtual bicycling exp
133. er Devices and much more www allelectronics com Free 96 page catalog 1 800 826 5432 PRINTED CIRCUIT BOARD 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 SPECIAL OFFER 10 PCS 3days 1 or 2 layers 249 10 PCS Sdays 4 layers 695 up to 30sq in ea includes tooling artwork L P l mask amp legend PULSAR INC 9901 W Pacific Ave Franklin Park IL 60131 Phone 847 233 0012 Fax 847 233 0013 www pulsar inc com sales pulsar inc com CIRCUIT CELLAR Issue 204 July 2007 91 e SURFACE MOUNT It writes your USB Code PROBING ADAPTERS Creates complete PC and Peripheral Both PC and Peripheral programs programs that talk to each other over understand your data items even odd USB Ready to compile and run sized ones and give you convenient M variables to handle them Large data Reports 64 000 bytes sec per Interface PICBASIC Pro Easily creates devices with multiple MPASM C18 Hi Tech C BGA QFP PLCC SOIC amp QFN Interfaces even multiple Identities p Pe SMT adapters solder to target board Automatically does MULTITAS KING E Ic BASIC Pro Modular probe boards Makes standard or special USB HID MPASM Hi Tech C
134. erience for riders The system provides speed and direction sensing virtual wind control and pedaling resistance control It also features a software interface to Google Earth Jeffrey Berezin Paul Gelling and Brian Post U S jeff berezin virtualbicycle com A Stellaris Based AIS Decoder Ships with cargo weighing over 300 tons must broadcast their positions using the universal automatic identification system AIS This well designed LM3S811 based system decodes AlS transmissions in software The transmissions are then transferred to a host system using the NMEA protocol Peter Baston U K ais petebaston co uk PGKey The PGKey is an electronic lock and key system that uses AES encryption for key verification The system features an LM3S811 for the lock and an LM3S102 for the key The lock is accessed by the key via two ports Admin and User The former is used for administration functions The latter is used to open the lock Alex Wolfing amp Charlie Krauter U S a13x5pam hotmail com Shock N Awe Powered by an LM3S828 this interesting table design responds to audio stimuli and produces amazing visual effects The design features 96 tricolor LEDs and four microphones The table can generate a single color display or exciting lighting effects Benjamin Wolpoff Thaine Hock Matt Corne Chad Harvey amp David Wolpoff U S bwolpoff fivemanconspiracy com Coil Gun Controller This educational system w
135. erved timeslot and manual an external event such as pressing a switch triggers registration Note that manual registration is the only option for an unhosted Point The next step for configuring a Point depends on whether it is hosted or unhosted For the latter it s simply a matter of specifying the direction for www circuitcellar com each of the five I O pins on the Pyxos FT chip Note that four of them can be defined as either input or output but the fifth pin is input only Hosted points are defined in terms of their network variables which are the inputs a Point receives from the network and outputs it delivers to the network As described earlier net work variables can be chosen from a list of existing standard types or using another utility resource editor you can define your own Once everything i e network Pilot Point is specified the Interface Builder program automatically gener ates the header and includes files that are combined with the API and each device s own application code Run that through all the compilers involved i e for the Pilot and hosted Point MCUs to generate the different binaries and you re in business MATCH POINT Before finishing up I want to com plement Echelon on the quality of the kit and tools This is complicated stuff but for the most part every thing worked as advertised right out of the box The only glitch I encountered was that the netw
136. es You will walk away with 750 if your design is chosen by the judges as best in category CIRCUIT CELLAR WNLIES E Photo 1 These are the development boards I find useful for investigating Microchip s 16 bit microcon troller families Microchip is offering some nice dis counts for contest entrants on select items i e the DM300027 is approximately 40 Note that each entry will automati cally be entered into a category that fits however your entry will be eligible to win a maximum of two categories The first category is for the effective use of SMPS resources dsPIC30F2020 This microcontroller with DSP has the peripherals you ll need including an ultra fast PWM and analog digital for your switch mode power supply SMPS design You ll be looking at methods for sensing current bias supplies gate drive issues transient response and how topology choices affect system design The second category is for the effec tive use of motor control resources dsPIC30F2010 Although this micro controller with DSP has a quadrature encoder and six PWMs you might want to design for something other than motor control Try this device for power conversion lighting or other controls using the fast 10 bit ADC with multiple samples and holds The third category is for the use of smart sensing methodologies any 16 bit microcontroller Design a sensor appli cation that uses the intelligence of one of the devices to impr
137. esults for G If the pocket lies on the right side of the target ball then the smallest magnitude root was chosen while the largest root was chosen if the pocket was on the left side For every colored ball that is found ghost ball positions and predicted tra jectories are drawn to the optimal pocket see Photo 2 As the balls MADE SIMPLE BRING YOUR PRODUCT QUICKLY AND LEGALLY TO MARKET RF Modules Add INSTANT wireless analog f digital capabilir fo your product Mus chnanmnal Madulma me a i Long Risnge Medules thee Ba icta EL i 4 ready Io glicemor unctian Modules EN Keyfeh TX amp Gain puru Alera Magnetic Base Vai F Parmarani amp inuri 800 736 6677 1559 Off Lane Merlin OA 7532 AW linktechnologes com Issue 204 July 2007 41 A Design Conference with some Real Muscle ARM Developers Conference and Design Pavilion October 2 4 2007 santa Clara Convention Center Strengthen your skills and speed your time to market Only the ARM Developers Conference offers Over 90 track sessions providing a complete end to end design tutorial for leveraging ARM IP in advanced embedded applications Combined tutorials with Portable Design Conference Design Centers and exhibitions from leading ARM licensees and Connected Community members offer a full complement of workshops and presentations Forums and analyst presentations on industry trends Register early and save
138. eyboard using just a numeric keypad Make the keypad work exact ly like the keypad found on any cellu lar phone Every numeric key is assigned a subset of possible charac ters to display depending on the num ber of key presses sensed within a time frame see Table 2 It is possible to enter lowercase let ters and uppercase letters Capital let Issue 204 July 2007 23 Keypad key number First press Second press Third press Fourth press Fifth press Sixth press Seventh press Eighth press Ninth press amp CO OI N OD C1 c5 n O x I oO OQ od wn 25 Oole O NO 0 ooa 05 no ce MM zece oouo s C UVU ZAIM Dee Table 2 Depending on the key presses it is possible to enter alphanumerical data and special characters using a standard numeric keypad There are up to nine levels ters are entered by pressing the key several times until the first uppercase letter appears on the display By default lowercase letters are entered first since most passwords are case sensitive and small letters are used more frequently Figure 2 shows the algorithm used by the firmware to enter alphanumeric data PASSWORDS AT WORK When you plug the Internet pass word manager system into a PC s USB port a welcome message is displayed on the LCD for several seconds After that the display prompts you to insert a card see Figure 3 When you insert
139. first to try to teach a microcon troller the language of the Internet The Internet related portion of the firmware is based on version 0 9 of www circuitcellar com Adam Dunkels s uIP www sics se adam uipfindex html It s a TCP IP stack for microcontrollers written in C and published under a BSD style license It contains the complete layer structure from the physical layer up to some example applications I adapted the routines for ARP ICMP UDP IP and TCP to work with my network device the ENC28J60 and added the other aforementioned protocols In order to use the 8 KB of SRAM in the ENC28J60 only the first part of received packets containing the protocol headers is loaded to the ATmega32 s internal SRAM After processing the header and only if the packet has been accepted the payload of the packet is passed to the respective application thus avoiding the need for a dedicated buffer for incoming packets OUTLOOK I hadn t imagined how many details would need to be considered when I started this project more than a year ago It has been a very interesting and challenging project It has also been a lot of fun The MiniEmail system provides all of the basics for communicating via e mail but such a project is never really finished There are still dozens of items on my to do list Fortunately the ATmega32 can be replaced with a new member of the AVR family the Atmel ATmega644 which is pin com patibl
140. for deletion All of the header data for all of the 1 024 messages cannot be held in SRAM at once only the most recent about 50 mail headers are held When you want to browse through older e mails CIRCUIT CELLAR the firmware automatically reconnects to the server and fetches the headers of the next 50 e mails When you select Check Mailbox in the main menu you get to a submenu where you can retrieve and read mail Before you can collect your mail you must enter your username and pass word which can be stored in EEP ROM for your convenience The firmware then retrieves the headers and displays the Mail Menu where you can browse through your e mail see Photo 4 Apart from the size and the date the first 42 characters of the subject and the mail sender are shown In the first row additional icons indi cate from left to right whether a mes sage is new has been marked for dele tion or has been read You can view the content of the selected message by pressing Return When the mail is fetched from the server it is prepared for viewing The header and HTML tags as well as long runs of the same character are stripped from the mail and base64 decoding used to encode 8 bit characters is performed so the content of the message is as readable as plain text Binary attachments e g images can t be handled Following this the mail is viewed in the text editor with editing disabled A similar action is per
141. formed when you press r in the Mail Menu In that case you can edit the text so you can add your reply Leaving the text editor will bring you back to the Send Mail menu where the reply address and subject will be filled in so your mail will be clear for take off To delete a message simply press D to mark it for deletion When you leave the Mail Menu you will be asked to confirm the deletion of the 040 Size 00315 13 Aus 4006 19 11 JU TT ampi eGmailprovi der nd This is the subject o 1 the Mall Photo 4 This is the so called Mail Menu where you can browse through your mailbox Data from the mail header e g the size of the mail its date and subject and the sender are displayed The small icons in the upper right give additional information www circuitcellar com n Compact Versatile Connected STELLARIS L 356965 Ethernete valuation features the Stellaris LM3SS6965 ARM Cortex M M3 based microcontroller with fully integrated 10 100 Ethernet MAC PHY The kit includes evaluation versions of popular software tools spanning the design spectrum from evaluation to prototyping to application specific design Perfect for a variety of applications including connected motion embedded web servers network based sensing and building automation MICRO Micro com selected message If necessary the firmware will reconnect to the server and delete the e mails Additional
142. g a few hundred bytes when you have not used over half of the flash memory space C code is also much easier to write and debug when com pared with assembler code The CCS compiler was designed to create optimized Photo 4 The second example is an active photo frame that displays images from the flash memory drive on a uVGA display and plays D PORTABLE DATA LOGGER MP3 files through headphones The same design can be used to drive addition to the standard features I know many of you use a PIC a larger display for a low cost information terminal you would expect from a quality Easy Embedded Linux 169 ui 16MB FLASH 32MB RAM Qty 1 uu a me 200Mhz Arm9 CPU 16 Digital I O code for PIC microcontrollers In CIRCUIT BOARDS Manufactured Domestically Since 1984 As low as Two Boards gt Watchdog deas Two Layers 10 100 Ethernet TO S MN Two Masks Battery backed Clock Calendar Ein One Le gen d 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 Unmasked boards for even less Out of the box kernel support for USB mass storage and 802 11b wireless along with a fully integrated Clock Calendar puts the OmniFlash ahead of the competition Call 530 297 6073 Email sales jkmicro com On the web at www jkmicro com JK
143. g an ana complexity we find the Sensor Point which uses an Atmel TinyAVR 8 bit eight pin MCU Befitting its name in addition to the lights and switches it includes tem perature and light level sensors as well as an analog voltage output Finally we come to the NanoPoint which is an example of an unhosted Point i e one that just uses the Pyxos FT chip by itself without a host MCU In the latter configuration the five pins used for the host MCU interface in Hosted Point mode are used instead as digital I O to directly control attached devices in this case the NanoPoints own com plement of lights and switches A significant portion of the board space and circuitry you see is associat ed with the use of the 24 VAC link power option Keep in mind that a minimal i e nonisolated common power supply nonlink powered Point could consist of little more than the Pyxos FT chip and its required 10 MHz crystal Also note that while the crys tal is required at least there s the m ENDE Bio TFT with Touch TFT with Touch from Reach Technology Inc Circuit Cellar 4 readers can win big Simply take a moment to complete the readership survey at www circuitcellar com survey2007 All participants will be entered for a chance to win a NEMA 4x IP65 enclosed operator Interface 4 diagonal TFT with touch or a Circuit Cellar back issue CD ROM complete set Don t delay Complete this important survey t
144. gh between 3 and 3 6 V while the Voc supported by the USB host is 4 4 to 5 25 V So if the microcontroller is pow ered directly from the USB lines then the data lines must pass through a level converter to compensate for the differ ent voltage levels the reason for the Zener diodes at 3 3 V in the data lines For a USB 1 1 compatible low speed device firmware implementation a 28 Issue 204 July 2007 lt ro aM6e s 08 mfa LCD2x16 1 5 Mbps bit stream must be decoded For the ATmegal68 clocked at 12 MHz eight CPU cycles are for each bit As a RISC processor the AVR executes most instructions in one clock cycle This gives the firmware about eight instructions to do the following opera tions on each bit In NRZI decoding a 1 is encoded as no change of the data lines A 0 is encoded as a change Decoding can be done by a negative exclusive OR opera tion between the current status and the previous one eight cycles earlier Bitstuff decoding is performed to preserve synchronization during long sequences of 1 A 0 change of data lines is inserted every six consec utive 1 bits This stuffed bit must be removed during reception In end of packet recognition the end of a packet is notified by an SEO con dition This means that both data lines CIRCUIT CELLAR which are normally the inverse of each other are at a logical 0 level for two bit times The received byte also must be
145. gned for serializ ing high speed signals in multimegapix el resolution CMOS and CCD image sensors Using proprietary CTL I O for serializing up to 12 bits at speeds up to 40 MHz the FIN212AC can be config ured as a serializer or deserializer and is implemented in pairs Patented CTL technology operates well in noisy RF environments by eliminating additional shielding required by similar high speed signals while offering the industry s lowest EMI 110 dBM The FIN212AC is especially beneficial when used in portable electronics with clamshell and slider form factors where minimizing the number of signals across a hinge reduces board space and improves relia bility The FIN212AC offers selectable LVCMOS edge rates and pulse widths to increase design flexibility while minimizing EMI These specialized fea tures allow the designer to tune the FIN212AC to a particular frequency range and enable implementations for both RGB and microcontroller inter faces without requiring software modi fications Although it primarily targets 8 to 12 bit camera interfaces in cell phones the FIN212AC is also well suited for applications with similar par allel interfaces with up to 12 bits such as laptops with integrated web cams VOIP phones and security cameras Featuring ultra low Power down mode about 0 1 pA when not transmitting data the FIN212AC is an extremely low power solution for conserving bat tery life in portable applications
146. guration the Vinculum operates as a serial to flash memory drive adapter written and finally the CLF comm mand closes testl Next remove your flash drive and connect it to your PC Mac or Linux system and open testl Notice that the data written by the Vinculum is pres ent Edit testl to add the message Hello from my PC Mac or Linux Next reattach the flash drive to the Vinculum board and enter RD testl Voila new text is displayed Now stop and think about what you accomplished You wrote read and exchanged data files between a PC Mac or Linux system and an embedded system using a flash drive You didn t even have to learn USB the MSC specification or the FAT file sys tem It was as easy as entering DOS like commands on a serial connection The hard work of understanding and implementing three industry specifica tions has been done already allowing you to focus on your application task The Vinculum monitor powers up in Extended Command mode where all the commands and data are in ASCII Some of the commands are summa rized in Table 1 The list represents about 2596 of the available monitor commands Refer to the firmware guide for more details The monitor can be switched into Short Command mode where binary commands and data are exchanged The VMUSIC board pro vides access to only the UART connec tion but this is enough for my first set of examples The Vinculum is also available in an OEM 24 pi
147. h ATmega32 2503 AVR 2006 www atmel com dyn resources prod documents doc2503 pdf AVR313 Interfacing the PC AT Keyboard 1235B AVR 2002 www atmel com dyn resources prod_ documents DOC1235 PDF Microchip Technology Inc ENC28J60 Datasheet DS39662B 2006 ww1 microchip com down loads en DeviceDoc 39662b pdf ENC28J60 Rev B4 Silicon Errata datasheet DS80257A 2006 SOURCES ATmega32 Microcontroller ATmega644 microcontroller and AT25256 EEPROM Atmel Corp www atmel com ENC28J60 Ethernet controller Microchip Technology Inc www microchip com 74HC4053 Analog multiplexer 74HC573 latch and 74HCT08 quad gate NXP Semiconductors WWNW nxp com Issue 204 July 2007 21 FEATURE ARTICLE by Carlos Cossio Internet Password Manager With this ATmega168 based password managing system you can enter display and securely store all of your passwords and usernames The handy device connects to your PC via a software controlled USB interface I used to surf the Internet every day to look for the latest information about my favorite topics Nowadays more and more web pages rely on login schemes that prompt me to enter a previously registered username and a valid password At first because my memory is not particularly good at remembering long strings of numbers and letters I used either the same login information for all my web accounts or I used simple passwords
148. h a shift light and rev limiter torque sensing by measuring shaft twist and resulting phase shift between two sensors and a G meter using an accelerometer duty cycle output In the end I was satisfied with Microsoft Excel as an effective low cost method to configure custom gauge functions and user calibrations With the configuration implemented with a simple nonencrypted text data format anyone with Excel experience can create new gauge function config CIRCUIT CELLAR uration and calibration sheets al Eric Kesselring works with electron paramagnetic reso nance EPR and NMR imaging systems at The Ohio State University Cen ter for Biomedical EPR Spectroscopy e Imaging He enjoys converting wood metal and plastics into particles smoke and occa sionally useful forms as well as exploring automo tive traction limits and dis covering new methods for removing countless layers of old paint from areas around his home You may e mail him at kaemkb yahoo com PROJECT FILES To download code go to ftp ftp circuitcellar com pub Circuit Cellar 2007 204 REFERENCE 1 Ford Service Publications Engine Emissions Diagnosis 1990 Shop Manual RESOURCE C Probst Ford Fuel Injection e Elec tronic Engine Control Bentley Pub lishers 1995 SOURCES MS96 Material device General Electric www gesensing com MAX7219 Constant current driver Maxim Integrated Products Inc ww
149. he Vinculum see Photo 5 The design s block diagram is shown in Figure 4 The example program uses RS 232 to control the Vinculum which writes data to the flash memory drive and the hardware connection is a standard four wire seri al port using TX RX RTS and CTS The Microchip Technology PICIGF88 runs an application that has access to a flash memory drive with Vinculum a real time clock a tempera ture humidity sensor and two analog input channels A connector for FTDI s TTL 232R 3V3 cable is included because it is a connector for a PIC debugger such as CCS s ICD U40 unit The program first checks to see if a flash memory drive is present If one www circuitcellar com is not found the PIC goes back to sleep since there is no point collecting data if there is no where to store it Once a flash memo ry drive is found the PIC starts a data collection cycle It reads the time from the Maxim Integrated Products DS1302 then the two analog signals and the bat tery voltage and finally the tempera ture and humidity The data is written on the flash memory drive and the sys tem goes back to sleep to save battery power The cycle repeats while a flash memory drive is present and the bat tery is charged The flash memory drive may be removed at any time and the data collected may be analyzed using a PC Mac or Linux based system The source code for the application is available with the development kit so you
150. ht want to connect to an application pro www circuitcellar com T FOR RELEASE better performance THIS MONTH PROPSoC with OMNISCIENT CODE GENERATION HI TECH PRO for PSoC ANSI C COMPILER from DENSER CODE BETTER PERFORMANCE the company that has for over two decades delivered Code compiled with HI TECH PRO for PSoC can deliver the industry s most reliable embedded software over 40 denser code than its competitor development tools and compilers comes with FREE 45 DAY EVALUATION OMNISCIENT CODE GENERATION A fully functional 45 day trial version of HI TECH PRO for Extracts information from multiple source files PSoC will be available free of charge from HI TECH s simultaneously allowing more intelligent state of the website Order your demo at www htsoft com portal ccpsoc SIEGOSEIHORPIHMOITPILIUE PRICE AND AVAILABILITY HI TECH PRO for PSoC includes at no extra cost e Optimizes the size of each pointer variable in your HI TECH PRIORITY ACCESS 12 months access to code based on its usage updates and technical support and HI TECH e Eliminates contention for PSoC index register SATISFACTION GUARANTEE a hassle free 30 day e Eliminates the need for many non standard C money back guarantee qualifiers and compiler options e Produces more efficient interrupt context switching code and e Customizes the functionality of the printf library function Can run on multiple platforms including Windows Linux
151. iable i has been incremented Now I added some seri al port code The Net Burner system comes with a serial cable and the Mtty tool that is used to load code or reload factory default programs when you ve got things all goofy Since this cable is connected to my development PC I plan to also use this as your serial interface connec tion There is a Reset button on the NetBurner board and I can control the system with the Mtty program This looks like a setup that will lead to a stable development environment even if I have written unstable code My next decision was whether to use the support provided by u C OS II for the serial ports As I explored example code I talked to support technicians at NetBurner and com piled code How to partition the design became clearer The files consist of the following CciBiSerial cpp the serial interface routines CciBiSerial h prototypes for the serial interface CciBiReports cpp the reporting routines and main cpp the main initial file Cci stands for Circuit Cellar Inc the customer Bi stands for Big Iron my name for this project The file extensions are cpp used with C The tools defaulted to this with the main file and I didn t want to change anything because I was just getting started and I was not sure about the exact requirements for the IDE Don t worry we are only using the C language Look in file main cpp at about line 24 and you will see extern
152. id the math and can t even buy the raw materials to do this project for less than what a com pletely installed system ends up costing with the current CT rebate program The only choice was to decide how big a system could afford no the maga zine isn t paying for this how much of the county to clear cut and who would be the lucky installer to get to deal with me while this mess is being built Incidentally I ve always been one of the first to adopt new technology but this may be setting a new standard even for me According to the CT Energy Fund the total number of present residential PV installations in the whole state of Connecticut population 3 5 million is 152 plus 18 commercial installa tions There are another 90 or so residential projects on the books for this year but any way you look at it we are definitely at the leading edge of the curve Presuming that everything stays on schedule in a few months l Il present a couple of articles on how my system was built and add our house to the installed PV list In case you are interested my objectives haven t changed in the last few months only the complexity has changed The contract has been signed and the rebate documentation has been submitted If nothing clogs up the works or screws up the rebate in a few weeks there should be a bunch of people doing the ladder and roof trick at my house The contracted system consists of 52 solar panels with a total rating of 10 760 W feeding thr
153. ine in the header of the mail it is not difficult Your e mail also needs a reply address so the recipient knows who sent the mail The reply address is normally the same for all of the messages you write The text you enter in this edit field is stored in the ATmega32 s EEP ROM so you don t have to type it every time you write a letter After you select the last menu item Send initiates the dispatch of the mail and displays a message that indicates whether or not it was successful CHECKING FOR MAIL What makes this part more sophisti cated is the ability to handle not only one e mail at a time but also fetch mail from the server The system can determine which messages are new and which messages have been read It can also extract data such as the sender subject or sent date from the header of the mail and then display the information The amount of mail the firmware can handle is limited by the size of the external SRAM The maximum num ber of e mails is currently 1 024 If you ve got more mail you will be so busy answering it that you won t have time to build your own MiniEmail client or you should delete some old mail Note that 1 024 is the number of unique identifiers that the system can remember The server assigns a unique identifier to each piece of mail The system uses the identifiers to keep track of which letters are new on the server which have already been read and which have been marked
154. ine the complexity and choice of the PSoC Since this is an article about embedded flash drive applications I chose the simplest dis play to implement here and I will cover interfacing to a Q VGA LCD panel in a future article I found a serial interface uLCD at Dontronics I was very impressed with how easy the 128 x 128 16 color displays were to use The 1 5 x 1 5 displays are not expensive You should get some and experiment with them I m sure you will find many uses for them just as I did I found the OLED displays much better to look at when compared with the LCDs but the firmware to drive both displays is identi cal From a hardware perspective just swap the GPS serial connection with a uLCD connection see Photo 4 The uLCD module is a very capable subsystem that supports graphics ren dering and several fonts My example uses about 5 of its capability because I just download images to it The uVGA images are 128 x 128 x 16 bit color The download package includes a PC application called Imager which converts 24 bit color BMP files into this format and adds a variety of transitions In this example the images will be copied to a flash memory drive and called nnn img nnn 000 to 999 MP3 files are also created for each image and they will be called nnn MP3 They could be your favorite songs renamed My base application starts by look ing for 001 img and copies it to the dis www circuitcellar com PCF8574
155. ions such as successful shot likelihood if there are multiple shot options to let you know which shot is best in a particular situation A more difficult challenge would be to allow compensation for the effects of the cue imparting spin on the cue ball known as English and the spinning cue ball transferring this spin to the object ball known as throw This would be very hard to detect in a 30 frame per second environment and most likely a high speed video frame capturing device would be required We re also considering a wireless sys tem that allows multiple users to view the shot on their own screens This would be ideal in a tutorial sce nario At the end of the project we implemented a prototype wireless sys tem which transferred a static video image from one Blackfin EZ KIT to a second EZ KIT and then displayed it on a TV The system used Analog Devices s ADF7020 radio transceivers hooked up to the Blackfin SPORT ports The principles of this system can be applied to other motion tracking applications like security surveillance wildlife monitoring and tracking objects in other sports such as bocce or bowling Currently one core does all the pro cessing in the software architecture while the second core practically sits idle performing only user I O routines and main system flow control If more computationally intensive routines are used in the future the workload could be shard between the two cores
156. ir cuit concerning the ENC28J60 is taken from its datasheet The PWM pin PB3 on the AT mega32 is used to adjust the brightness of the LCD s backlight This feature is used to switch off the back light in Standby mode and flash the back light to alert you when new e mail arrives Photo 2 shows the circuit board without the cables which are normally connected to it The ATmega32 is in the middle The CIRCUIT CELLAR ENC28J60 together with its peripher als is in the top right corner of the circuit board Moving from left to right on top there are two wires for the 5 V supply voltage the PS 2 con nector for the keyboard the nine pin connector for the USART interface and the RJ 45 Ethernet connector in the top right corner An ISP10 com patible connector on the bottom right is used for the in system pro gramming of the ATmega32 microcon troller The LCD is connected to the circuit board via a 16 pin connector You need two additional wires from the pin header next to the ATmega32 This is actually a design error and not recommended for reproduction You should use an 18 pin connector There are three LED status indica tors The red one next to the ISP10 connector is illuminated when the ISP interface is active The green and the red LEDs next to the ENC28J60 blink when packets are received red and sent green SOFTWARE The firmware for this project is post ed on the Circuit Cellar FTP site
157. it is only 12Mbps 2007 marks our 11th year of Free 30 day evals at www taltech com Don t Miss the Only Conference Dedicated to Flash Memory August 7 9 2007 santa Clara Marriott ESC Santa Clara ca The NAND market has grown faster than any technology in the history of semiconductors exceeding 11 billion in 2006 only a decade after its introduction sim Hanoy objective Analysis Fash Memory QScreen Low Cost Versatile Instrument Controller Download the free Front Panel Designer to design your front panels in minutes Issue 204 July 2007 Order your front panels online and receive them just in time www frontpanelexpress com e Touchscreen Operated GUI e 128x240 CCFL Backlit Graphic Display e Programmable in C or Forth e Hundreds of Screens Buttons amp Menus e A D and Two RS232 485 ports e 8 Timer Controlled Digital I O Lines e Up to 1 MB Flash 512KB RAM e Wide Selection of Plug in I O _ Mosaic Industries Inc NN tel 510 790 1255 fax 510 790 0925 Yt BT mm sr ww mosaic industries com CIRCUIT CELLAR www circuitcellar com Simple DTE IET No nage 1 630 245 1445 Naperville Illinois USA www gridconnect com 1 6 Layers Flex PCB High Quality 1 2 Weeks Delivery Start at Only 299 Custom Membrane Keyboards PCB FPC Backed Built in LED Start at 245 EZPC Www ezpcb com Her CO es ezpcb com CUSTOM MEMBRANE KEYBOARD
158. le data entry The DAC linear inter polation table holds the DAC output data for converting the digital display data to a voltage function The three sheets edit over 20 parameters For the compiler formatted sheet a compiler friendly file is generated and saved as gaugecfg prn A simple command file renames it gaugecfg asm and places it in the cor rect directory for the compiler To program a device with the EC2 serial in circuit program mer the linkable gaugecfg asm is assembled com piled and down loaded with the rest of the program files The output sheet for serial down loading contains configuration data programming com mands and invert ed checksums The sheet is saved in TXT format so it can be transferred to the gauge via the RS 485 serial port I used HyperTermi nal to communi cate and download data through an RS 232 to RS 485 From processor PCA Issue 204 July 2007 51 converter dongle MAKING THE CONNECTION I built a test panel to hold the six assembled units For analog measure ments either the high or low analog input must be connected For phase measurements a reference and the measured signal are required Frequen cy pulse width and duty cycle require only a single input With a host of options available I had to decide which parameters to monitor A bad sending unit from my old oil pressure gauge intermittently produced scary readings and a less than accurate fuel level
159. lop Prototype Processor with 80 Cores Intel AECA e Design and Implementation of the TRIPS Prototype Chip UT Austin CTO e Tile Processor Embedded Multicore for Networking Multimedia Tilera Yusuf Abdulghani Apple Embedded and Video e SH X3 SuperH Multi Core for Embedded Systems Renesas Steering Committee e An HD Image Processor for Low Cost Entertainment Products TI Don Alpert Camelback Arch e A Professional H 264 AVC CODEC Chip Set for HDTV Broadcast NTT Lily Jow HP Panel What s Next Beyond CMOS Said sen ae Moderator Norm Jouppi HP Labs radeep Dubey Intel John Mashey Techviser Howard Sachs Telairity Technology and Software Directions Al ith ESSI e Multi terabit Switch Fabrics Enabled by Proximity Communication Sun Micro ue rupi d e Thyristor RAM A High Speed High Density Embedded Memory T RAM Semi e Raksha A Flexible Architecture for Software Security Stanford U ids etia isa Program Vo Vnalrs Wireless JohnMashey Techviser A 4Gbps Wireless Uncompressed 1080p 60 GHz HD Transceiver SiBeam Rajeevan Amirtharajah UC Davis _ A2x2 MIMO Baseband for Wireless Local Area Network 802 11n Broadcom PES RET zu CAE ON t tt Keynote Il Multicore and Beyond Evolving the X86 Architecture Ralph Wittig alia N 3 Phil Hester CTO A John Montrym NVIDIA o Networking l Christos Kozyrakis Stanford U e Chesapeake A 50Gbps Network Processor and Traffic Manager Bay Micro Mitsuo Saito Techie e A System on a Chip with Integrated Accelerator
160. ltages of USB to JTAG 130 to 460 VAC The surge current capability of the LS42 was increased by as much as 62 to 65 kA This series is designed for rated voltages between 250 and 460 VAC Approval to UL 1 449 and CSA 22 2 has been granted for both series The varistors cost between 7 50 and 10 each depending on the type EPCOS Inc none 978 874 0299 WWW epcos com WWW seg ge r com CIRCUIT CELLAR Issue 204 July 2007 9 NEW PRODUCT NEWS LOW COST TRANSCEIVER BASED FPGA The new Arria GX FPGAs are optimized to support PCIe x1 and x4 SRIO and GbE is also available Designers PCI Express PCIe Gigabit Ethernet GbE and Serial can begin their Arria GX designs today by downloading RapidIOTM SRIO standards up to 2 5 Gbps These stan and installing the easy to use Quartus II development dards are rapidly emerging as mainstream protocols in a software version 7 1 wide variety of markets and applications Features of the The EP1AGX50CF484C6 costs 50 in 25 000 piece Arria GX family include the proven Stratix II GX trans quantities ceiver technology flip chip packages for superior signal integrity software tools and verified IP cores Altera Corp The Arria GX family comprises five devices ranging in www altera com density from 21 580 to 90 220 logic elements LEs up to 4 5 Mb of embedded memory and up to 176 multipliers It is built on TSMC s estab lished 90 nm process The family addresses the rapidly growi
161. ly sent over the physical connection calculate checksums etc On the physical layer network devices are addressed using their MAC addresses Because you know only the domain names of the mail servers you must first use the DNS protocol to translate the domain names to the correspon ding IP addresses and then use the ARP protocol to translate the IP to the MAC address Lastly you can direct your packet Before you can send your data you have to wrap it using either the TCP or UDP protocol The transmission control protocol TCP provides a sta ble connection to a remote host so you can be sure every packet sent reaches its target You need this as the basis for the SMTP and POP3 protocol you are aiming at The user datagram protocol UDP is much simpler and does not care if data gets lost or arrives in the wrong order but you also need this because DNS requests can be sent only via UDP TCP packets as well as UDP packets are once again wrapped according to the Internet protocol and finally passed to the ENC28 60 Received packets have to be passed through all of the respective protocol handlers in reverse order There are two more protocols in Fig ure 4 The Internet control message protocol ICMP is part of the IP family It is used for diagnostics purposes The simple network time protocol SNTP is even more useful to the MiniEmail system because it is needed to set its internal clock Fortunately I was not the
162. map DT www parallax com BASIC Stamp is a registered trademark of Parallax Inc Propeller Stamps In Class Parallax and the Parallax logo are trademarks of Parallax Inc
163. me of the newest elec tronic engine systems have multiple reference events per spark event that would not be calculated correctly with the present gauge software configura tion However timing can be easily read from about any engine with the addition of a TDC sensor and a spark pickup Diesel engine injector timing could be checked with a TDC sensor and a piezoelectric sensor on an injec tor line For easier assembly each gauge has a rear mounted five and 10 position latching connector housing that mates with two detachable pigtails Output signals are on the five pin connector with the inputs on the 10 pin connec tor An additional terminal block pro vides a way to connect gauges with external signal and network wires Power is tapped from vehicle ignition CIRCUIT CELLAR on source An additional tap comes from the vehicle instrumentation s lamp power for night dimming which feeds all gauge units and works along side the built in photocell dimming circuit SMOKE FREE ENVIRONMENT With everything connected it was time to power up and reload the gauges with their calibration There is a separate Excel file for each gauge containing a unique network address alarm setting analog or digital calibra tion data and parameters Since I was using the existing sensors for the ana log units the best accuracy would be obtained with measured ECM refer ence voltage entered into the spread sheet I had some troubl
164. modules and integration into exciting embedded Linux infrastructure Assist DSP software team as needed Proficient in embedded Linux C and script programming Working knowledge of SNMP PPP and ITU V series preferred Send resume to bar cellularspecialtie s com ww w cellu larsp ecialties com CIRCUIT CELLAR FAT 12 16 32 FILE SYSTEM DOS Windows Compatible USB Flash Disk USB Floppy amp Hard Disk SD MMC CompactFlash ATA IDE DiskOnChip NAND amp NOR Flash 10KB RAM 25KB ROM typical Low Cost No Royalty Full Source Code www smxrtos com Micro Digital Inc RTOS Innovators 800 366 2491 sales smxrtos com Full Speed CAN USB Adapter NN T x 1 630 2457445 Naperville Illinois USA WWW C a n com ft Qridconnect www circuitcellar com Tiny Linux controller 16MB fast SDRAM 10 100 Ethemet 64MHz Coldfire MCU 3 serial ports RS232 4 5 MB flash memory 1 CAN port SD card socket lo 2GB LCD KPD port Senini dev env Free serial na LUED oe er Embedded DSP Hands On Workshops Avoid confusing datasheets Rapidly learn to program design and debug your application Reinforce course concepts with included development tools Let us help you accelerate your design process Visit www dsp workshops com www circuitcellar com Versatile ia Picuianireeble Module Serlal PC USE Parallel Interface AVRIBASIC Stamp VB Compatible Onboard Flash Bitmap Memory D
165. more than 30 V Frequencies range from a couple of hertz to a couple of kilohertz The www circuitcellar com information helped define the hardware required to do the job Take a look at Photo 1 for a sample of a few sensors that may be monitored PLUMBER S HELPER Before getting far along with the PCB layout I looked for a suitable enclosure With a nominal 2 25 outside diam eter I found that a 1 5 PVC pipe end cap was close to the standard 2 0625 gauge body diameter The 1 5 inside diameter and 1 5 cap depth defined the hardware enve lope Some minor lathe work gave a nice flange and groove to hold an O ring faceplate legend lens and bezel The bezel comes from a 2 sched ule 40 PVC pipe machined on the inside to match the PVC cap s outside diameter Cus tom legends are constructed and easily customized with cutouts from laser printer transparencies created in Microsoft Word Photo 2 shows what is inside and how it fits together Three round PCBs are inside the 1 5 cylinder display processor and Molex x6 Hdr Photocell Q1 MMBT 4403 Photo 2 Take a look at a close up of a gauge assembly The clamp in the upper left is a split piece of 2 PVC schedule 40 A 6 32 screw threads through all PCBs and spacers holds the PCB assembly in an enclosure and pulls the clamps against the rear of the panel Input output and ISP connectors on the rear interface PCB fit through cutouts on the backsi
166. n 1 to 7 3 to 7 3 to 9 Table 1 Some peripherals appear the same across the 8 bit 16 bit boundary but many of the 16 bit peripherals are enhanced and can be found in multiples CIRCUIT CELLAR www circuitcellar com The I O requirements should be well defined before you choose a microcon troller This will allow you to zero in on a package size Through hole parts come in 18 20 28 and 40 pin DIP styles DIP SMT parts come in 18 20 and 28 pin SOIC and the smaller 20 and 28 pin SSOP style Tiny leadless QFM styles include 28 and 44 pin packages The higher pin count parts e g the 60 80 and 100 pin TQFPs are available in both a 0 4 mm and a 0 5 mm lead pitch If you looked at all of the 28 pin parts both 8 bit and 16 bit offered by Microchip it would still be over whelming That s why it is helpful to look at what s available using a couple of different methods The selection guides on the Microchip web site for 8 and 16 bit microcontrollers are based on a few different factors including family memory size memo ry type and application features I pre fer using the pin count or application features to narrow down the field Once all the peripheral bases have been covered you may need to estimate memory size or speed requirements Memory size can be affected by your choice of language use of tables and the application s computational require ments Speed may be an important fac
167. n 2 5 to 5 5 V This family comes in four vari eties general purpose sensor motor CIRCUIT CELLAR control and power conversion all oper ating at 30 MIPS Each flavor has periph erals based on general or specific applica tions For instance the sensor family is based on low pin count devices in sup port of high performance yet cost sen sitive applications The motor control family includes a quadrature encoder for position and velocity feedback Analog comparators and high speed ADCs and PWMSs in the power conversion family are needed for SMPS UPS and power factor correction applications The gen eral purpose family features codec sup port for speech and audio applications Executing at 40 MIPS 3 3 V the dsPIC33 family has the highest perform ance The general purpose family GP has both low pin count devices for sen sor applications and larger devices with codec interfaces and DMA The motor control and power conversion family MC has quadrature encoders and DMA STANDARD FEATURES Over the years additional features have crept into Microchip s embedded controllers Many now contain an on chip precision oscillator that can elimi nate the need for external crystals res onators or clock sources Low jitter PLLs can boost clocks to full internal speed lower speed external sources means reduced EMI Watchdogs have separate oscillators for independent operation An on chip clock monitor can
168. n DIP mod ule which provides additional access to the SPI port the parallel port FIFO and the other USB port see Photo 1 Your mind must be racing the things that I can do with this PORTABLE GPS TRACKER I have more equipment in my lab www circuitcellar com VDD Contrast LCD Display optional CY8C24223A Phase1 GPS Sensor Vinculum Figure 2 The GPS tracker is battery powered and the design allows the firmware to power down the GPS sensor and or the Vinculum and flash memory drive independently to conserve battery life Analog and digital blocks within the PSoC are used to generate and control the power needed by the other modules than most Radio Shack stores so I could choose from a wide range of projects I first grabbed a Garmin International GPS 18 LVC tracker with a serial interface Note that the GPS s RS 232 interface runs at a default 4 800 bps with TTL signal lev els and inverted signal polarities This is not a problem for FTDI s cable which is fully programmable Using the MPROG utility from the FTDI web site I reprogrammed the cable to inverted RX and TX I soldered a con nector to the Garmin cable to match the FTDI cable socket and then plugged the two together Next I con nected it to my PC running HyperTer minal at 4 800 bps At power up the GPS is quite verbose and starts send ing multiple reports after about 3 s I now had two serial devices a seri al to flash drive
169. nables a gauge to send an ASCII less than character when the gauge s MIN button is pressed and a greater than character when the MAX button is pressed to mark events To request current gauge data a master such as a laptop computer connected to the gauge s serial bus transmits serial data consisting of a single ASCII character from 01 to OF This command can be sent with HyperTerminal using characters from Ctrl A through Ctrl 0 As long as each gauge on the bus has a unique address www circuitcellar com DSO Test Instrument Software for BitScope Mixed Signal Oscilloscopes aici Ul 2 Channel BitScope Pocket Analyzer BitScope DSO Software for Windows and Linux BitScope DSO is fast and intuitive multi channel test and measurement software for your PC or notebook Whether it s a digital scope spectrum analyzer mixed signal scope Oscilloscope logic analyzer waveform generator or data recorder BitScope DSO supports them all Capture deep buffer one shots or display waveforms live just like an analog scope Comprehensive test instrument integration means you can view the same data in different ways simultaneously at the click of a button gt ctrum Analyzer DSO may even be used stand alone to share data with colleagues students or Integrated real time spectrum analyzer for each customers Waveforms may be exported as portable image files or live captures replayed inel with concurrent wavet on othe
170. needs to be able to handle the aggregate peak net work bandwidth while Points need only the horsepower necessary to deal with their own contribution HOOK EM DANNO When it comes to understanding the PsInit This is a user provided i e hardware specific function called at start up to initialize the SPI the host MCU uses to communi cate with the Pyxos FT chip PyxosPointInit Function called at startup to initialize the Pyxos FT chip and API PyxosPointSendUniqueId Each Pyxos FT chip is factory programmed with a unique 48 bit ID that identifies it within the network In most cases registra tion is handled automatically by the Pyxos FT chips themselves but this function allows a Point to manually register with the Pilot if necessary PyxosPointAnnounceTimeslot This function allows a Point to tell the Pilot which timeslot it should be assigned to Such hardwired registration is suitable in networks with a known and unchanging configuration PyxosPointGetTimeslot After initiating registration either manual automatic or hardwired this function allows a Point to confirm which timeslot the Pilot has assigned to it PyxosPointIsOnline This function returns true or false to allow a Point to determine that it has successfully registered with the Pilot and the network is operational PyxosPointEventHandler This is the main function that your application must call periodically to handl
171. ng electronics to gain ethernet gt Power supply and all cables Call for 100041 capability gt HTML editor and upload utility eee eee adt gt Printed manual 3 3 V with 17 1 0 pes or SV with 1171 0 Reads Analog Voltages FN Digital Signals In Out P HTML vidi j Serial data streams to from existing equipmet Reads up to 8 external digital temp sensors View data on an existing character LCD Able to directly drive Ry ilill T3 a character LCD dc Puma NH Mt MMMIECENESLENSDOI SMESORSESOMSEUURETA NEW PRODUCT NEWS CONNECTOR FAMILY ENABLES FAST MEZZANINE CONNECTIONS The new MicroSpeed connectors available in a variety of different heights are ideal for high speed data transfer in telecom and datacom applications The 1 mm modular shielded SMT connector system consists of two contact rows and two outwardly arranged shield plates With the availability of different height versions of the male 1 2 9 and 10 mm and female 4 6 8 and 10 mm connectors it is possible to create 16 different stacking heights from 5 mm to 20 mm A major advantage is the multiple con nector mating capability based on the high mating tolerance that allows the mating of more than one connector pair at the same time For impedance purposes the longitudinal pitch of MicroSpeed connectors is 1 mm and the transverse pitch is 1 5 mm The differential signal pairs can be arranged horizontally or vertic
172. ng need for low cost FPGAs with transceivers in the communications computer storage and industrial markets The FPGAs provide up to 12 full duplex trans Pre processor MEME ceiver channels optimized to implement the PCIe GbE and SRIO protocols The devices use flip chip packaging technology which provides a sig nificant signal integrity advantage over wire bond packages when combining transceivers with Ser advanced memory interfaces nedum Arria GX FPGAs offer a unique design environ ment that includes software tools complete char acterization reports reference designs and verified IP cores that meet compliance and interoperability A protocol specific development kit with support for E Medium interface OSCILLOSCOPES PACK PERFORMANCE IN A LUNCHBOX SIZED INSTRUMENT Six new oscilloscopes that break the paradigm of portable instrumentation are now available With 1 Mpts deep memory the new 5000 Series oscilloscopes merge high resolution and lab quality waveform acquisition and measurement capability with a lightweight portable frame For the first time high resolu tion measurements typically taken with larger more expensive instrumentation can be taken wherever they are needed either in the field or at the bench The oscilloscopes allow engineers to discover the root of debug issues much faster than those using pre vious generation portable oscilloscopes Built to achieve a 100 000 waveforms per sec
173. ng or data logging operations Cycling power is required to reinitialize serial communications down You have to be careful when using copper and certain aluminum tubing because the vibration can cause them to harden and eventually break But mounting sensors directly to the engine can subject them to some seri ous failure inducing torture so there are gotchas either way For now the fuel sensor is mounted on a bulkhead made where the fuel lines enter the fender well I plan to mount an OEM fuel pressure sensor directly on the fuel injector rail supply line where it will give a more accurate indication of pressure at the injector Since these ESC character Jump to Program mode N Disable serial port Address match Figure 5 With the serial port enabled here are some Operating mode options You can query single node data isolate a node or enter Programming mode 52 Issue 204 July 2007 CIRCUIT CELLAR are both new sensors a small eight conductor cable is run from the sen sors to the gauge test panel Fuel level information could be tapped from the node connecting the original fuel level sensor and the gauge The original fuel level sensor provided a 12 O full 73 O spec empty resistance output when measured between the sensor output terminal connection and vehicle ground Inter nally the fuel level sensor was a wire wound variable resistor with one end connected to the output terminal and the
174. oday 72 Issue 204 July 2007 CIRCUIT CELLAR Soft Panel Meter Demo E Input A 2j B www circuitcellar com option to drive the 10 MHz clock Pcholon Pyma FT Interface Ceveleper Pyaos Project pyens network example Prj waveform out of one of the Pyxos FT chip pins for use by other logic e g a host MCU TEE Urhoned Poor Software that comes with the kit dme Medana Kd Pogan ID SF FF FF OA DO I FE 00 Calculator includes a show and tell human ctn machine interface HMI application p aetna RSS keene The HMI demo centers around a pon TEL ae d screen representation of the entire net work and the functions associated with each device see Photo 2 For example pushing a button on one of the Points causes both a real LED on the Pilot board and the associated virtual LED on the HMI screen to light at the same time Referring again to Photo 1 notice the small twisted pair red and black cable between the Sensor and Actuator Point boards This cable connects the output DAC on the for mer to the input ADC on the latter Photo 4 A Pyxos FT Project starts with the big picture representing each of the Points on the network In turn each Point is defined by the standard network variable types SNVT associated with its particular application The HMI software includes a to the Pilot requires less than 1 KB while the Pilot Performance Demo which is a loop The
175. ode and the serial port would still communicate Cycling power cleared them but they reoccurred sporadi cally I assumed these errors were caused by corrupt data entering the display driver device To prove this I added a display driver reset func tion in the code every seven segment display update cycle which was a quick fix without having to disassem ble it Eventually I will revise the pull up resistor values on these serial lines As I later found out my alternator had lost a diode and didn t have enough oats to run both the headlights and the cool ing fan which probably pushed things over the edge with more overall elec trical system noise It was nice to have the flashing water temperature gauge give me a bold indication of the less than optimal operating conditions when the fan could not keep up with the cooling requirements This meant I had to upgrade the alternator and the cool ing fan After these changes the new gauges have given me reliable and entertain ing information The test panel between the center tunnel and lower dash was supposed to be a temporary unit but I like it so it will stay there for a while Photo 3 shows a snapshot of the panel with the engine idling UNFINISHED BUSINESS There are still plenty of things left to improve The enclosures may dis tort in the direct sun if interior tem peratures get too far north of the 140 F PVC rating Although the bezels sur vived a 160 F paint b
176. of low cost cable e g Cat 5 twisted pair The exact distance depends on a variety of factors such as the type of wire the network layout and whether it just carries data or provides link power to attached devices as well Speaking of network layout the FT in Pyxos FT stands for free topol ogy Logically the network can be con sidered a bus in the sense that all nodes see all traffic But just because it s logically a bus doesn t mean it has to be physically wired as such The range of wiring options can be understood as follows Imagine you re able to connect the probes of a VOM to different nodes in which case the wiring rule is simply as follows Any Protocol engine and DSP Clock and Reset Control registers Index timeslot memory SPI Port and DIO configuration in which every node has electrical continuity with every other is allowed Obviously a true physical bus i e single wire fills that bill But so does a star configuration And so does a bus of stars or a star of buses Most notably even a loop configuration something most networking schemes frown on is allowed The cool thing about a loop is that it can be broken and the network will still work because a broken loop devolves to a bus Network management is centralized in a single Pyxos FT Pilot serving the individual nodes which are known as Points The decision to use a centralized approach has a num ber of ramifi
177. of place DCT FFT and IFFT transforms Window func tions include bartlett blackman ham ming hanning and kaiser windows Control functions include PID control Not only will you find additional free libraries for the complete 16 bit family covering math functions see Table 3 and peripheral use see Table 4 but there are also application specific libraries They include speech encoding and decoding noise suppression acoustic and line echo cancellation speech recognition TCP and IP V 32 2222bis encryption FAT 16 Function execution times DMA Controller 0 1i213 415i6 7 DMA eady Fae DMA Channel podpherali 5 775 E DPSRA Porti Port2 M r DMA DS bus CPU Peripheral DS bus Peripheral cu DIMA non DM A DMA ready DMA ready peripheral 2 peripheral 3 Figure 1 Separate buses allow DMA transfers to occur simultane ously with CPU program execution Many peripherals support this background operation advanced AC induction ACIM brushless DC BLDC and permanent magnet synchronous motor PMSM control Please visit the 16 bit devel opment boards tools and libraries page on Microchip s web site for more information about the Microchip and third party libraries and tools Not every library is free While there may be licensing fees involved with using some of these in production eval uation single use copies are available to designers for a 5 charge DMA As you can see
178. ond acquisition rate more than 25 times faster than the next closest competitor the 5000 Series offers industry lead ing glitch capture capability in its class A high definition XGA display system which displays signals in 256 levels of intensity grading high lights varying degrees of signal activity which provides an unrivaled ability to view signal anomalies as they occur To further enhance the customer experience the 5000 Series oscilloscopes also integrate a full suite of connectivity standards including front and back panel USB ports GPIB LAN and XGA out The 5000 Series oscilloscopes are available now They start at 4 050 for the DSO5012A Agilent Technologies Inc www agilent com 10 Issue 204 July 2007 CIRCUIT CELLAR www circuitcellar com m IL Von ern d b Ww UL ra gy qu b 2 T un e i i im Bs 7 in Ba Tor E j ETFI ld d Igi pamm f i z n A simple embedded Ethernet integration device to get your products online fast Reduce development and Flash Memory for custom engineering time web pages Per Unt 2 5 5 Extended HTML tags allow for Send email alerts 100 22 27 SYRRITES WED Soren Development Kit Includes 26 99 30 95 No other technical knowledge gt Two EZ Web Lynx 1 25 49 54 needed for programming device gt Docking station for VEN Mice as Development Kit Easily added to existing programming testi
179. ork activity logging fea ture of the demo application didn t appear to work It took a call to Echelon to find out that the feature is only enabled if your display resolution is greater than 1024 x 768 since other wise there s just not enough room on the screen to show everything Between the various manuals for the chip kit and tools the documen tation is exceptionally complete and well written For example the chip databook includes a very comprehen sive 10 page itemized check list for your design Follow it and you will find and correct 99 of the potential hardware problems before you power up the first time With the kudos out of the way let s get to the bottom line Is Pyxos FT right for your application Of course for existing LonWorks applications the answer is clearly yes Pyxos FT gives those designs the abili ty to cost effectively extend the net work s reach from the building down CIRCUIT CELLAR to the room and box level while using familiar techniques and tools On the other hand there are clearly simple applications that you can get by without For a physically small and self contained device with relatively few nodes key Pyxos FT features up to 32 nodes over tens to hundreds of meters including the link power option go unutilized At the same time the costs less than 2 for the Pyxos FT chip in volume MCU code space required etc little they may be loom relatively larger Fo
180. orks as a controller and data recorder for a dual coil coil gun You can use the LM3S811 based controller to experiment with various aspects of the coil gun including timing and voltage control You can also measure the real time voltage and current Andrew Sterian U S steriana gmail com Automatic Antenna Positioner This well designed LM3S801 based system autonomously points an antenna base station toward a target remote transceiver indicated by a latitude longitude pair The microcontroller reads the quadrature encoder signal from the motor and the current antenna heading from the sensor It then processes the data and sends the PWM result to a motor driver Hoa Phan Nghia Tran amp Vincent Dinh U S hphoa yahoo com Swissjazz List The Swissjazz system retrieves artist and song title information from an Internet radio station s web site and displays it on the LM3S811 evaluation board s display The information updates every time a new song begins The system connects to the Internet via an 802 11b wireless CompactFlash card Fernando Jordan Switzerland jordanf swissonline ch StellarisGFX The StellarisGFX is a sound effects processor for gui tarists The LM3S811 based system s keyboard is used for navigating in the user menu You can set the volume level and select effects such as overdrive tube over drive and distortion Robert Papp Hungary probert edaboard com SD Card Display Controller The
181. 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 subscription orders payable in U S funds only via Visa MasterCard international postal money order or check drawn on U S bank Direct subscription orders and subscription related questions to Circuit Cellar Subscriptions P O Box 5650 Hanover NH 03755 5650 or call 800 269 6301 Postmaster Send address changes to Circuit Cellar Circulation Dept P O Box 5650 Hanover NH 03755 5650 Circuit Cellar amp 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 amp disclaims any responsibility for the safe and proper function of reader assembled projects based upon or from plans descriptions or information published by Circuit Cellar The information provided by Circuit Cellar is for educational purposes Circuit Cellar amp makes no claims or warrants that readers have a right to build things based upon these ideas under patent or other 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
182. out Microchip s 16 bit Microcontroller and Digital Signal Controller DSC families These powerful workhorses offer a broad range of products while preserving the compatibility that helps save you time and money on subsequent designs Put your creativity to the test Your project could win you a share of 15 000 in cash prizes and give you the international recognition you deserve Learn about unique contest sample opportunities special offers from Microchip and how you can be the next Circuit Cellar design contest success story TT i k T J 12 26 Compote mail Check mailbox Configuration Stand by Photo 3 This is a screenshot of MiniEmail s main menu In the upper right corner a clock shows the current time which is retrieved from the Internet An arrow to the left of the menu items indicates the selected item while the Main menu appears see Photo 3 The Compose Mail Check Mailbox and Configuration submenus form a hierarchical menu structure see Figure 3 When the other items listed beneath the respective menu titles in the diagram are activated e g start the text editor they enable you to input data such as a username and password or retrieve mail from the mail server Standby is the only action that is accessible directly from the main menu All other actions are grouped by function in the submenus The text editor is the part of the software that you will probably spend most of your time with
183. ove on traditional sensor methods Digital signal condi tioning may be the answer to simplify ing a cost sensitive application The fourth category is for connected communications applications any 16 bit microcontroller All of the 16 bit devices include various serial commu nication channels Their inherent nature allows them to easily access off chip peripherals in larger systems This might be a good category for your LIN or CAN bus application The fifth category is for the effective Issue 204 July 2007 79 Flash Card Library W Easily exchange data between your product and a PC E Create Append and Delete PC compatible files E Add GIGABYTEs of onboard or removable storage to your product W Compatible with over 20 card styles SD MMC MicroSD TransFlash If No OS RTOS or interrupts are needed Works with low cost Microcontrollers Support for FATI6 and FAT32 file systems M Full C sources easily ports to many C compilers Flash Card Adapter Board The flash card adapter board contains all the basic circuitry needed to add PC compatihle flash card memory to virtually any microcan troller application using as few as four VO pins It also includes 3 3V regulator huilt in level shifting and sockets for both SO MMC and Micros DE TransFlash memory cards PIC Midas oos Board he development board includes a built in demo application ard all the necessary hardware to run ea
184. ow er selectable rate Depending on the amount of buffer RAM in the selected PSoC device I collected a series of samples before writing them to the Vinculum The Vinculum buffers a sector s worth of data before writing to the flash memory drive I found a large variation of power draw from the flash memory drives that I tested so I pro grammed the Vinculum to keep the drive suspended except when it was accessing the drive This saved a lot of power The final and completed proj ect files can be downloaded from the Circuit Cellar FTP site I included an LCD that I used to simplify develop ment by also displaying the GPS posi tion during debugging For portability the example needs to be battery operated This is easy for the PSoC because it contains an inte grated charge pump that enables it to operate from a single 1 5 V battery I used some of the programmable blocks and a few external components to generate 5 V for the Garmin and Vinculum modules The final schematic of the first example is shown in Figure 2 I chose to enable each module s attachment to the 5 V generator because they can be individ ually powered off to save battery power I measured flash memory drive Photo 3 The first example uses a Cypress PSoC to interconnect a Vincu lum chip with a Garmin GPS sensor The character LCD is used for debug ging but it could be incorporated into the final design ry drive is present I record the GPRM
185. ow level routines for the ENC28J60 and the TCP IP stack whereas internet c contains the appli cations based on these protocols i e the implementation of the functions for retrieving and sending mails implementation of the POP3 and SMTP protocols the Mail Menu etc If you have ever programmed a mail client on a PC you probably know the post office protocol version 3 POP3 and simple mail transfer protocol SMTP which are used to retrieve and send e mail over the Internet When writing a mail client on a PC these two protocols are all you need to know because the operating system does the rest and most of the work for you Unfortunately there is no operating system on your ATmega32 so you have to build everything from scratch As you can see in Figure 4 there are many pro tocols hidden beneath the surface Your hardware namely the ENC28 J60 enables you to send and receive frames over an Ethernet connection which constitutes the physi cal layer Everything on top has to be done by the firmware i e you have to add the appropriate headers www circuitcellar com Ethernet Figure 4 These are the protocols implemented in the MiniEmail system s firmware The protocols are stacked on top of each other according to their dependencies For instance POP3 is based on TCP which in turn enhances the functionality of IP which in turn is equipped with the necessary Ethernet protocol header before it is final
186. ownloadable TTF Fonts 2T or 6 TOUCH Color TFT LCD s 240x150 or 320x240 resolutions Transflective w LED Frontlight 2 7 Transmissive w 250 nit backlight 8 6 512 colors or 65 535 colors Solve complex signal acquisition problems positioning amp control environmental LJ acceleration transients Pressure vibration BEDITar GPS Linux Driver ree Guaranteed in stock Customization available 16 bit analog inputs and outputs Million sample FIFO eliminates interrupts Wide analog input and output ranges 40 C to 859C Standard A www stx104 com Al Apex Embedded Systems salesisixi 04 com 608 256 0767 x24 Front Panels We work with your CAD program pert in Quality pertin Service pert in Material pertin Price Please contact us Email info cam expert com Web www cam expert com CIRCUIT CELLAR INTERNATIONAL salesiifiemosint com Hands on Training Bus Monitors amp Protocol Analyzers b a Host Adapters e Multinlexers Battary Applications e Sofware Tools CC Micro Computer Central PE is a trial of Phils Corer wWW mcc us cc or ul Issue 204 July 2007 87 Start designing with Freescale s advanced S12X family freescale Alliance Member Toll free 1 877 963 8996 www technologicalarts com PIC MCU support Embedded Ethernet Development kit with PCWH compile
187. r see Photo 1 Here s the run down Not unexpectedly the Pilot using an Atmel ARM 7 based flash MCU is the largest and most complicated Ca Vues Tok hap Consilii Tipe Fabina i erm ECHELON board Besides handling the Pilot duties it also supports USB and or LonWorks the orange connector con nections to a host PC Next up is the Accuator Point which using the same ARM7 based MCU as the Pilot demonstrates an example of a high performance Point In addition to the complement of digital I O that every board Photo 2 The human machine interface HMI demo application centers on a visual representation which along with an activity log allows monitoring transactions between devices attached to the network www circuitcellar com CIRCUIT CELLAR Pololu Robotics amp Electronics a Robot Kits Line followers Robot arms Hexapods Chassis Mechanical Components Gearboxes servos Wheels ball casters Motion Control Servo controllers Motor controllers Robot Controllers dual H bridge voltage trimmer pot regulator E on ADCT power LED green red usar LED an PD1 ATmega48 168 microcontroller L programming connector 20 MHz clock Solder Paste Stencils roe ea TEN 525 to quickly assemble B D JII a your surface mount N ER um designs Tr a cum oae o s Om m C omoc3 mmm Nm mi mE M ALLTEL sesa IUT m EE NN
188. r PCs as if a BitScope was locally connected BitScope DSO supports all current BitScope models auto configures when it connects i and can manage multiple BitScopes concurrently No manual setup is normally required ternal Trigger and special purpose Data export is available for use with third party software tools and BitScope s networked jital signals down to 25nS data acquisition capabilities are fully supported Di Cill 09 el T g gt 9t hak P QH 0 SPEC lt D pit wee ope com EN l J EN z A o 5 m s Zc NP PC 104 Single Board Computers Low Price Low Power High Reliability 200 MHz ARM9 using Linux development tools Power as low as 1 4 Watt 5 boards over 99 2000 configurations qty 100 Fanless no heat sink SDRAM up to 128MB 1 29 qty 1 Flash up to 128MB onboard ts7200 A a 10 100 Ethernet up to 2 shown with WEE 1 TN S in i AN tional A D te E ZO m Compact Flash and RS 485 i lt p E T DIO lines up to 55 NEW 2 USB ports a SD card COM ports up to 10 opus a options include onboard temperature sensor A D Converter 8 channel 12 bit Extended Temperature Programmable FPGAS a VGA video Battery Backed Real Time Clock USB Flash 256 M with ARM Tool Chain USB WiFi Linux Real Time extension NetBSD Off the Shelf Solutions ready to design into 133 MHz 586 your project using DOS development tools a Power as low
189. r for 499 discount code CCEEK OR Purchase a Windows IDE compiler and receive a FREE ICD UAO 350 PCW 12 bit and 14 bit PIC MCUs 425 PCWH 12bit 14 bit and PIC18 MCUs discount code CCICD Offers good until July 31 07 Shipping not included Not valid with any other offar www ccsinfo com EX uw TP 262 522 8500 x35 w fo eee 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 PHS 360 697 3472 voice pioneer telebyte com 88 Issue 204 July 2007 The 69 PLC Work as Stand Alone Ladder Logic PLC Or as Smart Remote l Os of PC PLCs RS465 allows 256 units to be networked Incredibly Easy to Program Y Our software is used by many rr colleges for teaching PLCs I i gt Get Free Ladder Logic Simulator i plc com cci htm 75mm x 50mm 399 95 XEM3010 1500P 1 500 000 gate FPGA Programmable PLL Over 110 I Os 32 MB SDRAM Configuration PROM 0 8 mm expansion 399 95 Oty 1 349 95 Oty 10 199 95 400 000 gate FPGA Programmable PLL Over 80 I Os 0 1 expansion headers Business card size 199 95
190. r the sim plest applications hacking a one shot hardwired solution or even just stick ing with the old wiring harness approach remain viable options Somewhere in the middle is the sweet spot for Pyxos FT Ask yourself these questions Are there enough nodes and protocol complexity that a dedicated resource i e the Pilot is called for Are there enough wiring concerns e g range noise and immunity that a transceiver chip of some sort is required in any case Is the link power capability a must have that justifies the possible extra cost of dealing with a 24 V supply and the need to derive power locally at each node Is your application a one shot project or will it grow and evolve to encompass a range of devices which could benefit by using a single stan dard network Does rolling your own networking solution represent a devel opment chore that you d just as well leave to Echelon There are many world beyond wiring harness applications for which at least one of the answers is yes If yours is one of them Pyxos FT is defi nitely an option worth considering al 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 SOURCE 11500R Pyxos FT network chip and Pyxos FT evaluation kit Echelon Corp www echelon com Issue 204 July 2007 75 by Jeff Bachiochi IE Are You Up for 16 Bits
191. rd when you are ready to do it using the getchar function LCD amp SRAM The LCD is more or less accessed Main menu Check mailbox Retrieve mail Read mail Username Password Compose mail Edit text Delete text Enter recipient Enter reply address Enter subject Send Configuration Do DNS request DNS mail server firmware version My IP Router MAC address SMTP server POPS server SNTP server Figure 3 Study this diagram of the menu structure Compose Mail Check Mailbox Configuration and Show are submenus that are accessible from the Main menu The Standby item in the Main menu switches the MiniEmail system to Standby mode CIRCUIT CELLAR like RAM Everything that is written to the RAM is immediately visible on the LCD At the moment the system uses a standard 64 x 128 dot matrix graphic LCD Because the LCD doesn t have a built in character set you have to provide your own which is con tained in chars h The sram c file contains the func tions for writing to and reading from the 128 KB of external SRAM In the external SRAM you store e g the text of incoming and outgoing mails the IDs of the mails and the data extracted from the mail headers The routines in lcd c and sram c are really straightforward so I won t discuss them in detail IMPORTANT STUFF The functions that provide Internet functionality are in two files enc28j60 c and internet c The first file contains the l
192. restart the system using the internal oscillator in case of an external clock failure Power consumption can be optimized by shut ting down peripherals or running at a reduced speed during idle periods Inter nal reset and brown out circuitry adds reliability without external components Many I O pins have a high current drive capability drives LEDs directly In addi tion to individual interrupt vectors for each peripheral 16 bit microcontrollers also have individual error trap vectors for oscillator failure illegal access stack over and underflow and math errors Where would a good microcontroller be without good tools MPLAB is the free integrated development envi ronment IDE that has been helping users edit build and debug programs for many years and continues to improve This contains an assem bler linker librarian a visual device Issue 204 July 2007 77 initializer and a simulator It supports Microchip s hardware development tools in circuit debugger ICD2 in circuit emulator REAL ICE and production programmer PM3 MPLAB also makes it easy to hook in your favorite third party software And remember MPLAB is the only tool you ll need for Microchip s complete line of microcontrollers PERIPHERAL PIN SELECT One of the problems with low pin count microcontrollers is that they are limited by their available I O pins As a result the family has more peripherals than the part has pins to support
193. rt R2 PO RO P1 RO R1 BYTEOP16M R3 2 R1 0 quad byte diff PO RO ABS RO V R1 ABS R1 V R2 BYTEPACK R1 RO I3 M3 B loop end PO R2 store diff pixel UNLINK RTS _CalcDiffASMB end I1 MI I3 M3 CIRCUIT CELLAR www circuitcellar com__ Original unoptimized code _CalcDiffASMB of black hockey tape on top of each cushion OBJECT DETECTION We mostly used back ground suppression to detect objects As we men tioned earlier a reference it feat is rs HL fT tat p fst fs fe ie oe sles LEE DE ES tt tT yet 0 103 yt li ASe 8 st TT TT el sto EE EE shows our hand coded assem bly code for the image differ encing routine Once the difference image has been acquired it is passed through a threshold detector for object detection The level of the threshold detector is ET tt LLLI lafe tured The absolute differ l Guo Wetec Cac Wack Figure 4 The numbers indicate the pixels and the order they are probed in the step search algorithm with a Step ize of four and eight a and b ground pixel and the current respectively Orange boxes indicate the presence of a ball White boxes are the altered We were planning to video frame pixel was calcu table s playing surface implement a dynamically lated By using special video pixel and vector instructions hardware circular buffers and zero overhead loop registers avail
194. s The LEM Minisens costs 1 96 each for 1 000 pieces LEM www lem com IB els SENSORS Introduces iLoad Capacitive Load Sensors with True USB connectivity Jj Plug and Sense Simplicity Digital Perfection Integrated signal conditioning e Digital USB log utpul e Accuracies 0 25 to 0 025 of FS em ature ated x Easy mounting features built in www loadstarsensors com 650 938 4282 info loadstarsensors com CIRCUIT CELLAR Issue 204 July 2007 13 FEATURE ARTICLE by Alexander Mann MiniEmail A Compact MCU Based Mail Client Alexander s mail client system uses an Atmel ATmega32 microcontroller and a Microchip Technology ENC28J60 Ethernet controller to continually check for e mail When mail arrives you can immediately read it on the system s LCD and respond with a standard keyboard E is rightly regarded as one of the killer applications of our age There s no doubt that having the abili ty to send messages to anyone in the world has made a positive impact on our daily lives With that said it s clear that even the fastest e mail serv ice is futile if you check your mailbox only once or twice per day If you want to read your mail as soon as it arrives the only feasible solution has been to keep your PC running all day so you can check for new mail on a regular basis This is not the smartest solution Not only can it get expen sive it can be annoying to listen to your PC s fans run all
195. s Intel Alan Jay Smith UC Berkeley Focalpoint Il A Low Latency High Bandwidth Switch Router Chip Fulcrum Micro Marc Tremblay Sun Micro Mobile PC Processors and Chipsets Jan Willem van de Waerdt e Power Management Features in Penryn 45nm Core2 Duo Intel NXP Semiconductors e Next Generation Mobile X86 Processor AMD Doug Burger UT Austin e nForce 680i and 680 Platform Processors NVIDIA Norm Jouppi HP Labs Big Iron Dileep Bhandarkar Microsoft e VictoriaFalls Scaling Highly Threaded Processor Cores Sun Micro Founder e The Next Generation Mainframe Microprocessor IBM Bob Stewart SRE computer EEE This is a preliminary program changes may occur For the most up to the minute details on presentations and schedules and for registration information please visit our web site where you can also check out HOT society Interconnects another HOT Symposium being held following HOT CHIPS Web http www hotchips org Email info2007 hotchips org 1997 2007 IEEE 10th Anniversary A Symposium of the Technical Committee on Microprocessors and Microcomputers of the IEEE Computer Society and the Solid State Circuits Society ply driving the Pyxos FT chip directly And of course there s no MCU over head because there s no MCU in nonhosted Points BUILD IT AND THEY WILL COME The final piece of the puzzle is the Pyxos FT Interface Developer pro gram It s largely a point and click affair by which you
196. s in handy when con verting nonlinear inputs to linear out puts to read with a multimeter o scope or analog to digital to analog functions An intersample A D conversion delay can be configured to take as long as 1 6 s to accumulate and then average 64 sam ples providing the means for a crude but www circuitcellar com effective symmetric finite impulse response filter This can help sift DC levels from low frequency amplitude modulated inputs like sloshing fuel level from the fuel level sensor The seven segment display buffer can also be configured to accumulate 2 4 8 32 or 64 interpolated averages for further filtering and to reduce digit skipping between large slope table entries With 64 averages the update cycle slows to about 460 ms Sensor inputs in digital form are processed by the Pulse Width Duty Cycle Phase or Frequency modes The pulse width function measures pulses from 0 1 to 99 9 ms duty cycles from 1 to 2 5 kHz phases from to more than 10 kHz and frequencies from less than 1 to more than 10 kHz Pulse width and duty cycles are han dled by a single 16 bit capture compare routine with a cascading byte bumped by timer overflow for a total of 24 timer Figure 3 The interface board assembly adds buffering locking connectors and increased protection to inputs and outputs www circuitcellar com bits Phase measurement uses an addi tional capture compare register to hold the extra events
197. s low power wireless simple serial interface range up to 1 mile 33 6K baud 56K baud AT commands caller ID cellular using Modems GSM and CDMA technologies Non volatile Memory up to 2MB 10 year lithium battery Serial Ports up to 4 serial ports with optional RS 485 opto isolated available 8 channel 12 bit A D converter optional 2 channel 12 bit DAC 12 bit A D DAC A D jumpered for 0 2 5V 0 10V or 0 20mA Philips SJA1000 opto isolated up to 1 megabit sec CAN Bus Controller selectable termination resistor Ocera Linux driver JE 32 inputs 32 outputs 200 mA drive optional 512 Kbyte or 1 MB 64 Digital O battery backed SRAM stack up to four boards RoHS compliant see our website for more boards and option details SYSTEMS We use our stuff 9 5 EL Technologic Visit our TS 7200 powered website at www embeddedARM com using Ctrl characters for commands prevents bus conflicts because the data output from a gauge in this mode will not contain the 01 to OF charac ters Gauge to master data is sent as four ASCII data characters and a comma An alternative method for entering Programming mode is hold ing both the MIN and MAX push but tons before powerup Figure 5 shows the available options with the serial port enabled Programming mode is indicated with a welcome message sent to the serial port upon entry and prg is dis played on a seven segment display Commands in Programming mode consist of single ASCII
198. s works out to a 2096 increase in speed _CalcDiffASMOptB LINK Q SP CR7 4 I0 RO CF address Il R1 BG address I2 RO I3 Rl MO 8 modify by 2 words MI 8 M2 8 M3 8 I2 4 offset CF by 1 word I3 4 offset BG by 1 word Prefetch first 2 words R2 I0 RO I1 M1 RA R5 BYTEOPI16M R3 2 R1 0 RA ABS R4 V R2 I2 RO R5 ABS R5 V RA BYTEPACK R5 R4 R6 R7 BYTEOP16M R3 2 R1 0 R6 ABS R6 V IO M0 R4 R ABS R V R2 IO RO RA R5 BYTEOP16M R3 2 R1 0 PO 5760 4 2 LSEIUPC B Toop Stdartl Bu p loop starti R6 BYTEPACK R7 R6 R4 ABS R4 V I2 M2 R6 R5 ABS RS V R2 I2 RO RO R72 BYTEOPBIGMCR3 2 RI 0 RA BYTEPACK R5 R4 R6 ABS R6 V LIO M0 R4 R ABS R V I R2 IO RO B loop endl RA R5 BYTEOPI6M R3 2 R1 0 Ro BYTEPACK R7 RO R4 ABS R4 V I2 M2 R6 R5 ABS RS V R2 I2 RO RO RJ BYTEORLIOGMCRS 2 RIU RA BYTEPACK R5 R4 R6 ABS R6 V R ABS R7 V LIO MO R4 R6 BYTEPACK R7 RO I2 M2 R6 R7 4 SP UNLINK RTS _CalcDiffASMOptB end 38 Issue 204 July 2007 loop end1 LCI LINK 0 I3 M3 PO RO CF address Pl R1 BG address P2 5760 LSETUP B loop start B loop end LCl P2 LIL MI B loop sta
199. s would be required I could not find a manufacturer that produced gauges for all of the functions I wanted to display creating a stew of mismatched face plates So out of seeds of dis content the multifunction gauge described in this arti cle emerged I thought about converting an existing air core move ment gauge but I wanted something that could also provide a digital readout After toying with how many T1 LEDs would fit inside a 2 0625 gauge housing I had my answer With three digi tal displays surrounded by 32 segments analog and digital representations were covered Since I had worked with 44 Issue 204 July 2007 other digital automotive gauges I felt obligated to address some of their undesirable properties such as washout in direct sun and fixed and often inappropriate update rates With a clean slate I built a wish list of desired features Ideally the 32 LED segments would have an analog feel to simulate an analog needle With bar graph scaling and format program mable options for update rates and my choice of bar graph display modes for mats such as bar growing between set points bar shrinking between setpoints bar shrinking to setpoints then growing after setpoints and simple dot or bar Photo 1 Here is a sampling of sensors including a mass airflow housing and a sense element an MAF element a fuel level float sensor air charge temperature and a Senstronics 0 to 100 PSI pressure
200. ser look at the firmware The backbone of the firmware is contained in the memain c and global h files including the Main menu parts of the user interface and the inter rupt handlers 20 Issue 204 July 2007 Before you start with the more involved routines handling the Inter net connections you must understand the code that controls the keyboard the LCD and the SRAM KEYBOARD INTERFACING Atmel s application note entitled AVR313 Interfacing the PC AT Key board describes how to connect a standard PC AT keyboard to an ATmega32 using only two I O pins one external interrupt pin INTI and one general I O pin The keyboard interfacing in the MiniEmail system is based on the code example given in the application note which allows the interrupt based reception of bytes sent by the keyboard controller I extended the code with a third look up table for recognizing extended scan codes of keys such as home and the arrow keys a parity check and the pos sibility of sending bytes in the opposite direction i e sending commands to the keyboard This is needed to control the keyboard s status LED which is not done by the keyboard controller itself You can also use it to change keyboard parameters like the typematic rate but at the moment I do not use this The decoded keystrokes are stored in a small buffer You don t have to react to keystrokes immediately but you can fetch the input from the key boa
201. sfer video frames from PPIO which is hooked up to the video decoder data lines to a buffer in SDRAM Another DMA channel transfers frames from SDRAM to PPII which is hooked up to the video encoder for video output to the TV VIDEO FRAME PROCESS The memory structure in the Blackfin is arranged into three sec tions L1 L2 and L3 L3 exter nal memory runs at speeds up to 120 MHz L2 internal memory that is shared between the two cores runs at 300 MHz Each core has its own 600 MHz L1 memory The limited size of L1 and L2 is insufficient to contain the entire exceeding the size of the available internal memory Processing directly on L3 is out of the question because memory access delays have a detrimen tal effect on system performance To solve the problem we divided Field O of the L3 frame into 15 sections each containing 720 pixels by 16 lines This means that the H blank and the V blank are ignored because they do not contain useful data A total of four 22 5 KB buffers were set up in L2 mem ory two for current frame data and two for the background frame We will describe the usefulness of the background image later in this article To coordinate the transfer of data from L3 to L2 memory we used the memory DMA MDMA controllers The dual four channel MDMA con trollers are independent from the two 16 channel DMA controllers available for peripheral devices The four buffers in L2 are logically group
202. sh between differ ent hardware or compilers You can write one piece of code and run it on a PC with Turbo C 3 0 Visual C or in your embedded system You can then use the 1 f def statements to change where I O is located for example STRINGS IN C I need to interrupt this presentation to talk a bit about strings in C An INT8 is a signed 8 bit entity but it s really built on the char data type It s very common to save ASCII characters in 8 bit memory locations The C lan guage also supports strings C strings are character sequences that are stored as one dimensional character arrays They are terminated with a null character 0 which is called NULL in ASCII The name refers to the C programming language using this string representation Refer to Listing 1 and remember what I said about arrays If you look up strcpy you will see the following description char strcpy char ast const char src I like to think of the keyword const as a promise you are making with the compiler In this case you are agreeing with the compiler that you will not be changing the character string src while the strcpy operation is running And in the example above the string This is a message is con stant for the copy operation Const has more value than this simple expla nation and that s another discussion The NNDK user manual contains documentation on the libraries includ ed The tools use the Cygnus C Sup
203. similar to the RLO530 17 56K 96 MS available from Digi Key This information helps if a Ford EEC com patible ECT or ACT sensor is needed with a nonstandard thread The ECT sensor can also be used as an engine oil transmission or rear axle tempera ture sensor The horsepower measurement uses the MAF sensor The transfer function in volts per approximate HP for stock and aftermarket MAF sensors are available from various Ford engine tuning web sites A simple cut and paste put the data into the gauge inter polation table I made assumptions about the engine s air and fuel effi ciency which vary throughout its operating range so this provided a general starting point www circuitcellar com from distribu tor mounted Hall effect sensor and shutter wheel and SPOUT spark output command from ECM The rising edge of the PIP typically indicates 10 BTDC The ris ing edge of the SPOUT indicates the actual firing of the ignition coil With four PIP and SPOUT events per each four stroke eight cylinder engine rev olution timing was computed 360 7 T degrees x c 7 T 4 events rev T OHNE 3 where T is the PIP reference rising edge T is the SPOUT rising edge T is the PIP next event rising edge The offset variable is the ignition system s offset calibration degrees BTDC typi cally 10 Changing the number of cylinders and offsets is a simple entry in the Excel sheet So
204. st Motion Tracking and Analysis System This group of designers combined their passion for billiards and embedded systems to design a pool tutorial system The system tracks the motion of the balls on a pool table and provides visual shot suggestions and predictions I you have a group of guys who are really keen on billiards and have a full load of engineering courses in the final year of their engineering program you have a big time conflict To resolve it you have three choices spend all your time studying and never have a life spend all your time shooting pool and never get to have a career or do what we did and persuade a professor that a suitable design project should com bine your passion for billiards and interest in embedded systems We developed a pool tutorial system for beginners The embedded system tracks the motion of billiard balls on a pool table and provides visual shot sug gestions to the user Additional infor mation such as ball trajectory and path history are also provided In this article we will explain how we designed and built the system In addition we ll describe the basic things you need to understand before moving on to the required video pro cessing We will detail the image pro cessing algorithms we developed to run the system with the lim ited memory on an Analog Devices Blackfin ADSP BF561 processor the issues we had developing the sys tem and possible upgrades The principl
205. symposium is the primary forum for engineers and researchers to highlight their leading edge designs Three full days of tutorials and technical sessions will keep you on top of the industry Organizing Committee o Morning Tutorial Approaches to System Design for the Working Engineer rdi g Ralph Wittig Xilinx David Witt Texas Instruments John Sell MiTo c oR Yo Peter Alfke Xilinx Shephard Siegel Mercury Computer Systems Vice Chair 5 9 Afternoon Tutorial Enterprise Power and Cooling A Chip to Data Center Perspective Don Draper Rambus U Norm Jouppi HP Labs Chandrakant Patel HP Labs Finance Parthasarathy Ranganathan HP Labs Lily Jow HP Publicity IBM Power6 IBM Kevin Krewell NVIDIA e Fault Tolerant Design of the IBM POWER6 Microprocessor Gail Sachs Uum e System Performance Scaling of IBM POWER6 Based Servers e ae e The 3rd Generation of IBM s Elastic Interface El 3 Implementation on POWER6 Auer Spansion Keynote I Vernor Vinge Computer scientist science fiction writer Sponsorship author of True Names and Rainbows End Amr Zaky Broadcom Publications Multi Core and Parallelism A Eau STATT ITE e NVIDIA GPU Parallel Computing Architecture NVIDIA Ravi Rajamani Oracle 2 Performance of Non Graphics Applications on the GeForce 88007 UIUC Sujata Ramasubramanian Intel Multi Core and Parallelism B mdr Loi e Radeon R600 a 2nd Generation Unified Shader Architecture AMD shell raS ARRS e Teraf
206. t fever On page 55 we provide photos and descriptions of the projects that placed in the Luminary Micro DesignStellaris2006 contest Check out the descriptions of the winning projects and then go to www circuitcellar com designstellaris2006 winners winners html to view the contest files and more And if you re gearing up to enter a proj ect in the Microchip 16 Bit Embedded Control Design Contest be sure to read through Jeff Bachiochi s contest primer on page 76 Jeff covers everything you need to know about Microchip s 16 bit microcontroller and DSC families It s time to put your design skills to the test Good luck As usual keep me posted on your progress C Mil cj circuitcellar com Issue 204 July 2007 CIRCUIT CELLAR CIRCUIT CELLAR THE MAGAZINE FOR COMPUTER APPLICATIONS CHIEF FINANCIAL OFFICER Jeannette Ciarcia MEDIA CONSULTANT Dan Rodrigues CUSTOMER SERVICE Debbie Lavoie CONTROLLER Jeff Yanco ART DIRECTOR KC Prescott GRAPHIC DESIGNER Mary Turek Sobuta STAFF ENGINEER John Gorsky FOUNDER EDITORIAL DIRECTOR Steve Ciarcia MANAGING EDITOR C J Abate WEST COAST EDITOR Tom Cantrell CONTRIBUTING EDITORS Jeff Bachiochi Robert Lacoste George Martin Ed Nisley NEW PRODUCTS EDITOR John Gorsky PROJECT EDITORS Steve Bedford Ken Davidson David Tweed ASSOCIATE EDITOR Jesse Smolin ADVERTISING 860 875 2199 Fax 860 871 0411 www circuitcellar com advertise PUBLISHER Sean Donn
207. t to connect a flash drive to their electronic cre ations The issue of course is that a flash drive is a USB device and to con trol it you need a USB host controller The USB specification deliberately put most of the communications complexity within the host controller since there is never more than one in a system The structure also enables USB devices to be simpler and therefore less expensive A flash drive is a mass storage class MSC device Although you can download the specifications for free at www usb org they are not easy to understand MSC specifications define only basic track sector and read write operations You also need to under stand the specifications for the FAT file system used on all commercial flash drives to be able to read and write data The amount of informa tion you need to understand to be able to just connect a flash drive is over whelming You need a component that implements all of these specifications for you After all they are industry agreed specifications that you have no www circuitcellar com interpreter and data processor Command a Flash drive Figure 1 This block diagram of the Vinculum chip shows the command line interpreter that provides a DOS like front end to a USB host controller The Vincu lum supports two USB ports that can be programmed as host or device ports freedom to change anyway you just want to use them INTRODUCING THE VINCULUM Future
208. t to see the power of using structures to encapsulate your information You could change INT16 DebugProcessCmd void to ProcessCmd struct COM DETAILS cp and not set cp amp Debug inside the routine You would then be able to pass different structures to the same code and handle many serial ports without writing unique software for each FINAL STEPS After DebugProcessCmd has received a complete command line it calls ExtractParameters That routine looks at the command line it just received If a valid start character is in the command line the routine www circuitcellar com separates all the parameters It copies each parameter into the INT8 Par BufLDBG COM PAR MAX LDBG COM CH AR MAX array The first subscript indexes each parameter while the sec ond subscript indexes each character in that parameter After extracting parameters DebugProcessCmd checks the unit ID portion of the command line that s been separated into the ParBuf array If the unit ID matches the unit s ID the command is for you I put in this test in case you are going to have several units connected of a party line like the RS 485 interface If the command is for this unit the com mand value is used to index a table of command numbers and a routine to call for each value I just step through each entry until I find a match Look at CciBiSerial cpp line 178 That s where I define the structure of the commands and matching routines
209. tal of all Points activity ebbs and flows CIRCUIT CELLAR Issue 204 July 2007 69 Pyxos FT networks are designed to be polarity insensitive both link power and data is a very nice touch Thanks to that feature and the Free Topology aspect wiring mistakes are a real world dollars and cents problem that Pyxos FT virtually eliminates VARIABLE INTEREST Another thing I like is the way Pyxos FT networks like their LonWorks brethren utilize a simple publish and subscribe model based on Standard Network Variable Types aka SNVTs With this data driven approach the only thing a Pyxos FT Point knows about or needs to know about is the collection of network variables eg temperature humidity and light level that are rel evant to its specific purpose A partic ular Point is defined by those network variables it has interest in i e inputs and or those it has the duty to provide i e outputs The Point will receive a message from the Pilot that includes input variable updates The Point will send a message to the Pilot when an output variable needs updating Simple just the way I like it Here s where the Point Pilot asym metry really pays off For Points life is easy since they need to do little more than wait for input updates to Function Description Frame timet Timeslots Pilot average SPI bandwidth Point average SPI bandwidth 1 8 ms 175 kbps 70 kbps 3 4 ms 19
210. that I ve been covering lately e g Wireless USB WiMedia ZigBee etc you d think wires were an endan gered species Au contraire There are still a lot of places where wires make sense from a reliability and security perspective not to mention the small matter of distributing power If wires are still a good thing that s not to ignore the fact that too much of a good thing can be a bad thing Recently my clothes dryer went on the fritz After popping the hood I dis covered a rat s nest of wires running hither and yon between the control panel motor and various sensors Just a reminder that old school wiring lash ups persist in many blue collar embedded apps Is there a way to enjoy the beauty of wires with less of the beastly aspects Echelon has got a new gadget the Pyxos FT chip that does just that see Figure 1 LAN IN THE BOX Echelon is best known for their LonWorks distributed processing and control scheme which has found success over the years in large scale build ing automation e g lighting security and HVAC and metering applications However while LonWorks may work for a skyscraper it is overkill for smaller scale in MISO DIO1 MOSI DIOO INT DIOS to handle last meter tasks at the end of the wire To that end low cost low power and real time capabilities are key requirements Here are the basics A Pyxos FT net work supports up to 32 nodes over tens to hundreds of meters
211. the StepS ize equals one arai TAM CIRCUIT CELLAR At that point we will have found the left most edge of the ball on the row Then a linear search is performed to find the right most edge of the ball in the row see Figure 4 We now compare this newly found left right column location pair against each element in our array of previously found object locations If this pair is in close proximity to an existing object location then the data is appended Since the balls cover only a small per centage of the table s playing surface and we are directly probing only one quarter of the pixels this method improves the speed of object detection A box is drawn around every ball that is detected The color of the each box corresponds to the ball s color The cue ball is distinguished by comparing each ball s color to white or the white repre sentation of the specific camera being used and the lighting environment Because of the detection algorithms and the nature of performing object detection as opposed to object recogni tion problems occur when objects other than pool balls enter the frame To alle viate this a size limit was placed on each target detected This helps reject the detection of larger objects that may be on the table such as a player s hand Imposing a 4 3 aspect ratio on object sizes also reduces sporadic detections However more work needs to be done on this to make the system more robust GH
212. threshold but we were limit ed by the project s time constraints At this point the binary image was scanned starting at the top left pixel and working row by row Active pixels that are close to each other both in the horizontal and vertical axes were marked as belonging to one object OBJECT COORDINATE EXTRACTION Object coordinate extraction is per 40 Issue 204 July 2007 formed using a step search algorithm In this algorithm only a fraction of the difference image pixels are probed to detect objects Each pool ball was about 16 pixels wide but this will vary depending on how far or close the camera is to the pool table Scanning starts at the top left corner of the difference image we will call the pixel x y If the pixel is above a certain threshold then it is considered part of an object If it is below the threshold then the pixel at location x StepSize y is tested Since each pool ball was about 16 pixels wide we set the variable StepSize to four Setting the StepS ize to this value would make sure that pool balls would not be skipped when scanning If the probe pixel x y is above the threshold then we will try to find the left most col umn that is part of the ball by probing x StepSize 2 y We will probe left by another factor of StepSize 2 if this pixel is above the threshold Other wise we will probe right by a factor of StepSize 2 Left right probing will be repeated until
213. tical blanking lines However in general the com bined active data resolution is 720 x 480 pixels Adapted from the ADSP BF561 hardware reference manual sists of shot suggestions and ball path tracking VIDEO BASICS The Blackfin evaluation kit has an Analog Devices ADV7183 video decoder and an Analog Devices ADV7179 video encoder which are compatible with different video stan dards We will focus on explaining the configurations we used The National Television Standards Committee NTSC provides video standards for North America includ ing the ITU R 656 data protocol which specifies how video data should be formatted and the timing character istics of the signals ITU R 656 uses an interlaced method of transferring data in which a single frame of active video what you see on your TV set is divided into two fields Field O and Field 1 Field O contains the odd num bered lines Field 1 contains the even lines An NTSC video frame consists of 525 lines with each line consisting of 858 2 byte pixels Blanking sections known as vertical blanking and hori zontal blanking data are embedded between each field and at the begin ning of each line see Figure 2 When a TV displays the data the odd lines are scanned first followed by the even lines The interlaced method reduces flickering which was common in older TV sets The blanking sections act as time delays to ensure that the electron gun inside the TV has enough
214. ticle I ll introduce you to Microchip s 16 bit family of parts I am always a bit apprehensive about leaving my comfort zone and trying a new part If you haven t used a 16 bit part I hope this article piques your interest As you ll see you can start working with a 16 bit part with a min imal amount of effort I encourage you 76 Issue 204 July 2007 to take this opportunity to take the leap and enter the contest After all it s really just a small step MICROCHIP S 16 BIT FAMILY If you have experience working with Microchip s 8 bit microcontrollers you won t be surprised that Microchip s policy has been smooth migration from the lowest six pin 8 bit MPU to the highest 100 pin 16 bit DSC The code compatibility packaging and tools remain remarkably consistent when migrating between families One of the best ways to present the advantages of the 16 bit family is to compare it to its 8 bit counterpart Table 1 shows the total 8 bit family which is extremely flavorful com pared to the two groups in the 16 bit embedded controller family You may be surprised by the cost comparison in the last row of the table There is no large premium for moving up to the higher performance family EENY MEENY MINY MOE When it comes to picking a micro controller there are a few factors that can quickly narrow the search The PCB technology you are designing for will be through hole SMT or a com bination of the two
215. tion for rounded tracks Smash for groups F Measure distances between arbitrary ponts Choose alternative raster rn the fly with Alt key You can use EAGLE Light for testing and fo EHE ESI im Birk Tti ir ri EAGLE 4 1 Schematic Capture Board Layout Aulorouier Windows Linux Rudd WSETTEEE es a Ej Ly W C m Uum ECCE n 1 UR d Lo zx nean VenimMercial appli AROS Wi charge he rregwigarg Version wrth na mix Sheet All other features cao i ta Maset Gi thes Professional Version nr onder our frae CD vou decide hr also get the reference ima Standard varsion Eurocard format with up to 4 signal layers max Sheets aD boas The Professional Versio 50 Issue 204 July 2007 restricted fo boards up to half Eurocard format mum of two signal layers and one schematic anil m from our interned Sie favor of the Commercial Light Versior you manual and a icense for commercial E 5sultabies for oars in G9 schematic Ms ne such limitations CIRCUIT CELLAR This is accomplished by sending the I node command in Operating mode with the serial port enabled In normal operation sensor input data is handled by six functional modes four digital and two analog Only one mode is run at a time The two analog modes consist of either reading the microcontroller s internal temperature sensor or an e
216. to 10 dBm RF power measurement Thomas Alldread Canada nimblesig telus net Squawk Box The well designed Squawk Box is a VoIP user device that interfaces to Asterisk a widely accept ed open source soft telephone switch The LM3S811 based system enables you to partici pate in worldwide conference networks as well as local ones The Squawk Box can be used as a public address system a two way intercom or a courtesy phone at a local airport Jake Gunderson U S jgunde tampabay rr com To see these projects and more visit www circuitcellar com d signstellaris2006 Not Just Another SMD Reflow Oven This new approach to reflow soldering incor porates a bread toaster with a controller built around an LM3S102 The system features a Nokia 3310 graphical display and buttons for starting the cycle Alexandre Guimaraes Brazil alexandre microcode com br Audio Noise Figure Meter The handy Audio Noise Figure Meter is used to measure the relative noise figure of audio amplifiers The system is built around an LM3S811 which acts as both the audio noise generator and the synchronous power detector James Koehler Canada jark shaw ca Uninterruptible Solar Power Supply The LM3S811 based Uninterruptible Solar Power Supply takes small standby loads off the grid and powers them from solar panels The supply switches seamlessly back to the grid if the solar power is unavailable at night or during periods of incl
217. to a location during the same bus cycle when the CPU is reading it or vice versa the location is read prior to the write during the cycle in question JUMP START PCBs You can find a hardware develop Function Addition Subtraction Multiplication Division Remainder acos asin atan atan2 COS sin tan cosh sinh tanh Logarithmic and exp exponential frexp Idexp log log10 pow sqrt Rounding functions ceil floor fabs modf fmod Function Group Basic floating point Trigonometric and hyperbolic Power functions Absolute value functions Modular arithmetic functions Table 3 The functions in the math library are IEEE 754 compliant operated in the Round to Nearest mode with signed zero signed infinity not a number NaN and denormal support www circuitcellar com ment board for practically every part that Microchip manufactures Although they are not free they are inexpensive and most come with a plethora of information and demo code to get you rolling your own quickly I have a few favorites that you will find helpful for this contest see Photo 1 As a participant your contest kit includes a batch of parts both 16 bit microcontrollers and a slew of periph eral components The included CD was specially prepared for the contest and includes MPLAB and a special issue of the C30 compiler
218. to make your device work The rub is which 1 The trick to implementing a HID is not understanding every thing in the HID specification but understanding exactly which subset of the specification you need and which is actually sup ported by Windows You will not find the latter in the HID specifica tion itself You need to check Microsoft s documentation A HID compliant peripheral com municates with Windows by sending reports The main HID design task is to invent a report format that conveys the intent of your control to the oper ating system The HID report descrip tor was built using the HID tool pro gram available at www usb org Do not even think about trying to figure out the actual hex values The tools do it for you The system s firmware returns this table to the host when the host issues a Get Descriptor Report request I use a simplified keyboard report descriptor which does not support the boot protocol In addition it does not allow setting status LEDs and only one simultaneous key press except modifiers is allowed Therefore I can use short 2 byte input reports The report descriptor was created with usb org s HID Descriptor Tool It can be downloaded from www usb org developers hidpage Redundant entries i e LOGICAL MIN IMUM and USAGE PAGE have been omitted for the second INPUT item FIRMWARE DESIGN For development tools I developed all the firmware with the help of Atmel AVR Studio 4
219. tools com al Tern oe aii migra i d registeren t Serr ir ni microcnip leacnnolooy Ine O years ago Parallax created the Stamps in Class program to address the need for affordable electronics and programming educational resources We now offer 0 comprehensive tutorials designed to introduce students and educators to electronics programming robotics and sensor management with the easy to use BASIC Stamp microcontroller Our interchangeable hardware platform and our free software tutorials and sample code downloads make outfitting your classroom affordable Our BASIC Stamp Educators Courses and broad support base help you get started and keep your program growing To learn more about Stamps in Class visit www parallax com sic In the spirit of Stamps in Class we have created our Propeller Education Kit and Labs to provide an affordable platform for learning cutting edge multi processing microcontroller technology With 8 processors that run simultaneously to perform independent or cooperative tasks the Propeller chip is an ideal controller for integrated embedded system design projects As always our manual labs software and sample code are free downloads Propeller Education Kit 32305 79 95 Visit www parallax com propeller for details 2 To learn more about Parallax BASIC Stamp education N visit www parallax com sic Quantity discounts are m A available Parallax Sales Department 888 512 1024 y M F 5 SPDT VCR i A
220. tor if you need fast sampling or data throughput One advantage of having standard size packages available throughout a product line is the ability to substitute either higher or lower per formance parts I often start with the highest performance part for my proto type and adjust my choice downward to fit the final code size and speed neces sary to achieve my design requirements PIC24F The PIC24F is the least expensive part in the 16 bit family of microcontrollers It runs on a 2 to 3 6 V supply with 16 MIPS operation at 3 3 V Each peripheral has its own interrupt vector with multiple priority levels Sixteen working registers include designated registers for single cycle 16 bit signed or unsigned multi ply and 32 and 16 bit signed or unsigned division 18 cycles Single and multibit shifts are also performed in a single cycle A repeat instruction simpli fies multiple iterations of any instruction The enhanced peripherals in the 16 bit www circuitcellar com family include 32 bit timers high speed 10 bit A D conversion up to 500 ksps with a sample buffer JTAG multiple PC UART SPI with FIFO buffers and IrDA support on the UART and parallel master port support for external periph erals A real time clock calendar RTCC with an external 32 kHz crystal supports 99 years leap year aware and alarms based on a mask of any and all registers The CRC generator module uses soft ware configurable terms and lengths
221. tory the default directory Not a big deal and one that NetBurner is working to cor rect I expect to report to you again about this issue as you explore other vendors offerings A screenshot of that initial debug session is in Photo 1 A classic menu and toolbar buttons are across the two top rows of controls Below that the Debug perspective is highlighted Debug enables you to look at the project All the tasks that are running several are in the top left window In the debug window top left I expand ed the Main thread Note that several threads are running And then in the code window lower left I inserted a break point in my main routine When an application is stopped at a break point each task entry can be expanded to display the call stack and line num ber in the source code from which it was called The NetBurner develop ment board is running the uC OS II real time operating system RTOS You can find articles about that RTOS in past issues of Circuit Cellar where it has been described in detail It s a popu lar RTOS and a good one to start with The other area of Photo 1 contains information about variables registers breakpoints and more I will cover these in more detail as the design pro gresses I added lines 17 and 32 to insert a variable i and to increment that variable each time through my big do nothing loop Pressing the green CIRCUIT CELLAR is encountered and in this case the var
222. transceiver SCT offers the high est integration and lowest cost per port in the industry The high integra tion of the DS26519 along with its low 1 8 V 3 3 V power operation makes it ideal for CSUs DSUs muxes switches routers channel banks and test equipment The DS26519 saves space and cost by eliminating the need for the mechanical relays typically required by redundancy protection implemen tations The device uses hitless pro tection switching HPS to provide reliable redundancy protection by pre senting high impedance at transmit outputs and receive inputs when power is not applied Additional space and cost savings are pro vided by its software selectable internal receive and transmit side termination for 75 O El coaxial 100 Q T1 twisted pair 110 Q J1 twisted pair or 120 O El twisted pair applications The DS26519 provides com prehensive functions for moni toring performance and commu nicating diagnostic information The diagnostic suite includes but is not limited to a bit error rate tester loss of signal indication analog local remote and dual loop backs large error counters for BPV CV CRC 6 CRC 4 and E bit in band repeating pattern generation detection and JTAG Also included is an internal clock rate adapter and an HDLC con troller with a 64 byte buffer in both ETT 8 16 32 bits the transmit and receive paths Object Or Source Code i ES Small Footprint This
223. uly 2007 CIRCUIT CELLAR www circuitcellar com LA A s T IT Lg Jj ami meme rr m let i TU mlt T e 3 CEMEGER AERE ES ERE RE HS 9 in E ena ss all BE HO HOECUHICR ee ma wm rx e aD RS mda 15 db XB ab Ma 1 z anim m am ran m ai n Cie aa B Professional d l E TPRI Em x hae S ma m ET al Hardware Capture Mb lees a Software Analysis js Cee do 35 Automatic Real time Hardware Compression eliminates the neec to reduce resolution Our newest versior makes dead time insignificant Edge and Pattern Triggers on all models cuales ad lode also includes Range gt lt gt lt and Stable Matches with Beata onda flexible cascadable Seque DC rs with pe 485 counters Pattern S searches with Match amp Duration Specia lied Sequential Searches Nea Serial and State Mode Signals Display FC Synchronous SPI Asynchronous RS 232 State Boolean Bus and Analog Data Single or Dual Waveform Views Resolution Zoom in Wave Views Time based Link Groups for all views Specialized Exports from Dati Tables and List Views f que nal 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 from 179 0 Uitechiools www tech tools com 972 272 9392 sales tech
224. ur pose I Os and two 16 channel DMA controllers About 100 KB of full speed L1 SRAM 32 KB of instruc tion 64 KB of data and 4 KB of scratch is in each core Shared between the two cores is 128 KB of low latency L2 memory We developed the code with Analog Device s Visual DSP integrated software development and debugging environment IDDE using both high level C C and Blackfin assembly language The EZ KIT came with a USB debugger unit to interface the JTAG emulator port to the IDDE How ever we sped up our development by borrowing one of Dr Smith s research in circuit emulators HPPCI ICE Our system comprises a pool table a standard camcorder a TV and the DSP evaluation kit see Figure 1 The camcorder is mounted over the pool table The video stream is sent to the DSP which analyzes the video data stream and finds the locations of all the balls on the table A live loop back video out put stream is sent from the DSP to the TV which contains the camcorder feed and additional visu al feedback informa tion in the form of video graphic over lays This additional information con Issue 204 July 2007 35 238 Bytes 1 440 Bytes Vertical blanking Active video field O Vertical blanking D amp x E amp 2 T m o N pum o X Active video field 1 Figure 2 ITU R 656 formatting for an NTSC video frame Depending on the protocol version there may be more or less ver
225. ut Captures Real Time Clock Calendar 2 UART with IrDA and LIN Protocals 2 9PIL Z2 27M 10 bit ADC 16 Channels 2 Analog Comparators MICROCHIP www microchip com PIC24 VDC NC NC GND OUT 4 9152MHz 0 1u SMARTCARD PC6 PCINT14 RESET PDO PCINT16 AxD Sas L 3 PD1 PCINTI7 TXD PD2 PCINT18 INTO PD3 PCINT19 OC2B INT1 Pp Lo SS 11 8 d PD4 PCINT20 XCK TO vec 8 GNC eee PB6 PCINT6 XTAL1 OSC1 i 10 T E 10 bBz PCINT7 XTAL2 OSC2 12MHz PDS PCINT21 OCOB T1 PDS PCINT22 0COA AINO PD7 PCINT23 AIN1 ATmega168 ADC5 SCL PCINT ADC4 SDA PCINT12 PC4 ADCS PCINT11 PC3 ADC2 PCINT10 PC2 ADCA PCINT9 PC1 PBO PCINTO CLKO ICP1 pu USB 1 VCC O D O Da e l 4 GND 10u N LN 47k Taav Tav Figure 4 Here is a schematic of the main board based on the ATmega168 microcontroller All of the microcontroller s resources are used to minimize the number of ICs present in the design DATA and DATA handle the commu nication between the computer and the device Signals on the wires are bidirec tional Voltage levels are differential When DATA is at a high level DATA is at a low level But there are some cases in which DATA and DATA are at the same level like end of packet EOP Therefore in the firmware driven USB implementation it is necessary to be able to sense or drive both signals According to the USB standard the signal wires must be driven hi
226. vironment is used for code development editing and compiling Don t worry about the C moniker I ll only be using C As you go along you ll see how that s accomplished The NBEclipse is the IDE for debug ging Eclipse was created by IBM as the successor to its VisualAge family of tools It is now managed by the Eclipse Foundation an independent not for profit consortium of software industry vendors I started with a default type of proj ect that just waits for a timer to expire but I had trouble getting it to work I had to download an updated version of the tools which is available at NetBurner s web site under the sup port tab To be honest I was still hav ing problems getting the network debugging up and running A phone call to support sorted out my difficul www circuitcellar com is a buffer to hold 100 8 bit entities characters is the first arraymember is the last array member is a pointer to an INI8 datatype sets the pointer p pointing to the first member of buf sets the pointer p pointing to the first member of buf sets the first member of the buf array to the ASCII character A is an illegal statement ties If you have been following this series of articles you read about my wrestling with the default settings and file locations for the vendor s IDE This issue was in that category I wanted to place all my files in one directory and the tools were looking for them in a different direc
227. w inaxim ic com ST00635 Storm sensor Senstronics www senstronics com C8051F330 Microcontroller Silicon Laboratories Inc www silabs com PT5101 ISR Texas Instruments Inc www ti com www circuitcellar com The DesignStellaris2006 Contest challenged engineers to implement Luminary Micro s Stellaris family of ARM Cortex M3 controllers and Keil s RealView Microcontroller Development Kit in innovative new designs Thank you to everyone who participated in this amazing contest To see the complete projects and more visit www circuitcellar com designstellaris2006 Handheld Multifunction Scope The LM3S811 based Handheld Multifunction Scope is an impressive multifunctional oscilloscope that supports several modes Oscilloscope Voltmeter Ohmmeter Capacitance Meter Inductance Meter Frequency Counter Logic Probe and Pulse Generator You can power the well designed sys tem with three AAA batteries or via your PC s USB port When you run the scope along with your PC you can display the traces and read outs on your monitor Jingxi Zhang amp Yang Zhang U S jzhang jupiter com RF NimbleSig Generator The versatile NimbleSig is a compact DDS RF signal generator built around an LM3S811 micro controller The system provides a frequency agile RF output signal source with 1 Hz step res olution from below the VLF to the mid VHF spec trum segments 25 kHz to 160 MHz It is also capable of low level 50
228. wiper connected to vehicle ground Since I installed an aftermar ket fuel level gauge and wanted to leave it in place I had to determine how the sensor was excited After probing with a multimeter I found that the gauge connection to the level sensor contained an 8 V source in series with a 50 O resistor The data along with the 16 gallon fuel tank capacity provided a voltage to fuel level function Later I discovered the 40 plus year old level sensor had a couple dead spots which explained the erratic levels When I replace the sensor I will map the resistance and voltage versus capacity at gallon inter vals for better accuracy Water temperature horsepower and time sensing all require a connection to the engine coolant temperature ECT mass airflow MAF sensor www circuitcellar com Programming mode serial commands L Load parameters to flash return status message D Dump parameters to port terminates with CR lt LF gt lt lt CS X Exit this mode Esc Abort current operation S Start continuous serial output stream in dddd 4 ASCII digit BCD format Will show MSB not present on LEDs Exits programming mode Examples L18 00 dd dd dd checksum received Returns programming success or fail status message Entire block of flash erased Must begin load at 1800 which holds parameter data D 18 00 01 2A Dump 012Ah 298d memory locations starting at 1800h dd dd dd dd d
229. xternal ana log signal With the on chip ADC run ning at up to 200 ksps there is plenty of time for averaging Accumulations of 2 4 8 32 or 64 may be selected For additional flexibility with nonlin ear analog input signals a 16 entry by 16 bit interpolation routine is utilized with the formula AT A x TD 4 AT x TD Dour 5alm 2 aay AT AT where A is 16 bits of raw input AT is a 16 bit table input entry less than A AT is a table input entry greater than A TD is the table output data from AT TD is the table output from AT This assumes that the first raw input data entry is O and subsequent entries are positive increasing integers to satis fy the lookup table input breakpoint search The table entries should begin at O and end at the maximum possible input value to prevent undefined out puts at the extremes Table output data entries can either increase or decrease with table input so positive or nega tive slopes are permitted Of course nice simple linear functions are also accepted The result of the interpolation rou tine is used by the bar graph display look up routine D A output alarm limits serial output buffer and a digi tal display averaging accumulator An update cycle with 64 samples takes about 7 ms The D A output routine also uses a 16 entry by 16 bit interpo lation table routine to convert the buffer value to a desired output volt age This come

Download Pdf Manuals

image

Related Search

Related Contents

815 020 093 3 - WABCO Product Catalog: INFORM  Overhead Projector PH  

Copyright © All rights reserved.
Failed to retrieve file