Designer Reference Manual
USB08 Evaluation Board
44
Software Module Descriptions
MOTOROLA
Software Module Descriptions
3.3 General Structure of the M68HC08 Firmware
The firmware of the M68HC08 consists of several source code modules
which are embedded into a common compiler project. The main()
function is contained in the module
. It controls the program
sequence via an endless loop (as usual in embedded software). The
module
settles the scanning of the input keys. Control of the
light-emitting diodes (LED) on the board is done using simple C macros;
no special C module is required for this purpose. The module
is responsible for reading of the resistive sensors.
These modules are supported by the file
, which contains the
interrupt and reset vectors. The four C source code modules are merged
into a common compiler project. In addition, the assembler module
which contains the C startup code is required.
The control of keys, LEDs, and analog-to-digital (A/D) transmitters are
support functions to the demonstration project because the main
attention is paid to the communication interface. The communication
functions are implemented directly by means of “#include” instructions in
the main module
Two ways of communication are implemented in the demonstration:
RS232 or USB. The selection takes place by defining USE_USB_PIPE
in the head of the main module. If this macro is defined,
automatically becomes a part of the main module; otherwise, the RS232
communication module
is merged.
If the USB implementation in the file
is used, the file
is also translated at the same time. It contains the static
data for all necessary USB descriptors.
For each of the C files
,
, and
there is a corresponding header file (* H) with the same base
name. The functions for controlling the LEDs on the board are contained
as macros in the file
. In several cases, the header
MC68HC08JB8.H contains the register and bit mask definitions required
by the MC68HC908JB8 microcontroller (MCU).