PES SCHOOL OF ENGINEERING

sanatoriumdrumΗλεκτρονική - Συσκευές

25 Νοε 2013 (πριν από 3 χρόνια και 4 μήνες)

64 εμφανίσεις

PES School of Engineering, Bangalore


I A Test
-

Solution manual



PES SCHOOL OF ENGINEERING

(Hosur Road, 1KM before Electronic City, Bangalore
-
560100)


INTERNAL TEST


I
SOLUTION MANUAL


Subject & Code
: Embedded Computing Systems & 06CS74

Time:

90 Mins

Name of faculty
: Mrs. Pramodini.D.V






1.

(a) Define an embedded system. Differentiate between general purpose micro
p
rocessor,
Microcontroller and
Digital Signal Processor (DSP)?




(5 Marks)



An embedded system is a way of working, organizing or performing one or many tasks
a
ccording to a fixed set of rules, program or plan.

It is a
lso an arrangement in which all unit
s
assemble and work together according to a program or plan.

An embedded system is a system that has software embedded into computer
-
hardware, which
makes a system dedicated for an application (s) or specific part of an application or product or
part of a

larger system.

General Purpose Processor (GPP) microp
rocessor can be embedded on a V
L
S
I chip.


When intensive computations are required, caches are used and pipeline and superscalar
operations are needed and large embedded software is to be located in the

external memory cores
and chips. No engineering cost for design of the processor.


For example, Intel 80x86, Sparc, or Motorola 68HCxxx

Embedding a Microcontroller core

is

used with internal memory, devices and
p
eripherals and
when embedded software is to be located in
i
nternal ROM or
f
lash.
No engineering cost for
design of the proces
sor with internal memory, devices and peripherals
. Microcontrollers are
68HC11xx, HC12xx,
HC16xx8051, 80251 PIC 16F84 or 16C76, 16F876 and
PIC18Microcontroller
.
Enhancements of ARM9/ARM7 ARM Cortex M3 from Philips, Samsung
and ST Microelectronics

are avail
able.

Embedding a DSP Core

is used with signal processing
-
related instructions for filters, images,
audio and video and CODEC operations.
No engineering cost for design of the
signal
processor
.

DSP cores available are
TMS320Cxx, OMAP1Tiger SHARC 5600xx PN
X 1300, 15002

DSP for mobile phones, for example, OMAP of Texas Instruments use the effective power
dissipation methods of dynamic switching both of power supply voltage and operating frequency
of the CPU core.

Filtering, noise cancellation, echo eliminati
on, compression and encryption
an
be done in DSP core.


(b) What are the important considerations when selecting a processor?

(
02

Marks)

1.

Processor Instructions in the Instruction set

2.

Processor ability to solve the complex algorithms used in meeting the dea
dlines for their
processing.

3.

Maximum bits in operand (8 or 16 or 32) in a single arithmetic or logical operation.

4.

Internal and External bus
-
widths in the data
-
path

5.

Clock frequency in MHz and processing speed


PES School of Engineering, Bangalore


I A Test
-

Solution manual



Million Instructions Per Second (
MIPS
) or



Mill
ion Floating Point Instructions Per Second (
MFLOPS
) or



Dhrystone

an alternate metric for measuring processing performance.


(c) What are characteristics and constraints in an embedded system?

(03

Marks)


Sophisticated Embedded System Characteristics

are
:




Dedicated
f
unctions



Dedicated complex algorithms



Dedicated (GUIs) and other user interfaces for the application



Real time operations

Defines the ways in which the system works, reacts to the events
and interrupts, schedules the system functioning in re
al time and executes by following a
plan to control the latencies and to meet the deadlines. [Latency

Waiting interval
between the instance at which a need to run the codes arises for task (or interrupt service
routine) following an event and instance of
start executing the codes]



Multi
-
rate operations

Different operations may take place at distinct rates. For example,
the audio, video, network data or stream and events have the different rates and time
constraints to finish associated processes.


Constrai
nts of an Embedded System Design



Available system
-
memory



Available processor speed



