ES Unit 1
ES Unit 1
I. Introduction,
II. Complex Systems and Microprocessor,
III. Embedded System Design Process,
IV. Formalisms for System Design, Design Examples.
V. Microprocessors and Microcontrollers: Microprocessors and Microcontrollers,
VI. The 8051 Architecture:
Introduction,
8051 Microcontroller Hardware,
Input/output Ports and Circuits,
External Memory.
Counter and Timers,
Serial data Input/output,
Interrupts.
I. Introduction:
i. System: A system is a way of working, organizing, or doing one or more tasks according to
a fixed plan, program, or set of rules.
ii. Embedded System:- A computer is a system that has the following or more components.
1)A microprocessor
2) A large memory comprising the following two kinds:
(a) primary memory (semiconductor memories RAM, ROM, and fast accessible
cacher)
(b) Secondary memory (magnetic memory located in hard disks, diskettes &
Cartridge
taper and optimal memory in CD-ROM)
3) Input writs like Keyboard, mouse, digitizer, Scammer, etc.
4) My Output units like video monitor, printer, etc.
5) Networking units like Ethernet cards, front-end processor-based drivers, etc.
6) i/o units like a modem, fax cum modem, etc.
→A Microprocessor is a single VLSI chip that has a CPU and may also have some other units
(for examples, caches, floating point processing arithmetic unit, pipeline and super-scaling
units) that are additionally present and that result in faster processing of instructions.
A microcontroller is a single-chip VLSI unit which, though having limited computational
capabilities, possess enhanced input output capabilities & a number of on-chip functional
units.
→>We will consider the design from the top down/ bottom- -up view.
Top-down View: - We will begin with the most abstract developed description of the system
and conclude with concrete details.
Bottom-up view: We start with components to build a System. We need it have perfect insight
into how later stages of the design process will turn out.
→In top down view, we start with system requirements. In next step, specification, we create
a more detailed description of what we want.
→ The details of the system's internals begin to take shape when we develop the architecture,
which gives the system structure in terms of large components.
→We can design those components, including both hardware (any specialized) & Software
modules we need.
Major goals of the designs: -
(i) Manufacturing cost
(ii) Performance (over all speed & deadlines)
(iii) power consumption.
(iv) user interface.
At each step in the design: -
(i) Analyse the design to determine how can we! matéperations.
(ii) Refine the design → to add detail.
(iii) Verify the design → to ensure that it still meets all system goals
1. Requirements: -
→ For creating architecture and components, we generally proceed in two phases:
(i) Gathering informal description from the customers known as requirements
(ii) Refining the requirements into a specification that contains enough information to begin
designing the system architecture
→ Requirements may be functional or non-functional. For Capturing the bask functions of the
embedded Systems, functional description is not sufficient.
→ Typical non-functional requirements include :-
(i) Performance
(ii) cost
(iii) physical size & weight
(iv) power consumption.
→ To refine at least the user interface portion of a system's a requirement is to build a
mock-up. (a model for testing or study).
→The mock-up may use canned data to simulate functionality in a restricted demonstration,
and it may be executed on a Pc or a workstation.
2. Specification:
→It serves as the contract between the customer and the architect
→ The specification must be carefully written so that it accurately reflects the customer’s
requirements.
→ It should meet system requirements and overall expectations of the customer. It should also
be unambiguous enough designers know what they need to build.
3. Architecture Design: -
→The specification does not say how the system does things, only what the system does.
→Describing how the system implements those functions is the purpose of the architecture.
→ The architecture design is a plan for the overall structure of the system that will be used
later to design the components that make up the architecture.
→ Architectural descriptions must be designed to satisfy both functional and non-functional
requirements.
→Only after we have designed an initial architecture that is not biased towards too many
implementation details, we should refine the system block diagram into two block diagrams
one of hardware and another for software.
4. Designing hardware and software Components: -
→ The architectural description tells us what component we need. The components design
effort builds these components in conformance to the architecture and specification.
→ The components in general include both hardware (Field programmable gate arrays
[FFGA's], boards &....) and software modules.
→ Some of the components will be ready-made. The CPU, for example will be a standard
component in almost all cases.
5. System Integration: -
→ Only after the components are built, they can put together and can view a working system
→ Bugs are typically found during system integration and good planning can find bugs
quickly.
→ System integration is difficult because it usually uncovers problems. Determining why
things don't work correctly and how they can be fixed is a challenge in itself.
IV. Formalisms for System Design:
Formalisms for system design are a set of visual modeling languages that can be used to
capture the basic components and behavior of a system 1. One such language is the Unified
Modeling Language (UML), which is designed to be useful at many levels of abstraction in
the design process 2. UML provides a set of structure diagrams and behavior diagrams that
can be used to describe the system’s architecture and behavior, respectively.
The use of formalisms in system design is important because it helps improve the quality and
cost of design and manufacture 1. It also helps designers meet requirements such as
functionality, performance, manufacturing cost, power consumption, time-to-market, and
other requirements.
The design process for creating complex systems involves multiple designers and requires a
proper design process. The process may be partially or fully automated using software tools to
transform and verify designs 1.
Here are some resources that might help you with formalisms for system design:
1. Unified Modeling Language (UML): UML is a visual modeling language that can be
used to capture all design tasks ¹³. It is designed to be useful at many levels of abstraction in
the design process.
2. Formalisms for System Design: This paper provides an overview of formalisms for
system design, including visual modeling languages, structure diagrams, and behavior
diagrams ¹. It also includes a detailed example of a model train controller .
Design Example: (Not sure with the correctness
of this)
This diagram shows the context-level flow of the
system. The system is designed to allow customers
to book flights, view flight schedules, and manage
their reservations. The system consists of several
modules, including a user interface module, a
flight search module, a reservation module, and a
payment module. The user interface module
provides a graphical interface for customers to interact with the system. The flight search
module allows customers to search for flights based on their preferences. The reservation
module allows customers to book flights and manage their reservations. Finally, the payment
module handles payment processing.
Basic components present internally inside the 8051 Microcontroller architecture are:
CPU (Central Processing Unit): CPU acts as a mind of any processing machine. It
synchronizes and manages all processes that are carried out in the microcontroller. The user
has no power to control the functioning of the CPU. It interprets the program stored in ROM
and carries it out from storage and then performs it projected duty. CPU manages the different
types of registers available in the 8051 microcontroller.
Interrupts: Interrupts is a sub-routine call that given by the microcontroller when some other
program with high priority is request for acquiring the system buses the n interrupts occur in
current running program.
Interrupts provide a method to postpone or delay the current process, performs a sub-routine
task and then restart the standard program again.
Types of interrupt in 8051 Microcontroller:
Let's see the five sources of interrupts in 8051 Microcontroller:
8051 Architecture:
micro controller is single chip on which timer, counter, serial port, I/O ports, oscillator,
memory in built. Intel was found 8051 micro controller in 1981 with in built memory in 8051
micro controller 4KB ROM,128byte RAM,2 timer/counter, crystal oscillator,4 I/O ports are
inbuilt. The 8051 family controller is eight bit with 40 pins IC.
feature:
• eight bit CPU each register A and B.
• PC(program counter) and DPTR (data pointer) are two sixteen bit register.
• eight bit program status word (PSW) register and stack pointer(SP).
• 4KB internal ROM and 128Bytes internal RAM.
• 32 inputs/outputs pins divided in four ports(P0-P1).
• two 16 bit timer/counter:T0,T1
• full duplex serial ports.
• control register:TCON,SCON,TMOD,IP,IE.
• five interrupt source.
• oscillator and clock circuit.
• support power down and idle mode for power saving.
FUNCTION OF EACH BLOCK OF 8051
ALU(Athematic Logic Unit):
• it arithmetic and logic units.
• used to perform arithmetic and logical operation.
REGISTER A:
• its call accumulator.
• its used as destination in all arithmetic and logical instruction.
• its also used in data transfer between 8051 and external memory.
REGISTER B:
• its used with A in multiplication and division instruction.
PC(program counter):
• its 16 bit register.
• its used to store address of next instruction to be executed.
DPTR(data pointer):
• its also 16 bit register.
• used to store 16 bit data.
• also store 16 bit address of external memory.
STACK POINTER(SP):
• its 8 bit register.
• store address of top of stack.
• stack is part of RAM where data store temporary.
PSW(program status word):
• its 8 bit register.
• its contain flag register which are change after arithmetic and logical instruction.
• its contain carry,auxiliary carry,parity,overflow and user define flags.
• also contain register bank selection bits.
INTERNAL MEMORY:
• internal RAM is 128 byte and ROM is 4KB called program memory.
• internal RAM divided in 3 parts.
1. 32 bytes for register bank(four register bank each contain 8 register of 1 byte)(00-
1Fh)
2. 16 bit addressable area where u can access individual bit(20-2Fh)
3. 80 byte for scratch pad area(30-7Fh).
EXTERNAL MEMORY:
• we connect 64KB of external memory with 8051.
SPECIAL FUNCTION REGISTER(SFR):
• IP,IE are used for interrupt.
• TCON,TMOD used for timer/counter operation.
• SCON for serial communication.
• PCON for power saving modes.
I/O PORTS:
• there are 32 pins for input and outputs.
• in 8051 four I/O ports each contain 8 pins.
• PORT 0:its provide 8 bit data as well as lower byte address(AD0-AD7).
• PORT 1:it for input/output.
• PORT 2:its provide higher byte of address.
• PORT 3:its input/output ports as well as some alternative function provide.
OSCILLATOR:
• its connected between XTAL1 and XTAL2 pins.
• its generated clock pulse for controller.
ALE(Address Latch Enable)/PROG:
• its demultiplex address and data bus which are multiplex(AD0-AD7).
• initial ALE high so work as address bus then ALE become LOW so work as data bus.
PSEN(program store enable):
• its output pin.
• which indicate program run from internal or external memory.
• if high then program executing from external memory otherwise internal memory.
EA(External Access input):
• its input pin.
• when using internal memory this connected with Vcc.
• its connected to ground when used external memory.
RST(reset):
• its input pin and active high pins.
• to restart micro controller we have to push this for at least two machine cycles.
PORT1:
• Like PORT0, PORT1 is also an 8-bit bidirectional I/O port.
• It's primarily used for general-purpose input and output operations.
• PORT1 pins can be configured to read input signals from external sensors or to send
output signals to control various devices.
•
PORT2 is an 8-bit bidirectional I/O port.
• It doesn't have any special functions like addressing bus duties; instead, it's dedicated
entirely to general-purpose I/O.
• You can use PORT2 to connect to external devices for data input or output as needed.
Port3 pin configuration
3. External Memory:-
Two separate external memory spaces are made available by the 16-bit PC and DPTR
and by different control pins for enabling external ROM and RAM chips. There are several
reasons for adding external memory:
(i) When the project is in the prototype stage, the expense- in time and money of having a
masked internal ROM made for each program "try" is prohibitive. The manufacturers make
available an EPROM Version, 4K of on-chip EPROM.
(ii) If the program is written in a high-level language, the program size exceeds 4k, and an
external program memory is needed. Manufacturers provide the ROMless 8031.
4. Counters and Timers:
A timer is a specialized type of clock that is used to measure time intervals. A
timer that counts from zero upwards for measuring time elapsed is often called
a stopwatch. It is a device that counts down from a specified time interval and is
used to generate a time delay, for example, an hourglass is a timer.
A counter is a device that stores (and sometimes displays) the number of times a
particular event or process occurred, concerning a clock signal. It is used to count the
events happening outside the microcontroller. In electronics, counters can be
implemented quite easily using register-type circuits such as a flip-flop.
A timer and a counter are not the same in 8051. A timer counts the internal
clock cycles of the microcontroller, while a counter counts the external pulses
applied to a pin of the microcontroller123. Both Timer 0 and Timer 1 are 16-bit wide
and can be used as timers or counters.
Timer Counter
The register is incremented for every The register is incremented considering the
machine cycle. 1 to 0 transition corresponding to an
external input pin (T0, T1).
Maximum count rate is 1/12 of the Maximum count rate is 1/24 of the
oscillator frequency. oscillator frequency.
A timer uses the frequency of the A counter uses an external signal to count
internal clock and generates delay. pulses.
Timer 1 Register
The 16-bit register of Timer 1 is accessed as low- and high-byte. The low-byte
register is called TL1 (Timer 1 low byte) and the high-byte register is called TH1
(Timer 1 high byte). These registers can be accessed like any other register. For
example, the instruction MOV TL1, #4H moves the value into the low byte of Timer
1.
6. Interrupts:
Interrupts are events that temporarily suspend the main program and pass control to external
sources. The 8051 microcontroller has five interrupt sources:
• Two internal timer interrupts
• Two external hardware interrupts
• One serial interrupt
The five interrupt signals are INT0, TFO, INT1, TF1, and RI/TI.
The highest priority interrupt is the Reset, with vector address 0x0000. The microcontroller
has two levels of interrupt priorities: high or low. Priorities are set by bits in a special
function register called IP.
The microcontroller can generate the timer and serial interrupts internally. External interrupts
are generated by additional interfacing devices or switches that are connected to the
microcontroller.
Interrupts can be enabled or disabled by setting or clearing corresponding bits in the Interrupt
Enable (IE) Register. All interrupts can also be enabled or disabled globally using the EA bit
in the IE register.
Internal Memory :-
>A functioning computer must have memory for program code bytes, commonly in ROM
and RAM memory for variable data that can be altered as the program runs.
The 8051 has a Harvard architecture, which uses the same address, in different memories,
for code & data.
Internal RAM: 128 byte internal