Vous êtes sur la page 1sur 6

Embedded Systems Engineering 301

Review Questions
Revised 2014-05-15
1.

There are two distinct categories of computer system designated as


re-programmable and embedded systems. Describe the basic
characteristics of each type and give examples of their application.

An embedded computer is frequently a computer that is implemented for a particular


purpose. In contrast, an average PC computer usually serves a number of purposes:
checking email, surfing the internet, listening to music, word processing, etc... However,
embedded systems usually only have a single task, or a very small number of related
tasks that they are programmed to perform. Any appliance that has a digital clock, for
instance, has a small embedded micro-controller that performs no other task than to
display the clock. Modern cars have embedded computers on board that control such
things as ignition timing and anti-lock brakes using input from a number of different
sensors.

2.

Describe two types of interrupt configuration on an HC12 which


will support maintenance of elapsed time (or time of day) and for
one of these code (or pseudo-code) for a service routine to update
seconds, minutes and hours as necessary. Provide sufficient
documentation and declarations to ensure the code is readable.

3.

Name one of the reference articles and author(s) specified during


the course. Name the magazine from which most are taken!

4.

The use of interrupt facilities and sophisticated peripheral


subsystems in embedded microcontrollers reduce the time critical
aspects which are important in many applications. Describe one
peripheral subsytem which may be found in embedded systems and
discuss the most appropriate type of interrupt facility and the
advantages which (would) accrue from the provision of interrupt
capabilities for this subsystem.

5.

For any microprocessor other than the 68HC12 describe the basic
processor configuration and give one example of a facility which
distinguishes this processor from its competition.

6.

Describe with an example the concept of Finite State Software and


its significance in the development of embedded systems.
A FSM is a conceptual model that represents how one single activity can change its
behaviour over time, reaction to internally or externally triggered events.
In digital design the basic system is a finite state machine which responds to
changes to its inputs by changing its internal state and updating its outputs. In
embedded systems the FSM is represented by the code which behaves in the same
manner and follows the same principles.
Ex: elevators which drop riders off at upper floors before going down, traffic lights
which change sequence when cars are waiting

7.

(i)
Describe the Finite State Machine approach to software
structuring.
(ii)
A system represented by the following state table is to be
implemented by software within an embedded system.
Using your preferred high level language show a corresponding
software implementation.
If appropriate use variables: Input, Output and State.
00

Coding

Inpu
t
State

00
01
11
10

s1
s2
s3
s4

s1
s3
s1
s3

01

s2
s2
s2
s1

11

s2
s3
s2

10

00

01

11

10

s3
s3
s4
s4

Outpu
t
1
0
0
0

0
0
0
0

0
0
0

0
0
0
0

8.

Describe the basic facilities expected to be provided by a timer


subsystem. For a microcontroller of your choice discuss how it
supports the basics and what other facilities it provides.

9.

Discuss the use of volatile and static in embedded C code.

A variable should be declared volatile whenever its value could change unexpectedly. In
practice, only three types of variables could change:
1. Memory-mapped peripheral registers 2. Global variables modified by an interrupt
service routine 3. Global variables accessed by multiple tasks within a multi-threaded
application

2.

Static variables are given space in memory at some fixed location within the
program. They exist when the program starts to execute and continue to
exist throughout the program's entire lifetime. The value of a static variable
is faithfully maintained until we change it deliberately (or remove power
from the memory).
10.

The CLIC2.h file is used in the lab. Determine how to express the
addresses of the peripheral subsystems in C. NOTE: IAR provides a
simple interface device address definition.

11.

MISRA C is playing an important role in the development of


embedded systems. Discuss that role and its basis.

Help develop safer code.


MISRA C is a set of software development guidelines for the C programming language
Its aims are to facilitate code safety, portability and reliability in the context of embedded
systems

12.

There is a lot of publicity about the concepts of "Hardware/


Software Codesign". Describe what is meant by this term and what
are the implications for the design of embedded systems.

13.

Assembly language is still used for the design of embedded


systems. Describe which system aspects are generally encoded
this way.

Assembly language is used primarily for direct hardware manipulation, access to


specialized processor instructions, or to address critical performance issues.
Typical uses are device drivers, low-level embedded systems, and real-time
systems.

Second Set:
1. Describe the Analogue to Digital Converter on a microcontroller which
you have used and what advantages there are to averaging results in
multiple result registers when only one input is being monitored.
Why is the default result alignment for 10 bit conversions in the
68HC12 left justified in a 16bit unsigned integer?
2. The use of lookup tables for standard functions like square root is
generally based on normalised values. Why? In particular discuss the
differences between the possible values of an 8bit integer square root
and an 8bit normalised lookup table for square roots.

