0% found this document useful (0 votes)
19 views

Module I

This document provides an overview of embedded systems and their characteristics. It discusses how embedded systems are designed to perform specific functions within larger devices. Common examples are listed and key characteristics like being single-purpose, constrained by size/power/cost, and requiring real-time performance are described. A digital camera is presented as a complex embedded system example, showcasing how it must optimize for these characteristics. The challenges of designing embedded systems to meet multiple optimization metrics are also outlined.

Uploaded by

Pranith Reddy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Module I

This document provides an overview of embedded systems and their characteristics. It discusses how embedded systems are designed to perform specific functions within larger devices. Common examples are listed and key characteristics like being single-purpose, constrained by size/power/cost, and requiring real-time performance are described. A digital camera is presented as a complex embedded system example, showcasing how it must optimize for these characteristics. The challenges of designing embedded systems to meet multiple optimization metrics are also outlined.

Uploaded by

Pranith Reddy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 90

Module I

BCSE305L: Embedded Systems

Prepared by
Dr. Vijayakumar P
Professor,
School of Electronics Engineering,
Vellore Institute of Technology, Chennai

18-01-2024 BCSE305L: Embedded Systems 1


Embedded Systems Overview
• Definition: An embedded system is a
computing system designed to perform a
specific function within a larger electronic
device.

• Contrasted with desktop computers, laptops,


or mainframes.

• Often goes unnoticed by the device's user.


18-01-2024 BCSE305L: Embedded Systems 2
Examples of Embedded Systems:
• Consumer electronics: cell phones, pagers, digital
cameras, camcorders, calculators, etc. - Home
appliances: microwave ovens, thermostat,
washing machines, etc.
• Office automation: fax machines, printers,
scanners, etc.
• Business equipment: cash registers, product
scanners, ATM machines, etc.
• Automobiles: transmission control, anti-lock
brakes, etc.

18-01-2024 BCSE305L: Embedded Systems 3


Characteristics of Embedded Systems:
• Real-time and reactive nature.
• Limited resources.
• Need for low power consumption.
• Require expertise in both hardware and
software design.
• Optimization of design metrics such as
performance, power consumption, and time-
to-market is crucial.
18-01-2024 BCSE305L: Embedded Systems 4
Common characteristics of embedded
systems include:

1. Single-functioned: Typically designed to execute a specific


program repeatedly, unlike desktop systems that run a variety of
programs.

2. Tightly constrained: Subject to strict design metrics such as


cost, size, performance, and power consumption, often
requiring optimization in these areas.

18-01-2024 BCSE305L: Embedded Systems 5


Common characteristics of embedded
systems include:
3. Real-time and reactive: Many embedded systems must react
to changes in their environment and perform computations in
real time without delay.

4. Pervasive presence: Embedded systems are found in a wide


range of electronic devices, from consumer electronics to
automobiles, and are becoming increasingly prevalent in
modern technology

18-01-2024 BCSE305L: Embedded Systems 6


Am embedded system example – a digital
camera

18-01-2024 BCSE305L: Embedded Systems 7


Digital cameras exemplify the characteristics of
embedded systems in several ways:
Single-functioned: A digital camera is designed to perform a
specific set of tasks repeatedly, such as capturing, compressing,
storing, decompressing, and displaying images. It is dedicated
to its primary function, unlike a general-purpose computer that
runs various applications.

Tightly constrained: Digital cameras have strict design


constraints, including cost, size, performance, and power
consumption. They must be affordable, compact, fast enough to
process images in real-time, and consume minimal power to
extend battery life.

18-01-2024 BCSE305L: Embedded Systems 8


Digital cameras exemplify the characteristics of
embedded systems in several ways:

Real-time and reactive: Digital cameras must react to user input


(e.g., pressing the shutter button) and process images in real-
time without delay. This real-time processing is essential for
capturing and displaying images effectively.

Pervasive presence: Digital cameras are ubiquitous in modern


society, found in various consumer electronics devices. They
showcase the prevalence of embedded systems in everyday
technology.

18-01-2024 BCSE305L: Embedded Systems 9


18-01-2024 BCSE305L: Embedded Systems 10
• The A2D and D2A circuits convert analog images to digital
and digital to analog, respectively.

• The CCD preprocessor is a charge-coupled device


preprocessor.

• The JPEG codec compresses and decompresses an image


using the JPEG2 compression standard, enabling compact
storage in the limited memory of the camera.

