The C programming language is a general-purpose high-level programming language that offers efficient and compact code and provides elements of structured programming. Many control and monitoring-based applications can be solved more efficiently with C than with any other programming language. C was originally available on mainframe computers, mini- computers, and personal computers (PCs). The C programming language is now available on most microcontrollers and microprocessors.
This book is not intended for teaching the C programming language. It is assumed that the reader is familiar with programming in C. The aim of this chapter is to show the special features of the C language when programming microcontrollers. In this book, the industry standard C51 optimizing C compiler is used throughout. This compiler has been developed by Keil Elektronik GmbH. C51 is available on both MS-DOS and Windows-based operating systems and the compiler implements the American National Standards Institute (ANSI) standard for the C language.
There are many other high-level language compilers available for micro- controllers, including PASCAL, BASIC, and other C compilers. Some of these compilers are freely available as shareware products and some can be obtained from the Internet with little cost. Also, some companies supply free limited capability compilers, mainly for evaluation purposes. These compilers can be used for learning the features of a specific product and in some cases small projects can be developed with such compilers. Section 2.5 gives a list of some sites where readers can find more information on high-level microcon- troller compilers.
The C51 compiler has been developed for the 8051 family of microcontrollers. This is one of the most commonly used industry standard C compilers for the 8051 family, and can generate machine code for most of the 20-pin and 40-pin 8051 devices and its derivatives, including the following microcontrollers:
Intel and others 8051, 80C51, and 87C51
Atmel 89C51, 89C52, 89C55, 89S8252, and 89S53
Atmel 89C1051 and 89C2051
AMD 80C321, 80C521, and 80C541 Dallas 80C320, 80C520, and 80C530
Signetics 8xC750, 8xC751, and 8xC752
Siemens 80C517 and 80C537
C51 is a professional, industry standard compiler with many features, including a large number of built-in functions. In this chapter we shall be looking at the features of the C51 programming language as applied to programming single chip microcontrollers. More information on the C51 compiler is available from Keil Elektronik GmbH (see the C51 Optimizing 8051 Compiler and Library Reference Manual).