Page 461 - Programming Microcontrollers in C
P. 461
446 Chapter 8 MCORE, A RISC Machine
shown above in bits and pieces. The complete listing is found in
newclock.c found on the CD-ROM in the Chapter 8 directory.
Summary
The developments in this chapter show an incremental approach
to producing a program. The whole project was understood at the
beginning of the chapter, but rather than try to develop the whole project,
a series of small tasks were developed and tested. The complexity of
each of these individual tasks was minimal. Often, the code required
for each portion was but a dozen or so lines long. Such an approach is
often the best approach to the development of complex code. This
approach is not mine—it has been around as long as I can remember.
With any new project, you should analyze the whole project and
start the development by breaking the project into tasks. Then, break
into subtasks and repeat the process until the tasks are so simple that
the code to implement them is trivial. Then step back a level and
repeat the process, making certain that the code implementation is as
simple as possible at all times. As this code is integrated, each module
should be compiled and tested. Therefore, your program will be built
of tested modules. Never attempt to write a big block of code without
first testing the various small blocks that comprise the whole program.