Limited power dissipation when running the system continuously in cycles of the system
start, wait for event, wake
-
up and run, sleep and stop.


System design constraints




Performance



power



size



non
-
recurring design cost, and



Manufacturing

costs.















PES School of Engineering, Bangalore


I A Test
-

Solution manual

2.

What are the functional circuits in a Microcontroller chip? Explain them in detail.

(10 Marks)



(a)
Application Specific Instruction
-
Set Processor (ASIP)

(b)DSP o
r

(c)Media processor or

(d)IO processor or

(e)Network processor or

(f)A domain specific processor


3.

Define design metrics in an embedded system. List out and explain the different
competing design metrics.







(
10 Marks)




Design Metrics
are:



Power Dis
sipation



Performance



Process Deadlines

PES School of Engineering, Bangalore


I A Test
-

Solution manual



User Interfaces



Size



Engineering cost



Manufacturing cost



Flexibility



Prototype development Time



Time
-
to
-
market System and



User safety Maintenance


4.

Describe: i) UART


ii) RS232C iii) SDIO.





(10 Marks)

i)

UART








Idle State
:
A line─non
-
return to zero (NRZ) state. It means in idle state the logic state is 1 at the
serial line.

Byte start signaling flag bit
:
Compulsory
-
Start bit 1 to 0 transition, which receiver detect at the
middle of bit interval T [T−1= prefixed baud rate.]

Data bits
:
After start bit;
8
bits transmitted on TxDline and received on RxDline during period of
8 T (receiver detect at the
middle of each bit interval T).

In earlier circuits, the number of data
bits could also be set 5, 6 or 7 in place of 8Full or half

duplex
.

Address bits for destination
: Not provided, c
an be indirectly sent by setting a programmable
bit P
= 0 or 1 as per receivers
processing circuit or programming
.

Control or error detect bit
: One bit
-
P
-
bit optional, present in 11T mode,
P bit can be

used to
d
etect parity error
,
P
-
bit can be used to interpret the preceding byte not as data but as address or
command or parity as per the processing circ
uit for serial bits at receiver.


Byte end flag bit
:
Compulsory
-
Minimum one stop bit at Logic 1 [In e
arlier circuits, the number
of stop bits could also be set 1½or 2 in place of 1]

PES School of Engineering, Bangalore


I A Test
-

Solution manual

Disconnected State
: Zero (Z) state, Disconnected
s
erial line logic state is 0


ii)

RS232
C


For asynchro
nous communication between two data serial links on a network ─Between a data
communication equipment and data terminal equipment

•RS232C ─a standard protocol used in IBM PC COM ports, keyboard, computer
-
mice and

•For the data serial link network in UART
bit format
.

DTE and DCE



RS232C communication is between a DTE (computer) COM (communication) port and a
DCE (modem) port.



DTE stands for 'Data Terminal Equipment'.



DCE stands for 'Data Communication Equipment'.



RS232C is a standard for interfacing signals
between DCE and DTE.

Sequence of serial bits in an RS232C Byte
:

ata Bits─RxDand TxDlines
, a
s per UART standard formats on RxD

and TxD

lines

Voltage Levels

at TxD and RxD lines in RS232C:

•logic 1─Receiver end voltage level from

3 V to

25 V

•logic 0 ─Receiver end voltage levelfrom + 3 V to + 25 V

•logic 1─Transmitter
end voltage level from

5 V to

15 V

•logic 0 ─Transmitter end voltage levelfrom + 5 V to + 15 V

•opposite to that of TTL logic

•wider noise margin to enable long distance communication

R
S232C Connector:



9 pin and 25
-
pin in case of IBM COM port



Can be sim
pler

Handshaking signals on 9 Pin connector

are
RI, DCD, DSR, DTR,
RTS,
CTS, DTR

Voltage levels at Handshaking signals

are
TTL standard

9
-
pin Connector Handshaking

signals



RI to indicate ring available at data communication equipment receiving end



When a mo
dem connects, modem sends data carrier detectDCD signal at an instance t0.



Communicates data set ready(DSR) signal at an instance t1 when it receives the bytes on
the line.



