eeweb pulse - issue 6, 2011

Upload: eeweb

Post on 07-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 EEWeb Pulse - Issue 6, 2011

    1/14

    PULSEEEWeb.com

    IssuAugust 9, 201

    Laura Bica NASA GroundStation Softwareand Hardware

    Electrical Engineering Community

    EEWeb

  • 8/6/2019 EEWeb Pulse - Issue 6, 2011

    2/14

    Contact Us For Advertising Opportunities

    1.800.574.2791advertising @eeweb.com

    www.eeweb.com/advertising

    Electrical Engineering CommunityEE Web

    Digi-Key is an authorized distributor for all supplier partners. New products added daily. 2011 Digi-Key Corporation, 701 Brooks Ave. South, Thief River Falls, MN 56701, USA

    www.digikey.com/techxchange

    Its all abou t

    connections.

    The user-to-user forum is for everyone, fromdesign engineers to hobbyists, to discusstechnology, products, designs and more.Join the discussions that match your interestor offer your expertise to others.

    Join the discussion now at:

    di scu ssio ns

    hobbyists

    engineers

    industry experts

    resourceslinks

    technical documentswhite papers

    reference designs

    application notes

    community

    power

    microcontroller

    lighting

    wireless

    sensor

    students

    http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7http://bit.ly/kDYHm7
  • 8/6/2019 EEWeb Pulse - Issue 6, 2011

    3/14EE Web | Electrical Engineering Community Visit www.eeweb.com 3

    TA B L E O F C O N T E N T S

    Laura Bica 4COMPUTER ENGINEERING GRADUATE STUDENT, SANTA CLARA UNIVERSITYInterview with Laura Bica, Intern in the Cisco Systems, Inc. Wireless Business Unit

    The Most Powerful Debugging Tool Ever - The LED BY PAUL CLARKE WITH EMB-PAPST

    When Software Stinks 10BY DAVE LACEY WITH XMOS

    RTZ - Return to Zero Comic 13

    The importance of the blinking LED is commonly underestimated. Think aheadand add LEDs to your next design for a great debugging tool.

    Fast real-time processing has its challenges. Lacey discusses a solution that combinesthe benefits of software with the real-time performance of hardware solutions.

    8

  • 8/6/2019 EEWeb Pulse - Issue 6, 2011

    4/14EE Web | Electrical Engineering Community Visit www.eeweb.com 4

    I N T E RV I E W

    Laura BicaNASA Ground StationSoftware and Hardware

    How did you get intoelectronics/engineering andwhen did you start?

    I grew up in a home that fosteredmy interest in technology. My dadis an engineer and from what I

    remember Ive always had someamount of fascination with what hedoes. When I was really young, my sister and I would play with the bigsatellite phones that he would bringhome from work for testing, so in a

    way I guess Ive been interested inand involved with engineering for along time.

    I also went to a high school calledHigh Tech High in San Diego,California which promoted my interest in technology even further.Through my school I was able toget a year-long internship withSPAWARs robotics departmentduring my junior year. During my internship I got to work with a robotthat utilized a Segway platform,and program it to do interestingthings (at least for a high schoolstudent) like following me aroundthe companys campus. Thatinternship also piqued my interestin soldering. When I started atSanta Clara and got involved withthe schools robotics lab, I knew that I had chosen the right majorand school to be able to pursue my interests in technology.

    What are your favoritehardware tools that you use?

    Definitely soldering irons. Thatis not to say that Im any good atsoldering or that I solder often,but for some reason I really enjoy it. When I worked at SPAWAR Ialways wanted to help the tech

    with her soldering jobs, and wouldproceed to get Use more flux!

    yelled at me for the next hour. Ieven told my parents I was goingto become a professional soldererand start a business dedicated to it.Luckily they convinced me to go tocollege first.

    What are your favoritesoftware tools that you use?

    That varies day to day. Thispast school year I learned how interesting and powerful MATLABcan be, and enjoyed learning how touse it in conjunction with my seniorproject. Until this past academic

    year, I was under the impressionthat MATLAB was an easy way out

    of programming for non-computerprogrammers, but Ive becomeespecially impressed with its ability to allow programmers to import

    Java libraries. Ive been able toenable some useful database andSSH functionality for my project by doing this. If Im in a more web-based mindset, a combinationof Photoshop and Dreamweavertends to be my software of choice.

    Laura Bica- Graduate Student in Computer Engineering at Santa Clara University

  • 8/6/2019 EEWeb Pulse - Issue 6, 2011

    5/14EE Web | Electrical Engineering Community Visit www.eeweb.com 5

    I N T E RV I E W

    What is the hardest/trickiestbug you have ever xed?

    The compiler that we had to buildin my compilers class last quarter

    was probably one of the toughestprojects that I have ever workedon, and with it came some of thetoughest bugs Ive ever had to fix.I dont know if I can come up withanything specific, but the majority of our class spent some long hoursin the computer lab last quartertrying to make our compilercompile. By the end, we sort of tookshiftsone person would finish hisor her project and then stay to helpuntil the next person finished, who

    would stay until the next personfinished, and so on.

    What is on your bookshelf?

    Quite literally the things that are onmy bookshelf at this very momentare my compilers book from lastquarter (which gives me chills

    just thinking about it), Essentialsof Software Engineering by Tsui

    Karam, OReilleys 802.11 Wireless Networksthe Definitive Guide, Programming the World WideWeb by Sebesta, Unmasking theGender Effect in the Engineering Workplace, The Art of Computer Systems Performance Analysisby Raj Jain, Content Networking by Hofmann and Beaumont,

    Beginners Guide to Text Editing (which I just noticed has a copyrightfrom before I was born), a Dilbertbook called Always Postpone

    Meetings with Time-Wasting Morons , some coloring books, Hitchhikers Guide to the Galaxy (which Im embarrassed to admit Istill havent read, but I do know thesignificance of 42!), and my cat hasconveniently placed himself on thebottom shelf, probably for the sakeof this interview.

    Do you have any tricks upyour sleeve?

    Well, right now most of my tricksare associated with helping me in

    my classes. As of last quarter I havedecided that imagining technicalproblems as non-technical pictures,shapes, or processes is a great

    way to understand concepts. Forexample, when converting regularexpressions to finite automata, Istarted thinking of everything interms of spaceships: A regex thatallows for 0 or more would looklike a spaceship with a top anda bottom, whereas a regex that

    allows for 1 or more of somethinglooks like a spaceship with only the top completed. To understandassembly code, I actually imagineeach of the instructions happening;a person actually has to physically move a value from one register toanother, for example, shift the bitsto the left. I think that imaginingeach instruction as a task beingperformed by an actual personmakes me more conscious of

    whether or not Ill be able to getthe desired outcome with my code.Im realizing how crazy all of thissounds as Im saying it, though.

    Another skill that Ive been using alot this year is pair programming,

    where one person programsand another looks over theprogrammers shoulder to quickly catch mistakes and typos. Im alsoa strong supporter of using caffeine(in the form of coffee) to promoteproductivity, if you want to considerthat a trick.

    What has been your favoriteproject?

    I got to participate in some really interesting activities during my time

    with the robotics lab on campus.

    The lab is responsible for operatingmultiple NASA spacecraft, whichopened up a lot of interestingopportunities for the student-runmission operations team. Some of the things that I got to participatein with regard to satellite missionoperations were actually operatingand communicating with thesatellite from the labs in-housebuilt ground station, helping withthe creation and maintenance of mission dashboards, as well asother mission-related tasks. Gettingto be involved with such a large-scale project like that was a really unique and exciting experience forme.

    Do you have any note-worthyengineering experiences?

    When I worked at SPAWAR, one of the first projects I worked on wasprogramming the Segway RMProbot to follow me. My mentorconvinced me that there was no

    way, given my program, that therobot would get within five feet of me during testing. So I stood thereand waited for the robot to detectand start following me. It foundme, but I guess I didnt make theimportance of the five foot boundary

    very clear, because it ran right intome a couple seconds later.

    Also, when I first started takingelectrical engineering classesat Santa Clara I was actually

    determined to start a fire. I nevermanaged, and I guess that explains why TAs for those classes always watched me a little more closely than everyone else. But, a couple

    years ago I decided that at the endof one of my electrical engineeringlabs I would start pullingcomponents out of the proto board

  • 8/6/2019 EEWeb Pulse - Issue 6, 2011

    6/14EE Web | Electrical Engineering Community Visit www.eeweb.com 6

    I N T E RV I E W

    while it was still powered, whichdefinitely resulted in getting a nicelittle zap.

    What are you currentlyworking on?

    Right now I am interning at CiscoSystems in the Wireless NetworkingBusiness Unit for the summer. Theteam I was placed with works on anetwork management system andmy project is to create a mobileapplication that incorporates datafrom the computer-based systeminto smaller tasks that can beaccomplished using an Android

    phone. The application is currently intended to be a device finder, sousers of the network managementsystem will be able to map thelocations of devices like accesspoints, clients, and interferers intheir building by using this app.In addition, users will be able tosee where they are on the mapin relation to the device they aresearching for, so the app will helpto guide them to the device they

    wish to find. This is my first time working on mobile applicationdevelopment, so Im learning a lot!

    As of June I graduated from my undergraduate program, whichincluded finishing my seniordesign project, which was inconjunction with the RoboticSystems Laboratory on campusthat I had been working withsince freshman year. Given thelabs involvement with spacecraftmissions, there are many differentresponsibilities, from creatingground station software andhardware, communicating with thesatellites regularly, to maintainingpublic web-based missiondashboards for each mission.

    My senior design project aimedto improve the system used forcreating and maintaining themission dashboard. The originaldashboard design was a staticHTML page that displayed valuesthat change frequently. Becausethe lab is involved with so many tasks related to the mission,maintaining and updating thedashboard doesnt always happen

    as often as it should. I createdscripts that automate the updatingprocess, so that the data displayedon the dashboard is always up to

    date. I also incorporated some of the labs anomaly detection dataand automated the productionof plots displayed on the pageto make the new version of thedashboard even more useful asa data dissemination mechanismthan the original version.

    What direction do you seeyourself heading in the nextfew years?

    After the summer Ill be goingon to graduate school at SantaClara for a masters in computerengineering for a year. Im planning

    on taking the networking track formy degree, as Im really interestedin the computer engineering sideof networks and I think that it is aconstantly evolving topic in thetechnological world right now.Once Im done with graduateschool, Im hoping to get a full time

    job in the industry, somewhere inCalifornia if possible.

    EEWebElectrical Engineering CommunityJoin Today

    www.eeweb.com/register

    http://bit.ly/jd6Wcwhttp://bit.ly/jd6Wcwhttp://bit.ly/jd6Wcwhttp://bit.ly/jd6Wcwhttp://bit.ly/jd6Wcwhttp://bit.ly/jd6Wcwhttp://bit.ly/jd6Wcwhttp://bit.ly/jd6Wcwhttp://bit.ly/jd6Wcwhttp://bit.ly/jd6Wcwhttp://bit.ly/jd6Wcwhttp://bit.ly/jd6Wcw
  • 8/6/2019 EEWeb Pulse - Issue 6, 2011

    7/14

    Avago Technologies AEDR-850x threechannel refective encoders integratean LED light source, photo detectorand interpolator circuitry.

    It is best suited to applications wheresmall size and space matters!

    Applications include medical handheld devices, camera phones, wheelchairs, actuator, vending machineapplications, just to name a ew.

    www.avagotech.com/motioncontrol

    Avago Technologies Motion Control Solutions

    Worlds Smallest MiniatureRefective 3-channel Encoder

    To request a ree sample go to:

    Features Advantages Benefts

    3-channel encoding(AB and I)

    Index Signal I No need or separatecomponents to generatethe index signal

    Miniature size Sur ace mount leadlesspackage: 3.95 mm (L) x3.4mm (W) x 0.95mm H)

    Ability to ft intominiature motor designs

    304 LPI High encoding resolution Various CPR capableby adjusting to thematching ROP o thecodewheel

    Built in Interpolator o 1x, 2x, and 4x

    1x, 2x and 4x via externalpinouts

    Base CPR resolution canbe interpolated by enduser

    High operatingrequencies: 55 kHzat 1x interpolation

    Operating requencies canbe increased by externalinterpolator pinouts bymaximum o 4x

    Corresponding highRPM per ormance withincreased requencies

    Index gating Options available or bothgated and ungated versions

    Catering or various usergating requirements

    -20C to 85C Industrial applicationcapable

    Covering consumer,commercial andindustrial applications

    http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5http://bit.ly/jpn9V5
  • 8/6/2019 EEWeb Pulse - Issue 6, 2011

    8/14EE Web | Electrical Engineering Community Visit www.eeweb.com 8

    There was a time when debugging was not easy. I wantto share some of the stuff I used to do to debug code and

    hardwarethe hard way.Going back to when I started out in the 80s, there werefew fancy debugging tools, and the ones that were around

    were expensive. In my first job we used Z80 processors, which was good because Id used them when playingaround with my ZX81 and ZX-Spectrum. Getting a boardto work the first time was not easy. Current micros can beloaded with code, but a processor needs, among otherthings, RAM and ROM to get you started.

    So once the first board was made, I put some basic

    code in it to just loop. To test it was working, I woulddisconnect the clock and run it from a 555 timer at about3Hz. Thats right, very slow! I would have LEDs hangingoff the Data Bus and Address Line. In fact, I had a headerthat would fit between the CPU and the board. This way Icould see the lines of code running and check. After thatI would progress to getting an I/O line working, slowly adding more and more code, testing each part of theboard bit by bit.

    Over time we got a working CPU board that would run

    code and address RAM and ROM correctly. It was nota massive task to test and develop but was important

    to get right early on. After this and getting an I/O port working, you get to the point where we are today withcurrent micros and can have a blinking LEDthe firstuniversal debugging tool!

    Many of my designs still have a place for a LED on anI/O pin. This is normally used as a heart beat indicator.That is, every time the code loops around, you togglethe LED and can see that the board and micro is stillrunning.

    The blinking LED is, however, a very important debug

    tool that I think people forget about today, even withmodern circuit debugging tools. Consider this: thefaster your LED blinks, the quicker your code is looping!Now hook this to an oscilloscope and you can monitor

    your loop time for the micro and detect when big stepchanges happen during events.

    Another use of our Blinky LED is for interrupts. Turn theLED on when entering an interrupt and off again when

    you exit. From a visual point of view, the more your LED ison, the more time you are spending inside your interrupt

    Paul Clarke Electronics Design Engineer

    The MostPowerfulDebuggingTool Ever

    THELED

  • 8/6/2019 EEWeb Pulse - Issue 6, 2011

    9/14EE Web | Electrical Engineering Community Visit www.eeweb.com 9

    T E C H N I C A L A RT I C L E

    code, resulting in less time running normal functions. Ona scope you can monitor what percentage of time yourcode is spent inside the interrupt code and if externalevents affect it. All this from an I/O pin output!

    After the LED, we used to hook up a Display or a UARTfor serial communication to a PC. This then allowed for

    visual monitoring of values inside the chip and software.Today, this can be done with in-circuit debugging toolsconnected directly to dedicated code or hardware inthe chip. At one point in time I even designed my ownin-circuit debugging tool for a Z80 CPU that allowedsingle stepping of code. However, I still feel that a singleI/O pin and a blinking LED is, by far, the most usefully debugging tool.

    About the Author:

    Paul Clarke is a digital electronics engineer with strongsoftware skills in assembly and C for embeddedsystems. At ebm-papst, he develops embeddedelectronics for thermal management control solutionsfor the air movement industry. He is responsible for theentire development cycle, from working with customerson requirement specifications to circuit and PCB design,developing the software, release of drawings, andproduction support.

    Figure 1: Green LEDs

    EE WebElectrical Engineering Community

    Contact Us For Advertising Opportunities

    [email protected]

    www.eeweb.com/advertising

    http://bit.ly/l6u6Cxhttp://bit.ly/l6u6Cxhttp://bit.ly/l6u6Cxhttp://bit.ly/l6u6Cxhttp://bit.ly/l6u6Cxhttp://bit.ly/l6u6Cxhttp://bit.ly/l6u6Cxhttp://bit.ly/l6u6Cxhttp://bit.ly/l6u6Cxhttp://bit.ly/l6u6Cxhttp://bit.ly/l6u6Cxhttp://bit.ly/l6u6Cxhttp://bit.ly/l6u6Cxhttp://bit.ly/l6u6Cx
  • 8/6/2019 EEWeb Pulse - Issue 6, 2011

    10/14EE Web | Electrical Engineering Community Visit www.eeweb.com 10

    Software is an amazing thing.Programming languages

    are immensely expressive,compilation is quick, there arelots of abstractions and tools fordevelopment, and it is quick andeasy to update the function of adevice. This means that any partin your system driven by softwareis the most flexible thing in yoursystema wonder part.

    However, there is one place thatsoftware really stinks: fast real-time processing. This is the kindof processing when a task must becompleted before some externalevent, for example, manipulatingimage data between screenrefreshes of a display, or supplyingdata to external I/O pins based onsome fast clock.

    Of course, software can be used forthis, but all the wonderful ease of

    use and flexibility seems to fall away.Software development becomeshard and difficult to maintain.

    The Problems

    So, why does software haveproblems when faced with real-timeor interface-driven applications?The problems can be characterizedinto categories:

    Problem 1: Multi-tasking

    Naturally, a processor is likely tobe trying to do more than one task,even for the simplest problem.However, processors cannotgenerally do more than one thing atonce. Even multi-core processors

    with traditional architectures may

    only be able to do two or four thingsat once in hardware.

    The problem is that multi-taskingon a naturally single-threadedprocessor involves the softwarescheduling tasks in and out of the processor in chunks. Fromthe viewpoint of a single task,scheduling means you do not know

    when you are in and when you areout, making it hard to meet real-timeconstraints.

    Problem 2: Interrupts

    Even for a single-threadedapplication, the processor is likely to be doing more than one thing at atime. Interrupts provide an implicitform of multitasking. An interruptfiring (to service an I/O handler forexample) is the same as a scheduler

    Dave LaceyTechnical Director of Software Tools

  • 8/6/2019 EEWeb Pulse - Issue 6, 2011

    11/14EE Web | Electrical Engineering Community Visit www.eeweb.com 11

    T E C H N I C A L A RT I C L E

    switching out a task. See figure 1.

    Problem 3: Lack of Predictability

    It seems that software really lacks

    predictability with regard to timing. You need a task to run in a certainnumber of microseconds but youcannot be sure it will. Schedulingand interrupts are only part of theproblem. Some microprocessorshave a cache for memory accessand the time a memory access takes

    varies depending on the state of thatcache. Also, some microprocessorsare superscalar so each instruction

    takes a variable amount of time toexecute. This all means that youcannot just count the number of instructions and know how longthat instruction sequence is goingto take.

    Problem 4: Lack of resources

    When real-time software is usedin embedded applications theretends to be another problem: lackof resources. Memory and clockcycles cost money so there is adrive to get as much as possiblefrom low-resource devices. Thisis a problem for modern softwareabstractions that tend to view resources as plentiful, for example,memory as an infinite resource.

    Solutions

    One option to avoid the problems of real-time software is to implementit in a hardware solution. If afixed function part exists with thefunctionality you want, there isreally nothing to do. Alternatively,a re-programmable hardware partlike an FPGA may do, providing

    you have the skills to program it.

    Even if you do, it is likely that somesoftware tasks are required so youhave to integrate the FPGA witha microprocessor, either on theFPGA or on a separate part. Thishardware/software division givesmultiple design flows and tools,and lacks the tight integration of disparate functionality that softwaredevelopment can provide.

    Are there any solutions thatprovide all the benefits of softwaredevelopment but without the issuesthat occur when trying to do real-time programming?

    One option is to use a real-timeoperating system (RTOS)conventional operating systems withextra different features for real-timeapplications. Firstly, the schedulingof multiple tasks is prioritized andtime-aware, so the scheduler triesto guarantee that tasks meet theirtiming constraint. Secondly, the OS

    is designed so that the worst-caseexecution time of all system tasksis known, enabling you to do some

    worst-case execution time (WCET)analysis.

    RTOSs on traditional micropro-cessors, however, provide a pretty heavyweight solution. It is trying tobend something not naturally real-time into a real-time framework.Even if the scheduling is real-timeaware and WCET is performed onsystem tasks, the non-determinismof the processor (cache, supers-calar execution) is still there. Theupshot of this is that even with areasonably fast microprocessor, it ishard to do tasks with sub-microsec-ond constraints due to the overheadof the OS. These kinds of tasks arestill traditionally handled with ASICSor FPGAs.

    XMOS devices provide a brandnew solution that combines the

    RAM GPIO INTCInterrupts

    Typical Bus Based System

    CPU

    CACHE

    PORTCPU

    RAM

    Events

    XMOS Device

    Figure 1: Interrupt vs. Event

  • 8/6/2019 EEWeb Pulse - Issue 6, 2011

    12/14EE Web | Electrical Engineering Community Visit www.eeweb.com 12

    T E C H N I C A L A RT I C L E

    benefits of software with the real-time performance of hardwaresolutions.

    XMOS Designedfor Real-Time

    XMOS processors are built groundup for real-time processing withfast external I/O constraints. They are designed to combine the bestof hardware design with the best of software design.

    Solution 1: HardwareMulti-tasking

    XMOS devices handle multi-tasking in hardware with a set of tasks running on different softwarethreads. Every clock cycle, adifferent thread swaps into contextin a round-robin style. This meansthat you do not have to worry abouta scheduleryou can view eachthread as an independent entity running at a set speed. It is also anaturally multi-core architecture,so adding more cores means thatmore independent tasks can berun.

    Solution 2: Event-Driven Architecture

    There is no OS layer on XMOSdevices. Instead of interrupts,each thread explicitly responds toevents. This approach means that

    there are no hidden tasks that can jump in and upset the timing of your software.

    Solution 3: Predictable Execution

    The lack of OS and softwarescheduler combined with memory that has no cache (each memory access takes one thread cycle) and

    the use of independent resourcesfor each thread, means that with

    XMOS, you have the predictability required for real-time applications.

    You know how long an instructionsequence will take statically.Furthermore, XMOS provides aTiming Analyzer (XTA) tool, whichaccurately gauges the worst-caseexecution time between two pointsof code (taking into account multiplepaths of control flow, function calls).

    Solution 4: Managed resources

    XMOS devices are designed

    for embedded applicationsand, as such, are low-cost andlow-resource. The key for thesoftware programmer is managingthose resources. The softwaredevelopment tools (standardC compiler based tools withextensions) keep track of resourceusage so you know you are not goingto run out at run time. If you needmore memory, processing power

    or I/O, simply add another core, asresources are fully scalable.

    The tools also ensure that eachthread only uses its own resourcesand cannot interfere with each other.

    Conclusion

    This article shows the difficulties of software programming for real-timeapplications and the motivation

    behind the design of the XMOSfamily of devices. The next time

    you design a system that requiresreal-time processing and I/Oprogramming, check out XMOSand see how you can combine thebenefits of software development

    with real-time performance.

    About the Author:

    Dr. David Lacey works as TechnicalDirector of Software Tools at XMOSLtd. With over ten years of research

    and development in programmingtools and compilation technology,he now works on the developmenttools for XMOS devices. As well astools development, he has workedon application developmentfor parallel and embeddedmicroprocessors including workin areas such as math libraries,networking, financial simulation,and audio processing.

    http://www.xmos.com/http://www.xmos.com/
  • 8/6/2019 EEWeb Pulse - Issue 6, 2011

    13/14EE Web | Electrical Engineering Community Visit www.eeweb.com 13

    R E T U R N T O Z E R O

  • 8/6/2019 EEWeb Pulse - Issue 6, 2011

    14/14

    R E T U R N T O Z E R O

    Join Today

    www.eeweb.com/register

    Electrical Engineering Community

    EE Web