100% found this document useful (1 vote)
925 views

PIC Microcontroller

The PIC microcontroller was developed in 1993 by Microchip Technology. It stands for Peripheral Interface Controller and was originally developed to control peripheral devices for computers. The PIC18 is an 8-bit microcontroller with features like timers, serial communication interfaces, ADC, and memory protection. It has separate program and data memory. The architecture includes an ALU, registers, and control unit. It has five I/O ports and timers that can generate interrupts.

Uploaded by

ANITHA KALAKONDA
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
100% found this document useful (1 vote)
925 views

PIC Microcontroller

The PIC microcontroller was developed in 1993 by Microchip Technology. It stands for Peripheral Interface Controller and was originally developed to control peripheral devices for computers. The PIC18 is an 8-bit microcontroller with features like timers, serial communication interfaces, ADC, and memory protection. It has separate program and data memory. The architecture includes an ALU, registers, and control unit. It has five I/O ports and timers that can generate interrupts.

Uploaded by

ANITHA KALAKONDA
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/ 28

PIC Microcontroller

• PIC microcontroller was developed in the year


1993 by microchip technology.
• The term PIC stands for Peripheral Interface
Controller. Initially this was developed for
supporting PDP(programmed data processor)
computers to control its peripheral devices,
and therefore, named as a peripheral interface
device.
Features of the PIC18 microcontroller
• - 8-bit CPU
• - 2 MB program memory space
• - 256 bytes to 1KB of data EEPROM
• - Up to 3968 bytes of on-chip SRAM
• - 4 KB to 128KB flash program memory
• - Sophisticated timer functions that include: input capture, output
compare,
• PWM, real-time interrupt, and watchdog timer
• - Serial communication interfaces: SCI, SPI, I2C, and CAN
• - Background debug mode (BDM)
• - 10-bit A/D converter
• - Memory protection capability
• - Instruction pipelining
• - Operates at up to 40 MHz crystal oscillator
Architecture of PIC Microcontroller
Microprocessor Unit
• Includes Arithmetic Logic Unit (ALU),
Registers, and Control Unit
– Arithmetic Logic Unit (ALU)
• Instruction decoder
– 16-bit instructions
• Status register that stores flags
– 5-bits
• WREG – working register
– 8-bit accumulator
Microprocessor Unit
– Registers
• Program Counter (PC)
– 21-bit register that holds the Program Memory address
• Bank Select Register (BSR)
– 4-bit register used in direct addressing the Data Memory

• File Select Registers (FSRs)


– 12-bit registers used as memory pointers in indirect
addressing Data Memory
– Control unit
• Provides timing and control signals
– Read and Write operations
PIC18F - Address Buses
• Address bus
– 21-bit address bus for Program Memory
• Addressing capacity: 2 MB
– 12-bit address bus for Data Memory
• Addressing capacity: 4 KB
Data Bus and Control Signals
• Data bus
– 16-bit instruction/data bus for Program Memory
– 8-bit data bus for Data Memory
• Control signals
– Read and Write
PIC18F – MPU and Memory
PROGRAM COUNTER AND ROM MEMORY SPACE
STATUS REGISTER FLAG
The PIC18 Memory Organization
• Data Memory and Program Memory are
separated
• - Separation of data memory and program
memory makes possible the simultaneous
access of data and instruction.
• - Data memory are used as general-purpose
registers or special function registers
• - On-chip Data EEPROM are provided in some
PIC18 MCUs
1. PIC18F452/4520 Memory

• Program Memory: 32 K
– Address range: 000000 to 007FFFH
• Data Memory: 4 K
– Address range: 000 to FFFH
• Data EEPROM
– Not part of the data memory space
– Addressed through special function registers
2. Data Memory Banks/BSR SELECTION
PIC18 I/O Ports
• Five I/O ports
– PORT A through PORT E
– Most I/O pins are multiplexed
– Generally have eight I/O pins
– Addresses already assigned to these ports
– Each port is identified by its assigned SFR
PIC18 I/O Ports
• The series of PIC16 consists of five ports such as Port A,
Port B, Port C, Port D & Port E.
• Port A is an 16-bit port that can be used as input or output
port based on the status of the TRISA (Tradoc Intelligence
Support Activity) register.
• Port B is an 8- bit port that can be used as both input and
output port.
• Port C is an 8-bit and the input of output operation is
decided by the status of the TRISC register.
• Port D is an 8-bit port acts as a slave port for connection to
the microprocessor BUS.
• Port E is a 3-bit port which serves the additional function
of the control signals to the analog to digital converter
Diagram of I/O Ports
Feature of Timer 0
• 8-bit timer/counter
• Readable and writable
• 8-bit software programmable prescaler
• Internal (4 Mhz) or external clock select
• Interrupt on overflow from FFh to 00h
• Edge select (rising or falling) for external clock
TimerO Control Register
Timer 1 Timer 1 (TMR1)
16-bit timer/counter

overflow occurs, an interrupt is generated


TMR1 increments from 0000h to FFFFh and rolls over to
000h
TMR1 operating mode is determined by the clock select
bit, TMR1CS
TMR1 module can operate in 2 basic modes-
(i). R.Hariharan
a timer (ii).a counter
AP / EEE - SECE
R.Hariharan AP / EEE - SECE
Example
Timer 2 Timer 2 (TMR2)
8-bit timer with Prescaler and Postscaler

TMR2 can be used as – PWM


TMR2 register is R/W – cleared on any device reset.
Timer2 module has an 8-bit period register PR2
Timer2 increments from 00h till reaches PR2
PR2 is initialized to FFh upon reset.

R.Hariharan AP / EEE - SECE


R.Hariharan AP / EEE - SECE
Interrupts

Polling
External
System
Interrupts

Software Hardware
Interrupt Interrupt
Request from software Request from external
R.Hariharan AP / EEE - SECE
Hardware device
PIC16C7X family has up to 12 sources of interrupt External
• Timer 0
• Timer 1
• RB Port Change
• Parallel Slave Port Read/Write
• A/D Converter
• USART Receive
• USART Transmit
• Synchronous Serial Port
• CCP1 (Capture, Compare, PWM)
• CCP2 (Capture, Compare, PWM)
• TMR2 to PR2 Match

R.Hariharan AP / EEE - SECE

You might also like