MICROCOMPUTER SYSTEM DEVELOPMENT
In the development of microprocessor-based systems, two major paths are usually
followed. These are;
i) Hardware design and
ii) Software design which are done concurrently and in stages.
Hardware design basically consists of selecting appropriate components and
interconnecting them to form an electronic circuit.
Software design consists of writing a program which when installed in the hardware
circuit, causes the complete system to function in the intended manner.
Fig 1.Flowchart diagram for the sequence of events that occur in development of a
microprocessor-based system.
Prepared by D kiarie ,2011 1
PROGRAM CREATION STEPS
In the development of program for software application the following steps has to be
followed
i) Design algorithm to solve the problem at hand
ii) Develop flowchart based on algorithm.
iii) Translate the flowchart into assembly or HLL (this is the source code)
iv) Load the source code into RAM of the microcomputer development
system (MDS)
v) Assemble or compile the program (using assembler or compiler or
interpreter) i.e. convert the source code into object code (machine code).
vi) Run or test the program
vii) Debug the program using debugger
viii) Repeat steps vi & vii above until satisfactory results are found
ix) The working program is loaded into EPROM chip by the help of an
EPROM programmer to be tested on the target system.
NB The above steps can be represented using a flowchart diagram below
Prepared by D kiarie ,2011 2
Fig 2.Flowchart diagram for software development
FACTORS CONSIDERED WHEN WRITING PROGRAMS FOR
MICROPROCESSORS
1. Reliability- is the correct working of the program for the purpose it’s developed.
2. Speed- a program that executes tasks quickly can often do more work than a
slower one.
3. Hardware cost- large programs require more memory chips, complex decoding
circuitry and interconnections, buffers, shift registers, latches, interface chips etc
4. Programming time and cost – although the computer hardware is becoming less
expensive, the cost of programming time continually rise.
5. Ease of use – a program that easier for other programmers or the end user to work
with will be more valuable than one that is relatively hard to use.
6. Error tolerance- a program that tolerates errors is easier to maintain and use. A
good program should report erroneous inputs and malfunctions without shutting
the entire system down.
7. Extendibility- a program that can be extended to tasks other than the one it is
specifically designed is clearly superior.
SOFTWARE TESTING
The are two broad methods of testing a new software
a) Functional or Black-box test; refers to tests that verify a specific action or
function of the code. Functional tests tend to answer the question of "can the user
do this" or "does this particular feature work".
b) Non-functional or White-box test; refers to aspects of the software in respect to
quality and suitability to users and not specific function .It checks for software
stability, performance, security, behavior under certain constraints, user-
friendliness etc.
Prepared by D kiarie ,2011 3
SOFTWARE SUPPORT
For convenient software development several software facilities are needed. They
include the following;
i) Assembler
ii) Disassembler
iii) compiler
iv) interpreter
v) operating system or monitor program
vi) text editor or editor
vii) debugger
viii) linker
ix) loader
x) emulator or simulator
xi) utility routines
Assembler
Is a program which translates Assembly Language Program instructions (ALP)
into machine language i.e. a form that the computer can understand. The resulting
binary code is called object code and is directly executable by the CPU.
Disassembler
Is a program used to generate an assembly language program corresponding to
machine language program. It’s useful in situations when a program is available in
machine form and is to be converted to assembly form for better understanding.
Compiler
This is a program that converts High Level Language instructions into their
machine language equivalent (binary form). It translates the whole program before
execution and thus produce intermediate object code program.
Interpreter
This is a program similar to compiler which translates HLL instructions into
binary form (machine code). However the interpreter fetches, translates and executes
each instruction as soon as it reads it, and thus does not produce object code program
(as in case of compiler)
Interpreters are however slower than compilers are usually for BASIC HLL)
N/B
- Assemblers can only be used in particular CPUs since the mnemonics are
different for each CPU.
- Advantage of using HLL is that it is independent of CPU type and secondly a
single program “statement” in HLL is usually translated into several machine
instructions hence easier to write unlike ALP.
Prepared by D kiarie ,2011 4
Text editor or editor
This is the program that manipulates text (source programs) and allows the user to
make corrections, additions, deletions and other changes.
Examples of editors are the word processing packages e.g. Word Perfect, MS-Word.
Facilities of text editor therefore include:-
- enter source program
- delete character or line
- insert a character or line
- list a specified number of lines of source program on the VDU
- Move to a specified line(s) of code.
Debugger
This is a program that helps in finding and correcting errors in source program. It
allows for the possibility of suspending a program, resuming execution, examining,
displaying and modifying contents of a register or memory.
Debugging techniques
a) Single stepping- allows the developer to run a program a single instruction at a
time then pause to display the results to ascertain whether the instruction performs
as expected.
b) Use of breakpoints-allows the system to run a group of instructions until a
specified address or data in the program is encountered; the program pauses to
display the results of the program execution up to that point. This facility is
suitable for testing a large program.
c) Manual mode- in this mode the equipment controlled by the microprocessor can
be turned ON or OFF or worked on while the MDS remains connected and
powered up. Since in most cases the equipment is some kind of prototype
requiring many changes and modifications this capability is a real convenience.
Loader
This is a program that reads a program from an input device and transfers it into
computer RAM memory.
Types of loaders
1. Bootstrap loader
This initiates a search for an operating system program on a floppy disc, hard disk
or CD-ROM and loads the program and related data into the RAM memory. Once
loaded the OS program takes control of the system.
2. Absolute loader
This loads each instruction of the object program in a fixed, pre-established
memory location. Each instruction is given an absolute address. This loader reads the
Prepared by D kiarie ,2011 5
object code line containing the starting address of the instruction/data and loads
successive words in successive memory locations.
3. Relocator loader
This loader incorporates most of the features and characteristics of the absolute
loader.
However, it allows the user to select and specify the memory locations in which
the instruction or data word are to be stored. Thus the same program can be loaded in
different parts of the memory without having to reassemble or recompile them.
Linker or linking loader
This is a program that will enter a series of programs and subroutines from input
device into memory and adjust their respective symbolic addresses (labels e.g. LOOP) so
as to have the program working as desired.
Advantages of a linker in processing of programs
- it links subroutines with main programs-enables a programmer to use other
peoples programs (supports modular programming)
- useful when a large program is subdivided into smaller programs(modules) for
ease of testing and debugging
Emulator or simulator
Is a program that runs on one machine and emulates the functionality of different
machine. It uses the host machine memory locations to act as registers and memory
locations of the emulated machine. It can emulate the operation of a CPU in its
absence.
Utility routines
Are all the essential sub-routines that perform specific tasks e.g. multiplication,
division, block transfers, input/output devices service routines (called “drivers”)
Operating system
This is a resident computer program that effectively acts as a software interface
between the user, the user’s programs and the computer hardware .It manages the use
of hardware and software resources in the microprocessor based on system.
It will for example continuously scan the keyboard for user input and display
specified content on the output device e.g. VDU, LED
All application programs interact with the computer and its resources via the
operating system
Small Operating Systems are referred to as monitor or supervisor program.
Monitor program used for Intel 8080, 8085 and Z80 is called CP/M (Control
Program/Monitor)
Prepared by D kiarie ,2011 6
Functions of an operating system
o initialize the system
o loads programs into RAM
o controls Input and Output devices
o executes programs in the RAM
o manages the memory
o Keeps a complete record of what has happened during the operation.
o Protects the hardware, software and data from improper use
Types of operating system
i) Batch mode operating system
In this operating system all the jobs to be executed are fed to the computer. Each
user’s job begins with a number of control codes telling the operating system which
of its facilities are required. The operating system then schedules jobs according to
the resources they require and their priority and eventually generates output-usually
on a line printer.
ii) Real-time operating system
Produce results within certain time constraints i.e. in synchronization with actual
occurrence of events
iii) Single user operating system
Can run only one program at a time and hence allows one user at a time. There is
no multiprogramming of the user’s programs e.g. MS-DOS
iv) Multiprogramming operating system
Here a number of interactive user programs are run concurrently e.g. a user could
be typing an MS- Word document while listening to an Audio CD.
v) Time sharing operating system
Several terminals share the same computer in a time division basis
vi) Network operating system
Several computers can be connected and managed
Standard programs found in operating system include;-
- text editor
- debugger
- linker
- loader
- assembler, compiler, interpreter
Prepared by D kiarie ,2011 7
HARDWARE DEVELOPMENT AIDS
Among the hardware development support systems required in software
development are:-
a) Microcomputer Development System (MDS)
b) Single-board microcomputer
c) In-Circuit Emulator (ICE)
d) Chip programmers (burners) and UV EPROM erasers.
e) Fault diagnosis equipment e.g. Logic analyzer, signature analyzer etc
(a) Microcomputer Development System (MDS)
This is a microcomputer equipped with special purpose software and hardware
used to aid the design and development of microprocessor based systems.
Some software found in an MDS are; editor, assembler, compiler, loader, linker,
debugger and the backbone operating system.
Among the hardware subsystems included in an MDS are; large main memory,
Disc drives, VDU, keyboard, printer (to give out hard copy), EPROM programmer
and eraser, CD writer and optionally an In-Circuit Emulator (ICE).
Fig3. MDS Block diagram
(b) Single-board microcomputer
Is a microprocessor-based system that has all its units and peripherals residing on
a single board.
Prepared by D kiarie ,2011 8
It’s normally equipped with hexadecimal keys, function keys plus six 7-segment
displays for display of memory address and data contents. Since it is equipped with a
small amount of memory an assembler is NOT usually available. All programs must
therefore be entered in Hexadecimal form.
An example of a single board microcomputer is EOJ 85 , Microprofessor and
Fox Kits. Single boards are the simplest way to learn programming in classroom. For
complex programming an MDS is required.
Single board microcomputer commands
1. RESET; Is used to restart the monitor program
2. GO or EXEC; Executes the program from specified starting point to a given
breakpoint.
3. STEP; Allows the programmer to run a program in a single-step basis ie an
instruction or a number of instructions are executed before a pause.
4. INSERT; used to insert an instruction in the program.
5. DELETE; used to delete an instruction in the program.
6. DISPLAY; displays trace data or address in various formats eg binary, decimal,
hexadecimal etc
7. NEXT; allows the developer to move the next consecutive memory location
8. GO PREV; allows the developer to move the previous memory location
(c) In-Circuit Emulator (ICE)
Definition: An ICE is a device that allows a system under development
(prototype) to be attached to a development system (MDS) for testing and debugging
purposes.
An ICE is designed to emulate the CPU being used in the system under
development in its absence. An ICE is interfaced to the system under development by
replacing its CPU with a multi-pinned plug (pod) connected by multiway connecting
cord. The ICE behaves exactly as the target processor. It reads the correct sequence of
program instructions from the target memory and generates the correct bus signals during
their execution. It is hence possible to keep a record in area of the MDS memory of the
sequence of action of the system under development processor. This record is known as
real-time trace and it can be examined later by the MDS system software (debugger) to
locate possible errors. This is a useful facility for determining hardware faults.
Prepared by D kiarie ,2011 9
Fig 4. ICE Block diagram
Advantages of using an ICE
1. Since an ICE can be operated without being connected to the prototype,
preliminary software development can be done even before developer’s
prototype hardware is available.
2. The ICE allows the software element to be tested on the actual hardware
on which it will run, but still allows programmer convenience to isolate
code.
3. ICE can be used to debug production units where the CPU is soldered in
and cannot be replaced.
4. ICE provides a complex breakpoint system that monitors the target
microprocessor activity and stops microprocessor operations at
predetermined points for analysis of certain target circuit signals.
5. Allows for software download between MDS and ICE.
6. Allows resource sharing.
Bench marking
Is the use of some standard programs (Benchmark program) to compare the
performance of different microprocessors on identical task.
Bench marking is used to:
- Assess the comparative performance of two microprocessors.
- Ascertain if the configuration provided by a manufacturer performs according
to his claim.
Prepared by D kiarie ,2011 10
Self Assessment Questions
KNEC 2008
1. Draw a labeled block diagram of a basic Microprocessor Development System
(MDS) (5 marks)
2. Describe the functions of the following facilities in an MDS;
I. Single-stepping
II. Break-point
III. Manual mode (6 marks)
3. State any three advantages of using an In-Circuit-Emulator (ICE) in
microprocessor development. (6 marks)
KNEC 2010 (DCS)
4. Describe the following software tools;
i) Debugger
ii) Loader
iii) Assembler (6 marks)
5. Explain the functions of any four typical commands available on a single board
microcomputer training kit (8 marks)
6. Distinguish between one pass and two pass assembler (2 marks)
KNEC 2008 DCS
7. State any four software tools of a Microcomputer Development System (MDS)
(4 marks)
8. List the steps required to develop a piece of application software. (6 marks)
9. With the aid of a flowchart, describe microcomputer development cycle.
(10 marks)
KNEC 2007
10. Describe the following software development aids;
i) Macro instruction
ii) Text editor
iii) Simulator
iv) Linker (8 marks)
11. Explain the two basic methods of testing new software. (4 marks)
KNEC 2004
12. Explain the situation in which a breakpoint is used to debug program and how it is
done. (3 marks)
13. State any four benefits of an operating system. (4 marks)
14. Explain any four standard programs found within an operating system.(8 marks)
15. Explain any four factors to be considered when evaluating different programs for
microprocessor systems. (8 marks)
KNEC 2010
16. Develop a flowchart to outline the sequence of steps followed in developing a
modern microprocessor based system. (6 marks)
Prepared by D kiarie ,2011 11
KNEC 2009
17. In place of an operating system, 8-bit development systems have a monitor
program. State any four monitor program facilities and explain the function(s) of
each. (8 marks)
18. Explain any three benefits of using a development system (MDS) when
implementing a microprocessor based systems.
(6
marks)
KNEC 2007 DCS & KNEC1994
19. With the aid block diagrams, describe the process of producing a modern
microprocessor system using an In-Circuit –Emulator (ICE). (12 marks)
20. State any four development tools used in microprocessor development systems
Prepared by D kiarie ,2011 12