Page 366 - Programming Microcontrollers in C
P. 366
Advanced Topics in Programming Embedded Systems (M68HC12) 351
Monitor This function executes all of the time and receives
data from the keyboard. It interprets the entries and
passes control to the appropriate function to execute.
Encode Encodes the alpha data read from the keyboard
with a Huffman code.
Decode Decodes the Huffman encoded data stored in
FLASH when needed.
Numdup Converts numeric data passed in an array to the
modified BCD format and saves these data in the
FLASH array, also a passed parameter.
Putbcd Converts the encoded numeric data contained in
the passed array to ASCII form. Places the con
verted data in an array that is passed to the function.
Getchar Reads in a character from the serial port. This func
tion and putchar() below work with the
standard library input/output functions that will
be used by the program.
Putchar Sends a character to the serial port.
Get Reads in a character string, either numeric or al
pha from the serial input.
Printout Prints the contents of the phone book stored in
EEPROM.
Printafter Prints the next entry in the phone book.
Saveit Saves the phone book entry in the proper
EEPROM location.
Reset Erases the contents of the EEPROM.
Most of these functions have nothing to do with the underlying
computer. Therefore, we will write code that is completely indepen
dent of the computer. If there is ever a potential modification in this
code when changing to the embedded microcontroller, standard com
piler control commands will be used.