• The Pixel coprocessor aids in rapidly displaying images.

• The Memory controller controls access to a memory chip also


found in the camera, while the DMA controller enables direct
memory access without
18-01-2024
requiring the use of the11
BCSE305L: Embedded Systems
microcontroller.
• The UART enables communication with a PC’s serial port
for uploading video frames, while the ISA bus interface
enables a faster connection with a PC’s ISA bus.

• The LCD ctrl and Display ctrl circuits control the display of
images on the camera’s liquid-crystal display device.

• A Multiplier/Accum circuit assists with certain digital signal


processing.

• At the heart of the system is a microcontroller, which is a


processor that controls the activities of all the other circuits.

• We can think of each device as a processor designed for a


particular task, while the microcontroller is a more general
processor designed for general tasks.

18-01-2024 BCSE305L: Embedded Systems 12


• This example illustrates some of the embedded system
characteristics described above.

– First, it performs a single function repeatedly. The system


always acts as a digital camera, wherein it captures,
compresses and stores frames, decompresses and displays
frames, and uploads frames.

– Second, it is tightly constrained. The system must be low


cost since consumers must be able to afford such a camera.
It must be small so that it fits within a standard-sized
camera. It must be fast so that it can process numerous
images in milliseconds. It must consume little power so
that the camera’s battery will last a long time.

18-01-2024 BCSE305L: Embedded Systems 13


• However, this particular system does not posses a high degree
of the characteristic of being reactive and real-time, as it only
needs to respond to the pressing of buttons by a user, which
even for an avid photographer is still quite slow with respect to
processor speeds.

18-01-2024 BCSE305L: Embedded Systems 14


Design challenge – optimizing design metrics

• The embedded-system designer must of course construct an


implementation that fulfills desired functionality, but a
difficult challenge is to construct an implementation that
simultaneously optimizes numerous design metrics.

• For our purposes, an implementation consists of a software


processor with an accompanying program, a connection of
digital gates, or some combination thereof.

• A design metric is a measurable feature of a system’s


implementation. Common relevant metrics include:

18-01-2024 BCSE305L: Embedded Systems 15


Common relevant metrics
• Unit cost: the monetary cost of manufacturing each copy of
the system, excluding NRE cost.

• NRE cost (Non-Recurring Engineering cost): The monetary


cost of designing the system. Once the system is designed, any
number of units can be manufactured without incurring any
additional design cost (hence the term “non-recurring”).

• Size: the physical space required by the system, often


measured in bytes for software, and gates or transistors for
hardware

18-01-2024 BCSE305L: Embedded Systems 16


• Performance: the execution time or throughput of the system.

• Power: the amount of power consumed by the system, which


determines the lifetime of a battery, or the cooling requirements of
the IC, since more power means more heat.

• Flexibility: the ability to change the functionality of the system


without incurring heavy NRE cost. Software is typically considered
very flexible.

• Time-to-market: The amount of time required to design and


manufacture the system to the point the system can be sold to
customers

18-01-2024 BCSE305L: Embedded Systems 17


• Time-to-prototype: The amount of time to build a working
version of the system, which may be bigger or more expensive
than the final system implementation, but can be used to verify
the system’s usefulness and correctness and to refine the
system's functionality.

• Correctness: our confidence that we have implemented the


system’s functionality correctly. We can check the
functionality throughout the process of designing the system,
and we can insert test circuitry to check that manufacturing
was correct.

18-01-2024 BCSE305L: Embedded Systems 18


• Safety: the probability that the system will not
cause harm

18-01-2024 BCSE305L: Embedded Systems 19


18-01-2024 BCSE305L: Embedded Systems 20
Embedded processor technology
• Processor technology involves the architecture of the
computation engine used to implement a system’s desired
functionality.
• While the term “processor” is usually associated with
programmable software processors, we can think of many
other, nonprogrammable, digital systems as being processors
also.
• Each such processor differs in its specialization towards a
particular application (like a digital camera application), thus
manifesting different design metrics.
• We illustrate this concept graphically in Figure 1.5. The
application requires a specific embedded functionality,
represented as a cross, such as the summing of the items in an
array, as shown in Figure 1.5(a).
18-01-2024 BCSE305L: Embedded Systems 21
• Several types of processors can implement
this functionality, each of which we now
describe.

• We often use a collection of such processors


to best optimize our system’s design metrics,
as was the case in our digital camera example.

