Beruflich Dokumente
Kultur Dokumente
INTRODUCTION
An embedded system is a computer system with a dedicated function within a large
mechanical or electrical system, often with real-time computing constraints. It is embedded as
part of a complete device often including hardware and mechanical parts. Embedded systems
control many devices in common use today .Properties typical of embedded computers when
compared with general-purpose ones are e.g. low power consumption, small size, rugged
operating ranges and low per-unit cost. This comes at the price of limited processing resources,
which make them significantly more difficult to program and to interface with.
Modern embedded systems are often based on microcontrollers (i.e. CPUs with integrated
memory or peripheral interfaces)[4]but ordinary microprocessors (using external chips for
memory and peripheral interface circuits) are also still common, especially in more complex
systems. In either case, the processor(s) used may be types ranging from general purpose to
specialize in certain class of computations, or even custom designed for the application at hand.
A common standard class of dedicated processors is the digital signal processor (DSP). Since the
embedded system is dedicated to specific tasks, design engineers can optimize it to reduce the
size and cost of the product and increase the reliability and performance. Some embedded
systems are mass-produced, benefiting from economies.
Embedded systems range from portable devices such as digital watches and MP3 players,
to large stationary installations like traffic lights, factory controllers, and largely complex
systems like hybrid vehicles, MRI, and avionics. Complexity varies from low, with a
single microcontroller chip, to very high with multiple units, peripherals and networks mounted
inside a large chassis or enclosure.
HISTORY:One of the very first recognizably modern embedded systems was the Apollo Guidance
Computer, developed by Charles Stark Draper at the MIT Instrumentation Laboratory. At the
project's inception, the Apollo guidance computer was considered the riskiest item in the Apollo
project as it employed the then newly developed monolithic integrated circuits to reduce the size
and weight. An early mass-produced embedded system was the Autonetics D-17 guidance
computer for the Minuteman missile, released in 1961.
User interface:More sophisticated devices which use a graphical screen with touch sensing or screenedge buttons provide flexibility while minimizing space used: the meaning of the buttons can
1 | Page
change with the screen, and selection involves the natural behavior of pointing at what's
desired. Handheld systems often have a screen with a "joystick button" for a pointing device.
Some systems provide user interface remotely with the help of a serial (e.g. RS232, USB, IC, etc.) or network (e.g. Ethernet) connection. This approach gives several
advantages: extends the capabilities of embedded system, avoids the cost of a display,
simplifies BSP and allows one to build a rich user interface on the PC. A good example of this is
the combination of an embedded web server running on an embedded device (such as an IP
camera) or a network router.
Processors in embedded systems:Embedded processors can be broken into two broad categories. Ordinary microprocessors
(P) use separate integrated circuits for memory and peripherals. Microcontrollers (C) have onchip peripherals, thus reducing power consumption, size and cost.. Both Von Neumann as well as
various degrees of Harvard architectures are used. RISC as well as non-RISC processors are
found. Word lengths vary from 4-bit to 64-bits and beyond, although the most typical remain
8/16-bit. Most architectures come in a large number of different variants and shapes, many of
which are also manufactured by several different companies.
Readymade computer boards:PC/104 and PC/104+ are examples of standards for ready made computer boards
intended for small, low-volume embedded and ruggedized systems, mostly x86-based. These are
often physically small compared to a standard PC, although still quite large compared to most
simple (8/16-bit) embedded systems. They often use DOS, Linux, NetBSD, or an embedded realtime operating system such as MicroC/OS-II, QNX or VxWorks. Sometimes these boards use
non-x86 processors.
2 | Page
2. POWER SUPPLY
Power supply is a system which converts 230V AC mains supply (230V is the UK mains
voltage) into a regulated 5V DC supply.
3 | Page
The PIC16F73 and PIC16F76 have one-half of the total on-chip memory of the
external crystal/clock
Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
Two Capture, Compare, PWM modules
8-bit, up to 8-channel Analog-to-Digital converter
Synchronous Serial Port (SSP) with SPI (Master mode) and I2C (Slave)
Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI)
Parallel Slave Port (PSP), 8-bits wide with external RD, WR and CS controls (40/44-pin
only)
Brown-out detection circuitry for Brown-out Reset (BOR)
5 | Page
6 | Page
7 | Page
9 | Page
TMR0 register is written, the increment is inhibited for the following two instruction cycles. The
user can work around this by writing an adjusted value to the TMR0 register. Counter mode is
selected by setting bit T0CS (OPTION_REG<5>). In Counter mode, Timer0 will increment,
either on every rising or falling edge of pin RA4/T0CKI. The incrementing edge is determined
by the Timer0 Source Edge Select bit T0SE (OPTION_REG<4>). Clearing bit T0SE selects the
rising edge. The prescaler is mutually exclusively shared between the Timer0 module and the
Watchdog Timer. The prescaler is not readable or writable. The TMR0 interrupt is generated
when the TMR0 register overflows from FFh to 00h. This overflow sets bit TMR0IF
(INTCON<2>). The interrupt can be masked by clearing bit TMR0IE (INTCON<5>). Bit
TMR0IF must be cleared in software by the Timer0 module Interrupt Service Routine, before reenabling this interrupt. The TMR0 interrupt cannot awaken the processor from SLEEP, since the
timer is shut-off during SLEEP.
3.10 Using Timer0 with an External Clock
When no prescaler is used, the external clock input is the same as the prescaler output.
The synchronization of T0CKI, with the internal phase clocks, is accomplished by sampling the
prescaler output on the Q2 and Q4 cycles of the internal phase clocks. Therefore, it is
necessary for T0CKI to be high for at least 2Tosc (and a small RC delay of 20 ns) and low for at
least 2Tosc (and a small RC delay of 20 ns). Refer to the electrical specification of the desired
devices
12 | P a g e
can be generated by either of the two CCP modules as the special event trigger (see Sections 8.1
and 8.2). Register 6-1 shows the Timer1 Control register.
When the Timer1 oscillator is enabled (T1OSCEN is set), the RC1/T1OSI/CCP2 and
RC0/T1OSO/T1CKI pins become inputs. That is, the TRISC<1:0> value is ignored and these
pins read as 0. Additional information on timer modules is available in the PIC micr MidRange MCU Family Reference Manual (DS33023).
3.13 T1CON: TIMER1 Control Register (ADDRESS 10h)
Timer1 is enabled in Counter mode, the module must first have a falling edge before the counter
begins to increment.
3.15 TIMER2
Timer2 is an 8-bit timer with a prescaler and a postscaler. It can be used as the PWM
time-base for the PWM mode of the CCP module(s). The TMR2 register is readable and
writable, and is cleared on any device RESET. The input clock (FOSC/4) has a prescale option of
1:1, 1:4 or 1:16, selected by control bits T2CKPS1:T2CKPS0 (T2CON<1:0>).
The Timer2 module has an 8-bit period register, PR2.Timer2 increments from 00h until it
matches PR2 and then resets to 00h on the next increment cycle. PR2 is a readable and writable
register. The PR2 register is initialized to FFh upon RESET. The match output of TMR2 goes
through a 4-bit postscaler (which gives a 1:1 to 1:16 scaling inclusive) to generate a TMR2
interrupt (latched in flag bit TMR2IF, (PIR1<1>)). Timer2 can be shut-off by clearing control bit
TMR2ON (T2CON<2>) to minimize power consumption.
.Additional information on timer modules is available in the PIC micr Mid-Range MCU Family
Reference Manual (DS33023).
3.16 Timer2 Prescaler and Postscaler
The prescaler and postscaler counters are cleared when any of the following occurs:
a write to the TMR2 register
a write to the T2CON register
any device RESET (POR, MCLR Reset, WDT Reset or BOR) TMR2 is not cleared when
T2CON is written.
3.17 Output of TMR2
The output of TMR2 (before the postscaler) is fed to the SSP module, which optionally
uses it to generate shift clock.
3.18 CCP1CON Register /CCP2CON Register (ADDRESS: 17h/1Dh)
15 | P a g e
4. LED INTERFACING
The LED is based on the semiconductor diode. When a diode is forward biased (switched on),
electrons are able to recombine with holes within the device, releasing energy in the form of
photons. This effect is called electroluminescence and the color of the light (corresponding to the
energy of the photon) is determined by the energy gap of the semiconductor. LEDs present
manyadvantages over incandescent light sources including lower energy consumption, longer
lifetime, improved robustness, smaller size, faster switching, and greater durability and
reliability.
The PIC controller can sink (absorb) or source (give out) a small amount of current, which
means that an LED can be connected directly to the output pin. A series resistor (value 330R) is
also required to limit the current.
17 | P a g e
Buttons are typically made out of hard material, usually plastic or metal.The surface is usually
flat or shaped to accommodate the human finger or hand, so as to be easily pushed. Buttons are
most often biased switches, though even many un-biased buttons require a spring to return to
their un-pushed state. Different people use different terms for the "pushing" of the button, such
as press, depress , A push-button is a simple switch mechanism for controlling some aspect of
a machine or
a process.
mash,
and punch.
The
"push-button"
has
been
utilized
in calculators, push-button telephones, kitchen appliances, and various other mechanical and
electronic devices, home and commercial.The simplest input is a switch or push button. This can
operate with just one additional support component, a pull-up resistor, but there are still some
significant issues to consider, such as input loading and debouncing. switch is interfaced with a
pull-up resistor. Let us make sure we understand how this works. When the switch is open, the
output voltage of the circuit is pulled up to _5 V via the resistor. Another way to look at it is that
there is no current in the resistor (assuming there is no load on the output), so there is no volt
drop, and the output voltage must be the same as the supply (_5 V). When the switch is closed
the output is connected direct to 0 V; the resistor prevents the supply being shorted to ground.
18 | P a g e
information .In addition to the ten numerals, seven segment displays can be used to show letters
of the Latin, Greek alphabets including punctuation, but only few representations are
unambiguous and intuitive at the same time: uppercase A, B, C, E, F, G, H,I,J,L,OP,S,U,YZ, and
lowercase a, b, c, d, g, h, i, n, o, q, r, t, u.
5.1 Types of Seven Segment Display
Common anode.
Common cathode.
Seven segment display is of two types Common cathode (CC) and Common anode (CA). In
Common Cathode configuration, the negative terminals of all LEDs are connected to the
common pins. The common is connected to ground and a particular LED glows when its
corresponding pin is given high. In Common Anode arrangement, the common pin is given a
high logic and the LED pins are given low to display a number. The diagrams of both types of
seven segment display are given below.
20 | P a g e
6. LCD INTERFACING
21 | P a g e
A liquid crystal display is a special thin flat panel that can let light go through it, or can block the
light. (Unlike an LED it does not produce its own light). The panel is made up of several blocks,
and each block can be in any shape. Each block is filled with liquid crystals that can be made
clear or solid, by changing the electric current to that block. Liquid crystal displays are often
abbreviated LCDs. Liquid crystal displays are often used in battery-powered devices, such as
digital watches, because they use very little electricity. They are also used for flat screen TV's.
They work well by themselves when there is other light around. For TV's and some other cases
where light is needed, a back-light is built into the product. Above shown LCD has 16 pins and
their descriptions are given in the table.
22 | P a g e
23 | P a g e
24 | P a g e
Motion Control, in electronic terms, means to accurately control the movement of an object
based on either speed, distance, load, inertia or a combination of all these factors. There are
numerous types of motion control systems, including; Stepper Motor, Linear Step Motor, DC
Brush, Brushless, Servo, Brushless Servo and more.A stepper motor is an electromechanical
device which converts electrical pulses into discrete mechanical movements. Stepper motor is a
form of ac. motor .The shaft or spindle of a stepper motor rotates in discrete step increments
when electrical command pulses are applied to it in the proper sequence. The motors rotation has
several direct relationships to these applied input pulses. The sequence of the applied pulses is
directly related to the direction of motor shafts rotation. The speed of the motor shafts rotation is
25 | P a g e
directly related to the frequency of the input pulses and the length of rotation is directly related to
the number of input pulses applied .For every input pulse, the motor shaft turns through a
specified number of degrees, called a step. Its working principle is one step rotation for one input
pulse. The range of step size may vary from 0.72 degree to 90 degree. In position control
application, if the number of input pulses sent to the motor is known, the actual position of the
driven job can be obtained.
7.1 A stepper motor differs from a conventional motor (CM) as under:
Input to SM is in the form of electric pulses whereas input to a CM is invariably from a constant
voltage source. A CM has a free running shaft whereas shaft of SM moves through angular steps.
In control system applications, no feedback loop is required when SM is used but a feedback
loop is required when CM is used. A SM is a digital electromechanical device whereas a CM is
an analog electromechanical device.
7.2 Open Loop Operation
One of the most significant advantages of a stepper motor is its ability to be accurately controlled
in an open loop system. Open loop control means no feedback information about position is
needed. This type of control eliminates the need for expensive sensing and feedback devices such
as optical encoders. Control position is known simply by keeping track of the input step pulses.
Every stepper motor has a permanent magnet rotor (shaft) surrounded by a stator. The most
common stepper motor has four stator windings that are paired with a center-tapped common.
This type of stepper motor is commonly referred to as a four- phase stepper motor. The center tap
allows a change of current direction in each of two coils when a winding is grounded, thereby
resulting in a polarity change of the stator. Notice that while a conventional motor shaft runs
freely, the stepper motor shaft moves in a fixed repeatable increment which allows one to move
it to a precise position. This repeatable
26 | P a g e
Winding C
Winding B
1
2
3
Winding A
Winding D
27 | P a g e
Winding
Winding B
Winding C
Winding D
Since the stepper motor is not an ordinary motor and has four separate coils which have to be
energized one by one in a stepwise fashion. We term them as coil A,B,C and D. At a particular
instant the coil a should get supply and then after some delay the coil B should get a supply and
then coil C and then coil D and so on the cycle continues. The more the delay is introduced
between the energisation of the coils the lesser is the speed of the stepper motor and vice versa.
used to drive the motors. L293D contains two inbuilt H-bridge driver circuits. In its common
mode of operation, two DC motors can be driven simultaneously, both in forward and reverse
direction. The motor operations of two motors can be controlled by input logic at pins 2 & 7 and
10 & 15. Input logic 00 or 11 will stop the corresponding motor. Logic 01 and 10 will rotate it in
clockwise and anticlockwise directions, respectively. Enable pins 1 and 9 (corresponding to the
two motors) must be high for motors to start operating. When an enable input is high, the
associated driver gets enabled. As a result, the outputs become active and work in phase with
their inputs. Similarly, when the enable input is low, that driver is disabled, and their outputs are
off and in the high-impedance state.
8. IR TECHNOLOGY
29 | P a g e
but
it
does
emit
infrared
radiation
which
we
feel
as
heat.
The warmer the object, the more infrared radiation it emits. We use IC LM324 for this.
Fig8.2 Pin
diagram of LM324
8.2 LM324
30 | P a g e
The LM124/SA534/LM2902 series consists of four independent, high-gain, internally frequencycompensated operational amplifiers designed specifically to operate from a single power supply
over a wide range of voltages.
8.3 Unique features
In the linear mode, the input common-mode voltage range includes ground and the output
voltage can also swing to ground, even though operated from only a single power supply voltage.
The unity gain crossover frequency and the input bias current are temperature-compensated.
Internally frequency-compensated for unity gain
Large DC voltage gain: 100dB
Wide bandwidth (unity gain): 1MHz (temperature-compensated)
Wide power supply range Single supply: 3VDC to 30VDC or dual
supplies: 1.5VDCto 15VDC
Very low supply current drain: essentially independent of supply
voltage (1mW/op amp at +5VDC)
Low input biasing current: 45n ADC (temperature-compensated)
Low input offset voltage: 2mVDCand offset current: 5nADC
Differential input voltage range equal to the power supply voltage
Large output voltage: 0VDCto VCC-1.5VDCswing
31 | P a g e
32 | P a g e