Receiving end responds at an instance t2 by data terminal ready (DTR) signal.

COM p
ort and Modem Handshaking signalssignals

After DTR,
request to send

(RTS) signal is sent at an instance t3
.

Receiving end responds by
clear to send
(CTS) signal at an instance t4. After the response CTS,
the data bits are transmitted by modem from an instan
ce t5 to the receiver terminal.
T
wo sets of
bytes sent in asynchronous mode, the handshaking signals RTS and CTS can again be
exchanged. This explains why the bytes do not remain synchronized during asynchronous
transmission.


PES School of Engineering, Bangalore


I A Test
-

Solution manual



RS232C port in a computer
RS232C computer



Used up to 9600 baud per s asynchronous serial transmission rate with UART mode
communication.



Generally baud rates set at 300, 600, 1200, 4800 and 9600.



When transmitting upto0.25 m or 1 m on cable (untwisted) the maximum baud rate c
an
b
e 115.2 k or 38.4k baud per/
s,

respectively.


(iii)
SDIO

Secure Digital Association (SD)


•SD−an association of over 700 companies started from 3 companies in 1999

•Created a new flash memory card format, called SD format for IOs

•SDIO card has become popular feature in handheld mobile devices, PDAs, digital
cameras and embedded
systems.

SDIO C
ard:




SD card size−just 0.14 cm ×2.4 cm ×3.2 cm.



Allowed to stick out of the handheld device open slot, which can be at the top in order to
facilitate insertion of the SD card.

SDIO card host controller
:

A processing element functions used SDIO host cont
roller to process the IOs.

Controller may include SPI controller to support SPI mode for the IOsand also supports the
needed protocol functionality internally

SD card IO functionalities
:


•SDIO (Secure Digital Input Output) card
.


•Can have upto eight log
ical functions.


•provides additional memory storage in SD format

PES School of Engineering, Bangalore


I A Test
-

Solution manual

•Functions include IOswith several protocols, for example, IrDA adapter, Ethernet adapter, GPS
or WiFi, Bluetooth, WLAN, digital camera, barcode or RFID code readers

SCI Control bits Program
ming
:


For single byte transactions, SDIO card may include a UART 16550 mode communication over
the SD

SDIO 9 pins:



SDIO has 9 pins.



Total 6 pins are for SPI and SD

SDIO Functions and Card SDIO Card

SDIO host controller9
-
pin Connector1. SDIO (Secure
Digit
al Input Output) up to eight logical functions

during communication2. CRC checks on the
transferred data and 3.
It s
pecifies capabilities for additional tries by retransmission on error4.
Data communication 48
-
bit command/ request format for 48
-
bit control

register/ status register
bits5. Supports data transfer in block of bytes6.
It is p
rogrammable or SPI (20 Mbps) or 1
-
bit SD
(25 Mbps) or 4
-
bit SD (100 Mbps by 4 serial bits in parallel) communication
.


5.

What do you mean by System on Chip (SoC)? With a neat

block diagram, explain an
embedded SoC in a mobile phone.






(
10 Marks)

Mobile phone SoC(System
-
on
-
Chip)
:


Hardware units
:



Microcontroller or ASIP (Application Specific Instruction Set Processor) to process
encoding and deciphering and another ASIP for
voice compression.



ASIC for the actions of dialing, modulating, demodulating, interfacing the key board
interfacing and multiple line LCD matrix displays, stores data input and recalls data from
memory.



DSP core, CCDSP, DSP, video, voice and Pixel Process
ors



Flash, EEPROMsand SRAMs,



Peripheral circuits, ADC, DAC and Interrupt controller



Direct Memory Access controller



LCD controller



Battery

M
obile phone software development tools are as follows:



RTOS

Windows Mobile, Palm OS, or Symbian, BREW



Java 2 Micro
Edition (J2ME) along with KVM as a Java Virtual Machine



