Using the Free SDCC C Compiler to Develop Firmware for the DS89C430/450 Family of Microcontrollers

Abstract: The SDCC (Small Devices C Compiler) is a free C compiler developed for 8-bit microcontrollers. This application note demonstrates how to use the SDCC to develop firmware for the DS89C430/450 family of ultra-high-speed 8051-compatible microcontrollers. Installing the SDCC free C compiler is also explained.

Introduction

The SDCC (Small Devices C Compiler) is a free C compiler developed for 8-bit microcontrollers. Although compatible with many different architectures, the SDCC compiler has extended support for devices based on the 8051-core. This application note will focus on using the SDCC to develop firmware for the DS89C430/450 family of ultra-high-speed 8051-compatible microcontrollers from Maxim/Dallas Semiconductor.

The SDCC is a command line, firmware development tool that includes a preprocessor, a compiler, an assembler, a linker, and an optimizer. Also bundled with the install file is the SDCDB, a source level debugger similar to gdb (GNU Debugger). When an error-free program is compiled and linked with the SDCC, a Load Module in Intel hex format is created. This file can then be loaded into the DS89C430/450 microcontroller's flash memory using a Serial Loader. (See DS89C430/450 documentation and application notes for details on downloading firmware to device).

For the most up-to-date information about the SDCC, visit http://sdcc.sourceforge.net or read the SDCC manual, sdccman.pdf (copied to your hard drive during installation). Questions can also be submitted to the online SDCC message forum or mailing list which can be found in the "Support" section of the SDCC webpage.

Installing the SDCC Free C Compiler

To install the SDCC, download the latest version from the "Download" section of the SDCC website at http://sdcc.sourceforge.net. Although nightly builds of the software are available, it is usually safest to download the latest fully tested release version.

On the "Download" page, builds of the SDCC are available for several different operating systems. If you are working on a PC running Microsoft Windows, download the win32 self-executing SDCC install file and run the executable.

When installing the program, a prompt will appear asking to add the directory containing the program binaries to your path. This is recommended, and the remainder of this application note will assume that the user has done so.

Compiling a Simple C Program with the SDCC Compiler

To ensure that the SDCC installed correctly on your hard drive, open a Command Prompt and type sdcc --version. Press [Enter], and the text displayed in Figure 1 should appear in the window (actual text will depend on the SDCC version that you downloaded):

Figure 1. Verifying the correct installation of the SDCC by performing a version check.
Figure 1. Verifying the correct installation of the SDCC by performing a version check.

0 comments:

Post a Comment