1-PIC Uc

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 30

DEFINITION

 An embedded system is a system that has embedded software


and computer hardware which makes it a system dedicated for
an application or specific part of an application.
 Embedded Systems are products designed with computational
intelligence and interfaces to the physical environment to
perform specific functions.
 These products are designed to meet a set of specified
requirements derived to provide solutions to real-world
problems.
 The computational intelligence in embedded systems refers to the use of
microprocessors, microcontrollers that form the heart of embedded
systems.
 The intelligence for the embedded system is the software program that is
loaded into the memory of the microprocessor peripherals.
 Embedded systems have the following characteristics that differentiate
them from other systems.
Specific Function
Constrained System
Real time System
Reliability
 Specific Function:
A single specific function is performed by the embedded system
in a repetitive manner. For example, a digital camera is an embedded
system that is designed to take pictures.
 Constrained System:
The design for embedded systems will need to meet stringent
requirements that makes the application commercially viable. These
applications need to be designed keeping in mind the performance, size
and commercial aspects of the product.
 Real time systems:
Embedded systems are also called real-time interactive
systems since they need to perform in an environment within specific time
constraints.
For example, an air-bag system in an automobile needs to be
deployed within a few milliseconds of a head-on collision in order to save
the occupants of the vehicle.
 Reliability:
The dedicated programs running in these systems works all
the time. In medical applications such as a pacemaker that is implanted
next to the heart to provide electrical stimulations.
SIMPLE EMBEDDED
SYSTEMS
These embedded systems are designed for
specific purposes where the user need not be trained
extensively to understand the system.
Examples
1. Digital Clock
2. Calculator
3. Microwave Oven
 An example for simple embedded system is process indicator
which displays temperature in degree Celsius or degree
Fahrenheit. The features of this system are described below:
 LCD indicator that displays temperature
 ON-OFF switch to turn on or off the indicator
 Slide switch to select the units to be in Celsius or Fahrenheit
 Battery compartment
COMPLEX EMBEDDED SYSTEM
 These systems may be interconnected by sub-systems
comprising of simple embedded systems.
 Moreover the interconnectivity between the various
functional blocks may change in real-time.
 A typical embedded system in an automotive application is
a classic example of complex embedded system.
 The modern car has a few of the following sub-systems with
each one having a microcontroller.
 Air-conditioning system
 Audio entertainment
 Cruise control
 Electronic power steering
 Air-bag control
 Anti-lock braking system
MICROPROCESSOR
 It is an IC which has only the CPU inside it
 It does not have RAM, ROM and other peripherals
 It does not have specific applications. So it requires high
resources like RAM, ROM, I/O ports.
 High power consumption
 Von Neumann architecture
 Low Speed
MICROCONTROLLER
 It has a CPU with fixed RAM, ROM and other peripherals embedded on a
single chip
 It is referred to as ‘computer on a single chip’
 The microcontroller with the software loaded in the internal memory is
referred to as an ‘embedded chip’
 It is application specific. Hence requires small resources and can be
embedded on a single chip
 Reduced size and cost
 Low power consumption
 Harvard architecture
 High speed
CISC ARCHITECHTURE
 Complex Instruction Set Computer
 Large number of instructions
 Execution time for an instruction may be different and
may take several clock cycles
 Efficient use of memory space
 Complex hardware to store a large instruction set
 Works faster for complex instructions but may be slow
for simple tasks
 Number of instructions per program is minimized
RISC ARCHITECHTURE
 Reduced Instruction Set Computer
 RISC architecture utilizes small but highly optimized set of instructions
 One cycle execution time -most instructions are executed in one clock
cycle
 Reduced complexity in hardware
 Complex operations are performed as a series of simple instructions
 Instructions are of fixed length and format
 RISC design is simple and can be designed for high clock frequencies.
VON NEUMANN ARCHITECHTURE
 The processor fetches instruction and data from one
memory
 CPU can either read an instruction or write data from/to
the memory. Both cannot occur at the same time.
 This limits the operating bandwidth