(Java Wireless toolkit with JDK (Java Development kit)

Mo
bile browser for access the Web:



Down
-
loader for Java games, ring
-
tones, games, wall papers



Simple camera with Bluetooth
synchronization
, IrDA

and WAP connections support
.




6.

Compare

the parallel ports interfaces for the keypad, stepper motor and touch screen.











(
10 Marks)

Keypad:




Physical layout can be 3 ×5 plus 1 or 16 in a one row



16 keys assumed to be divided in four columns and fou
r rowsfor circuit design

PES School of Engineering, Bangalore


I A Test
-

Solution manual

o

One column connects to one poll line

o

One key in a row connects to one sense



16
-
keys keypad and Four Menu keys



Mobile smart phone has 16 keys and four menu select up, down, left, right keys



A processing element−a keypad controllin
g
-
device (controller)



A set of switches or keypad of 16 keys andfour
menu menu
-
select

keys

Assume that idle state logic state = 1.



Four bits of an 8 bit input port
A
(A4
-
A7) for four menu select keys.



16 keys −arranged in four rows and four columns.



Othe
r four bits of
A

(A0
-
A3)



input from four common ends of four rows.



Four bits of output port
C

(C0
-
C3)



output to four common ends of four columns.

f
ur
co


P
rocessing element in the device:



Activates for polling output from port
C
ten times each secon
d



Sends C0
-
C3 = 0000 and after a wait it reads D0
-
D7 and A4
-
A7



Processes the bounces when a key is pressed. This takes care of bouncing effects.

PES School of Engineering, Bangalore


I A Test
-

Solution manual



p
rocessing element computes the code of the pressed key and generates a status signal
when a key is found pres
sed. From the bit pattern found at A0
-
A3, the processing
element computes the 7
-
bit ASCII code of the pressed key at that instance and send
output for the code through D0
-
D6. It also outputs D7 = 1 if a key is found pressed else
D7 = 0.

m

Parallel Port

In
terfacing with Stepper Motor:



One step angle when its four coils are given the currents in a specific sequence and that
sequence is altered.



Assume that currents at an instance equal +
i
, 0, 0, 0 in four coils X, X’, Y, Y’. The motor
rotates by one step
when the currents change to 0, + i, 0, 0.

Forward motion Sequences at the intervals of
T:

Sequences at the intervals of
T
are changed as follows: 1000, 0100, 0010, 0001, 1000, 0100, ….
[The bits in the nibble (set of 4 bits) rotate by right shift.]

Revers
e motion Sequences at the intervals of
T:



Sequences are changed to rotate the motor in reverse direction



0001, 00010, 0100, 1000, 0001, 0010, ….[The bits in the n
ibble (set of 4 bits) rotate by
left shift.]

when

its four

Half Angle Change
:

Coils are given
the currents in the sequences of 1100, 0110, 0011, 1001,
1100, 0110, …. or 0011, 0110, 1100, 1001, 0011, 0110, ….



The motor rotates (
n
/2) steps in interval = (
n
.T/2). T is the period of clock pulses, which
drive the motor by change of coil currents to nex
t sequence.

Stepper motor
driver
is

a processing elemen
t.
is given two out



Driver is given two outputs from the port─clock pulsesand rotating direction bit
r
. For example,
if r = 1, the motor rotates clockwise and 0 then anti
-
clockwise. The motor rotates
as long as clock
pulses are given at the output pin.


putom

the

Touch screen
:





An input device cum LCD display device.



Interfaced for the output through output port
O
to an LCD display device controller.

PES School of Engineering, Bangalore


I A Test
-

Solution manual



Interfaced for an additional input port
I
for a

byte



The byte corresponds to the address of touched position on display screen.



Touching at a position on the screen, there is a change in resistance or capacitance,



The change depends on touched position.



A touch can be by a finger or stylus.



The sty
lus about one
-
fifth thinner than a pencil and about half of the length of the pencil.

Sensing a touched Position:



The resistance or capacitance ─a part of a bridge circuit,



The circuit generates analog voltage as per the touched screen position.



An 8
-
bi
t ADC is given input from a bridge circuit and the 8
-
bit ADC output connects to
an 8
-
bit input port
I
.
s

Parallel port inputs, outputs and control signals to controller (a processing
element as single purpose processor)



Three control signals IO PC0
-
PC2 a
s inputs to the LCD controller



PB0 to PB7 8 input/output bits for parallel set of 8 IO bits for commands and data and for
status bits



Control signal ADC start at PC3 to sense screen (x, y) touched position data using PA0
-
PA7


of


a st


Control Bits:




Cont
roller is sent control words and data words for initialization and programming by
setting the PB0
-
PB7, PC0 and PC1 outputs for each word to controller.



Touch screen ADC is sent control bit PC3 for start of ADC


7.

Explain
:


i) Watchdog Timer

