Embedded System Spring 2011 Lecture 3 The PIC
Embedded System Spring, 2011 Lecture 3: The PIC Microcontrollers Eng. Wazen M. Shbair
Today’s Lecture o Comparison between Microprocessors and Microcontrollers. o Advantages of Microcontroller. o Criteria for considering Microcontroller. o Overview of the PIC 18 Family IUG- Embedded System 2
Microprocessor vs. Microcontroller o Microprocessor is general-purpose microprocessors such as Intel’s x 86 family. o Microprocessor dose not contain RAM, ROM or I/O Ports on the chip it self. o Microcontroller has CPU and fixed amount of RAM, ROM, I/O Ports and Timer all on a single chip. IUG- Embedded System 3
Microprocessor vs. Microcontroller IUG- Embedded System 4
Microprocessor vs. Microcontroller o Microprocessor and Microcontroller are widely used in embedded system products. o Typically, in an embedded system the microcontroller’s ROM is burned with a purpose for specific functions needed for the system. (e. x. Printer) IUG- Embedded System 5
Choosing a µController o The major 8 -bit n Freescale Semiconductor’s (formerly Motorola) 68 HC 08/68 HC 11 n Intel’s 8051 n Atmel’s AVR n Zilog’s Z 8 n PIC from Microchip Technology IUG- Embedded System 6
Criteria for Choosing µController 1. Meeting the computing needs of the task at hand efficiency and cost effectively 2. Availability of SW and HW development tools n n Compilers Assemblers Debuggers Emulators 3. Wide availability and reliable source. IUG- Embedded System 7
Criteria for Choosing µController o Meeting the computing needs of the task at hand efficiency and cost effectively n n n n Determine its type, 8 -bit, 16 -bit or 32 -bit Speed Packaging (40 -Pin or QFP) Power consumption The amount of RAM and ROM The number of I/O pins and the timer Cost per unit Ease of upgrade. IUG- Embedded System 8 3 -8
µC Data width o 8 -bit Microcontrollers n PIC 10, PIC 12, PIC 14 n PIC 16, PIC 17, PIC 18 o 16 -bit Microcontrollers n PIC 24 F, PIC 24 H o 32 -bit Microcontrollers n PIC 32 o 16 -bit Digital Signal Controllers n ds. PIC 30, ds. PIC 33 F IUG- Embedded System 9
Overview of the PIC 18 Family o An 8 -bit µController called PIC is introduces in 1989 by Microchip Technology Corporation o It includes n n Small Data RAM Few bytes of ROM One timer I/O ports IUG- Embedded System 10 3 -10
PIC 18 Feathers o o o o RISC Architecture On-chip program, Code, ROM Data EEPROM Timers ADC USART I/O Ports IUG- Embedded System 11
RISC Architecture o o o Reduced Instruction Set Computer (RISC) Small, highly optimized set of instructions Uses a load-store architecture Short execution time Pipelining Many registers
Figure 1 -2. Simplified View of a PIC Microcontroller IUG- Embedded System 13 3 -13
Microcontroller IUG- Embedded System 15 3 -15
PIC µC program ROM o PIC exists in terms of different speed and the amount of on-chip RAM/ROM o Compatibility is restricted as far as the instructions are concerns. IUG- Embedded System 16 3 -16
PIC µC Program ROM o o Its used to store Program or code PIC 18 can support up to 2 MB Generally, they come with 4 KB – 128 KB Available in flash, OTP, UV-EPROM, and masked. IUG- Embedded System 17
UV-EPROM IUG- Embedded System 18 3 -18
PIC 18 Fxxxx with flash o Its on chip ROM is flash o It memory can be erased in second compared to 20 minute needed for UV-EPROM o Used for product development IUG- Embedded System 19
PIC 18 Cxxxx and Masked PIC o One Time Programmable (OTP) n C indicates the OTP RPM n Used for mass production n Cheaper o Masked n program will be burned into the PIC chip during the fabrication process IUG- Embedded System 20
PIC C data RAM and EEPROM o Max. 4096 Bytes (4 k. B) of data RAM space. o Data RAM space has two components n Varied GPR, General Purpose RAM o For read/write and data manipulation o Divided into banks of 256 B n Fixed SFR, Special Function Registers o Some of PICs have a small amount of EEPROM n Used for critical data storing IUG- Embedded System 21
IUG- Embedded System 22
PIC µC peripherals o o o o 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 IUG- Embedded System 23 3 -23
References o Jie Hu , ECE 692 Embedded Computing Systems , Fall 2010. o PIC Microcontroller And Embedded Systems: using Assembly and C for PIC 18, M. Mazidi, R. Mc. Kinlay and D. Causey, Prentice Fall, 2008. o Eng. Husam Alzaq, Embedded System Course, IUG, 2010 IUG- Embedded System 24
- Slides: 23