HARVARD ARCHITECHTURE
 The computer has physically separate storage for instructions
and data-separate memory space
 CPU can read an instruction and perform data memory access
at the same time
 Thus this architecture can be faster for a complex circuit
 Different program and data bus widths are possible
PIC FAMILY
 8 bit
PIC 10, 12, 16, 17,
18(Ex:12F628,16F877A)
 16 bit
PIC 24F, 24H, 24E
 dsPIC(16 bit)
dsPIC 30F, 33F, 33E
 32 bit
PIC 32(Ex:PIC32MX, PIC32MZ)
PIC ARCHITECTURE
 Low-end architecture
Simple processor with 12 bit , wide
instruction
 Mid-range architecture
More number of peripherals
Simple instruction set- 35 instructions
Watchdog Timer
PIC 16F877A features
 High-Performance RISC CPU
 Only 35 single-word instructions to learn.
 Operating speed: DC – 20 MHz clock input
 DC – 200 ns instruction cycle
 Up to 8K x 14 words of Flash Program Memory
 In-Circuit Serial Programming™ (ICSP™) via two
pins(SCK/SCL and SDI/SDA)
 Watchdog Timer (WDT) with its own on-chip RC oscillator
for reliable operation
 Programmable code protection
 Power saving Sleep mode
 Selectable oscillator options
Peripheral Features

 • Timer0: 8-bit timer/counter with 8-bit prescaler.


 • Timer1: 16-bit timer/counter with prescaler.
 • Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler.
 • Two Capture, Compare, PWM modules
 - Capture is 16-bit, max. resolution is 12.5 ns
 - Compare is 16-bit, max. resolution is 200 ns
 - PWM max. resolution is 10-bit
 • Synchronous Serial Port (SSP) with SPI(Master mode) and I2C(Master/Slave)
 • Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI)
with 9-bit address detection
 • Parallel Slave Port (PSP) – 8 bits wide with external RD, WR and CS controls
 • Brown-out detection circuitry for Brown-out Reset (BOR)
Analog Features
• 10-bit, up to 8-channel Analog-to-Digital Converter (A/D)
• Brown-out Reset (BOR)
• Analog Comparator module with:
- Two analog comparators
- Programmable on-chip voltage reference (VREF) module
- Comparator outputs are externally accessible
CMOS Technology:
• Low-power, high-speed Flash/EEPROM technology
• Fully static design
• Wide operating voltage range (2.0V to 5.5V)
• Low-power consumption
PIN DIAGRAM
MEMORY ORGANISATION
Block Diagram of PIC16F877A
 There are three memory blocks in PIC 16F877A : program
memory, data memory, EEPROM memory
 Program memory and Data memory have separate buses so
that concurrent access can occur
PROGRAM MEMORY ORGANISATION
 The PIC16F877A has a 13-bit program counter capable of
addressing an 8K word x 14 bit program memory space.
 Accessing a location above the physically implemented
address will cause a wraparound.
 The Reset vector is at 0000h and the interrupt vector is at
0004h.
Data Memory Organization

 The data memory is partitioned into multiple banks which


contain the General Purpose Registers and the Special
Function Registers.
 Bits RP1 (Status<6>) and RP0 (Status<5>) are the bank select
bits.
 Each bank extends up to 7Fh (128 bytes).
 The lower locations of each bank are reserved for the Special
Function Registers.
 Above the Special Function Registers are General Purpose
Registers, implemented as static RAM.
 The General Purpose register file can be accessed
either directly or indirectly, through the File
Select Register (FSR).
 The Special Function Registers are registers used
by the CPU and peripheral modules for
controlling the desired operation of the device.
 The Special Function Registers can be classified
into two sets: core (CPU) and peripheral.
Status Register

 The Status register contains the arithmetic status of the ALU, the Reset status and the
bank select bits for data memory.
 The Status register can be the destination for any instruction, as with any other register.
 If the Status register is the destination for an instruction that affects the Z, DC or C bits,
then the write to these three bits is disabled. These bits are set or cleared according to
the device logic.
Register file Map
Special Function Register

You might also like