18-01-2024 BCSE305L: Embedded Systems 22


Types of Embedded Processors
1. General-Purpose Processors: Examples include ARM,
Intel x86, and MIPS processors. These are versatile
processors used in a wide range of applications.

2. Application-Specific Processors: Customized


processors designed for specific applications, such as
digital signal processors (DSPs) for signal processing
tasks.

3. Single-Purpose Processors: Specialized processors


tailored to perform a specific function, such as LCD
controllers, stepper motor controllers, etc

18-01-2024 BCSE305L: Embedded Systems 23


18-01-2024 BCSE305L: Embedded Systems 24
General-purpose processors -- software
• The designer of a general-purpose processor builds a device
suitable for a variety of applications, to maximize the
number of devices sold.

• One feature of such a processor is a program memory – the


designer does not know what program will run on the
processor, so cannot build the program into the digital circuit.

• Another feature is a general datapath – the datapath must be


general enough to handle a variety of computations, so
typically has a large register file and one or more general-
purpose arithmetic-logic units (ALUs).
• .
18-01-2024 BCSE305L: Embedded Systems 25
General-purpose processors -- software

• An embedded system designer, however, need


not be concerned about the design of a general-
purpose processor.

• An embedded system designer simply uses a


general-purpose processor, by programming
the processor’s memory to carry out the required
functionality.

• Many people refer to this portion of an


implementation simply as the “software” portion
18-01-2024 BCSE305L: Embedded Systems 26
Using a general-purpose processor in an embedded system may result in
several design-metric benefits.

• Design time and NRE cost are low, because the designer must only write a
program, but need not do any digital design.

• Flexibility is high, because changing functionality requires only changing


the program.

• Unit cost may be relatively low in small quantities, since the processor
manufacturer sells large quantities to other customers and hence
distributes the NRE cost over many units.

• Performance may be fast for computation-intensive applications, if using


a fast processor, due to advanced architecture features and leading edge
IC technology.

18-01-2024 BCSE305L: Embedded Systems 27


However, there are also some design-metric
drawbacks.

• Unit cost may be too high for large quantities.

• Performance may be slow for certain


applications.

• Size and power may be large due to unnecessary


processor hardware.

18-01-2024 BCSE305L: Embedded Systems 28


• For example, we can use a general-purpose processor to
carry out our array summing functionality from the earlier
example.

• Figure 1.5(b) illustrates that a general purpose covers the


desired functionality, but not necessarily efficiently.

• Figure 1.6(a) shows a simple architecture of a general-purpose


processor implementing the array summing functionality. The
functionality is stored in a program memory.

• The controller fetches the current instruction, as indicated by


the program counter (PC), into the instruction register (IR).

• It then configures the datapath for this instruction and executes


the instruction.
18-01-2024 BCSE305L: Embedded Systems 29
18-01-2024 BCSE305L: Embedded Systems 30
Single-purpose processors -- hardware

• A single-purpose processor is a digital circuit designed to


execute exactly one program.

• All of the components other than the microcontroller are


single-purpose processors.

• The JPEG codec, for example, executes a single program that


compresses and decompresses video frames.

• An embedded system designer creates a single-purpose


processor by designing a custom digital circuit.
18-01-2024 BCSE305L: Embedded Systems 31
• Using a single-purpose processor in an embedded system
results in several design metric benefits and drawbacks, which
are essentially the inverse of those for general purpose
processors.

• Performance may be fast, size and power may be small, and


unit-cost may be low for large quantities, while design time
and NRE costs may be high, flexibility is low, unit cost may be
high for small quantities, and performance may not match
general-purpose processors for some applications.

• For example, Figure 1.5(d) illustrates the use of a single-


purpose processor in our embedded system example,
representing an exact fit of the desired functionality, nothing
more, nothing less.

18-01-2024 BCSE305L: Embedded Systems 32


• Figure 1.6(c) illustrates the architecture of such a single-purpose
processor for the example.

• Since the example counts from one to N, we add an index register.

• The index register will be loaded with N, and will then count down
to zero, at which time it will assert a status line read by the
controller.

• Since the example has only one other value, we add only one
register labeled total to the data path.

• Since the example’s only arithmetic operation is addition, we add a


single adder to the datapath.

• Since the processor only executes this one program, we hardwire the
program directly into the control logic.

18-01-2024 BCSE305L: Embedded Systems 33


Application-specific processors

• An application-specific instruction-set processor (or ASIP) can


