Professional Documents
Culture Documents
Now days this is the area of Electronics circuit which are using microprocessors
or microcontroller in the circuits, i.e. EMBEDDED SYSTEM.. Because these
are intelligent device so these device are making our life easier.
I try to give the basic understanding of the 8051 microcontroller and in this
book we have given all the circuit which is practically implemented. So, this
book written to cover most of the practical aspect for interfacing of the I/O
devices with microcontroller. We have covered interfacing of the TTL, chip,
intelligent LCD displays, and stepper motors etc with microcontroller 8051; in
this we have used internal memory of microcontroller 8051.
VINAY KUMAR
A
Summer Training Project Report
On
“Embedded System”
2010-11
VINAY KUMAR
UNIT-1
1.1-Introduction of CETPA……………………………………………1
1.3-History..................................................................................................3
1.6-Characterstics……………………………………………………….7
UNIT-2
2.4- Ports………………………………………………………………..16
CETPA Objectives
* Promoting Computer Education & Technology.
* Open platform for the development jobs.
* Provide World Class Computer Education.
* Organize Paper Presentation & Quizzes.
* Organize Conferences & Seminars.
* Collaboration with other Institute.
* Launch Research Paper & Projects of the Members.
* Research for Advance Technology.
* Honor Outstanding Personalities.
CETPA Education
CETPA is an association dedicated for spreading advance computer education
to all over the world. CETPA provides computer education in advance
technology courses like LINUX, J2EE, VHDL, EMBEDDED SYSTEM,
ADVANCE EMBEDDED SYSTEM, CAD , Pro-E or Mechanical &
Electronics students, .NET, MATLAB, ADVANCE JAVA, ORACLE,
SOFTWARE TESTING etc.
CETPA R&D
CETPA is working continuously in Research and Development field from the
very beginning CETPA has developed a number of advanced software and
currently working in following main projects.
* Congestion Control in Wireless Traffic.
* Real Time Scheduling for Automatic Guided Vehicles.
* Advancement in Microprocessors Technology.
* CETPA Linux( releasing soon).
1
CETPA Open Platform
CETPA is an association, which is providing open platform for software
development. Our thinking is that development tools should be provided free of
cost so that the technological advancement and refinement can take place
unhindered. In this mission everyone is invited CETPA. Linux is a special
flavour of Linux that can be easily optimized and customized for just about any
application or need .Extreme performance, configurability and a top-notch user
and developer community are all hallmarks of the CETPA experience
2
used by many second source manufacturers. This course is built according to
the use of 8051 micro controller in the designing of Embedded System.
1.3 HISTORY
In the earliest years of computers in the 1940–50s, computers were sometimes
dedicated to a single task, but were far too large and expensive for most kinds of
tasks performed by embedded computers of today. Over time however, the
concept of programmable controller evolved from electromechanical sequence
via solid state devices, to the use of computer technology.
The first microprocessor for example, the Intel 4004 was
designed for calculators and other small systems but still required many external
memory and support chips. In 1978 National Engineering Manufacturers
Association released a "standard" for programmable microcontrollers, including
almost any computer-based controllers, such as single board computers,
numerical, and event-based controllers.
As the cost of microprocessors and microcontrollers fell it became feasible to
replace expensive knob-based analog components such
as potentiometrs and variable capatiors with up/down buttons or knobs read out
by a microprocessor even in some consumer products. By the mid-1980s, most
of the common previously external system components had been integrated into
the same chip as the processor and this modern form of
the microcontroller allowed an even more widespread use, which by the end of
the decade were the norm rather than the exception for almost all electronics
devices.
The integration of microcontrollers has further increased the applications for
which embedded systems are used into areas where traditionally a computer
would not have been considered. A general purpose and comparatively low-cost
microcontroller may often be programmed to fulfill the same role as a large
number of separate components. Although in this context an embedded system
is usually more complex than a traditional solution, most of the complexity is
contained within the microcontroller itself. Very few additional components
may be needed and most of the design effort is in the software. The intangible
nature of software makes it much easier to prototype and test new revisions
compared with the design and construction of a new circuit not using an
embedded processor.
3
1.4 Scope of Embedded System
Embedded systems are designed to do some specific task, rather than be a
general-purpose computer for multiple tasks. Some also have real-time
performance constraints that must be met, for reasons such as safety and
usability others may have low or no performance requirements, allowing the
system hardware to be simplified to reduce costs.
Embedded systems are not always standalone devices. Many embedded
systems consist of small, computerized parts within a larger device that serves a
more general purpose. For example, the Gibson Robot Guitar features an
embedded system for tuning the strings, but the overall purpose of the Robot
Guitar is, of course, to play musicThe program instructions written for
embedded systems are referred to as firmware, and are stored in read-only
memory or Flash memory chips. They run with limited computer hardware
resources: little memory, small or non-existent keyboard and/or screen.
1.5 What is embedded system
An embedded system is a computer system designed to perform one or a few
dedicated functions often with real-time computing constraints. It is embedded
as part of a complete device often including hardware and mechanical parts..
6
1.6 Characteristics:
1. Embedded systems are designed to do some specific task, rather than be a
general-purpose computer for multiple tasks. Some also have real-
time performance constraints that must be met, for reasons such as safety
and usability; others may have low or no performance requirements,
allowing the system hardware to be simplified to reduce costs.
7
Fig: e-con Systems eSOM270 & eSOM300 Computer on Modules
User interface:
Embedded systems range from no user interface at all dedicated only to one task
to complex interfaces that resemble modern computer desktop operating
systems. Simple embedded devices use buttons, LEDs, graphic or
character LCDs (for example popular HD44780 LCD) with a simple menu
system.
Tools 10
As for other software, embedded system designers use compilers, assemblers,
and debuggers to develop embedded system software. However, they may also
use some more specific tools:
11
Debugging
Embedded debugging may be performed at different levels, depending on the
facilities available. From simplest to most sophisticated they can be roughly
grouped into the following areas:
Unless restricted to external debugging, the programmer can typically load and
run software through the tools, view the code running in the processor, and start
or stop its operation. The view of the code may be as assembly code or source-
code.
Because an embedded system is often composed of a wide variety of elements,
the debugging strategy may vary. For instance, debugging a software- (and
microprocessor-) centric embedded system is different from debugging an
embedded system where most of the processing is performed by peripherals
(DSP, FPGA, co-processor). An increasing number of embedded systems today
use more than one single processor core. A common problem with multi-core
development is the proper synchronization of software execution. In such a
case, the embedded system design may wish to check the data traffic on the
busses between the processor cores, which requires very low-level debugging,
at signal/bus level, with a logic analyzer, for instance.
12
Reliability
Embedded systems often reside in machines that are expected to run
continuously for years without errors, and in some cases recover by themselves
if an error occurs. Therefore the software is usually developed and tested more
carefully than that for personal computers, and unreliable mechanical moving
parts such as disk drives, switches or buttons are avoided.
Specific reliability issues may include:
1. The system cannot safely be shut down for repair, or it is too inaccessible
to repair. Examples include space systems, undersea cables, navigational
beacons, bore-hole systems, and automobiles.
2. The system must be kept running for safety reasons. "Limp modes" are
less tolerable. Often backups are selected by an operator. Examples
include aircraft navigation, reactor control systems, safety-critical
chemical factory controls, train signals, engines on single-engine aircraft.
3. The system will lose large amounts of money when shut down:
Telephone switches, factory controls, bridge and elevator controls, funds
transfer and market making, automated sales and service.
13
Immunity Aware Programming High vs low volume
For high volume systems such as portable music players or mobile phones,
minimizing cost is usually the primary design consideration. Engineers typically
select hardware that is just “good enough” to implement the necessary
functions.
For low-volume or prototype embedded systems, general purpose computers
may be adapted by limiting the programs or by replacing the operating system
with a real-time operating system.
UNIT 2
14
2.2 Typical applications
8051 chips are used in a wide variety of control systems, telecom applications,
robotics as well as in the automotive industry. By some estimations, 8051
family chips make up over 50% of the embedded chip market.
15
memory. PIN 30 is called ALE (address latch enable), which is used when
multiple memory chips are connected to the controller and only one of them
needs to be selected. We will deal with this in depth in the later chapters. PIN
29 is called PSEN. This is "program select enable". In order to use the external
memory it is required to provide the low voltage (0) on both PSEN and EA pins.
2.4 Ports
There are four 8 bit ports: P0, P1, P2 and P3.
PORT P1 (Pins 1 to 8): The port P1 is a general purpose input/output port which
can be used for a variety of interfacing tasks. The other ports P0, P2 and P3
have dual roles or additional functions associated with them based upon the
context of their usage.
PORT P3 (Pins 10 to 17): PORT P3 acts as a normal IO port, but Port P3 has
additional functions such as, serial transmit and receive pins, 2 external
interrupt pins, 2 external counter inputs, read and write pins for memory access.
PORT P2 (pins 21 to 28): PORT P2 can also be used as a general purpose 8 bit
port when no external memory is present, but if external memory access is
required then PORT P2 will act as an address bus in conjunction with PORT P0
to access external memory. PORT P2 acts as A8-A15.
PORT P0 (pins 32 to 39) PORT P0 can be used as a general purpose 8 bit port
when no external memory is present, but if external memory access is required
then PORT P0 acts as a multiplexed address and data bus that can be used to
access external memory in conjunction with PORT P2. P0 acts as AD0-AD7, as
can be seen from fig 1.1
16
2.
5 Oscillator Circuits
The 8051 requires the existence of an external oscillator circuit. The oscillator
circuit usually runs around 12MHz, although the 8051 (depending on which
specific model) is capable of running at a maximum of 40MHz. Each machine
cycle in the 8051 is 12 clock cycles, giving an effective cycle rate at 1MHz (for
a 12MHz clock) to 3.33MHz (for the maximum 40MHz clock).
18
2.12 General Purpose Registers
The 8051 has 4 selectable banks of 8 addressable 8-bit registers, R0 to R7. This
means that there are essentially 32 available general purpose registers, although
only 8 (one bank) can be directly accessed at a time. To access the other banks,
we need to change the current bank number in the flag status register.
Program Memory
After reset, the CPU begins execution from location 0000H. each interrupt is
assigned a fixed location in program memory. The interrupt causes the CPU to
jump to that location, where it executes the service routine. External Interrupt 0,
for example, is assigned to location 0003H. If External Interrupt is used, its
19
service routine must begin at location 0003H. If the interrupt is not used, its
service location is available as general purpose program memory. The interrupt
service locations are spaced at 8-byte intervals:
0003H for External Interrupt 0, 000BH for Timer 0,
0013H for External Interrupt 1, 001BH for Timer 1, and so on. If an interrupt
service routine is short enough (as is often the case in control applications), it
can reside entirely within that 8-byte interval. Longer service routines can use a
jump instruction to skip over subsequent interrupt locations, if other interrupts
are in use. The lowest addresses of program memory can be either in
the on-chip Flash or in an external memory. To make this selection, strap the
External Access (EA) pin to either VCC or GND. For example, in the AT89C51
with 4K bytes of on-chip Flash, if the EA pin is strapped to VCC, program
fetches to addresses 0000H through 0FFFH are directed to the internal Flash.
Program fetches to addresses 1000H through FFFFH are directed to external
memory. In the AT89C52 (8K bytes Flash), EA = VCC selects addresses 0000H
through 1FFFH to be internal and addresses 2000H through FFFFH to be
external. If the EA pin is strapped to GND, all program fetches are directed to
external memory. The read strobe to external memory, PSEN, is used for all
external program fetches. Internal program fetches do not activate PSEN.
The hardware configuration for external program execution. Note that 16 I/O
lines (Ports 0 and 2)
are dedicated to bus functions during external program memory fetches. Port 0
(P0 in Figure 5) serves as a multiplexed address/data bus. It emits the low byte
of the Program Counter (PCL) as an address and then goes into a float state
while waiting for the arrival of the code byte from
the program memory. During the time that the low byte of the Program Counter
is valid on P0, the signal ALE (Address Latch Enable) clocks this byte into an
address latch. Meanwhile, Port 2 emits the high byte of the Program Counter
(PCH). Then PSEN strobes the external memory, and the microcontroller reads
the code byte.
20
Program Memory
Program memory addresses are always 16 bits wide, even though the actual
amount of program memory used may be less than 64K bytes. External program
execution sacrifices two of the 8-bit ports, P0 and P2, to the function of
addressing the program memory.
Data Memory
The right half of the internal and external data memory spaces available on
Atmel’s Flash microcontrollers. Hardware configuration for accessing up to 2K
bytes of external RAM. In this case, the CPU executes from internal Flash. Port
0 serves as a multiplexed address/data bus to the RAM, and 3 lines of Port 2 are
used to page the RAM. The CPU generates RD and WR signals as needed
during external RAM accesses. You can assign up to 64K bytes of external data
memory. External data memory addresses can be either 1 or 2 bytes wide. One-
byte addresses are often used in conjunction with one or more other I/O lines to
page the RAM. Two-byte addresses can also be used, in which case the high
address byte is emitted at Port 2.
21
Internal data memory addresses are always 1 byte wide, which implies an
address space of only 256 bytes. However, the addressing modes for internal
RAM can in fact accommodate 384 bytes. Direct addresses higher than 7FH
access one memory space, and indirect addresses higher than 7FH access a
different memory space. Thus, the Upper 128 and SFR space occupying the
same block of addresses, 80H through FFH, although they are physically
separate entities. The lowest 32 bytes are grouped into 4 banks of 8 registers.
Program instructions call out these registers as R0 through R7. Two bits in the
Program Status Word (PSW) select which register bank is in use. This
architecture allows more efficient use of code space, since register instructions
are shorter than instructions that use direct addressing.
22
23
Programming Status Word:
23
Addressing Modes
Indirect Addressing
In indirect addressing, the instruction specifies a register that contains the
address of the operand. Both internal and external RAM can be indirectly
addressed. The address register for 8-bit addresses can be either the Stack
Pointer or R0 or R1 of the selected register bank. The address register for 16-bit
addresses can be only the 16-bit data pointer register, DPTR.
Register Instructions
The register banks, which contain registers R0 through R7, can be accessed by
instructions whose opcodes carry a 3- bit register specification. Instructions that
access the registers this way make efficient use of code, since this mode
eliminates an address byte. When the instruction is executed, one of the eight
registers in the selected bank is accessed. One of four banks is selected at
execution time by the two bank select bits in the PSW.
Register-Specific Instructions
Some instructions are specific to a certain register. For example, some
instructions always operate on the Accumulator, so no address byte is needed to
point to it. In these cases, the opcode itself points to the correct register.
Instructions that refer to the Accumulator as an assemble as Accumulator-
specific opcodes.
Indexed Addressing
Program memory can only be accessed via indexed addressing. This addressing
mode is intended for reading look-up tables in program memory. A 16-bit base
register (either DPTR or the Program Counter) points to the base of the table,
and the Accumulator is set up with the table entry number. The address of the
table entry in program memory is formed by adding the Accumulator data to the
base pointer.
24
Another type of indexed addressing is used in the “case
jump” instruction. In this case the dest ination address of a jump instruction is
computed as the sum of the base pointer and the Accumulator data.
Serial communication
The concept of serial communication is the process of sending data one bit at a
time, sequentially, over a communication channel or computer bus. This is in
contrast to parallel communication, where several bits are sent as a whole, on a
link with several parallel channels. Serial communication is used for all long-haul
communication and most computer networks, where the cost
of cable and synchronization difficulties make parallel communication impractical.
Serial computer buses are becoming more common even at shorter distances, as
improved signal integrity and transmission speeds in newer serial technologies
have begun to outweigh the parallel bus's advantage of simplicity
2.15 Advantage
Enables real-time, deterministic scheduling and task prioritization
Abstracts away the complexities of the processor
Provides a solid infrastructure constructed of rules and policies
Simplifies development and improves developer productivity
Integrates and manages resources needed by communications stacks and
middleware
Optimizes use of system resources
Improves product reliability, maintainability and quality
Promotes product evolution and scaling
25
2.15 Applications
Communications applications
Medical electronics technology
Military and aerospace embedded software applications
Electronics applications and consumer devices
Industrial automation and process control software
Conclusion
After completing this report I have understood the importance of this very topic.
I have tried my level best in briefly each and every dimension the specified
topics so it may a source of impactful information to the readers
REFERENCES:
From the book of M.S.Mazidi
From the Wikipedia
26
26