o

A timing device
such that it is set for a preset time interval and an event must
occur during that interval else the device will generate the timeout signal on
failure to get that event in the watched time interval.

PES School of Engineering, Bangalore


I A Test
-

Solution manual

o

On that event, the watchdog timer is disabled to disable

generation of timeout or
reset



Timeout may result in processor start a service routine or start from beginning



Assume that we anticipate that a set of tasks must finish in 100 ms interval.



The watchdog timer is disabled and stopped by the program instru
ction in case the tasks
finish within 100 ms interval.



In case task does not finish (not disabled by the program instruction), watchdog timer
generates interrupts after 100 ms and executes a routine, which is programmed to run
because there is failure of
finishing the task in anticipated interval.

Watchdog timer application
:


•An application in mobile phone is that display is off in case no GUI interaction takes place
within a watched time interval.

•The interval is usually set at 15 s, 20 s, 25 s, 30 s
in mobile phone.

•This saves power

Provisioning of watchdog timer



A software task can also be programmed as a watchdog timer



Microcontroller may also provide for a watchdog timer.


iii)

Software Timer.

o

A software, which executes and increases or decreases
a count
-
variable (count
value) on an interrupt from on a system timer output or from on a real
-
time clock
interrupt.

o

The software timer also generate interrupt on overflow of count
-
value or on
finishing value of the count

o

SWT is a timer based on the syst
em clock interrupts

o

The interrupt functions as a clock input to an SWT.

o

This input is common to all the SWTsthat are in the list of activated SWTs.

o

Any number of SWTscan be made active in a list.

o

Each SWT will set a status flag on its timeout (
count
-
val
ue
reaching 0).




PES School of Engineering, Bangalore


I A Test
-

Solution manual



Actions are analogous to that of a hardware timer. While there is physical limit (1,2 or 3 or 4) for
the number of hardware timers in a system, SWTscan be limited by the number of interrupt
vectors provided by the user.

•Certain proces
sors (microcontrollers) also defines the interrupt vector addresses of 2 or 4 SWTs




iii) Challenges in embedded system design.

Amount and type of hardware needed
:



Optimizing themicroprocessors, ASIPsand single purpose processors in the system



Optimizi
ng according to the performance, power dissipation, cost and other design
metrics the system



Optimizing hardware (memory RAM, ROM or internal and external flash or secondary
memory in the system, peripherals and devices internal and external to the system
, ports
and buses in the system and power source or battery in the system).

Taking
into account the design metrics:

Design metrics examples

power dissipation, physical size, number of gates and engineering,
prototype development and manufacturing costs.

Optimizing the Power Dissipation
:



Clock Rate Reduction



Operating Voltage Reduction



Wait, Stop and Cache Disable Instructions

Clever real
-
time programming. It is by using
of 'Wait' and 'Stop' instructions and disabling or controlling certain units when not

needed
is one method of saving power during program execution

Disable use of certain structural units of the processor to reduce power dissipation



Caches

when not necessary and



Keep in disconnected state those structure units that are not needed during

a particular
software
-
portion execution, for example, display screen, timers or IO units



Control of power requirement, for example, by screen auto
-
brightness control

Process Deadlines
:

Meeting the deadline of all processes in the system while keeping th
e memory, power
dissipation, processor clock rate and cost at minimum is a challenge
.


Flexibility and Upgradeability
:
Ability to offer the different versions of a
product for marketing and offering the product in advanced versions later
on.

Reliability:
Designing reliable product by appropriate design and thorough testing, verification
and validation is a challenge.