serve as a compromise between the above processor options.

• An ASIP is designed for a particular class of applications with


common characteristics, such as digital-signal processing,
telecommunications, embedded control, etc.

• The designer of such a processor can optimize the data path for
the application class, perhaps adding special functional units
for common operations, and eliminating other infrequently
used units.

18-01-2024 BCSE305L: Embedded Systems 34


Application-specific processors
• Using an ASIP in an embedded system can provide the
benefit of flexibility while still achieving good performance,
power and size.
• However, such processors can require large NRE cost to
build the processor itself, and to build a compiler, if these
items don’t already exist.
• Much research currently focuses on automatically
generating such processors and associated retargetable
compilers.
• Due to the lack of retargetable compilers that can exploit
the unique features of a particular ASIP, designers using
ASIPs often write much of the software in assembly
language.

18-01-2024 BCSE305L: Embedded Systems 35


Application-specific processors
• Digital-signal processors (DSPs) are a common class of ASIP,
so demand special mention.

• A DSP is a processor designed to perform common operations


on digital signals, which are the digital encodings of analog
signals like video and audio.

• These operations carry out common signal processing tasks


like signal filtering, transformation, or combination.

18-01-2024 BCSE305L: Embedded Systems 36


Application-specific processors
• Such operations are usually math-intensive, including
operations like multiply and add or shift and add.

• To support such operations, a DSP may have special


purpose datapath components such a multiply-
accumulate unit, which can perform a computation like
T = T + M[i]*k using only one instruction.

• Because DSP programs often manipulate large arrays of


data, a DSP may also include special hardware to fetch
sequential data memory locations in parallel with other
operations, to further speed execution.

18-01-2024 BCSE305L: Embedded Systems 37


Application-specific processors
• Figure 1.5(c) illustrates the use of an ASIP for our
example;

• while partially customized to the desired functionality,


there is some inefficiency since the processor also
contains features to support reprogramming.

• Figure 1.6(b) shows the general architecture of an ASIP


for the example.

18-01-2024 BCSE305L: Embedded Systems 38


Application-specific processors
• The datapath may be customized for the example.

• It may have an auto-incrementing register, a path that


allows the add of a register plus a memory location in
one instruction, fewer registers, and a simpler
controller.

18-01-2024 BCSE305L: Embedded Systems 39


18-01-2024 BCSE305L: Embedded Systems 40
Design technology

• Design technology involves the manner in which we


convert our concept of desired system functionality into an
implementation.

• We must not only design the implementation to optimize


design metrics, but we must do so quickly.

• The designer must be able to produce larger numbers of


transistors every year, to keep pace with IC technology.

• Hence, improving design technology to enhance


productivity has been a focus of the software and
hardware design communities for decades.
18-01-2024 BCSE305L: Embedded Systems 41
• To understand how to improve the design process, we must
first understand the design process itself. Variations of a top-
down design process have become popular in the past decade,.

18-01-2024 BCSE305L: Embedded Systems 42


The designer refines the system through several abstraction
levels.

• At the system level, the designer describes the desired


functionality in some language, often a natural language like
English, but preferably an executable language like C; we shall
call this the system specification.

• The designer refines this specification by distributing


portions of it among chosen processors (general or single
purpose), yielding behavioral specifications for each
processor.

18-01-2024 BCSE305L: Embedded Systems 43


• The designer refines these specifications into register-transfer
(RT) specifications by converting behavior on general-
purpose processors to assembly code, and by converting
behavior on single-purpose processors to a connection of
register-transfer components and state machines.

• The designer then refines the register-transfer-level


specification of a single-purpose processor into a logic
specification consisting of Boolean equations.

• Finally, the designer refines the remaining specifications into


an implementation, consisting of machine code for general-
purpose processors, and a gate-level netlist for single-
purpose processors.

18-01-2024 BCSE305L: Embedded Systems 44


There are three main approaches to improving
the design process for increased productivity,
which we label as

• compilation/synthesis,

• libraries/IP, and

• test/verification.

18-01-2024 BCSE305L: Embedded Systems 45


Compilation/Synthesis
• A designer specify desired functionality in an abstract
manner, and automatically generates lower-level
implementation details.

• Describing a system at high abstraction levels can improve


productivity by reducing the amount of details, often by an
order of magnitude, that a design must specify.

• A logic synthesis tool converts Boolean expressions into a


connection of logic gates (called a netlist).

