UNIT IV Embedded
UNIT IV Embedded
UNIT IV Embedded
The CAN bus was designed for automotive electronics and was first used in production cars in 1991.
It uses bit-serial transmission.
CAN runs at rates of 1 MB/s over a twisted pair connection of 40 m.
An optical link can also be used.
The bus protocol supports multiple masters on the bus.
Physical Layer:
As shown in Fig 4.6.1, each node in the CAN bus has its own electrical drivers and receivers that
connect the node to the bus in wired-AND fashion.
In CAN terminology, a logical 1 on the bus is called recessive and a logical 0 is dominant.
When all nodes are transmitting 1s, the bus is said to be in the recessive state; when a node transmits a
0, the bus is in the dominant state.
Data are sent on the network in packets known as data frames.
CAN is a synchronous bus—all transmitters must send at the same time for bus arbitration to work.
Fig 4.5
The machine’s software was developed by a single programmer in PDP-11 assembly language over
several years.
The software includes four major components:
stored data,
a scheduler,
a set of tasks, and
Interrupt services.
The three major critical tasks in the system follow:
A treatment monitor controls and monitors the setup and delivery of the treatment in eight phases.
A servo task controls the radiation gun, machine motions, and so on.
A housekeeper task takes care of system status interlocks and limit checks.
Let’s examine the software problems responsible for one series of accidents.
Treat is the treatment monitor task, divided into eight subroutines (Reset, Datent, and so on).
Tphase is a variable that controls which of these subroutines is currently executing.
Treat reschedules itself after the execution of each subroutine.
The Datent subroutine communicates with the keyboard entry task via the data entry completion flag,
which is a shared variable.
Datent looks at this flag to determine when it should leave the data entry mode and go to the Setup
test mode.
The Mode/energy offset variable is a shared variable: The top byte holds offset parameters used by
the
Datent subroutine, and the low-order byte holds mode and energy offset used by the Hand task.
When the machine is run, the operator is forced to enter the mode and energy, but the operator can
later edit the mode and energy separately.
The software’s behavior is timing dependent.
If the keyboard handler sets the completion variable before the operator changes the Mode/energy
data, the Datent task will not detect the change—once Treat leaves Datent, it will not enter that
subroutine again during the treatment.
However, the Hand task, which runs concurrently, will see the new Mode/energy information.
Apparently, the software included no checks to detect the incompatible data.
After the Mode/energy data are set, the software sends parameters to a digital/analog converter and
then calls a Magnet subroutine to set the bending magnets.
Setting the magnets takes about 8 seconds and a subroutine called Ptime is used to introduce a time
delay.
Due to the way that Datent, Magnet, and Ptime are written, it is possible that changes to the
parameters made by the user can be shown on the screen but will not be sensed by Datent.
One accident occurred when the operator initially entered Mode/energy, went to the command line,
changed Mode/energy, and returned to the command line within 8 s.
The error therefore depended on the typing speed of the operator.
Leveson and Turner emphasize that the following poor design methodologies and flawed
architectures were at the root of the particular bugs that led to the accidents:
The designers performed a very limited safety analysis.
Mechanical backups were not used to check the operation of the machine.
Programmers created overly complex programs based on unreliable coding styles.
QUALITY ASSURANCE TECHNIQUES:
The International Standards Organization (ISO) has created a set of quality standards known as
ISO 9000.
ISO 9000 was created to apply to a broad range of industries, including but not limited to embedded
hardware and software.
The processes used to satisfy ISO 9000 affect the entire organization as well as the individual steps
taken during design and manufacturing.
We can, however, make the following observations about quality management based on ISO 9000:
Process is crucial:
Knowing what steps are to be followed to create a high quality product is essential to ensuring that all
the necessary steps are in fact followed.
Documentation is important:
The creation of the documents describing processes helps those involved understand the processes
Documentation helps internal quality monitoring groups to ensure that the required processes are
actually being followed and
It also helps outside groups to understand the processes and how they are being implemented.
Communication is important:
Quality ultimately relies on people.
Good documentation is an aid for helping people to understand the total quality process.
The people in the organization should understand not only their specific tasks but also how their
jobs can affect overall system quality.
Metrics are used in quality control process to know the levels of quality, the execution speed of
programs or the coverage of test patterns and the rate at which bugs are found.
Role of ISO 9000:
To help organizations to study their total process, not just particular segments that may appear to be
important at a particular time.
One well-known way of measuring the quality of an organization’s software development process is
the
Capability Maturity Model (CMM).
The CMM provides a model for judging an organization.
It defines the following five levels of maturity:
1. Initial: A poorly organized process, with very few well-defined processes.Success of a
project depends on the efforts of individuals, not the organization itself.
2. Repeatable: This level provides basic tracking mechanisms that allow management to
understand cost, scheduling, and how well the systems under development meet their goals.
3. Defined: The management and engineering processes are documented and standardized.
All projects make use of documented and approved standard methods.
4. Managed: This phase makes detailed measurements of the development process and product
quality.
5. Optimizing: At the highest level, feedback from detailed measurements isused to
continually improve the organization’s processes.
VERIFYING THE SPECIFICATION:
Verifying the requirements and specification is very important for the simple reason that bugs in the
requirements or specification can be extremely expensive to fix later on.
Fig 4.5.1 shows how the cost of fixing bugs grows over the course of the design process.