Chapter 3
Chapter 3
2
Life Cycle Models
5
Common Models
Waterfall
V Cycle
Spiral
Rapid Prototype
6
Common Models
7
Common Models
Time axis
8
The Waterfall Model
10
The Waterfall Model
11
The V Cycle Model
12
The V Cycle Model diagram
13
The V Cycle Model
14
The Spiral Model
15
The Spiral Model
Its philosophy is
To start small,
Explore the risks,
Develop a plan to deal with the risks and
Commit to an approach for the next iteration
The cycle continues until the product is complete.
16
The Spiral Model diagram
17
Rapid Prototyping – Incremental
18
Rapid Prototyping – Incremental
19
PROBLEM SOLVING – SIX STEPS TO DESIGN
Requirements definition
System specification
Functional design
Architectural design
Prototyping
Test
21
PROBLEM SOLVING – SIX STEPS TO DESIGN
22
Embedded systems development tools
23
Embedded systems development tools
… Continued
A real-time operating system (RTOS) is a program that
Schedules execution in a timely manner,
Manages system resources, and
Provides a consistent foundation for developing application
code
Application code designed on an RTOS can be quite diverse,
ranging from a simple application for a digital stopwatch to a much
more complex application for aircraft navigation/ remote surgery
24
Embedded systems development tools
… Continued
An RTOS comes in two basic flavors: kernels and full operating
systems
A kernel usually implements the basic task and memory
management functions
A full operating system may have drivers for disk drives, serial
ports, and other common resources
25
Embedded systems development tools
… Continued
Most RTOS kernels contain the following components
Scheduler-is contained within each kernel and follows a set of
algorithms that determines which task executes when
Objects-are special kernel constructs that help developers
create applications for real-time embedded systems
Services-are operations that the kernel performs on an object
or, generally operations such as timing, interrupt handling, and
resource management
26
Embedded systems development tools
… Continued
RTOSs are best suited for real-time, application-specific embedded
systems
Kernels are the core module of every RTOS
Kernels can deploy different algorithms for task scheduling
RTOSs for real-time embedded systems should be reliable,
predictable, high performance, compact, and scalable
27
Logic Analyzer
28
Logic Analyzer … Continued
30
Logic Analyzer … Continued
State mode,
Operational mode of the logic analyzer can be changed by
using the microprocessor clock to provide the signal to capture
a state
Each time the processor clock rises from low to high, you
capture the state of the pins of the processor and write that to
the logic analyzer memory
Most logic analyzers are available with software
31
Logic Analyzer … Continued
By post-processing the raw trace, either on the host or in the logic analyzer
itself, the information is distilled
From the state of all the processor pins on every clock cycle to
Bus cycles,
Assembly language instructions, and
Finally to C source statements
33
Logic Analyzer … Continued
36
Compilers and Programming
Environments … Continued
State Machine
The software is in one state at a time and only those functions that
pertain to the current state are monitored
This method has the advantage of classifying the functionality
Every state has its own unique code and you can change the code for a
particular state without affecting the code for any other state
The disadvantages to this method are that there usually is a lot of
duplication
37
Compilers and Programming
Environments … Continued
Multiple State Machines/ Polling Loop
Each process can have unique states
A polling loop goes to each process, which then branches to code for
the particular state it is in
When done, the process code exits to the next process
The pool timer uses this method for activity status checks based on
timer rollover
What happens after that depends on whether the code is in powerfail,
time set, or normal timekeeping mode (state)
38
Compilers and Programming
Environments … Continued
Incremental State Machine
Each process executes a few steps of whatever operation it performs in
whatever state it is in; it then transfers control to the next process
Each process also keeps track of where in its internal sequence it is
The next time the process is executed, it takes up where it left off and
executes a few more steps
This gives all processes the appearance of executing simultaneously,
although slowly
39
Compilers and Programming
Environments … Continued
RTOSs
RTOS allows the code to manage tasks by starting and stopping them
based on priority or time
For example, the code to communicate with another system might be
activated only if there are data to send
40
Compilers and Programming
Environments … Continued
The Development Language
At system level everything works with machine code, i.e, ones and
zeros
Understanding and recalling machine level language is cumbersome
and difficult to recall
Then a low level programming language is developed to deal with
processor and makes programming a bit handy
This low level programming language that provides access to hardware
is called Assembly language 41
Compilers and Programming
Environments … Continued
Different processors have different sets of instructions used for
assembly language programming
But still the machines are dealing with machine code where translation
of assembly language to machine code is mandatory
The translator that translate assembly code to machine code is
assembler
Understanding and implementing embedded system using assembly
language is big asset for embedded system developer
42
Compilers and Programming
Environments … Continued
For complex design, however, it is difficult to use assembly language for
programming
In addition to that if in future the processor is going to change then it
might require to rewrite the assembly code for the new processor which
is time consuming and requires additional cost
So high-level language like C and C++ … and others are also important
for development of application software for embedded system
43
Compilers and Programming
Environments … Continued
While selecting the programming language the following should be
considered
Processors Supported
Emulator Support
Code/ Storage Size
Optimization
Assembly Support and others
44
Compilers and Programming
Environments … Continued
Any source code written by any language needs to be translated into
machine code, since machine code is the only language the hardware
can directly execute
All languages except machine language need development tools that
generate the corresponding machine code the hardware will understand
This mechanism usually includes one or some combination of
preprocessing, translation, and/or interpretation of machine code
generation techniques
45
Compilers and Programming
Environments … Continued
The preprocessor’s role is to organize and restructure the source code
to make translation or interpretation of this code easier
Many languages convert source code, either directly or after having
been preprocessed, to target code through the use of a compiler
Compiler is a program which generates some target language, such as
machine code and Java byte code, from the source language, such as
assembly, C and Java.
46
Compilers and Programming
Environments … Continued
47
Compilers and Programming
Environments … Continued
A compiler typically translates all of the source code to a target code at
one time
Most compilers are located on the programmer’s host machine and
generate target code for hardware platforms that differ from the platform
the compiler is actually running on
These compilers are commonly referred to as cross-compilers
In the case of assembly, an assembly compiler is a specialized cross-
compiler referred to as an assembler
48
Compilers and Programming
Environments … Continued
In case of C programming language compiler generates object file
which later on linked with C system libraries to generate executable file
The executable binary file can created either directly onto the board’s
memory or ready to be transferred to the target embedded system’s
memory by a loader
49
Compilers and Programming
Environments … Continued
50