18-01-2024 BCSE305L: Embedded Systems 46


• A register-transfer (RT) synthesis tool converts finite-state
machines and register-transfers into a datapath of RT
components and a controller of Boolean equations.

• A behavioral synthesis tool converts a sequential program


into finite-state machines and register transfers.

• Likewise, a software compiler converts a sequential


program to assembly code, which is essentially register-
transfer code.

• Finally, a system synthesis tool converts an abstract system


specification into a set of sequential programs on general
and single-purpose processors.

18-01-2024 BCSE305L: Embedded Systems 47


• The relatively recent maturation of RT and behavioral
synthesis tools has enabled a unified view of the design
process for single-purpose and general-purpose processors.

• Design for the former is commonly known as “hardware


design,” and design for the latter as “software design.”

• In the past, the design processes were radically different –


software designers wrote sequential programs, while
hardware designers connected components.

• But today, synthesis tools have converted the hardware design


process essentially into one of writing sequential programs.

18-01-2024 BCSE305L: Embedded Systems 48


• We can think of abstraction levels as being the rungs of
a ladder, and compilation and synthesis as enabling
us to step up the ladder and hence enabling designers to
focus their design efforts at higher levels of abstraction,
as illustrated in Figure 1.10.

• Thus, the starting point for either hardware or


software is sequential programs, enhancing the view
that system functionality can be implemented in
hardware, software, or some combination thereof.

• The choice of hardware versus software for a particular


function is simply a tradeoff among various design metrics,
like performance, power, size, NRE cost, and especially
flexibility; there is no fundamental difference between what
the two can implement.

18-01-2024 BCSE305L: Embedded Systems 49


18-01-2024 BCSE305L: Embedded Systems 50
• Hardware/software codesign is the field that
emphasizes this unified view, and develops
synthesis tools and simulators that enable the
co-development of systems using both
hardware and software

18-01-2024 BCSE305L: Embedded Systems 51


Libraries/IP
• Libraries involve re-use of pre-existing implementations.
Using libraries of existing implementations can improve
productivity if the time it takes to find, acquire, integrate and
test a library item is less than that of designing the item
oneself.

• A logic-level library may consist of layouts for gates and


cells.

• An RT-level library may consist of layouts for RT


components, like registers, multiplexors, decoders, and
functional units.
18-01-2024 BCSE305L: Embedded Systems 52
• A behavioral-level library may consist of commonly used
components, such as compression components, bus
interfaces, display controllers, and even general purpose
processors.

• The advent of system-level integration has caused a great


change in this level of library.

• Rather than these components being IC’s, they now must


also be available in a form, called cores, that we can
implement on just one portion of an IC.

• This change from behavioral-level libraries of IC’s to


libraries of cores has prompted use of the term Intellectual
Property (IP), to emphasize the fact that cores exist in a
“soft” form that must be protected from copying.

18-01-2024 BCSE305L: Embedded Systems 53


• Finally, a system-level library might consist
of complete systems solving particular
problems, such as an interconnection of
processors with accompanying operating
systems and programs to implement an
interface to the Internet over an Ethernet
network.

18-01-2024 BCSE305L: Embedded Systems 54


Test/Verification
• Test/Verification involves ensuring that
functionality is correct. Such assurance can
prevent time-consuming debugging at low
abstraction levels and iterating back to high
abstraction levels.

18-01-2024 BCSE305L: Embedded Systems 55


• Simulation is the most common method of testing for correct
functionality, although more formal verification techniques are
growing in popularity.

• At the logic level, gatelevel simulators provide output signal


timing waveforms given input signal waveforms.

• Likewise, general-purpose processor simulators execute


machine code.

• At the RT-level, hardware description language (HDL)


simulators execute RT-level descriptions and provide output
waveforms given input waveforms.

18-01-2024 BCSE305L: Embedded Systems 56


• At the behavioral level, HDL simulators
simulate sequential programs, and co-
simulators connect HDL and general purpose
processor simulators to enable
hardware/software co-verification.

18-01-2024 BCSE305L: Embedded Systems 57


• At the system level, a model simulator simulates
the initial system specification using an abstract
computation model, independent of any processor
technology, to verify correctness and
completeness of the specification.

• Model checkers can also verify certain properties


