Advertisement

Basics of microcontroller design tools

Extracting a microcontrollers full capability

While microcontroller specs may be the first thing engineers look at when deciding on a device for their system, the ecosystem that surrounds the microcontroller is certainly very important, and becoming more so. What good is it to have the best MCU around if there are no tools to leverage its capabilities? Let's examine the various hardware and software tools needed to create an effective microcontroller development environment.

The Basics

Before we can even blink LEDs or spin motors we have to understand a projects minimum requirements. A good place to start is the integrated development environment.

Finding the right IDE is an important process. After all, this is the window at which many microcontroller developers spend hours staring. This is the blank canvas for the engineer/artist where keystrokes paint a design – typically in C. An IDE has two main viewpoints: the code editor view and the debug view. Through the IDE, developers can copy and paste code examples or write code from scratch in the editor view. The developer has the option to switch to the debug view within the IDE to find errors.

  • Minimum:
    • Code editing
    • Simple debug (set breakpoints, watch variables, single-step through code)
  • Next step up:
    • Integrated code examples
    • Cloud-connectivity for pulling in resources or enabling a social aspect for sharing code with other developers
    • Flexible compiler efficiency for improving code density
    • GUI-based programming tools for generating code and initializing peripherals
    • Auto-detection of the target microcontroller
    • Support for a wide range of target microcontrollers

Hardware tools

Once settled on an IDE, the hardware tools are the next part of the development ecosystem. These vary considerably in form factor, cost and, scope, but usually there are two main components: the emulator and the target board. The flash emulation tool is typically a standalone module that connects the target MCU to the computer and takes compiled code from the IDE and programs it into the target chip. The emulator is also responsible for enabling the debug capability inside of the IDE.

 FAJH_TI_tools_1S_Apr2013

Fig. 1: A simple microcontroller development setup

Some hardware development tools feature both the target microcontroller and emulator on the same PCB, usually on low-cost development tools that enable quick startup and evaluation of a particular microcontroller. The MCU LaunchPad evaluation kits from Texas Instruments are examples of this type of tool.

  • Minimum:
    • Flash emulation tool (FET) for programming and debugging
    • Target board with microcontroller
  • Next step up:
    • Hardware tools with an on-board emulator alongside the target MCU
    • Development tools with LEDs, displays, buttons and more to give users easy out-of-the-box functionality
    • These tools can also have specific application focus getting users closer to an actual end-equipment design
    • The target board should provide easy access to all of the microcontroller pins for easy interfacing with external components and measurement equipment

  MSP430

Fig. 2: The MSP430 LaunchPad is an example of a microcontroller development kit with an on-board emulator for programming and debugging

Optional elements

Some supplemental tools can further improve the development ecosystem. Microcontroller vendors have useful code repositories that make development on their particular device easier. There are typically synched to the cloud  are especially helpful thanks to the guaranteed latest version of a particular resource and documentation, as well the ability to filter useful content based on various criteria. Resource explorers can be integrated into the IDE itself or delivered as a standalone downloadable package.

Many microcontroller companies provide unique application-specific software resources and tools. Graphical User Interfaces (GUIs) are becoming prevalent and GUI tools exist for generating code specific to many applications.

For battery-operated applications, ensuring low power is key to the end user experience and suppliers are going above and beyond simply providing ultra-low-power microcontrollers. They are also creating tools to enable developers to squeeze every last nanoamp out of their application. These tools range from power profile during debug to line-by-line code analysis. They allow developers to see where “leaks” in power consumption are present in the code, and ultimately to write more efficient software.

Developers looking to create more complex systems that require critical timing often use an  RTOS that enables multi-tasking of various functions. An RTOS is particularly useful when various modules need to share limited resources by ensuring resources are allocated properly for each function. An RTOS allows the developer to give each function a priority with the help of a pre-emptive scheduler. This prioritization and resource-sharing also helps developers ensure that key functions will complete deterministically, which is essential for applications such as wireless communications, medical devices, or motor control.

Logic and spectrum analysis

Logic analyzers are digital profilers that give MCU developers unique visibility into the microcontroller's activity during run time. While the debug features found on an IDE gives plenty of visibility into the inner-workings of the microcontroller, the logic analyzer gives us more information about what is happening outside of the MCU. The analyzers offer multiple channels and allow us to see the digital signals present throughout a microcontroller system. These are especially useful when dealing with serial communication interfaces that often requires specific and precisely-timed digital streams. A logic analyzer allows us to probe each of the lines responsible for serial communication and presents the information in an easily digestible format. A logic analyzer may also have intelligence and can parse the incoming signals into the various components of a communication protocol and appropriately presents it to the developer.

What the logic analyzer is to the digital world, the spectrum analyzer is to the wireless world. Debug can be difficult for wireless microcontroller designs because of the intangible properties of wireless communication. A spectrum analyzer can see wireless signals and report frequency information to the developer.

These tools, combined with a standard oscilloscope and multimeter, are all a design engineer needs. Good examples of the tools described include TI's Code Composer Studio IDE, which supports all of TI's embedded processors. TI's LaunchPad Evaluation Platforms are low cost kits for MSP430, C2000, and Stellaris processors.

Advertisement



Learn more about Texas Instruments

Leave a Reply