3. Describe the various approaches to interrupt service routine entry and


how these relate to the areas of application of the microprocessor.
Indicate the advantages and disadvantages of the various methods.
4. Describe the process and use of double and single level solutions to the
finite state software process.
5. Describe the use of series solutions to the generation of trigonometric
quantities. In particular discuss the generation of an integer solution to
the sine and cosine values.
6. Short floating point routines for trig functions can be written rather
than use the built in functions provided by the C libraries. Why would
you use them?
7. Scaling is an important part of computing in integer only processor
environments. Describe what it is and how it is used. What would be
the value of developing an unsigned integer multiply/divide function in
this context?
8. Pulse width modulation is an important technique for generation of
analogue outputs from microcontrollers. How would you convert
such an output to an actual analogue output?
Describe 2 distinct methods of generating PWM waveforms. Write code
(or pseudo-code) for one of these methods.
9. The 68HC12 has a built in pwm system. Describe how to configure this
system to provide a mark:space ratio of 2:3.
10. Discuss the problems of contact bounce in switches and how this may
be overcome by software. Indicate some of the difficulties which may
be implicit in implementation.
11. Under what conditions can you use a shift right operation to replace a
divide by 2. Why is there a potential problem?
Third Set
1.

Microcontroller manufacturers often have several families on the


market at the same time. Give reasons why they would do this.

2.

MISRA C provides guidelines for many aspects of C in embedded


systems. Describe the recommendations for the standard types such
as int, long etc.

3.

It is often useful to use extreme values from an A/D converter to


indicate out of range information. What is the implication of this
when doing data conversion?

4.

Describe how the keyboard interface is implemented in the CLIC2


system.

5.

The 68HC12 responds to a number of exceptions indicate how the


system responds to an IRQ and to a COP timeout.

6.

Why do companies developing embedded systems need a


Firmware Development Standard. Indicate three topics expected
to be covered.

7.

What is the definition of defensive programming. Is it a good


thing during system development and if so why?

8.

In C parameters are passed to functions with the right hand


parameter placed on the stack first. Give the reason for this and
indicate whether this facility is considered good programming in
the context of new code for embedded systems.

9.

PWM waveforms can be specified using a number of terms. Explain


each of the following in the context of a PWM waveform. Mark to
Space Ratio, Pulse width, period, left aligned, centre aligned. Some
systems do not allow the PWM waveform to take the extreme values
of Full on or full off. Explain the reasoning behind this and indicate
for an 8 bit system the maximum and minimum mark space ratios
allowed.

10 A meteorological measuring system is being developed and the


following characteristics of the pressure sensor subsystem have been
established. The pressure sensor is linear and is adjusted to produce a
signal representing the range 600 hectaPascals to 1100 hectaPascals over
a voltage range of 4.9 millivolts to 4.9951 volts.
This signal is applied to a 10bit AD converter operating over the range of
0 to 5volts. The value obtained from the AD converter will be placed in a
variable named hecP
a) What would be the expected meaning of a value of 0x0000 made by the
AD converter?
b) What would be the expected meaning of a value of 0x03FF made by the
AD converter?
c) How many steps of the AD converter would be available for representing
the pressure value? Show how you obtain the value.
d) Can this system accurately represent the output value in hectaPascals
monotonically? (Without jumps in value). Explain your answer.
e) The pressure sensor is affected by temperature which is available as a
value (degK) coded at 2 bits per degree Kelvin.i.e. 273 degrees K or 0
degrees C is 0x0222. The AD converter variable for temperature is
called degK.
The AD value for pressure indicates high by 1/8 of the Kelvin
temperature.

f) Give an expression for the pressure in hectaPascals in this system. This


may be obtained by one expression or by writing a series of expressions
which will produce the answer.
g) How might fixed point arithmetic be used in such a system?
ANSI C does not specify how interrupt routines should be handled but
provides a #pragma facility to extend the language as required but this is not
always used by compilers. Indicate how the IAR compiler meets the needs for
interrupt service.
10.

11. Some C compilers

for the HC12 use functions such as __enable_interrupt()


while others may use CLI() etc. From where has the second function name
been derived. Discuss the portability of these functions to other processor
families.
12. The declarations

shown below provide the basis for access to the keypad in


the CLIC2 system. Explain how the expression for Keypad works and all
implications for its use in a program.
#define
#define

Extport (0x4000) // Peripheral Base Address


CLIC2Offset (0) // Local peripheral offset - Jumper 0

#define

Keypad

( * (volatile ui_8 *) (Extport + CLIC2Offset + 0x04))

Vous aimerez peut-être aussi