of the specification, such as ensuring that certain
simultaneous conditions never occur, or that the
system does not deadlock
18-01-2024 BCSE305L: Embedded Systems 58
8051 ARCHITECTURE
FEATURES
 8-bit CPU
 4K bytes on-chip program memory (ROM)
 128 bytes on-chip data memory (RAM)
 32 I/O pins arranged as four 8-bit ports (P0 - P3)
 32 general purpose registers each of 8-bit
 Special Function Registers (SFRs) of 128 bytes
 16-bit Program Counter
 8-bit Processor Status Word (PSW) & Stack Pointer
 Two 16-bit timer/counters : T0 and T1
 Two external and three internal vectored interrupts
 One full duplex serial I/O (UART)
PIN DIAGRAM
8051 Architecture
65
 The ARM processor, like all RISC processors, uses a load-store architecture.
This means it has two instruction types for transferring data in and out of the
processor.

 Load instructions copy data from memory to registers in the core, and
conversely the store instructions copy data from registers to memory.

 There are no data processing instructions that directly manipulate data in


memory. Thus, data processing is carried out solely in registers.

 Load and store instructions use the ALU to generate an address to be held in
the address register and broadcast on the Address bus.

 Data enters the processor core through the data bus and the data may be an
instruction to execute or a data item.
ARM Architecture
 Address register: It store the 32-bit memory address from which the
data/instruction to be accessed.

 Incrementer: It increments the memory address so as to point to the next


instruction when required.

 Data in and Data out registers: It is used as a buffer to store the 32-bit data
when read/write operation is performed from/into the memory

 Instruction decoder and control unit:

 The instruction decoder translates instructions before they are executed.

 The operation in the processor is managed and controlled with the help of
signals generated to different components in the system from the control
unit.
 Register bank:
 Data items are placed in the register bank - a storage unit made up of 32-
bit registers.

 Also it is used in arithmetic operations, intermediate variable storage,


temporary address storage.

 ALU:
 This unit performs the various arithmetic and logical operations on two
32-bits inputs.

 The primary input comes from the register file using A bus, whereas the
other input comes from the barrel shifter using the B bus.

 After passing through the ALU unit, the result is written back to the
register file using the ALU bus.

 Status registers flags are modified by the ALU outputs.


 Barrel shifter:
 This is the unique and powerful feature of the ARM
processor which has the ability to shift the 32-bit binary
pattern in one of the source registers left or right by a
specific number of positions before it enters the ALU.

 This shift increases the power and flexibility of many data


processing operations and it is useful for loading constants
into a register to achieve fast multiply/division by a power
of 2.
 Multiply register:
 This unit performs the operation known as multiply-
accumulate (MAC), a fundamental operation in many
computing devices, especially in Digital Signal
Processing (DSP) application.

 MAC unit operates in two stages, firstly it computes the


product of given numbers and forward the result for the
second stage operation i.e. addition/accumulate.

 Any operation’s result can be written back to the register


bank, or if the instruction needs memory access, the result
is sent to the address register.
Registers
• General Purpose registers hold either data or address
• All registers are of 32 bits
• In user mode 16 data registers and 2 status registers
are visible
• Data registers: r0 to r15
– Three registers r13, r14, r15 perform special functions
– r13: stack pointer
– r14: link register ( where return address is put whenever a
subroutine is called)
– r15: program counter
REGISTERS

• The ARM processor has three registers assigned to a


