Affordable Access

Publisher Website

Advanced topics in programming embedded systems (M68HC12)-Chapter 7

Elsevier Inc.
DOI: 10.1016/b978-187870757-4/50009-0
  • Computer Science


Publisher Summary C programming is very important for small microcontrollers. In this chapter, much emphasis has been placed on the construction of small functions and then integrating these functions into a working package. Modular development of a program can yield very satisfying results. This chapter discusses programming a part of the features of a telephone, or perhaps of an electronic phone book into the chip. A telephone book function is one complete module that is a part of the telephone control. As it stands, the HC12 has a small amount of EEPROM into which a phone book can be stored. The FLASH memory has some disadvantages that discourage its use to store the telephone book data. For encoding and decoding the name data to be stored in the phone book, Huffman code was used. To do justice to the encoding technique, it is necessary to try to build the code to encode the type of text that a phone book represents. The program encodes the alpha data entered in the array s[ ] into a Huffman code of the same data and returns the encoded data in the array array[]. Perhaps the easiest way to test the encode routine is to execute it in conjunction with its corresponding decode routine. The data are stored in the main data array and access to these data is made through the values stored in the corresponding entry for each set of data. The programs were all compiled, linked, and tested with the DOS-based compiler named COSMIC compiler 2.

There are no comments yet on this publication. Be the first to share your thoughts.


Seen <100 times