SlideShare a Scribd company logo
1 of 66
INTRODUCTION
TO
PIC MICROCONTROLLERS
Dr.Y.Narasimha Murthy Ph.D
yayavaram@yahoo.com
Do you Know this gentleman ???..
Dr.YNM
2
• He is none other than Steve Sanghi, the
chairman, president and CEO of Microchip
Technology Inc.
• Sanghi moved from India to U.S. to pursue a
Master’s degree at the University of
Massachusetts after bachelor’s degree in
engineering, from Punjab Engineering College.
• In 1993, Sanghi became president and CEO of
Microchip after seeking advice from venture
capital firms on starting his own company.
Dr.YNM 3
Since then, he has transformed Microchip
into a billion-dollar company specializing in
Microcontroller and analog semiconductors
used in devices ranging from remote
controls to cars. He also has been involved
in science and technology education
programs, and he’s been known to frequent
science fairs and question kids about their
projects.
Dr.YNM 4
Brief Introduction….
• The term PIC stands for “Peripheral Interface
Controller” .It is the brain child of Microchip
Technology, USA .They have coined this name
to identify their single chip micro-controllers.
These 8-bit micro controllers have become
very important now -a -days in industrial
automation and embedded applications etc…..
Dr.YNM 5
• PICs are popular with both industrial
developers and hobbyists alike due to their
low cost, wide availability, large user base,
extensive collection of application notes,
availability of low cost or free development
tools, and serial programming (and re-
programming with flash memory)
capability.
Dr.YNM 6
• Microchip PIC microcontrollers are available in
various types.
• When PIC microcontroller MCU was first
available from General Instruments in early
1980's, the micro-controller had a simple
processor executing 12-bit wide instructions
with basic I/O functions.
• These devices are known as low-end
architectures. They have limited program
memory and are meant for applications requiring
simple interface functions and small program &
data memories.
Dr.YNM 7
Some of the low-end device numbers are
• 12C5XX
• 16C5X
• 16C505
Dr.YNM 8
• Mid range PIC architectures built by
upgrading low-end architectures with more
number of peripherals, more number of
registers and more data/program memory.
Some of the mid-range devices are
• 16C6X
• 16C7X
• 16F87X
Dr.YNM 9
contd
Program memory type is indicated by an
alphabet.
• C = EPROM
• F = Flash
• RC = Mask ROM
Dr.YNM 10
• One of the mid -range versions of PIC Cs is
PIC16C6x/7x.
• The 7x family has an enhancement of Analog
to Digital converter capability.
• These Cs are available with a range of
capabilities packaged in both dual in-line
(DIP) packages and surface-mount packages.
These are available in 28 pin DIP,40 pin DIP,
44 pin surface mount package etc.
Dr.YNM 11
• In this 6x/7x family of Micro controllers ,
PIC 16C62A/PIC 16C74A are found with a
suffix A. some of PIC do not contain this A.
The presence of A indicates the brown-out
reset feature, which causes a reset of the
PIC when the Power Supply voltage drops
below 4.0 V.
Dr.YNM 12
Salient features
• Speed :
When operated at its maximum clock rate a
PIC executes most of its instructions in 0.2
s or five instructions per microsecond.
• Instruction set Simplicity :
The instruction set is so simple that it consists
of just 35 instructions
Dr.YNM 13
• Integration of operational features:
Power-on-reset and brown-out protection
ensure that the chip operates only when the
supply voltage is within specifications.
• A watch dog timer resets the PIC if the chip
malfunctions or deviates from its normal
operation at any time.
• Programmable timer options:
Three timers can characterize inputs, control
outputs and provide internal timing for the
program execution.
Dr.YNM 14
• Powerful output pin control:
A single instruction can select and drive a
single output pin high or low in its 0.2 s
instruction execution time. The PIN can
drive a load of up to 25A.
• I/O port expansion:
With the help of built in serial peripheral
interface the number of I/O ports can be
expanded. EPROM/DIP/ROM options are
provided.
Dr.YNM 15
• I/O port expansion:
This is the most important aspect in the PIC
controllers.With the help of built in Serial
Peripheral Interface(SPI) the number of I/O
ports can be expanded. EPROM/DIP/ROM
options are provided.
• Interrupt control:
Up to 12 independent interrupt sources can
control when the CPU will deal with each
sources.
Dr.YNM 16
PIC 16C6X/7X CONTROLLERS
PERIPHERAL FEATURES
• The PIC16CXX/17CXX is a family of low-cost, high-
performance, CMOS, fully-static, 8-bit microcontrollers.
• There are Three Timers : Namely Timer 0, Timer 1,
Timer 2
• Timer 0: 8-bit timer/counter with 8-bit prescaler
• Timer 1: 16-bit timer/counter with prescaler can be
incremented during sleep via external crystal/clock
• Timer 2: 8-bit timer/counter with 8-bit period register,
pre-scaler and post-scaler.
Dr.YNM 17
Contd…
• Capture/Compare/PWM (CCP) module(s)
• Capture is 16-bit, max resolution is 12.5 ns,
Compare is 16-bit, max resolution is 200ns,
PWM max resolution is 10-bit
• Synchronous Serial Port (SSP) with SPITM and
I2C
• Universal Synchronous Asynchronous
Receiver Transmitter (USART/SCI)
Dr.YNM 18
• Parallel Slave Port (PSP) 8-bits wide, with
external RD, WR and CS controls
• Brown-out detection circuitry for Brown-out
Reset (BOR)
• PIC16CXX microcontroller family has
enhanced core features, eight-level deep stack,
and multiple internal and external interrupt
sources.
Dr.YNM 19
ARCHITECTURE
• The high performance of the PIC16CXX family can
be attributed to a number of architectural features
commonly found in RISC microprocessors. To begin
with, the PIC 16CXX uses a Harvard architecture, in
which, program and data are accessed from separate
memories using separate buses. This improves
bandwidth over traditional Von Neumann architecture
where program and data may be fetched from the
same memory using the same bus.
Dr.YNM 20
HARVARD ARCHTECTURE
Dr.YNM 21
• As the PIC 16c6x/7x family of micro-
controllers uses Harvard Architecture it
enables the devices exceptionally fast
execution speed for a given clock rate. In the
Harvard Architecture separate buses are used
for Data and Instruction as shown in the
diagram.
• Instructions are fetched from program memory
using buses that are distinct from the buses
used for accessing variables in data memory,
I/O ports etc. Every instruction is coded as a
single 14-bit word and fetched over a 14-bit
wide bus.
Dr.YNM 22
Contd….
• Separating program and data buses further
allows instructions to be sized differently than
8-bit wide data words.
• Instruction op-codes are 14-bits wide making it
possible to have all single word instructions.
• A 14-bit wide program memory access bus
fetches a 14-bit instruction in a single cycle
Dr.YNM 23
Example
• The PIC 16C61 addresses 1K x 14 of program
memory.
• The PIC16C62/62A/R62/64 addresses 2K x 14
of program memory, and
• the PIC16C63/R63/65/65/65A/R65 devices
address 4K x 14 of program memory.
• The PIC 16C66/67 address 8K x 14 program
memory. All program memory is internal.
Dr.YNM 24
• The PIC16CXX can directly or indirectly address its
register files or data memory. All special function
registers including the program counter are mapped
in the data memory.
• The PIC16CXX has an orthogonal (symmetrical)
instruction set that makes it possible to carry out any
operation on any register using any addressing mode.
• This symmetrical nature and lack of “special optimal
situations” makes programming with the PIC16CXX
simple yet efficient, thus significantly reducing the
learning curve.
Dr.YNM 25
Block Diagram-16C6X
Dr.YNM 26
CPU REGISTERS
The CPU registers are
• Working Register (W)
• Status – Register
• FSR – File Select Register
• INDF
• PCLATH
• Program Counter
• PCL
• Eight Level Stack
Dr.YNM 27
General Block Diagram
Dr.YNM 28
Contd…
• Working Register:
Working Register is used by many instructions
as the source of an operand. It also serves as
the destination for the result of instruction
execution and it is similar to accumulator in
other cs and ps. It is a 8-bit regarding.
• Status Register:
It contains the arithmetic status of the ALU, the
RESET status and the bank select bits for the
data memory.
Dr.YNM 29
C: Carry/borrow bit
DC: Digit carry/borrow bit
Z: Zero bit
NOT_PD: Reset Status bit (Power-down mode
bit)
NOT_TO: Reset Status bit (tme- out bit)
RPO: Register bank Select
The bits 7 and 6 of Status Register are unused by
16c6x/7x.
Dr.YNM 30
The ‘C’ bit is set when two 8-bit operands are
added together and a 9-bit result occurs. This
9-bit is placed in the carry bit.
• The DC or Digit carry bit indicates that a carry
from the lower 4 bits occurred during an 8-bit
addition.
Contd…
Dr.YNM 31
• Example: 0011 1000
0011 1000
0111 0000
Here DC=1 as a result of the carry from the bit
3 to the bit 4 position.
Dr.YNM 32
• The Z or zero bits is affected by the execution of
arithmetic or logic instructions.
• The reset status bits NOT_TO and NOT_PD are used
in conjunction with PIC’s sleep mode.
• The micro controller can put itself to sleep mode to
save power during intervals when it has nothing to
do. It can be reset by any of three kinds.
• Upon reset the CPU can check these two reset status
bits to determine which kind of event resettled it and
then respond accordingly.
Dr.YNM 33
• The Register bank select bit RPO is used to
select either bank .
When RPO=0, select Bank 0, RPO=1, select
Bank 1.
• Example: bcf STATUS, RPO
Select bank 0
• bsf STATUS, RPO
Select bank 1.
Dr.YNM 34
Contd…
• FSR – (File Select Register):
It is the pointer used for indirect addressing. In the
indirect addressing mode the 8-bit register file
address is first written into FSR. It is a special
purpose register that serves as an address pointer to
any address through out the entire register file.
• INDF – (Indirect File):
It is not a physical register .Addressing this INDF
will cause indirect addressing. Any instruction
using the INDF register actually access the register
pointed to by the FSR.
Dr.YNM 35
contd
• PCL:
PCL is actually the lower 8-bits of the 13-bit
program counter. It can be read like any other
register.
• PCLATH (Program Counter Latch):
The upper 3-bits of PCLATH remains zero and
serves no purpose, it is only when PC2 is written to
that PCLATH is automatically written into the PC
at the same time.
Dr.YNM 36
Memory organisation :
It has three memory blocks.
• Program memory
• Data memory
• Stack
Dr.YNM 37
• The 6x/7x family controllers have either 2k or 4k
address of program memory. Normally a program
memory of 2k addresses needs only a 11-bit program
counter to access any address (211=2048=2k).
• A program memory of 4k address needs a 12-bit
program counter. But this PIC family uses 13-bit
program counter allowing the controllers to an 8k-
program memory without changing the CPU structure.
Program Memory
Dr.YNM 38
Dr.YNM 39
• Two addresses in the program memory address
space are treated in a special way by the CPU.
• The first address H’ 000’ being a go to mainline
instruction the second special address, H’ 004’
being a ‘go to in service’ instruction can be
assigned to this address to make the CPU to
jump to the beginning of the Interrupt Service
routine located elsewhere in the memory space.
Dr.YNM 40
Dr.YNM 41
contd
• When we deal with tables, if any tables are
created they are assigned to addresses in the
range H’005 – H’0FF’.
• For most of the applications this space is
sufficient.
The main line program begins after the tables.
Dr.YNM 42
Data memory (Register Files)
Data Memory is also known as Register File.
Register File consists of two components.
• General purpose register file ( RAM).
• Special purpose register file (similar to SFR in
8051).
Dr.YNM 43
• The special purpose register file consists of
input/output ports and control registers.
Addressing from 00H to FFH requires 8 bits of
address.
• However, the instructions that use direct
addressing modes in PIC to address these
register files use 7 bits of instruction only.
• Therefore the register bank select (RP0) bit in
the STATUS register is used to select one of
the register bank
Dr.YNM 44
Data Memory map
Dr.YNM 45
PIC Reset actions
• Reset is used to put the microcontroller
into a known state. Normally when a PIC
microcontroller is reset, execution starts
from address 0 of the program memory.
• This is where the first executable user
program resides.
• The reset action also initializes various
SFR registers inside the Microcontroller.
Dr.YNM 46
Contd…
• Reset mechanisms ensure that the CPU starts running
when the appropriate operating conditions have been
met, and can be used to restart the CPU in case of
program failure.
• The actual reset to the CPU or the Chip_Reset, is
generated by a flip-flop. This has two inputs, S (Set)
and R (Reset).
Dr.YNM 47
Contd…..
• The CPU enters Reset mode when Chip_Reset goes
low, which is caused by the S line going high. It stays
there until the flip-flop is cleared, caused by the R
line going high.
• The S input to the flip-flop goes high, via a three-
input OR gate, if any of the following goes high:
Dr.YNM 48
Contd…..
• The Reset action normally occurs in various
situations like
• Power On Reset
• Master Clear( ) Reset
• Watchdog Timer Reset
• Brown-out Reset (This feature is not available
in PIC16C61/62/64/65 series. Only 74 series
have this feature
Dr.YNM 49
Contd…..
• The reset action will set the program counterto
the starting address of the program.This starting
address is different for different members.For
Ex:Starting address for PIC16C71 is
000H.whereas for PIC16C57 it is 7FFH.
• So,The first instruction to be executed will
appear at the reset vector.
Dr.YNM 50
contd
• An important point to be remembered, is when
powered ,most of the hardware registers are
initialized ,but RAM locations are not
initialized.
• A reset cycle will initialize the RAM locations.
• So,the conclusion is Reset and Power-on are
different in PIC controllers.
Dr.YNM 51
Contd…..
• The Brown-out reset occurs when the supply
voltage falls below 4 volts.The device remains
in the Brown-out reset state till the supply
voltage is restored.
• The Brown-out reset also includes another
feature .
• If Vdd is hit with a transient noise spike ,
causing Vdd to drop below 4.0Volts for longer
than 100 micro seconds the Brown-out reset
circuit detects that and
Dr.YNM 52
Contd…..
• reset the chip. whereas in most of the other
microcontrollers many erroneous executions takes place
during this time.
• The PIC brown-out reset will also help if the power-on
reset conditions are not not met.
• There is a provision of power-up timer of about 72mS.
• Once this is enabled the Brown-out reset occurs once
again incase of non-restoration of supply within 72 mS.
Dr.YNM 53
PIC Oscillator Connections
• There are 4 common oscillator modes that are
available on most PIC micro devices.
• HS, XT, LP and RC. (High speed, Crystal, Low-
power clocking, Internal RC)
• These modes support crystals, canned oscillator
modules, some resonators or the use of an external
resistor and capacitor as a clock source. When using a
crystal or resonator, other components such as
capacitors may be needed.
Dr.YNM 54
Contd…..
• The HS mode stands for “High Speed” mode. It is
designed to be used with crystals,and resonators with
a frequency of 3 to 4 MHz or more. The important
thing to remember about HS mode is that it provides
the highest drive level available.
Crystals and Resonators must be DRIVEN by a signal
to work. The gain on this signal controls whether an
oscillation will occur and how strong it will be. Care
must be taken not to underdrive or overdrive the
crystal or resonator.
Dr.YNM 55
Contd…..
• The XT mode stands for “Crystal” mode and will
produce a medium drive level. It is designed to be
used with crystals and resonators of 1 to about 4
MHz.
• XT mode has moderate power consumption since its
drive level is lower than that of
HS mode, and because a lower clock speed is
produced. Remember, as a rule: the
faster the clock used, the more current the application
will require
Dr.YNM 56
Contd…..
• The LP mode stands for "Low Power” mode.
This mode is useful for circuits that require the lowest
power possible. LP mode is engineered for
32.768kHz crystal operation, and it can function at
any frequency below 200kHz. LP mode is most
commonly used for 32.768kHz operation.
• LP mode will produce the slowest clock rate, and as
a result, the lowest power consumption of all the
modes.
• LP mode is ideal for timing sensitive applications
since these same crystals are used as a time base in
wrist-watches.
Dr.YNM 57
Contd…..
• The RC mode stands for “External RC” mode.
• It is important to note that this is an _EXTERNAL_
RC mode, ( some PICmicro
devices have an _INTERNAL_ RC mode).
• RC mode uses a resistor-capacitor network connected
to the OSC1 pin. When the
device is configured for external RC mode, these
components are automatically driven to produce a
frequency which will run the PICmicro MCU.
Dr.YNM 58
Contd…..
• RC mode is designed for very low-cost
applications.
• The power consumed will vary due to the
wide range of frequencies that can be created
using this mode .
Dr.YNM 59
Contd…..
• It is extremely important to note that RC mode
will produce an inaccurate clock
source.
• In some applications this won’t matter, but
applications that are timing
sensitive should not be used with this mode. For
this reason, RC mode is not recommended for
timing sensitive applications or for RS-232
communication.
Dr.YNM 60
Contd…..
• The IntRC mode stands for “Internal RC”
mode and functions much like the standard
External RC mode.
• Unlike External RC mode, in IntRC mode the
resistor and capacitor are already provided.
Microcontrollers with this feature have an on-
chip RC oscillator. Current designs run at
approximately 4 MHz.
Dr.YNM 61
Contd…..
• IntRC mode is the least expensive oscillator
available since no external components are
needed.
• It is also useful, because devices in this mode
can often use the OSC1 and OSC2 lines for
general purpose I/O. This feature makes the
PIC12CXXX and other 8-pin PICmicro
devices very popular.
Dr.YNM 62
Contd…..
• The ER mode stands for “External Resistor” mode.
• ER mode is very similar to External RC mode, but no
capacitor is needed. One resistor controls the
frequency produced.
• Similar to RC mode, ER mode has moderate power
consumption, and is low cost.However, due to the
nature of RC oscillators, it is not recommended for
timing sensitive applications or for RS-232 use.
Dr.YNM 63
Dr.YNM 64
Limitations
The PIC architectures have several limitations:
• Only a single accumulator
• A small instruction set
• Operations and registers are not orthogonal; some
instructions can address RAM and/or immediate
constants, while others can only use the accumulator
• Memory must be directly referenced in arithmetic and
logic operations, although indirect addressing is
available via 2 additional registers
• Register-bank switching is required to access the
entire RAM of many devices
Dr.YNM 65
THANQ !!
Wish you good luck
Dr.YNM 66

More Related Content

What's hot

What's hot (20)

ARM Processor
ARM ProcessorARM Processor
ARM Processor
 
PIC Microcontrollers
PIC MicrocontrollersPIC Microcontrollers
PIC Microcontrollers
 
Pic 18 microcontroller
Pic 18 microcontrollerPic 18 microcontroller
Pic 18 microcontroller
 
Introduction to ARM LPC2148
Introduction to ARM LPC2148Introduction to ARM LPC2148
Introduction to ARM LPC2148
 
8251 USART
8251 USART8251 USART
8251 USART
 
I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
 
Unit 2 mpmc
Unit 2 mpmcUnit 2 mpmc
Unit 2 mpmc
 
ARM7-ARCHITECTURE
ARM7-ARCHITECTURE ARM7-ARCHITECTURE
ARM7-ARCHITECTURE
 
Arm instruction set
Arm instruction setArm instruction set
Arm instruction set
 
8255 PPI
8255 PPI8255 PPI
8255 PPI
 
Architecture of 16C6X
Architecture of 16C6XArchitecture of 16C6X
Architecture of 16C6X
 
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
 
8051 memory
8051 memory8051 memory
8051 memory
 
PIC-18 Microcontroller
PIC-18 MicrocontrollerPIC-18 Microcontroller
PIC-18 Microcontroller
 
Memory Segmentation of 8086
Memory Segmentation of 8086Memory Segmentation of 8086
Memory Segmentation of 8086
 
Hardwired control
Hardwired controlHardwired control
Hardwired control
 
Introduction to microprocessor
Introduction to microprocessorIntroduction to microprocessor
Introduction to microprocessor
 
Introduction to Microcontroller
Introduction to MicrocontrollerIntroduction to Microcontroller
Introduction to Microcontroller
 
Introduction to embedded systems
Introduction  to embedded systemsIntroduction  to embedded systems
Introduction to embedded systems
 
Embedded C - Lecture 1
Embedded C - Lecture 1Embedded C - Lecture 1
Embedded C - Lecture 1
 

Similar to PIC Microcontrollers.ppt

Introduction to pic microcontroller
Introduction to pic microcontrollerIntroduction to pic microcontroller
Introduction to pic microcontrollerSiva Kumar
 
Introduction_PIC18F458_Ritula Thakur.pptx
Introduction_PIC18F458_Ritula Thakur.pptxIntroduction_PIC18F458_Ritula Thakur.pptx
Introduction_PIC18F458_Ritula Thakur.pptxAvinashJain66
 
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080Vivek Venugopal
 
EE6008 MCBSD - Introduction to PIC Micro controller
EE6008 MCBSD - Introduction to PIC Micro controller EE6008 MCBSD - Introduction to PIC Micro controller
EE6008 MCBSD - Introduction to PIC Micro controller pavihari
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontrollersnehapvs
 
Class 5 an 8 bit embedded platform
Class 5 an 8 bit embedded platformClass 5 an 8 bit embedded platform
Class 5 an 8 bit embedded platformSURYAPRAKASH S
 
Ajal mod 1
Ajal mod 1Ajal mod 1
Ajal mod 1AJAL A J
 
Lecture 5-Embedde.pdf
Lecture 5-Embedde.pdfLecture 5-Embedde.pdf
Lecture 5-Embedde.pdfBlackHunter13
 
Presentation for EEE engineers on Microcontroller by Dilip Kumar Roy
Presentation for EEE engineers on Microcontroller by Dilip Kumar RoyPresentation for EEE engineers on Microcontroller by Dilip Kumar Roy
Presentation for EEE engineers on Microcontroller by Dilip Kumar RoyDilip Kumar Ckt
 
Microchip's PIC Micro Controller
Microchip's PIC Micro ControllerMicrochip's PIC Micro Controller
Microchip's PIC Micro ControllerMidhu S V Unnithan
 
Microcontroller pic 16f877 architecture and basics
Microcontroller pic 16f877 architecture and basicsMicrocontroller pic 16f877 architecture and basics
Microcontroller pic 16f877 architecture and basicsNilesh Bhaskarrao Bahadure
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architectureJamia Hamdard
 
Seminar topic.on embeded system
Seminar topic.on embeded systemSeminar topic.on embeded system
Seminar topic.on embeded systemSachinMaithani1
 

Similar to PIC Microcontrollers.ppt (20)

Introduction to pic microcontroller
Introduction to pic microcontrollerIntroduction to pic microcontroller
Introduction to pic microcontroller
 
Introduction_PIC18F458_Ritula Thakur.pptx
Introduction_PIC18F458_Ritula Thakur.pptxIntroduction_PIC18F458_Ritula Thakur.pptx
Introduction_PIC18F458_Ritula Thakur.pptx
 
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
 
EE6008 MBSD
EE6008  MBSDEE6008  MBSD
EE6008 MBSD
 
EE6008 MCBSD - Introduction to PIC Micro controller
EE6008 MCBSD - Introduction to PIC Micro controller EE6008 MCBSD - Introduction to PIC Micro controller
EE6008 MCBSD - Introduction to PIC Micro controller
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
 
Ee6008 mcbsd notes
Ee6008 mcbsd notesEe6008 mcbsd notes
Ee6008 mcbsd notes
 
Class 5 an 8 bit embedded platform
Class 5 an 8 bit embedded platformClass 5 an 8 bit embedded platform
Class 5 an 8 bit embedded platform
 
Ajal mod 1
Ajal mod 1Ajal mod 1
Ajal mod 1
 
12C5XX.PDF
12C5XX.PDF12C5XX.PDF
12C5XX.PDF
 
PIC16F1934.PDF
PIC16F1934.PDFPIC16F1934.PDF
PIC16F1934.PDF
 
Lecture 5-Embedde.pdf
Lecture 5-Embedde.pdfLecture 5-Embedde.pdf
Lecture 5-Embedde.pdf
 
datasheet.pdf
datasheet.pdfdatasheet.pdf
datasheet.pdf
 
Datasheet
DatasheetDatasheet
Datasheet
 
Presentation for EEE engineers on Microcontroller by Dilip Kumar Roy
Presentation for EEE engineers on Microcontroller by Dilip Kumar RoyPresentation for EEE engineers on Microcontroller by Dilip Kumar Roy
Presentation for EEE engineers on Microcontroller by Dilip Kumar Roy
 
Microchip's PIC Micro Controller
Microchip's PIC Micro ControllerMicrochip's PIC Micro Controller
Microchip's PIC Micro Controller
 
Microcontroller pic 16f877 architecture and basics
Microcontroller pic 16f877 architecture and basicsMicrocontroller pic 16f877 architecture and basics
Microcontroller pic 16f877 architecture and basics
 
Introduction to 8085 by Adi PPT.pdf
Introduction to 8085 by Adi PPT.pdfIntroduction to 8085 by Adi PPT.pdf
Introduction to 8085 by Adi PPT.pdf
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architecture
 
Seminar topic.on embeded system
Seminar topic.on embeded systemSeminar topic.on embeded system
Seminar topic.on embeded system
 

More from Dr.YNM

Introduction to DSP.ppt
Introduction to DSP.pptIntroduction to DSP.ppt
Introduction to DSP.pptDr.YNM
 
Atmel.ppt
Atmel.pptAtmel.ppt
Atmel.pptDr.YNM
 
Crystalstructure-.ppt
Crystalstructure-.pptCrystalstructure-.ppt
Crystalstructure-.pptDr.YNM
 
Basics of OS & RTOS.ppt
Basics of OS & RTOS.pptBasics of OS & RTOS.ppt
Basics of OS & RTOS.pptDr.YNM
 
Introducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptxIntroducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptxDr.YNM
 
Microcontroller-8051.ppt
Microcontroller-8051.pptMicrocontroller-8051.ppt
Microcontroller-8051.pptDr.YNM
 
Introduction to ASICs.pptx
Introduction to ASICs.pptxIntroduction to ASICs.pptx
Introduction to ASICs.pptxDr.YNM
 
VHDL-PRESENTATION.ppt
VHDL-PRESENTATION.pptVHDL-PRESENTATION.ppt
VHDL-PRESENTATION.pptDr.YNM
 
Basics of data communications.pptx
Basics of data communications.pptxBasics of data communications.pptx
Basics of data communications.pptxDr.YNM
 
CPLD & FPGA Architectures and applictionsplications.pptx
CPLD & FPGA Architectures and applictionsplications.pptxCPLD & FPGA Architectures and applictionsplications.pptx
CPLD & FPGA Architectures and applictionsplications.pptxDr.YNM
 
Transient response of RC , RL circuits with step input
Transient response of RC , RL circuits  with step inputTransient response of RC , RL circuits  with step input
Transient response of RC , RL circuits with step inputDr.YNM
 
CISC & RISC ARCHITECTURES
CISC & RISC ARCHITECTURESCISC & RISC ARCHITECTURES
CISC & RISC ARCHITECTURESDr.YNM
 
Lect 4 ARM PROCESSOR ARCHITECTURE
Lect 4 ARM PROCESSOR ARCHITECTURELect 4 ARM PROCESSOR ARCHITECTURE
Lect 4 ARM PROCESSOR ARCHITECTUREDr.YNM
 
Lect 3 ARM PROCESSOR ARCHITECTURE
Lect 3  ARM PROCESSOR ARCHITECTURE Lect 3  ARM PROCESSOR ARCHITECTURE
Lect 3 ARM PROCESSOR ARCHITECTURE Dr.YNM
 
Microprocessor Architecture 4
Microprocessor Architecture  4Microprocessor Architecture  4
Microprocessor Architecture 4Dr.YNM
 
Lect 2 ARM processor architecture
Lect 2 ARM processor architectureLect 2 ARM processor architecture
Lect 2 ARM processor architectureDr.YNM
 
Microprocessor Architecture-III
Microprocessor Architecture-IIIMicroprocessor Architecture-III
Microprocessor Architecture-IIIDr.YNM
 
LECT 1: ARM PROCESSORS
LECT 1: ARM PROCESSORSLECT 1: ARM PROCESSORS
LECT 1: ARM PROCESSORSDr.YNM
 
Microprocessor architecture II
Microprocessor architecture   IIMicroprocessor architecture   II
Microprocessor architecture IIDr.YNM
 
Verilog Test Bench
Verilog Test BenchVerilog Test Bench
Verilog Test BenchDr.YNM
 

More from Dr.YNM (20)

Introduction to DSP.ppt
Introduction to DSP.pptIntroduction to DSP.ppt
Introduction to DSP.ppt
 
Atmel.ppt
Atmel.pptAtmel.ppt
Atmel.ppt
 
Crystalstructure-.ppt
Crystalstructure-.pptCrystalstructure-.ppt
Crystalstructure-.ppt
 
Basics of OS & RTOS.ppt
Basics of OS & RTOS.pptBasics of OS & RTOS.ppt
Basics of OS & RTOS.ppt
 
Introducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptxIntroducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptx
 
Microcontroller-8051.ppt
Microcontroller-8051.pptMicrocontroller-8051.ppt
Microcontroller-8051.ppt
 
Introduction to ASICs.pptx
Introduction to ASICs.pptxIntroduction to ASICs.pptx
Introduction to ASICs.pptx
 
VHDL-PRESENTATION.ppt
VHDL-PRESENTATION.pptVHDL-PRESENTATION.ppt
VHDL-PRESENTATION.ppt
 
Basics of data communications.pptx
Basics of data communications.pptxBasics of data communications.pptx
Basics of data communications.pptx
 
CPLD & FPGA Architectures and applictionsplications.pptx
CPLD & FPGA Architectures and applictionsplications.pptxCPLD & FPGA Architectures and applictionsplications.pptx
CPLD & FPGA Architectures and applictionsplications.pptx
 
Transient response of RC , RL circuits with step input
Transient response of RC , RL circuits  with step inputTransient response of RC , RL circuits  with step input
Transient response of RC , RL circuits with step input
 
CISC & RISC ARCHITECTURES
CISC & RISC ARCHITECTURESCISC & RISC ARCHITECTURES
CISC & RISC ARCHITECTURES
 
Lect 4 ARM PROCESSOR ARCHITECTURE
Lect 4 ARM PROCESSOR ARCHITECTURELect 4 ARM PROCESSOR ARCHITECTURE
Lect 4 ARM PROCESSOR ARCHITECTURE
 
Lect 3 ARM PROCESSOR ARCHITECTURE
Lect 3  ARM PROCESSOR ARCHITECTURE Lect 3  ARM PROCESSOR ARCHITECTURE
Lect 3 ARM PROCESSOR ARCHITECTURE
 
Microprocessor Architecture 4
Microprocessor Architecture  4Microprocessor Architecture  4
Microprocessor Architecture 4
 
Lect 2 ARM processor architecture
Lect 2 ARM processor architectureLect 2 ARM processor architecture
Lect 2 ARM processor architecture
 
Microprocessor Architecture-III
Microprocessor Architecture-IIIMicroprocessor Architecture-III
Microprocessor Architecture-III
 
LECT 1: ARM PROCESSORS
LECT 1: ARM PROCESSORSLECT 1: ARM PROCESSORS
LECT 1: ARM PROCESSORS
 
Microprocessor architecture II
Microprocessor architecture   IIMicroprocessor architecture   II
Microprocessor architecture II
 
Verilog Test Bench
Verilog Test BenchVerilog Test Bench
Verilog Test Bench
 

Recently uploaded

Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage examplePragyanshuParadkar1
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 

Recently uploaded (20)

Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage example
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 

PIC Microcontrollers.ppt

  • 2. Do you Know this gentleman ???.. Dr.YNM 2
  • 3. • He is none other than Steve Sanghi, the chairman, president and CEO of Microchip Technology Inc. • Sanghi moved from India to U.S. to pursue a Master’s degree at the University of Massachusetts after bachelor’s degree in engineering, from Punjab Engineering College. • In 1993, Sanghi became president and CEO of Microchip after seeking advice from venture capital firms on starting his own company. Dr.YNM 3
  • 4. Since then, he has transformed Microchip into a billion-dollar company specializing in Microcontroller and analog semiconductors used in devices ranging from remote controls to cars. He also has been involved in science and technology education programs, and he’s been known to frequent science fairs and question kids about their projects. Dr.YNM 4
  • 5. Brief Introduction…. • The term PIC stands for “Peripheral Interface Controller” .It is the brain child of Microchip Technology, USA .They have coined this name to identify their single chip micro-controllers. These 8-bit micro controllers have become very important now -a -days in industrial automation and embedded applications etc….. Dr.YNM 5
  • 6. • PICs are popular with both industrial developers and hobbyists alike due to their low cost, wide availability, large user base, extensive collection of application notes, availability of low cost or free development tools, and serial programming (and re- programming with flash memory) capability. Dr.YNM 6
  • 7. • Microchip PIC microcontrollers are available in various types. • When PIC microcontroller MCU was first available from General Instruments in early 1980's, the micro-controller had a simple processor executing 12-bit wide instructions with basic I/O functions. • These devices are known as low-end architectures. They have limited program memory and are meant for applications requiring simple interface functions and small program & data memories. Dr.YNM 7
  • 8. Some of the low-end device numbers are • 12C5XX • 16C5X • 16C505 Dr.YNM 8
  • 9. • Mid range PIC architectures built by upgrading low-end architectures with more number of peripherals, more number of registers and more data/program memory. Some of the mid-range devices are • 16C6X • 16C7X • 16F87X Dr.YNM 9
  • 10. contd Program memory type is indicated by an alphabet. • C = EPROM • F = Flash • RC = Mask ROM Dr.YNM 10
  • 11. • One of the mid -range versions of PIC Cs is PIC16C6x/7x. • The 7x family has an enhancement of Analog to Digital converter capability. • These Cs are available with a range of capabilities packaged in both dual in-line (DIP) packages and surface-mount packages. These are available in 28 pin DIP,40 pin DIP, 44 pin surface mount package etc. Dr.YNM 11
  • 12. • In this 6x/7x family of Micro controllers , PIC 16C62A/PIC 16C74A are found with a suffix A. some of PIC do not contain this A. The presence of A indicates the brown-out reset feature, which causes a reset of the PIC when the Power Supply voltage drops below 4.0 V. Dr.YNM 12
  • 13. Salient features • Speed : When operated at its maximum clock rate a PIC executes most of its instructions in 0.2 s or five instructions per microsecond. • Instruction set Simplicity : The instruction set is so simple that it consists of just 35 instructions Dr.YNM 13
  • 14. • Integration of operational features: Power-on-reset and brown-out protection ensure that the chip operates only when the supply voltage is within specifications. • A watch dog timer resets the PIC if the chip malfunctions or deviates from its normal operation at any time. • Programmable timer options: Three timers can characterize inputs, control outputs and provide internal timing for the program execution. Dr.YNM 14
  • 15. • Powerful output pin control: A single instruction can select and drive a single output pin high or low in its 0.2 s instruction execution time. The PIN can drive a load of up to 25A. • I/O port expansion: With the help of built in serial peripheral interface the number of I/O ports can be expanded. EPROM/DIP/ROM options are provided. Dr.YNM 15
  • 16. • I/O port expansion: This is the most important aspect in the PIC controllers.With the help of built in Serial Peripheral Interface(SPI) the number of I/O ports can be expanded. EPROM/DIP/ROM options are provided. • Interrupt control: Up to 12 independent interrupt sources can control when the CPU will deal with each sources. Dr.YNM 16
  • 17. PIC 16C6X/7X CONTROLLERS PERIPHERAL FEATURES • The PIC16CXX/17CXX is a family of low-cost, high- performance, CMOS, fully-static, 8-bit microcontrollers. • There are Three Timers : Namely Timer 0, Timer 1, Timer 2 • Timer 0: 8-bit timer/counter with 8-bit prescaler • Timer 1: 16-bit timer/counter with prescaler can be incremented during sleep via external crystal/clock • Timer 2: 8-bit timer/counter with 8-bit period register, pre-scaler and post-scaler. Dr.YNM 17
  • 18. Contd… • Capture/Compare/PWM (CCP) module(s) • Capture is 16-bit, max resolution is 12.5 ns, Compare is 16-bit, max resolution is 200ns, PWM max resolution is 10-bit • Synchronous Serial Port (SSP) with SPITM and I2C • Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) Dr.YNM 18
  • 19. • Parallel Slave Port (PSP) 8-bits wide, with external RD, WR and CS controls • Brown-out detection circuitry for Brown-out Reset (BOR) • PIC16CXX microcontroller family has enhanced core features, eight-level deep stack, and multiple internal and external interrupt sources. Dr.YNM 19
  • 20. ARCHITECTURE • The high performance of the PIC16CXX family can be attributed to a number of architectural features commonly found in RISC microprocessors. To begin with, the PIC 16CXX uses a Harvard architecture, in which, program and data are accessed from separate memories using separate buses. This improves bandwidth over traditional Von Neumann architecture where program and data may be fetched from the same memory using the same bus. Dr.YNM 20
  • 22. • As the PIC 16c6x/7x family of micro- controllers uses Harvard Architecture it enables the devices exceptionally fast execution speed for a given clock rate. In the Harvard Architecture separate buses are used for Data and Instruction as shown in the diagram. • Instructions are fetched from program memory using buses that are distinct from the buses used for accessing variables in data memory, I/O ports etc. Every instruction is coded as a single 14-bit word and fetched over a 14-bit wide bus. Dr.YNM 22
  • 23. Contd…. • Separating program and data buses further allows instructions to be sized differently than 8-bit wide data words. • Instruction op-codes are 14-bits wide making it possible to have all single word instructions. • A 14-bit wide program memory access bus fetches a 14-bit instruction in a single cycle Dr.YNM 23
  • 24. Example • The PIC 16C61 addresses 1K x 14 of program memory. • The PIC16C62/62A/R62/64 addresses 2K x 14 of program memory, and • the PIC16C63/R63/65/65/65A/R65 devices address 4K x 14 of program memory. • The PIC 16C66/67 address 8K x 14 program memory. All program memory is internal. Dr.YNM 24
  • 25. • The PIC16CXX can directly or indirectly address its register files or data memory. All special function registers including the program counter are mapped in the data memory. • The PIC16CXX has an orthogonal (symmetrical) instruction set that makes it possible to carry out any operation on any register using any addressing mode. • This symmetrical nature and lack of “special optimal situations” makes programming with the PIC16CXX simple yet efficient, thus significantly reducing the learning curve. Dr.YNM 25
  • 27. CPU REGISTERS The CPU registers are • Working Register (W) • Status – Register • FSR – File Select Register • INDF • PCLATH • Program Counter • PCL • Eight Level Stack Dr.YNM 27
  • 29. Contd… • Working Register: Working Register is used by many instructions as the source of an operand. It also serves as the destination for the result of instruction execution and it is similar to accumulator in other cs and ps. It is a 8-bit regarding. • Status Register: It contains the arithmetic status of the ALU, the RESET status and the bank select bits for the data memory. Dr.YNM 29
  • 30. C: Carry/borrow bit DC: Digit carry/borrow bit Z: Zero bit NOT_PD: Reset Status bit (Power-down mode bit) NOT_TO: Reset Status bit (tme- out bit) RPO: Register bank Select The bits 7 and 6 of Status Register are unused by 16c6x/7x. Dr.YNM 30
  • 31. The ‘C’ bit is set when two 8-bit operands are added together and a 9-bit result occurs. This 9-bit is placed in the carry bit. • The DC or Digit carry bit indicates that a carry from the lower 4 bits occurred during an 8-bit addition. Contd… Dr.YNM 31
  • 32. • Example: 0011 1000 0011 1000 0111 0000 Here DC=1 as a result of the carry from the bit 3 to the bit 4 position. Dr.YNM 32
  • 33. • The Z or zero bits is affected by the execution of arithmetic or logic instructions. • The reset status bits NOT_TO and NOT_PD are used in conjunction with PIC’s sleep mode. • The micro controller can put itself to sleep mode to save power during intervals when it has nothing to do. It can be reset by any of three kinds. • Upon reset the CPU can check these two reset status bits to determine which kind of event resettled it and then respond accordingly. Dr.YNM 33
  • 34. • The Register bank select bit RPO is used to select either bank . When RPO=0, select Bank 0, RPO=1, select Bank 1. • Example: bcf STATUS, RPO Select bank 0 • bsf STATUS, RPO Select bank 1. Dr.YNM 34
  • 35. Contd… • FSR – (File Select Register): It is the pointer used for indirect addressing. In the indirect addressing mode the 8-bit register file address is first written into FSR. It is a special purpose register that serves as an address pointer to any address through out the entire register file. • INDF – (Indirect File): It is not a physical register .Addressing this INDF will cause indirect addressing. Any instruction using the INDF register actually access the register pointed to by the FSR. Dr.YNM 35
  • 36. contd • PCL: PCL is actually the lower 8-bits of the 13-bit program counter. It can be read like any other register. • PCLATH (Program Counter Latch): The upper 3-bits of PCLATH remains zero and serves no purpose, it is only when PC2 is written to that PCLATH is automatically written into the PC at the same time. Dr.YNM 36
  • 37. Memory organisation : It has three memory blocks. • Program memory • Data memory • Stack Dr.YNM 37
  • 38. • The 6x/7x family controllers have either 2k or 4k address of program memory. Normally a program memory of 2k addresses needs only a 11-bit program counter to access any address (211=2048=2k). • A program memory of 4k address needs a 12-bit program counter. But this PIC family uses 13-bit program counter allowing the controllers to an 8k- program memory without changing the CPU structure. Program Memory Dr.YNM 38
  • 40. • Two addresses in the program memory address space are treated in a special way by the CPU. • The first address H’ 000’ being a go to mainline instruction the second special address, H’ 004’ being a ‘go to in service’ instruction can be assigned to this address to make the CPU to jump to the beginning of the Interrupt Service routine located elsewhere in the memory space. Dr.YNM 40
  • 42. contd • When we deal with tables, if any tables are created they are assigned to addresses in the range H’005 – H’0FF’. • For most of the applications this space is sufficient. The main line program begins after the tables. Dr.YNM 42
  • 43. Data memory (Register Files) Data Memory is also known as Register File. Register File consists of two components. • General purpose register file ( RAM). • Special purpose register file (similar to SFR in 8051). Dr.YNM 43
  • 44. • The special purpose register file consists of input/output ports and control registers. Addressing from 00H to FFH requires 8 bits of address. • However, the instructions that use direct addressing modes in PIC to address these register files use 7 bits of instruction only. • Therefore the register bank select (RP0) bit in the STATUS register is used to select one of the register bank Dr.YNM 44
  • 46. PIC Reset actions • Reset is used to put the microcontroller into a known state. Normally when a PIC microcontroller is reset, execution starts from address 0 of the program memory. • This is where the first executable user program resides. • The reset action also initializes various SFR registers inside the Microcontroller. Dr.YNM 46
  • 47. Contd… • Reset mechanisms ensure that the CPU starts running when the appropriate operating conditions have been met, and can be used to restart the CPU in case of program failure. • The actual reset to the CPU or the Chip_Reset, is generated by a flip-flop. This has two inputs, S (Set) and R (Reset). Dr.YNM 47
  • 48. Contd….. • The CPU enters Reset mode when Chip_Reset goes low, which is caused by the S line going high. It stays there until the flip-flop is cleared, caused by the R line going high. • The S input to the flip-flop goes high, via a three- input OR gate, if any of the following goes high: Dr.YNM 48
  • 49. Contd….. • The Reset action normally occurs in various situations like • Power On Reset • Master Clear( ) Reset • Watchdog Timer Reset • Brown-out Reset (This feature is not available in PIC16C61/62/64/65 series. Only 74 series have this feature Dr.YNM 49
  • 50. Contd….. • The reset action will set the program counterto the starting address of the program.This starting address is different for different members.For Ex:Starting address for PIC16C71 is 000H.whereas for PIC16C57 it is 7FFH. • So,The first instruction to be executed will appear at the reset vector. Dr.YNM 50
  • 51. contd • An important point to be remembered, is when powered ,most of the hardware registers are initialized ,but RAM locations are not initialized. • A reset cycle will initialize the RAM locations. • So,the conclusion is Reset and Power-on are different in PIC controllers. Dr.YNM 51
  • 52. Contd….. • The Brown-out reset occurs when the supply voltage falls below 4 volts.The device remains in the Brown-out reset state till the supply voltage is restored. • The Brown-out reset also includes another feature . • If Vdd is hit with a transient noise spike , causing Vdd to drop below 4.0Volts for longer than 100 micro seconds the Brown-out reset circuit detects that and Dr.YNM 52
  • 53. Contd….. • reset the chip. whereas in most of the other microcontrollers many erroneous executions takes place during this time. • The PIC brown-out reset will also help if the power-on reset conditions are not not met. • There is a provision of power-up timer of about 72mS. • Once this is enabled the Brown-out reset occurs once again incase of non-restoration of supply within 72 mS. Dr.YNM 53
  • 54. PIC Oscillator Connections • There are 4 common oscillator modes that are available on most PIC micro devices. • HS, XT, LP and RC. (High speed, Crystal, Low- power clocking, Internal RC) • These modes support crystals, canned oscillator modules, some resonators or the use of an external resistor and capacitor as a clock source. When using a crystal or resonator, other components such as capacitors may be needed. Dr.YNM 54
  • 55. Contd….. • The HS mode stands for “High Speed” mode. It is designed to be used with crystals,and resonators with a frequency of 3 to 4 MHz or more. The important thing to remember about HS mode is that it provides the highest drive level available. Crystals and Resonators must be DRIVEN by a signal to work. The gain on this signal controls whether an oscillation will occur and how strong it will be. Care must be taken not to underdrive or overdrive the crystal or resonator. Dr.YNM 55
  • 56. Contd….. • The XT mode stands for “Crystal” mode and will produce a medium drive level. It is designed to be used with crystals and resonators of 1 to about 4 MHz. • XT mode has moderate power consumption since its drive level is lower than that of HS mode, and because a lower clock speed is produced. Remember, as a rule: the faster the clock used, the more current the application will require Dr.YNM 56
  • 57. Contd….. • The LP mode stands for "Low Power” mode. This mode is useful for circuits that require the lowest power possible. LP mode is engineered for 32.768kHz crystal operation, and it can function at any frequency below 200kHz. LP mode is most commonly used for 32.768kHz operation. • LP mode will produce the slowest clock rate, and as a result, the lowest power consumption of all the modes. • LP mode is ideal for timing sensitive applications since these same crystals are used as a time base in wrist-watches. Dr.YNM 57
  • 58. Contd….. • The RC mode stands for “External RC” mode. • It is important to note that this is an _EXTERNAL_ RC mode, ( some PICmicro devices have an _INTERNAL_ RC mode). • RC mode uses a resistor-capacitor network connected to the OSC1 pin. When the device is configured for external RC mode, these components are automatically driven to produce a frequency which will run the PICmicro MCU. Dr.YNM 58
  • 59. Contd….. • RC mode is designed for very low-cost applications. • The power consumed will vary due to the wide range of frequencies that can be created using this mode . Dr.YNM 59
  • 60. Contd….. • It is extremely important to note that RC mode will produce an inaccurate clock source. • In some applications this won’t matter, but applications that are timing sensitive should not be used with this mode. For this reason, RC mode is not recommended for timing sensitive applications or for RS-232 communication. Dr.YNM 60
  • 61. Contd….. • The IntRC mode stands for “Internal RC” mode and functions much like the standard External RC mode. • Unlike External RC mode, in IntRC mode the resistor and capacitor are already provided. Microcontrollers with this feature have an on- chip RC oscillator. Current designs run at approximately 4 MHz. Dr.YNM 61
  • 62. Contd….. • IntRC mode is the least expensive oscillator available since no external components are needed. • It is also useful, because devices in this mode can often use the OSC1 and OSC2 lines for general purpose I/O. This feature makes the PIC12CXXX and other 8-pin PICmicro devices very popular. Dr.YNM 62
  • 63. Contd….. • The ER mode stands for “External Resistor” mode. • ER mode is very similar to External RC mode, but no capacitor is needed. One resistor controls the frequency produced. • Similar to RC mode, ER mode has moderate power consumption, and is low cost.However, due to the nature of RC oscillators, it is not recommended for timing sensitive applications or for RS-232 use. Dr.YNM 63
  • 65. Limitations The PIC architectures have several limitations: • Only a single accumulator • A small instruction set • Operations and registers are not orthogonal; some instructions can address RAM and/or immediate constants, while others can only use the accumulator • Memory must be directly referenced in arithmetic and logic operations, although indirect addressing is available via 2 additional registers • Register-bank switching is required to access the entire RAM of many devices Dr.YNM 65
  • 66. THANQ !! Wish you good luck Dr.YNM 66