Design Article

PRODUCT HOW-TO: Adapting MCU software to meet your design needs

Michael Wei

2/16/2010 3:41 PM EST

As the world continues to go digital, microcontrollers (MCUs) are being introduced to more applications than ever. New televisions use MCUs to increase the contrast ratio with LEDs.

Lawnmowers can be automated with the help of MCUs, and use electric motors instead of gasoline engines to improve efficiency and reduce pollution. Coffee makers are made smarter with the addition of an MCU to make the perfect cup right when you wake up.

With the growth of MCUs comes a wave of developers with a variety of different backgrounds. This forces us to take another look at MCU software development. In order to maximize the usability of the processor, MCU software must appeal to the wide audience of users and place a larger emphasis on system applications.

Catering to Different Programming Preferences
MCUs are no longer being programmed by only seasoned embedded systems engineers. New applications and the widespread availability of MCUs attract engineers who have never touched digital hardware before, hobbyists with only a passion for technology, and even artists looking for a new way to express their talents.

These new capabilities require that developers break away from traditional, fixed way of programming MCUs and move to methodologies that provide them with a number of different levels of abstraction and control.

To provide that capability, TI designers developed the controlSUITE software for the company's Piccolo C2000 MCUs with a 4-level hardware abstraction layer (HAL) that enables such flexibility (Figure 1 below).

Figure 1. Different programmers with varying backgrounds and preferences can program C2000 MCUs their way with the 4 hardware abstraction layers enabled by controlSUITE software.

Level #1.Starting from the very bottom, registers and addresses can be referenced directly as they always have been.

Level #2. But building from there, the second level, bit fields, allows registers and the functional groups of bits within them to be accessed like variables. By mapping registers to memory, programmers can now access and store values into bits or functional groups of bits as if modifying a variable, and can also watch them like variables in real-time.

This eliminates confusing and error-prone methods like bit-masking. Bit fields appeal to experienced MCU programmers by providing complete access to the device while making programming easier.

Level #3. Taking a step even further, an API of peripheral drivers allows users to program the peripherals with simple function calls. For example, initializing and setting up a PWM can be done by calling functions and passing them parameters like period, duty cycle, and channel number.

These peripheral API drivers provide a simpler interface to new embedded programmers (or a familiar function-call interface to PC software developers.)

Level #4. Finally, a complete baseline framework enables new users to jump into their application without having to worry about setup code, including task management and GPIO mapping.

Combined, these four levels, and the ability to move amongst them, give a programmer the ability to quickly implement simple functions while simultaneously providing full access to take full advantage of C2000's control-oriented peripherals.


Next:




Please sign in to post comment

Navigate to related information

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)

Feedback Form