Microcontroller 3 PIC types PIC architecture Md Atiqur

  • Slides: 29
Download presentation
Microcontroller – 3 PIC types PIC architecture Md. Atiqur Rahman Ahad

Microcontroller – 3 PIC types PIC architecture Md. Atiqur Rahman Ahad

PIC microcontroller • PIC Peripheral Interface Controller – by Microchip Technology • These devices

PIC microcontroller • PIC Peripheral Interface Controller – by Microchip Technology • These devices have been very successful in 8 -bit microcontrollers. • Why? Microchip Technology has continuously upgraded the device architecture and added needed peripherals to the microcontroller to suit customers' requirements. • The development tools [assembler and simulator] are freely available at http: //microchip. com

Low-end PIC architecture • have limited program/code memory • for applications requiring simple interface

Low-end PIC architecture • have limited program/code memory • for applications requiring simple interface functions and small program & data memories • Some device nos. – 12 C 5 XX 16 C 505

Mid-range PIC arc… • • more number of peripherals, more number of registers and

Mid-range PIC arc… • • more number of peripherals, more number of registers and more data/program memory. Some devices are – 16 C 6 X 16 C 7 X 16 F 87 X • Program memory type is indicated by alphabet: C = EPROM OTM (one-time programmable) F = Flash RC = Mask ROM [cheapest, burnt while IC fabrication]

UV-EPROM

UV-EPROM

Mem. vs. Pins vs. Versions

Mem. vs. Pins vs. Versions

Compare 8 -bit PIC arch. • Visit http: //www. microchip. com/pagehandler/enus/family/8 bit/architecture/home. html

Compare 8 -bit PIC arch. • Visit http: //www. microchip. com/pagehandler/enus/family/8 bit/architecture/home. html

PIC CPU archi.

PIC CPU archi.

Baseline PIC® Microcontrollers

Baseline PIC® Microcontrollers

read • Simple 33 (12 -bit wide) instruction set for ease of use and

read • Simple 33 (12 -bit wide) instruction set for ease of use and quick development • 2 K word (3 KB) addressable program memory • 144 bytes RAM (max) • 2 level hardware stack • 1 (8 -bit) file select register • Multiple product options and easy migration

Mid-range PIC

Mid-range PIC

read • • 35 (14 -bit wide) instructions 8 K word (14 KB) addressable

read • • 35 (14 -bit wide) instructions 8 K word (14 KB) addressable program memory 46 bytes RAM (max) 8 level hardware stack 1 (9 -bit) file select register Hardware interrupt handling Highly integrated feature set, including EEPROM, LCD, m. Touch™ sensing solutions and serial communications

Enhanced Mid-Range PIC

Enhanced Mid-Range PIC

read • • 49 (14 -bit wide) instructions 32 K word (56 KB) addressable

read • • 49 (14 -bit wide) instructions 32 K word (56 KB) addressable program memory 4 KB RAM (max) 16 level hardware stack 2 (16 -bit) file select registers Hardware interrupt handling with content save Advanced feature set, multiple serial communications and motor control capability

PIC 18

PIC 18

read K series • Provides the highest performance with benchmark nano. Watt XLP extreme

read K series • Provides the highest performance with benchmark nano. Watt XLP extreme low power consumption. • 83 (16 -bit wide) powerful C-optimized • Up to 2 MB addressable program memory • 4 KB RAM (max) • 32 level hardware stack • 1 (8 -bit) file select register • Integrated 8 x 8 hardware multiply • Highest performance 8 -bit architecture

Why PIC is popular? • Speed: Harvard Architecture, RISC architecture, 1 instruction cycle =

Why PIC is popular? • Speed: Harvard Architecture, RISC architecture, 1 instruction cycle = 4 clock cycles. • Instruction set simplicity: The instruction set has 35 instructions for PIC 16 (as opposed to 111 instructions for 8051).

Why PIC is popular? . . . • Power-on-reset and brown-out reset. • Brown-out-reset

Why PIC is popular? . . . • Power-on-reset and brown-out reset. • Brown-out-reset means when the power supply goes below a specified voltage (say 4 V), it causes PIC to reset; hence malfunction is avoided. • A watchdog timer (user programmable) resets the processor, if the software/program ever malfunctions and deviates from its normal operation.

Why PIC is popular? . . . • PIC microcontroller has 4 optional clock

Why PIC is popular? . . . • PIC microcontroller has 4 optional clock sources. – – Low power crystal Mid range crystal High range crystal RC oscillator (low cost). • Programmable timers and on-chip ADC. • Up to 12 independent interrupt sources.

Why PIC is popular? . . . – EPROM/ – OTP[one-time programmable] ROM/ –

Why PIC is popular? . . . – EPROM/ – OTP[one-time programmable] ROM/ – Masked version/ – Flash memory option. • I/O port expansion capability. • Free assembler and simulator support from Microchip at www. microchip. com

PIC CPU archi.

PIC CPU archi.

PIC Memory Organization has 13 bits of program/code memory address. Hence it can address

PIC Memory Organization has 13 bits of program/code memory address. Hence it can address up to 8 k [213=8192] of program memory. The program counter is 13 -bit. PIC 16 C 6 X or 16 C 7 X program memory is 2 k or 4 k. While addressing 2 k of program memory, only 11 -bits are required. Hence two MSBs of the program counter are ignored. • Similarly, while addressing 4 k of memory, 12 bits are required. Hence the MSB of the program counter is ignored. • • • – 2^10 = 1024 – 2^12=4096 – 2^14=16384 … 2^11 = 2048 2^13=8192 2^16=65536

Data mem. / RAM Data memory (Register Files): • Data Memory aka Register File.

Data mem. / RAM Data memory (Register Files): • Data Memory aka Register File. • Register File consists of two components. – General purpose register file (same as RAM). – Special purpose register file (similar to SFR in 8051: Special Function Registers (SFRs) of 128 bytes) – fixed & every microcontroller must have them • It consists of I/O ports and control registers Recall registers of 8086 & compare

 • PIC 18 has a max of 4096 bytes (4 K) [2^12=4096]of data

• PIC 18 has a max of 4096 bytes (4 K) [2^12=4096]of data RAM space. • Size of special-purpose reg [SPR] is fixed • Size of general-purpose reg [GPR] varies from 256 B to 4096 B. • GPR is divided into banks of 256 B each [more – ch. 6]

Data mem map

Data mem map

PIC 18 – I/O pins • Can have from 16 to 72 pins –

PIC 18 – I/O pins • Can have from 16 to 72 pins – dedicated for I/O [more ch. 4]

PIC 18 - peripherals • All PIC 18 family have the following standard peripherals

PIC 18 - peripherals • All PIC 18 family have the following standard peripherals – – ADC – Timers – USART [universal synchronous asynchronous receiver transmitter] – it allows us to connect the PIC 18 -based system to serial ports (e. g. , COM port of the IBM PC)

PIC µC peripherals • • CAN- (Controller Area Network), LIN- (Local Interconnect Network), USB-

PIC µC peripherals • • CAN- (Controller Area Network), LIN- (Local Interconnect Network), USB- (Universal Serial Bus), I²C- (Inter-Integrated Circuit), SPI- (Serial Peripheral Interface), Serial or Ethernet Interface ADC - Analog Digital Converter USART- Universal Synchronous Asynchronous Receiver Transmitter Courtesy – • • http: //microchip. com ‘PIC Microcontroller and Embedded Systems, by MA Mazidi et al. , Pearson, 2012 29