Professional Documents
Culture Documents
Embedded System
Embedded System
REPORT OF
6-MONTHS INDUSTRIAL TRAINNING
ON
EMBEDDED SYSTEMS
Submitted By : Submitted To :
Ramandeep Singh Mr. Harsimran Singh
40204020 HOD
c
ACKNOWLEDGEMENT
Ramandeep Singh
40204020
¬REFACE
To provide them to study with the latest trends those have been
established and edged a well as the one¶s that are being developed in
the country. Moreover to make students feel sure that whatever they are
learning in this training period would certainly help them for the future
courses of action and help them to develop their potential and technical
skills.
× Micro-controller 805Î
× Introduction to Kiel.
× Commands used.
× Introduction to ISP.
6) Some Basic programs using assembly Î2 -Î30
is a well established institute in Chandigarh with an experience of
fifteen years and has gained recognition as training organization of high repute
offering international quality education in the field of Electronics &
Communication technology. The centre boasts of a professional faculty which
satisfies the needs & expectancy of today's knowledge hungry students.
An elect nic component i any indi i i le elect onic building block packaged
in a di crete form wit two or more connecting leads or metallic pads.
Components are intended to be connected toget er, usually by soldering to a
printed circuit board, to create an electronic circuit wit a particular function
(for example an amplifier, radio recei er, or oscillator). Components may be
packaged singly (resistor, capacitor, transistor, diode etc.) or in more or less
complex groups as integrated circuits (operational amplifier, resistor array,
logic gate etc). Acti e components are sometimes called devices rat er t an
components.
where
R is the resistance of the object, usually measured in ohms, equivalent to
J.s/C
Resistors come in many shapes and sizes, and depending on their size and
construction technology, they can dissipate differing amounts of power (the
amount of power dissipated in a resistor can be calculated using the equation
P=I 2 R, where I is the current flowing through the resistor and R is the
resistance). Typically, resistors used in digital systems encounter relatively low
voltages and currents, and therefore, they can be relatively small. The Digilab
resistors are rated to dissipate 250mW of power, or 1/4 Watt. Resistors that can
dissipate more than 1/4 Watt are physically larger. For example, power
resistors that can dissipate several Watts or more can be cigar-sized or even
larger. For small resistors, resistor values are "encoded" as a series of coloured
bands on the resistor body.
To determine the value of a small resistor (i.e., 1/8 Watt or 1/4 Watt), first
locate the tolerance band on one end of the resistor - it will typically be either
gold (59% tolerance) or silver (10% tolerance). The colour band at the other
end of the resistor is band1. Use the table below to find the two-digit number
associated with the colors of bands 1 and 2. The band nearest the tolerance
band is the multiplier (or exponent) band - the digits associated with the first
two colour bands are multiplied by 10 raised to the power indicated by the
colour of the multiplier band. The following table associates band colors to
digits and multiplier factors. Simply multiply the two-digit value by the
multiplier, and you¶ve got the resistor value.
Resistors are manufactured with many body colors, with tan or light brown
being the most typical. The only significant resistor body colors are white and
blue; these colors signify a non-flammable or fusible resistor. Such resistors are
used in circuits where overheating might pose a safety risk. In circuit
schematics and in parts lists, resistor reference designators always begin with
an "R". You can see several rectangular white boxes with "R-" on the Digilab
board silk-screen. The schematic symbol for a resistor is shown above.
Resistors are non-polarised, so they can be placed in a PCB in any orientation.
For a wide variety of materials and conditions, the electrical resistance does not
depend on the amount of current flowing or the amount of applied voltage. V
can either be measured directly across the object or calculated from a
subtraction of voltages relative to a reference point. The former method is
simpler for a single object and is likely to be more accurate. There may also be
problems with the latter method if the voltage supply is AC and the two
measurements from the reference point are not in phase with each other.
S ri s circuits
A i i it i i it i i i t i i ,
t t l t t t . ti t t
i t . t t l i t f t i it i f i l
i t i t l ft i i i l i t :
i l t i t f i t i i : R = R1 + R + R + ...
A i i it i i t i .
Wit 1 V tt , V=IRt t t l ti t i it i :
I=V/R=1 / = . A. tt i t l
. A.
¬ p E IpI S
A ll l i it i i it i i t i t it t i
t t t , t i t il t t t .
t i ll l i it , it fl i l
ll l i i t t i .
lt i t i ll l i t .
t t l i t f t f i t i ll l i f i
t i l ft i t l , t t i t i l
ft t t l:
E i l t i t f i t i ll l: 1 / R = 1 / R1 + 1 / R + 1 /
R +...
A ll l i it i i t i .I t i t t
li t tt lit , t t i t
i t t i t . If t l ft t i t
:
Wit 1 V tt , V=IRt t t l ti t i it i : I = V / R
=1 / = A.
i i i l t l f i I = V / R. lt
i t i 1 V, :
IÎ Î0 / 8 Î.25 A
I2 Î0 / 8 Î.25 A
I3 Î0 / 4 2.5 A
Note that the currents add together to 5A, the total current.
A pa allel e i o ho -
If the resistors in parallel are identical, it can be very easy to work out
the equivalent resistance. In this case the equivalent resistance of N
identical resistors is the resistance of one resistor divided by N, the
number of resistors. So, two 40-ohm resistors in parallel are equivalent
to one 20-ohm resistor; five 50-ohm resistors in parallel are equivalent
to one Î0-ohm resistor, etc.
You have three resistors in parallel, with values 6 ohms, 9 ohms, and Î8
ohms. The smallest resistance is 6 ohms, so the equivalent resistance
must be between 2 ohms and 6 ohms (2 6 /3, where 3 is the number
of resistors).
Doing the calculation gives Î/6 Î/Î2 Î/Î8 6/Î8. Flipping this upside
down gives Î8/6 3 ohms, which is certainly between 2 and 6.
A '( is an electrical device that can store energy in the electric field
between a pair of closely-spaced conductors (called 'plates). When voltage is
applied to the capacitor, electric charges of equal magnitude, but opposite
polarity, build up on each plate.
A capacitor is a two-terminal device that can store electric energy in the form
of charged particles. You can think of a capacitor as a reservoir of charge that
takes time to fill or empty. The voltage across a capacitor is proportional to the
amount of charge it is storing - since it is not possible to instantaneously move
charge to or from a capacitor, it is not possible to instantaneously change the
voltage across a capacitor. It is this property that makes capacitors useful on the
Digilab board.
Capacitors are used on the Digilab board to keep the voltage supplies and some
signals stable regardless of circuit activity, and to store charge when inputs are
activated in order to slow their assertion times. Twenty-seven capacitors of
three different types and values are used on the Digilab board. The majority of
the capacitors (24 out of 27) are used to decouple Digilab's integrated circuits
from the power supply. These 24 bypass capacitors are placed on the board
very close to the Vdd pins of all chips, where they can supply the short-term
electrical current needs of the chips. Without such bypass capacitors, individual
chips could cause the Vdd supply across the entire Digilab board to dip below
5V during times of heavy current demand. Nearly every chip in every digital
system uses bypass capacitors. Bypass capacitor value can be determined if the
worst-case current requirements are known (by using the formula I = C dv/dt),
but more typically, capacitors in the range 0.01uF to 0.1uF are used without
regard to the actual current requirements. The Digilab board uses 0.047uF
bypass capacitors. The board also uses a bulk bypass capacitor (C27) to
provide charge storage for the entire circuit board - this large 47uF capacitor
can supply the individual bypass capacitors during times of exceptional need.
A capacitor can store electric energy when disconnected from its charging
circuit, so it can be used like a temporary battery. Capacitors are common used
in electronic devices to maintain power supply while batteries are being
changed. (This prevents loss of information in volatile memory.)
Capacitors are used in power supplies where they smooth the output of a full or
half wave rectifier. They can also be used in charge pump circuits as the energy
storage element in the generation of higher voltages than the input voltage,
Capacitors are connected in parallel with the power circuits of most electronic
devices and larger systems (such as factories) to shunt away and conceal
current fluctuations from the primary power source to provide a "clean" power
supply for signal or control circuits. Audio equipment, for example, uses
several capacitors in this way, to shunt away power line hum before it gets into
the signal circuitry. The capacitors act as a local reserve for the DC power
source, and bypass AC currents from the power supply. This is used in car
audio applications, when a stiffening capacitor compensates for the inductance
and resistance of the leads to the lead-acid car battery.
The total capacitance of the above circuit is:
1 1 1 1
§ § ...... §
1 2 3
Ceq = C1 + C2 + «.. + Cn
×
: Like electrolytic. Polarized. Better performance with higher
frequencies. High dielectric absorption. High leakage. Have much better
performance in low temperatures.
× Made from carbon aerogel, carbon nanotubes, or
highly porous electrode materials. Extremely high capacity. Can be used
in some applications instead of rechargeable batteries.
×
: - for example with a 555 timer IC controlling the charging and
discharging.
<
Ohm's law predicts the current in an (ideal) resistor (or other ohmic device) to
be applied voltage divided by resistance:
Where
X
One problem with the use of an ammeter is the need for the meter to be inserted
into the circuit and become part of it. Mistakenly placing the ammeter in
parallel with a circuit will blow the fuse, possibly damaging the meter and
causing injury. In AC circuits, an inductive coupling adapter converts the
magnetic field around a conductor into a small AC current that can be easily
read by a meter. See clamp meter. In a similar way, accurate DC non-contact
arnmeters have been constructed using Hall effect magnetic field sensors
For high-precision measurements the above types of meter are inadequate, This
is because the meter's reading is the sum of the resistance of the measuring
leads, the contact resistances and the resistance being measured. To reduce this
effect, a precision ohmmeter has four terminals, called Kelvin contacts. Two
terminals carry the current from the meter, while the other two allow the meter
to measure the voltage across the resistor. With this type of meter, any current
drop due to the resistance of the first pair of leads and their contact resistances
is ignored by the meter. This four terminal measurement technique is called
Kelvin sensing, after William Thomson, Lord Kelvin, who invented the Kelvin
bridge in 1861 to measure very low resistances.
Diodes are constructed from the same type of silicon as transistors, but they are
simpler devices that have only two terminals. Called the anode and cathode, the
two ends of the diode are constructed of positively doped silicon (the anode)
joined directly to negatively doped silicon (the cathode). This pn-junction
exhibits the unique characteristic of allowing current to flow in only one
direction (from the anode to the cathode). Diodes have a minimum threshold
voltage (or Vth, usually around 0.7V) that must be present between the anode
and cathode in order for current to flow. If the anode voltage is not at least Vth
greater than the cathode voltage, no current will flow. Likewise, if the cathode
voltage is greater than the anode voltage, the diode is said to be reverse-biased
and no current will flow. In an ideal diode, if the diode voltage equals the
threshold voltage (plus a small amount), then unlimited current can flow
without causing the voltage across the diode to increase. And, if the diode is
reversed-biased, no current will flow regardless of reverse-voltage magnitude.
Diodes have many uses in electronic circuits. As examples, they are frequently
employed in power supply circuits to turn alternating current (AC) into direct
current (DC), they are used to limit the amount of over-voltage that can be
applied to a given circuit node, and they are used to force given circuit nodes to
remain at or below a certain voltage. On the Digilab board, three individual
diodes are used to limit the voltages applied to the Red, Blue, and Green pins
of the VGA connector (M) to 0.7VDC or less.
Note the identification methods used to mark a diode's cathode -terminal: the
schematic symbol has a line at the point of the triangle; the physical diode has a
dark line on the plastic component housing; and the silk-screen pattern has both
a line at the cathode end and a square pad for the cathode lead. When loading a
diode into a circuit board, make sure that the dark line on the diode matches the
line in the silk-screen pattern. Remember that since diodes allow current to
flow in only one direction, a backwards diode will cause the circuit to
malfunction.
c
Diodes locations on the circuit board are typically denoted with a "D-"
reference designator
LEDs are available in a wide variety of sizes and shapes. The 'standard' LED
has a round cross-section of 5mm diameter and this is probably the best type
for general use, but 3mm round LEDs are also popular.
Round cross-section LEDs are frequently used and they are very easy to install
on boxes by drilling a hole of the LED diameter, adding a spot of glue will help
to hold the LED if necessary. LED clips are also available to secure LEDs in
holes. Other cross-section shapes include square, rectangular and triangular.
As well as a variety of colours, sizes and shapes, LEDs also vary in their
viewing angle. This tells you how much the beam of light spreads out. Standard
LEDs have a viewing angle of 600 but others have a narrow beam of 300 or
less.
Rapid Electronics stock a wide selection of LEDs and their catalogue is a good
guide to the range available.
X
× LEDs produce more light per Watt than do incandescent bulbs; this is
useful in battery powered devices.
× LEDs can emit light of an intended color without the use of color filters
that traditional lighting methods require. This is more efficient and can
lower initial costs.
× The solid package of an LED can be designed to focus its light.
Incandescent and fluorescent sources often require an external reflector
to collect light and direct it in a usable manner.
× When used in applications where dimming is required, LEDs do not
change their colour tint as the current passing through them is lowered,
unlike incandescent lamps, which yellow.
× LEDs are built i1nside solid cases that protect them, unlike incandescent
and discharge sources, making them extremely durable.
× LEDs have an extremely long life span: upwards of 100,000 hours,
twice as long as the best fluorescent bulbs and twenty times longer than
the best incandescent bulbs. (Incandescent bulbs can also be made to last
an extremely long time by running at lower than normal voltage, but
only at a huge cost in efficiency; LEDs have a long life when operated at
their rated power.)
× Further, LEDs mostly fail by dimming over time, rather than the abrupt
burn-out of incandescent bulbs,
× LEDs light up very quickly. A typical red indicator LED will achieve
full brightness in microseconds; LEDs used in communications devices
can have even faster response times.
× LEDs can be very small and are easily populated onto printed circuit
boards.
cti E s i sris
If you wish to have several LEDs on at the same time it may be possible to
connect them in series. This prolongs battery life by lighting several LEDs with
the same current as just one LED.
All t E t i i t s m currt it i t if t
ll t t . l t ffi i t lt t
i t Vf E Vf l it l tl t t
Vf t i t . t l f t i t t ll t
E lt
V VV
LEDs are produced in a staggering array of shapes and si es, The 5 mm
cylindrical package (red, fifth from the left) is the most common, estimated at
80% of world production. The color of the plastic lens is often the same as the
actual color of light emitted, but not always. For instance, purple plastic is
often used for infrared LEDs, and most blue devices have clear housings. There
are also LEDs in extremely tiny packages, such as those found on blinkies.
((&(
LEDs are available in red, orange, amber, yellow, green, blue and white. Blue
and white LEDs are much more expensive than the other colors.
Some of these applications are further elaborated upon in the following text.
× Architectural lighting.
× Status indicators on all sorts of equipment.
× Traffic lights and signals.
× Exit signs.
× Motorcycle and Bicycle lights.
× Toys and recreational sporting goods.
× Railroad crossing signals.
× Light bars on emergency vehicles.
× Elevator Push Button Lighting.
× Red, yellow, green, and blue LEDs can be used for model railroading
applications.
× Remote controls, such as for TVs and VCRs, often use infrared LEDs.
× Because of their long life and fast switching times, LEDs have been
used for automotive high-mounted brake lights and truck and bus brake
lights and turn signals for some time, but many high-end vehicles are
now starting to use LEDs for their entire rear light clusters. Besides the
gain in reliability, this has styling advantages because LEDs are capable
of forming much thinner lights than incandescent lamps with parabolic
reflectors. The significant improvement in the time taken to light up
(perhaps 0.5s faster than an incandescent bulb) improves safety by
giving drivers more time to react.
× LED phototherapy for acne using blue or red LEDs has been proven to
significantly reduce acne over a 3 month period.
When a current flows through the coil, the resulting magnetic field attracts an
armature that is mechanically linked to a moving contact. The movement either
makes or breaks a connection with a fixed contact. When the current to the coil
is switched off, the armature is returned by a force approximately half as strong
as the magnetic force to its relaxed position. Usually this is a spring, but gravity
is also used commonly in industrial motor starters. Most relays are
manufactured to operate quickly. In a low voltage application, this is to reduce
noise. In a high voltage or high current application, this is to reduce arcing.
If the coil is energized with DC, a diode is frequently installed across the coil,
to dissipate the energy from the collapsing magnetic field at deactivation,
which would otherwise generate a spike of voltage and might cause damage to
circuit components. If the coil is designed to be energized with AC, a small
copper ring can be crimped to the end of the solenoid. This "shading ring"
creates a small out-of-phase current, which increases the minimum pull on the
armature during the AC cycle. [1]
× to isolate the controlling circuit from the controlled circuit when the two
are at different potentials, for example when controlling a
mains-powered device from a low-voltage switch. The latter is often
applied to co~trol office lighting as the low voltage wires are easily
installed in partitions, which may be often moved as needs change. They
may also be controlled by room occupancy detectors in an effort to
conserve energy,
So far we have been talking about a constant supply of voltage - one that
doesn't change over time, such as a battery before it starts to run down. This is
what is commonly know of as 3or DC which is to say that there is
no change in voltage over a period of time. This is not the kind of electricity
found coming out of the sockets in your wall at home. The electricity supplied
by the hydro company changes over short periods of time (it changes over long
periods of time as well, but that's an entirely different story...) Every second,
the voltage difference between the two terminals in your wall socket fluctuates
between about -170 V and 170 V sixty times a second (if you live in North
America, at least ...). This brings up two important points to discuss.
Firstly, the negative voltage... All a negative voltage means is that the electrons
are flowing in a direction opposite to that being measured. There are more
electrons in the tested point in the circuit than there are in the reference point,
therefore more negative charge. If you think of this in terms of the two tanks of
water - if we're sitting at the bottom of the empty tank, and we measure the
relative pressure of the full one, its pressure will be more, and therefore
positive relative to your reference. If you're at the bottom of the full tank and
you measure the pressure at the bottom of the empty one, you'll find that it's
less than your reference and therefore negative. (Two other analogies to
completely confuse you.., it's like describing someone by their height. It doesn't
matter how tall or short someone is - if you say they're tall, it probably means
that they're taller than you.
Secondly, the idea that the voltage is fluctuating. When you plug your coffee
maker into the wall, you'll notice that the plug has two terminals. One is a
reference voltage which stays constant (normally called a "cold" wire in this
case ...) and one is the "hot" wire which changes in voltage realtive to the cold
wire. The device in the coffee maker which is doing the work is connected with
each of these two wires. When the voltage in the hot wire is positive in
comparison to the cold wire, the current flows from hot through the coffee
maker to cold. One one-hundred and twentieth of a second later the hot wire is
negative compared to the cold, the current flows from cold to hot. This is
commonly known as alternating current or AC.
So remember, alternating current means that both the voltage and the current
are changing in time.
Digital electronics are those electronics systems that use a digital signal instead
of an analog signal. Digital electronics are the most common representation of
Boolean algebra and are the basis of all digital circuits for computers, mobile
phones, and numerous other consumer products.
The most common "fundamental unit" of digital electronics is the logic gate.
By combining numerous logic gates (from tens to hundreds of thousands) more
complex systems can be created. The complex system of digital electronics is
collectively referred to as a digital circuit.
To most electronic engineers, the terms "digital circuit", "digital system" and
"logic" are interchangeable in the context of digital circuits
X
× Digital systems interface well with computers and are easy to control
with software. It is often possible to add new features to a digital system
without changing hardware, and to do this remotely, just by uploading
new software. Design errors or bugs can be worked-around with a
software upgrade, after the product is in customer hands.
A logic gate performs a logical operation on one or more logic inputs and
produces a single logic output. The logic normally performed is Boolean logic
and is most commonly found in digital circuits. Logic gates are primarily
implemented electronically using diodes or transistors, but can also be
constructed using electromagnetic relays, fluidics, optical or even mechanical
elements.
The named because, if 0 is called "false" and 1 is called "true,"
the gate acts in the same way as the logical "and" operator. The following
illustration and table show the circuit symbol and logic combinations for an
AND gate. (In the symbol, the input terminals are at left and the output
terminal is at right.) The output is "true" when both inputs are "true."
Otherwise, the output is "false."
V3 $(
* * *
* ! *
! * *
! ! !
The OR gets its name from the fact that it behaves after the fashion of the
logical inclusive "or." The output is "true" if either or both of the inputs are
"true." If both inputs are "false," then the output is "false."
V3 $(
Input 1 Input 2 Output
* * *
* ! !
! * !
! ! !
The
% ( 8 is a digital logic gate that implements logical
negation. It behaves according to the truth table to the right. A HIGH output (1)
results if the inputs is LOW (0). If the input is HIGH (1), a LOW output (0)
results.
'& '&
! *
* !
V3 $(
The gate operates as an AND gate followed by a NOT gate. It acts in
the manner of the logical operation "and" followed by negation. The outputis
"false" if both inputs are "true." Otherwise, the output is "true."
V3 $(
* * !
* ! !
! * !
! ! *
%
* * !
* ! *
! * *
! ! *
The XNOR (exclusive-NOR) gate is a combination XOR gate following by an
inverter. Its output is ³true´ if inputs are the same, and ³false´ if the inputs are
different.
* * !
* ! *
! * *
! ! !
pVision3 IDE
× An integrated M
facility with automatic dependency
generation. You don't have to figure out which header files
and include files are used by which source files. The Keil
compilers and assemblers do that automatically.
pV ?
Executing
pVision offers several ways you can control and manipulate
program execution.
× c
p - Both simple and complex breakpoints are
supported by the pVision Debugger.
Advanced analysis' tools are available to help you test and debug
your embedded applications.
Target Debugging
Target debug drivers allow you to test programs running on
target hardware.
STE¬S IN LEApNING
Alphabets, Constants,
digits, special variables, Instructions Program
symbols keywords
SAGE
Main()
{
printf(´hello, world\nµ);
}
#include <stdio.h>
int main(void)
{
printf(´hello, world\nµ);
return 0;
}
AV Sp ¬
Main() declares the start of the function, while the two curly
brackets show the start and finish of the function. Curly
brackets in C are used to group statements together as in a
function, or in the body of a loop. Such a grouping is known as a
compound statement or a block.
printf("This is a C program\n");
prints the words on the screen. The text to be printed is enclosed
in double quotes. The \n at the end of the text tells the program
to print a newline as part of the output.
A S
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulo Reduction (Remainder from integer division)
Shorthand Equivalent
i++; or ++i; i = i + 1;
i--; or --i; I = I ² 1;
X = a * b++; is equivalent to x = a * b;
x = b+ 1;
x = --i * (a + b) ; is equivalent to i = i ² 1;
x = I * (a + b);
These can cause confusion if you try to do too many things on
one command line. You are recommended to restrict your use of
++ and - to ensure that your programs stay readable.
Shorthand Equivalent
i+ = 10; i = i + 10;
i -= 10; i = i - 10;
i *= 10; i = i * 10;
i /= 10; i = i / 10;
Symbol Meaning
&& And
II Or
! Not
C code Meaning
MMAN?S SE?
1. SWITASE STATEMANT:
The control statement that allows us to make a decision from the
number of choices is called a switch, or switch case - default.
Since these three keywords go together to make up the control
statement.
2. F pL ¬:
. WILE:
A while loop is ideally suited for cases where we want to do
something a fixed no. of times.
4. cpEAK:
We often come across situations where we want to jump out of a
loop instantly, without waiting to get back to conditional test.
The keyword break allows us to do this. When break is
encountered inside any loop, control automatically passes to the
first statement after the loop,
5. IN¬ pT:
Inport reads a word from a hardware port
Inportb reads a byte from a hardware port
6. T¬ pT:
Outport outputs a word to a hardware port
Outportb outputs a byte to a hardware port
INTp ?TI N T IS¬ ² FLAS
¬p GpAMMEp
This ISP programmer can be used either for in system
programming or as a stand ² alone spi programmer for ATMEL
programmable devices. The IS¬ .zp file contains the main
program and the o/p port driver. Place all files in same folder.