particular task or special function: r13, r14, and r15.
• Register r13 is traditionally used as the stack pointer
(sp) and stores the head of the stack in the current
processor mode.
• Register r14 is called the link register (lr) and is where
the core puts the return address whenever it calls a
subroutine.
• Register r15 is the program counter (pc) and contains
the address of the next instruction to be fetched by the
processor.
Registers
• Depending upon context, registers r13 and r14
can also be used as GPR
• Any instruction which use r0 can as well be
used with any other GPR (r1-r13)
• In addition, there are two status registers
– CPSR: current program status register
– SPSR: saved program status register
Registers
PIC Architecture
• Peripheral Interface Controller (PIC) is
microcontroller developed by Microchip,
PIC microcontroller is fast and easy to
implement program when we compare
other microcontrollers like 8051.
• The ease of programming and easy to
interfacing with other peripherals PIC
became successful microcontroller.
We know that microcontroller is an integrated chip which
consists of RAM, ROM, CPU, TIMERS, COUNTERS etc.
PIC is a microcontroller which also consists of ram, rom,
CPU, timers, counter, ADC (analog to digital converters),
DAC (digital to analog converter).
PIC also supports the protocols like CAN, SPI, UART for
interfacing with other peripherals. PIC mainly used modified
Harvard architecture and also supports RISC (Reduced
Instruction Set Computer) by the above specification RISC
and Harvard we can easily that PIC is faster than the 8051
based controller which is made-up of Von-Newman
architecture.
Memory of the PIC is divided into 3 types of memories:
• Program Memory - A memory that contains the
program(which we had written), after we've burned it. As a
reminder, Program Counter executes commands stored in the
program memory, one after the other.
• Data Memory – This is RAM memory type, which contains a
special registers like SFR (Special Function Register) and GPR
(General Purpose Register). The variables that we store in the
Data Memory during the program are deleted after we turn of
the micro.
• These two memories have separated data buses, which makes
the access to each one of them very easy.
• Data EEPROM (Electrically Erasable Programmable Read-Only
Memory) - A memory that allows storing the variables as a
result of burning the written program.
• Each one of them has a different role.
• Program Memory and Data Memory two memories that are
needed to build a program, and Data EEPROM is used to save
data after the microcontroller is turn off.
• Program Memory and Data EEPROM they are non-volatile
memories, which store the information even after the power
is turn off. These memories called Flash Or EEPROM.
• In contrast, Data Memory does not save the information
because it needs power in order to maintain the information
stored in the chip.
RAM
RAM (Random Access Memory) which is a volatile memory used
for storing the data temporarily in its registers.
RAM memory is divided in to Banks, in each banks we have
number of registers.
The RAM registers is divided into 2 types. They are General
purpose registers (GPR) and Special purpose registers (SPR).
Three important SFRs:
1.Status Register: Changes the bank
2.Port Register: Assigns logic values 0 or 1 to the ports
3.TRIS Register: Data direction register for input and output
Architecture
CPU
• CPU is not different from other microcontrollers CPU.
• PIC microcontroller CPU consists of Arithmetic logic unit
(ALU), memory unit (MU), control unit (CU), Accumulator etc.
• RISC has very few instructions (approx. ~ 35) which are used in
the program.
• Length of the instruction is small and fixed and takes same
amount of time for processing.
• As the instruction is small it will take less time to process
another words CPU will be fast.
• Compiler need not be complex and debugging will be very
easy in the programmer point of view.
I/O Ports
• Port A: It is a 16-bit port, which can be used as an input or
output port based on the status of the TRISA register.
• Port B: It is an 8-bit port, which can be used as both an input
and output port.
• Port C: It is an 8-bit port whose operation (input or output) is
determined by the status of the TRISC register.
• Port D: It is an 8-bit port, which apart from being an I/O port,
acts as a slave port for connection to the microprocessor bus.
• Port E: It is a 3-bit port that serves the additional function of
the control signals to the A/D converter.
Timers
PIC microcontrollers consist of 3 timers, out of
which the Timer 0 and Timer 2 are 8-bit timers
and the Time-1 is a 16-bit timer, which can also
be used as a counter.
A/D Converter
The PIC Microcontroller consists of 8-channels,
10-bit Analog to Digital Converter. The operation
of the A/D converter is controlled by these
special function registers: ADCON0 and
ADCON1.
Oscillators

• Oscillatorsare used for timing generation. PIC


microcontrollers consist of external oscillators like crystals or
RC oscillators. In the case of crystal oscillators, the crystal is
connected between two oscillator pins, and the value of the
capacitor connected to each pin determines the mode of
operation of the oscillator. The different modes are low-power
mode, crystal mode, and the high- speed mode. In the case of
RC oscillators, the value of the Resistor and Capacitor
determines the clock frequency. The clock frequency ranges
from 30 kHz to 4 MHz.
CCP Module
A CCP module works in the following three modes:
• Capture Mode: This mode captures the time of arrival of a
signal, or in other words, captures the value of the Timer
when the CCP pin goes high.
• Compare Mode: It acts as an analog comparator that
generates an output when the timer value reaches a certain
reference value.
• PWM Mode: It provides pulse width modulated output with a
10-bit resolution and programmable duty cycle.
• Watchdog timer that resets the microcontroller in case of any
software malfunction.
PIC Microcontroller Advantages
• Interfacing of an analog device is easy without
extra circuitry.
• When compared to other microcontrollers,
power consumption is very low, and
programming is very easy.
• It is consistent and faulty of PIC percentage is
very low. Using RISC architecture the
performance is high-speed.
Thank You

You might also like