2 PIC microcontroller PIC Peripheral Interface Controller by Microchip TechnologyThese 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
3 Low-end PIC architecture have limited program/code memoryfor applications requiring simple interface functions and small program & data memoriesSome device nos.12C5XX 16C5X 16C505
4 Mid-range PIC arc… more number of peripherals, more number of registers andmore data/program memory.Some devices are16C6X 16C7X 16F87XProgram memory type is indicated by alphabet: C = EPROM OTM (one-time programmable) F = Flash RC = Mask ROM [cheapest, burnt while IC fabrication]
11 readSimple 33 (12-bit wide) instruction set for ease of use and quick development2K word (3 KB) addressable program memory144 bytes RAM (max)2 level hardware stack1 (8-bit) file select registerMultiple product options and easy migration
17 readK seriesProvides the highest performance with benchmark nanoWatt XLP extreme low power consumption.83 (16-bit wide) powerful C-optimizedUp to 2 MB addressable program memory4KB RAM (max)32 level hardware stack1 (8-bit) file select registerIntegrated 8x8 hardware multiplyHighest performance 8-bit architecture
18 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 PIC16 (as opposed to 111 instructions for 8051).
19 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 4V), 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.
20 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.
21 Why PIC is popular?... I/O port expansion capability. 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
23 PIC Memory Organization has 13 bits of program/code memory address.Hence it can address up to 8k [213=8192] of program memory.The program counter is 13-bit.PIC 16C6X or 16C7X program memory is 2k or 4k.While addressing 2k of program memory, only 11-bits are required. Hence two MSBs of the program counter are ignored.Similarly, while addressing 4k of memory, 12 bits are required. Hence the MSB of the program counter is ignored.2^10 = ^11 = 20482^12= ^13=81922^14=16384 … 2^16=65536
24 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 themIt consists of I/O ports and control registers Recall registers of 8086 & compare
25 PIC18 has a max of 4096 bytes (4K) [2^12=4096]of data RAM space. Size of special-purpose reg [SPR] is fixedSize of general-purpose reg [GPR] varies from 256 B to 4096 B.GPR is divided into banks of 256B each [more – ch.6]
27 PIC18 – I/O pins Can have from 16 to 72 pins – dedicated for I/O [more ch. 4]
28 PIC18 - peripheralsAll PIC18 family have the following standard peripherals –ADCTimersUSART [universal synchronous asynchronous receiver transmitter] – it allows us to connect the PIC18-based system to serial ports (e.g., COM port of the IBM PC)
29 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 InterfaceADC - Analog Digital ConverterUSART- Universal Synchronous Asynchronous Receiver Transmitter
30 Courtesy – http://microchip.com ‘PIC Microcontroller and Embedded Systems, by MA Mazidi et al., Pearson, 2012