Advertisement

Embedded C Programming with 8051

  • Kai Qian
  • David den Haring
  • Li Cao
Chapter

Abstract

This chapter introduces 8051 C programming. The 8051 C is designed for programming the 8051 microcontroller. It is both an extension and subset of ANSI C. It is assumed that the readers of this book have basic C programming knowledge. The ANSI C syntax is given in Appendix A for your reference. The difference in programming with 8051 C compared to ANSI C programming are all about the microcontroller architecture such as I/O ports, memory, CPU registers, timers and interrupts. Everybody knows C is the closest to assembly language and is a better choice for large and complex system software, device drivers, or embedded software. However, it is still platform independent so that ANSI C may not be the best choice for the time critical or resource critical software project. It is difficult to write projects in machine dependent assembly language because the programmer must know all the hardware details, and it is difficult to do debugging, testing, and maintenance. The 8051 C is between the C standard language and “51” family assembly language. It will be much easier for a C programmer to switch to 8051 C because he/she only needs to learn the extensions to the language and to deal with missing parts of the standard library. Assembly instructions can be embedded into 8051 C programs if it is necessary. Most microcontrollers have a dedicated C compiler available just like the 8051 C for “8051” family microcontrollers. This chapter will discuss the C extension related hardware so that you will have a better understanding of the foundation of the 8051 microcontroller before you do coding in 8051 C.

Keywords

Register Bank Embed Software Memory Type Assembly Code Head File 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

References

  1. 1.
    C and the 8051, 4th edition, Thomas W Schultz, Wood Island Prints, 2008Google Scholar
  2. 2.
    Embedded C, Michael J Pont, Addison-Wesley Professional, 2002Google Scholar
  3. 3.
    Demo Kit, Getting Started with the 8051 Microcontroller development Tools, http://www.adatronik.com.pl/files/IDE/keil/dm51.pdf

Copyright information

© Springer Science+Business Media, LLC 2009

Authors and Affiliations

  1. 1.Dept. of Computer ScienceSouthern Polytechnic UniversityMariettaUSA
  2. 2.Atronix Engineering Inc.NorcrossUSA
  3. 3.University of Texas at AustinAustinUSA

Personalised recommendations