0% found this document useful (0 votes)
135 views18 pages

PIC Microcontroller

The document discusses the PIC microcontroller family, describing key features of 8-bit and 18-bit PIC microcontrollers including memory size, number of I/O pins, timers, and additional features like ADC channels. Selection criteria for choosing a PIC microcontroller are provided such as speed, memory size, number of I/O pins, power consumption, and available features. An overview is given of the PIC18F458 microcontroller highlighting its memory, I/O pins, timers, and communication features.

Uploaded by

k2_chaitanya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
135 views18 pages

PIC Microcontroller

The document discusses the PIC microcontroller family, describing key features of 8-bit and 18-bit PIC microcontrollers including memory size, number of I/O pins, timers, and additional features like ADC channels. Selection criteria for choosing a PIC microcontroller are provided such as speed, memory size, number of I/O pins, power consumption, and available features. An overview is given of the PIC18F458 microcontroller highlighting its memory, I/O pins, timers, and communication features.

Uploaded by

k2_chaitanya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

PIC Microcontroller

 PIC 16CXX, PIC18FXX are 8-bit


microcontroller by Microchip.
 It uses High speed RISC Architecture
 PIC are popular due to High performance, Low cost,& small
Size.
 Mostly Single word instructions, except 4 two
word instructions.
 Operating frequency for 18CXX – DC to 40 MHz
 Some advanced versions include ADC with 4-8
Channels
 General features includes Timers, Watch dog timers,
ADC, Extended
2
Instruction / Data memory , Serial communication , Capture/
Harvard Architecture
Von Neumann
Architecture
 Von Neumann Architecture:
 Fetches instructions and
data from a single memory
space
8-bit Bus Program
& Data
 Limits operating bandwidth
Memory
CPU  Harvard
Harvard Architecture:
 Uses two separate memory
Architecture
spaces for program
instructions and data
8-bit Bus Data  Improved operating bandwidth
Memory

CPU
 Allows for different bus
16-bit Bus
widths
Program 3
Memory
Comparison of PIC Family
PIC
Family
Pins Flash/ Timers I/O pins/ Additional Features
RAM ADC
Memory channels
range
PIC 6 896 B/ 64B 8 bit(2), PWM 4/ 2ch. ---
10CXX (2) 8bit

PIC 8 3.5 8 bit(2), 16 6/ 3 ch.8 bit USART(1)


12CXX KB/128- BIT(1)PW
256 B M (2)
PIC 14- 7-28 8 bit(4), 16 12/ 4 ch 10 WDT, Data E,
16FXX 40 KB/512B- BIT(1)PW bit, USART, I2C,
2KB M (2) SPIEPROM
PIC 40- 2 MB/32- 3 Timers, 33- 72/ 12 USB, 12 bit ADC,
18FXX 100 128 KB WDT, PWM ch 10 bit CAN , I2C, SPI Bus,
USART 4
New for 18 series
 The number of instructions more than doubled, with 16-bit
instruction
word
 Enhanced Status register
 Hardware 8 × 8 multiply
 More external interrupts
 Two prioritized interrupt vectors
 Radically different approach to memory structures, with
increased memory size
 Bigger Stack, with some user access and control
 Phase-locked loop (PLL) clock generator.

5
Selection Criteria for PIC Microcontroller
 1) Speed
 2) Amount of RAM/ ROM
 3) Number of I/O pins, Timers
 4) Power consumption
 5) Availability of tools
 6) Added features like ADC/ DAC/ CCP, Bus support like
CAN, SPI, I2C, USB.
 7) Watchdog timer, Timer modes, Data EEPROM etc.

6
PIC 18F458

High-Performance, Enhanced
Flash Microcontrollers with
CAN

7
Features of IC 18F452/458
 It uses 16-bit wide instructions, 8-bit wide data path.
 Program memory 2MBytes ROM [21 Address line]
 4KBytes of Data RAM [12 Address lines]
 32 KB flash ROM
 256 bytes – Data EEPROM – for storing critical information
 10 bit, 8 channel ADC
 5 ports A[6], B,C,D[8], E[3] =33 IO lines
 Capture/ Compare/ Pulse width modulation module.

8
Features of PIC 18F458
High-Performance RISC CPU:

 Three external interrupt pins,


 Has 15 bank registers with 256 entries, GPR [ variable]
and SFR [fixed locations]
 Priority levels for interrupts.
 USART , 3 Timers/ Counters 8-bit/16-bit timer/counter
with 8-bit programmable prescaler
 DC-40 MHz clock Input
 High current sink /source 25 mA/25 mA

9
PIC 18F452 General Architecture

10
Review: MPU and Memory

11
PIC18F Programming Model
 The representation of the internal
architecture of a microprocessor, necessary
to write assembly language programs
 Divided into two groups
 Arithmetic Logic Unit (ALU) and Registers
 From Microprocessor Unit (MPU)
 Special Function Registers (SFRs)
 From Data (File) Memory

12
PIC18F Programming Model

14
Arithmetic Logic Unit (ALU)
 Instruction Decoder
 16-bit Instructions
 STATUS: Flag Register
 5 individual bits called flags
 WREG (W): Working Register
 8-bit Accumulator
 Product
 16-bit Product of 8-bit by 8-bit Multiply
Arithmetic Logic Unit

Example
ADDWF F, d, a ;Add WREG to File (Data) Reg.
; S a v e r e s u l t i n W.E.,Piufnde. =0
Pro f . M . N . K a ka tk a r, S .C .O 16
;Save result in F if d = 1
Flags in Status Register

 N (Negative Flag)
 Set when bit B7 is one as the result of an arithmetic/logic operation
 OV (Overflow Flag)
 Set when result of an operation of signed numbers goes beyond 7-
bits
 Z (Zero Flag)
 Set when result of an operation is zero
 DC (Digit Carry Flag) (Half Carry)
 Set when carry generated from Bit3
 to Bit4 in an arithmetic operation
 C (Carry Flag)
Set when an addition generates carry
Registers
 Program Counter (PC)
 21-bit register functions as a pointer to program
memory during program execution
 Table Pointer
 21-bit register used as a memory pointer to copy
bytes between program memory and data registers
 Stack Pointer (SP)
 5-bit register used to point to the stack
 Stack
 31 registers used for temporary storage of memory

addresses during execution of a program


Registers
 BSR: Bank Select Register (0 to F)
 4-bit Register
 Provides upper 4-bits of 12-bit address of data
memory
 FSR: File Select Registers
 FSR0, FSR1, and FSR2
 FSR: composed of two 8-bit registers
 FSRH and FSRL
 Used as pointers for data registers
 Holds 12-bit address of data register

You might also like