1 / 36

Microcontrollers, Basics Successful Software Development for MCUs

Learn how to start a software project, benefits of model-based design, coding tools, software project management, and additional resources for successful embedded system development.

rickym
Download Presentation

Microcontrollers, Basics Successful Software Development for MCUs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Microcontrollers, BasicsSuccessful Software Development for MCUs • 18 January 2012 • Jonathan A. Titus

  2. Anyone Can Program in C! Sidney Harris ...but that doesn’t mean they write GOOD code.

  3. How Do You Start a Software Project? • You must have a clear objective! • Describe system architecture and behavior • Simple projects: 1- to 5-person team • Complex project: several teams • Hardware engineers • Software engineers • Mechatronics engineers • Sensor experts • Graphical-user-interface designers

  4. Investigate Model-Based Design • In the “not-so-good” old days... Courtesy of The MathWorks

  5. Model-Based Design I Courtesy of The MathWorks

  6. Model-Based Design II Courtesy of Texas Instruments

  7. Create an Executable Model • Use modeling and simulation tools: • MATLAB and Simulink: MathWorks • www.mathworks.com • LabVIEW and MatrixX: National Instruments • www.ni.com • Maple and MapleSim: Maplesoft • www.maplesoft.com

  8. Clutch-Control Model Courtesy of The MathWorks

  9. Vehicle-Control Model Courtesy of Maplesoft

  10. Model-Based Design • Benefits • Everything traces back to requirements • Teams work with the same information • Data flows up and down • No prototypes needed to begin • Tools can produce known-good code • VHDL, Verilog, C, C++ • Program MCUs and FPGAs

  11. Model-Based Design • Problems • Large commitment of time and money • Requires commitment to a new design discipline • Needs a team “evangelist” • Difficult to convince teams to use new tools

  12. Model-Based Design • "Driving Technical Change: Why People on Your Team Don't Act on Good Ideas and How to Convince Them They Should," by Terrence Ryan, The Pragmatic Programmers, 2010. ISBN: 978-1-93435-660-9.

  13. Model-Based Design • Helpful white papers: • "Adopting Model-Based Design Interactive Kit," The MathWorkshttp://www.mathworks.com/programs/techkits/techkit_adopting_mbd.html. • "Shortening the Embedded Design Cycle with Model-Based Design," National Instruments • http://zone.ni.com/devzone/cda/tut/p/id/4074. • "High-Performance Physical Modeling and Simulation," MapleSoft • http://www.maplesoft.com/products/maplesim/index.aspx. • "Developing Quality Embedded Systems Using Model-Based Design," The MathWorkshttp://www.gistl.com/2008/Using_Model_Based_Design.pdf

  14. Software Development • If model-based design isn’t right for you, what other approaches can you take? • IAR VisualSTATE software • Statecharts: State-machine designs • Flow-chart models • DIY techniques?

  15. IAR VisualSTATE "Designing a state machine to solve a problem," IAR Systems. http://tinyurl.com/7ckyejf

  16. Statechart Design "Practical UML Statecharts in C/C++," 2nd ed., Miro Samek, Newnes-Elsevier, 2009. ISBN: 978-0-7506-8706-5.

  17. Coding Tools I • MCUs have an associated C/C++ compiler • MCU vendors supply software tools: • Microchip -- MPLAB X • Texas Instruments -- Code Composer Studio • Freescale -- CodeWarrior • Renesas -- High-Performance Embedded Workbench • Rabbit Semiconductor -- Dynamic C • Vendor tools “close to the chips” • Try free or limited versions before you buy

  18. Coding Tools II • Custom Computer Services • CodeSourcery (Mentor) • MikroElektronika • Third-Party Tools • Atollic • GreenHills Software • Hitex • IAR • Code-Red Technology • Keil (ARM) • HiTech (Microchip) • Raisonance • Rowley

  19. What Should Software Tools Do? • Compile C, C++, and assembly-language • Easily mix C/C++ and in-line assembly code • Simplify tracking projects, files, and revisions • Provide a “smart” color-coding editor • Simplify I/O and peripheral setup • Provide debug and test capabilities • Quickly connect with program/debug pods • Link to latest documents and manuals

  20. What Should Software Tools Do? • Simplify tracking projects, files, and revisions Courtesy of Keil Software

  21. What Should Software Tools Do? • Provide a “smart” color-coding editor

  22. What Should Software Tools Do? • Simplify I/O and peripheral setup Courtesy of Texas Instruments

  23. What Should Software Tools Do? • Provide debug and test capabilities Courtesy of Microchip

  24. What Should Software Tools Do? • Quickly connect with program/debug pods

  25. Take Advantage of Other Resources • Use dev kits as “golden platforms” for code tests • Adopt a consistent coding style: • Google C++ Style Guide • If you are new to MCUs, start with a small board • Arduino Uno, Digilent Uno32, ARM mbed • Use vendor code libraries • Visit and join MCU-user and MCU-software forums • Embedded Systems Conference (ESC) • 26 through 29 March 2012, San Jose, CA, USA

  26. Good Embedded-System Books • "Test-Driven Development for Embedded C," James W. Grenning, The Pragmatic Programmers, 2011. ISBN: 978-1-93435-662-3. • "Automated Defect Prevention: Best Practices in Software Management," by Dorota Huizinga and Adam Kolawa, Wiley Interscience, 2007. ISBN: 978-0-470-04212-0. • "The Art of Designing Embedded Systems," 2nd ed., by Jack Ganssle, Newnes, 2008. ISBN: 978-0-7506-8644-0. • "The Firmware Handbook," Jack Ganssle, ed., Newnes, 2004. ISBN: 978-0-7506-7606-9.

  27. Hed • Text • Bullets • If • Needed

  28. Hed • Text • Bullets • If • Needed

  29. Hed • Text • Bullets • If • Needed

  30. Hed • Text • Bullets • If • Needed

  31. Hed • Text • Bullets • If • Needed

  32. Hed • Text • Bullets • If • Needed

  33. Hed • Text • Bullets • If • Needed

  34. Hed • Text • Bullets • If • Needed

  35. Hed • Text • Bullets • If • Needed

More Related