Firmware Development

In a system, firmware is the software that resides in and operates on the lowest level of hardware. It literally means software that can not be changed. Most of the time, firmware performs those tasks which are absolutely necessary for the system to operate. These involve configuring and readying the hardware and peripherals at start-up or providing an abstraction layer for other software to easily use the concerned hardware. We will discuss here the firmware for microcontroller based embedded systems.

Microcontrollers based embedded systems are usually developed when discrete components are not able to perform the desired job efficiently or when there are some level of computational tasks involved. Firmware is the thing that is loaded on the microcontroller chips and it then drives the controller to get the desired results.

Microcontrollers are used immensely in all types and level of embedded systems. As firmware operates on the lowest level, it heavily depends on the hardware’s architecture. There exist a lot of diverse microcontroller families and, in addition, featuring a broad list of peripherals. Three of the most commonly used ones are Intel’s MCS-51 (8051), Microchip’s PIC and Atmel’s AVR. Each of these families offers distinct firmware development tools so quite a variety is available here.

Firmware can be coded in two categories of programming languages; low level and high level. Assembly is a low level language so it directly deals with the lowest hardware. While, on the other hand, a high level language like ‘C’ does abstraction so it is easier to code in. High level languages make the programming far easier but more efficient code is usually achieved using low level languages. Both low and high level languages use syntaxes or commands written in human- language and the actual code for the hardware is generated by an assembler or compiler. Nowadays, compilers for high level programming languages have become quite efficient so assembly is seldom used.

To achieve code efficiency, compilers are usually designed specific to the microcontroller family. So there is not a single compiler for all kinds of hardware. Compilers mostly come bundled with integrated development environments (IDE’s) which also offer code debuggers and simulators. For example, widely used IDE and compiler for MCS-51 (8051) family is KEIL, MPLAB for PIC and AVR Studio for AVR. Apart from these, CCS’s PIC-C and mikroElektronika’s mikroC are also famous. Compiler takes the source code and generates formatted “.HEX” file that actually contains the desired machine code. Many other files are also optionally generated, like “.COF” (debug info) and “.LST” (compatible assembly code), which are used for code debugging or troubleshooting. Assembler generates a binary “.BIN” file as the machine code.

The formatted “.HEX” files are used by devices called programmers or burners to transfer (or “burn”) the machine code into the target microcontroller. Commonly used “burning” techniques are in-system programming (ISP) and the JTAG (Joint Test Action Group) protocol. Both can also be used to perform in-circuit code debugging. JTAG was not developed for such works but is now used significantly, especially in the microprocessor and operating system based embedded systems.

, , , ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: