Donald Wyatt Embedded Systems IT 441 Midterm Exam Monday, October 28, 2002 Multiple Choice. 3 points each. Select the single best answer for each question.

sanatoriumdrumElectronics - Devices

Nov 25, 2013 (3 years and 6 months ago)

87 views

Donald Wyatt

Embedded Systems

IT 441 Midterm Exam

Monday, October 28, 2002



Multiple Choice. 3 points each. Select the single best answer for each question.


1. The standard high and low priority interrupt vectors in the PIC 18F452 are spaced
10h bytes a
part. This is because.


A.

The 10h byte space allows for a short routine starting at the vector address. A
longer routine could be called from the vector address.

B.

Interrupt service routines are written at the vector address and cannot be more
than 10h bytes

long.

C.

The interrupt vector uses three bytes to specify the address of the routine. The
vectors are arbitrarily spaced on 10h memory boundaries.

D.

The address of an interrupt routine requires 10h bytes to specify.


2. A major benefit of the Harvard Archi
tecture is

A.

Single
-
word instructions execute more quickly than multi
-
word instructions

B.

Code and data share memory and increase hardware efficiency

C.

Interrupt latency time is very predictable because instructions execute in a
single cycle

D.

Code and data can

be loaded into the CPU simultaneously on separate
buses


3. What percentage of embedded systems are built with no or custom
-
built operating
systems?


A.

0%

B.

1
-
5%


C.

6
-
15%

D.

16
-
30%

E.

31% or more


4. The “rule of ten” means that

A.

it takes ten times longer to develo
p code in assembler than in high
-
level
languages such as C.

B.

if it costs $1 (labor) to fix a bug while coding it could easily cost $1000 to fix
that same bug after the product has shipped

C.

you should have at least one comment for every ten lines of source co
de
.

D.

the power of computing systems increases by a factor of ten every two years.

E.

the power of computing systems increases by a factor of two every 10
months.


5. What is the difference between a simulator and an emulator in embedded system
development

A.

A
simulator runs in the target system while an emulator runs in the
development system

B.

A emulator runs in the target system while an simulator runs in the
development system

C.

A simulator is intended for assembly language testing while an emulator is
intended
for C
-
code testing.

D.

There is no practical difference. Different companies name these similar tools
with different names



6. A “watch
-
dog timer” enables the implementation of real
-
time systems by providing

A.

a timer used by dog breeders to train police dog
s

B.

a regularly timed interrupt for starting real
-
time tasks

C.

a very flexible interrupt which is set for individual, critical real
-
time tasks.

D.

a time
-
of
-
day alarm to synchronize all tasks at a fixed time.

E.

a mechanism for the safe shut
-
down of a system if any

task takes too long to
complete.

F.

a timer triggered by an external interrupt or signal coming into the system.



7. What is the “volatile” keyword is used for in C programming of embedded systems?

A.

To indicate that the memory being used is RAM rather than
a permanent
medium such as ROM or flash.

B.

To indicate that the program can be modified while it is running.

C.

To indicate that the variable designated by volatile could be changed by an
input not under program control.

D.

To designate an interrupt routine activa
ted by a hardware signal



8. A simple DC motor is to be controlled by an embedded system using a pulse width
modulation system. The motor speed will be the highest when

A.

The off period of the pulse is at a maximum compared to the on period.

B.

The on period
of the pulse is at a maximum compared to the off period.

C.

The frequency of the pulse train is highest.

D.

The frequency of the pulse train is lowest.



9. A cross
-
compiler is used to

A.

Convert high
-
level language code to assembler code

B.

Convert one high
-
level l
anguage to a different high
-
level language

C.

Compile code for a target CPU that is different from the development CPU

D.

Combine both high
-
level language and assembler into a single module


Section B. Short questions and problems.


1. The addresses of the PIC
18F452 that the following interrupt types (vectors) use are:
-

(2 points each)


a. Power
-
on Reset:


0000h


b. High
Priority Interrupt:

000008h


c. Low
Priority Interrupt:

000018h


d.

Brown
-
out Reset:


0000h


2 (2). What are the two most signific
ant parameters to be aware of when evaluating
Analog to digital converters?


a. Resolution




b. Sampling Frequency


Others include

* Scaling

*
Conversion Time

*
Digitizing errors

* Sample and hold



3. The features that define a RISC system are:
-

(Sel
ect all correct statements. 2 points
each correct,
-
1 each incorrect answer)

A.

A wide range of assembly instructions are available including floating point
arithmetic.

B.

The data memory and program memory are connected to the CPU using
different buses.

C.

Instruc
tions execute in one instruction cycle

D.

Any RISC system is faster than any CISC system

E.

The data word size is the same as the instruction word size.

F.

“Multiply” instructions are not permitted on RISC systems

G.

RISC systems can only be used in embedded systems,

they cannot be used
in desktop systems.

H.

The system has a relatively small set of instructions which can be used
to build up more complex instructions (subroutines). These more
complex routines will take several cycles to execute.

I.

RISC systems always have
only one accumulator and do not have other CPU
registers for indexing, arithmetic, stack etc.

J.

The time elapsed before an interrupt is serviced (interrupt latency) can
be very accurately predicted.


4.(4) Assume that FSR1H is loaded with 0x00 and FSR1L is
loaded with 0x34. What
will the following instruction do? Use SFR names and addresses as appropriate.



CLRF POSTINC1


Clears INDF1 and increments the pointer.





5. A Digital to Analog converter is to be built using an R/2R ladder, op
-
amp and 10
-
bit
ana
logue switch. The output (analog) voltage range is
-
5V to +5V


a. (4) What is the smallest voltage increment that this device is capable of? Show
calculations.


Vmin = 1/1024 * Vref


Vmin = 1/1024 * 10 = 0.009765625 V
resolution



b. (4) What is the bene
fit of an R/2R ladder design over a series of resistors with values
of

R, 2R, 4R, ... 2
n

R?


It would be difficult to get an inline resistor package that would allow for this.

Furthermore the calculations would be more complex.

Odd resistor values.



c. (
3) The software for this D/A system will output

A.

10 bit values proportional to the magnitude of the desired voltage

B.

10 bit values proportional to the frequency of the desired voltage

C.

Bit patterns indicating the next rotary position of the motor to be contro
lled

D.

10 single bits in sequence for each new motor position

E.

10 single bits in sequence for each new motor speed




6. (3)
Real
-
time embedded (RTE) system testing has special challenges compared to
testing of normal, desk
-
top
-
computer based software. All so
ftware must be checked for
syntax and algorithmic correctness. In addition RTE software must also consider other
important factors such as:
-





(i)How much time it takes to complete a complex task


(ii)How do you monitor your system, indicator light
s output. How do you use I/O
that you have available


(iii)Power consumption, how much power are you using to perform a task.



7. (8) Calculate the necessary values to configure a PIC18F452 serial port. The system
oscillator is 30 MHz. The desired ba
udrate is 38.4 Kbps. Calculate the necessary
SPBRG and BRGH values for the lowest error. State the error as a percentage.


BRGH low

Desired baud rate = Fosc / (64 ( x + 1))


X = (Fosc / Desired Baud Rate) / 64)


1


X = (30000000 / 38400) / 64


1

X = 11.
20703125


Calculated Baud rate = 30000000 / (64 (11 + 1))




= 39062.5

(39062.5


38400) / 38400 = 0.017252604166666666666666666666667


With BRGH high


X = [(fosc / desired baud rate) / 16 ]


1


X = ( 30000000 / 38400 ) / 16


1


X = 47.828125


Calculated

Baud rate = 30000000 / (16 ( 48 + 1))




= 38265.306122448979591836734693878

(38265.306122448979591836734693878


38400 ) / 38400 =
-


0.0035076530612244897959183673469388


BRGH high with

SPBRG = 48

Error of 0.35%




8. (3) The PIC18Cxxx has an “Access
Bank” with general Purpose Registers (GPR) and
Special Function Registers (SFR). Where in the memory banks is the Access bank
located?



Technically the access bank is located in the lower half of bank zero 000h


07Fh
and the upper half of bank 15 F80h


FFFh.






9. (6) Assume you wish to develop a system involving a few digital I/O using an PIC
18F452 chip. What components and development tools do you need? Do not assume
you have a lab full of stuff available. Assume you are in a new start
-
up company

with
electric power and a standard PC desktop machine and normal office supplies.
Assume you have a stock of 18F452 chips. List the most important things you would
need to design and bring up a working microcontroller.




Computer Related

i.

Programmer


A un
it that connects to the computer and
programs the Flash chip

ii.

MPLAB development environment.

iii.

Documentation, the data sheet would be needed.

iv.

An emulator would be great but is not required.



Physical

i.

A prototype board system. Some system where you can either

wirewrap the embedded device to the appropriate inputs and
outputs, or use a breadboard.

ii.

Powersupply for the prototype board.

iii.

Switches and other devices you would like to interface with
the chip.



Test Equipment

i.

Meter

ii.

Logic probe.

iii.

Oscilliscope.

iv.

Logic analy
zer would be nice.













10.

Background: You have been hired as the chief system designer for a new start
-
up
company. The company is designing and building embedded systems for device that
will be built into a family
-
room table and be used with a to
uch
-
screen for playing board
games (electronic monopoly, chess, checkers etc.), providing news, traffic and weather
updates, allow ordering snack food (pizza etc.) and videos over the internet (to be
played on a different TV/VCR system), and use sensors to

monitor whether people are
in the room, outside weather conditions, control inside heating and cooling.


The unit acts as an independent battery
-
powered system and uses wireless Internet
connections so the table can be easily moved.



A. (4) Would you u
se an operating system for this application? (zero points)
Justify

your
choice (all the points).


Yes


There is absolutely no reason to go re
-
inventing the wheel here. If there is an
imbedded operating system such as uClinux that you can use and it alread
y has
the abilility to connect to the internet then there is no reason to go and make one
of your own.


Further, you want your system to be user friendly, most operating systems that
are built up on embedded systems are very limited an not very user fri
endly.


It seems like you will be doing a lot of development and testing and the benefits
that an operating system will give you far outweigh the drawbacks.






B. (2) You have a choice of a fast clock (1.8 GHz MHz) or a slow one (100 MHz). You
calcul
ate the load on the system and estimate that either one has sufficient processing
power for the intended applications. Would you choose the fast or the slow one? (zero
points)
Justify

your choice in just a few words. (all the points).


100 Mhz


100 Mhz = l
ess power consumption


-

This is battery powered so we have to be concerned with that.