PIC Microcontroller and E b dd d S tEmbedded...
Transcript of PIC Microcontroller and E b dd d S tEmbedded...
![Page 1: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/1.jpg)
PIC Microcontroller and E b dd d S tEmbedded Systems
Muhammad Ali Mazidi, Rolin McKinlay and Danny Causey
Eng. Husam AlzaqE g m qThe Islamic Uni. Of Gaza
The PIC uCs 1-1
![Page 2: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/2.jpg)
Chapter 1:pThe PIC Mi t ll Microcontrollers: History and Features History and Features
Microcontroller and
PIC Microcontroller d E b dd d S
Embedded ProcessorsOverview of the PIC18 and Embedded Systems
Muhammad Ali Mazidi, Rolin McKinlay and D C s F b
Overview of the PIC18 Family
Danny Causey, February 2007.
The PIC uCs 1-2
![Page 3: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/3.jpg)
ObjectiveObjective
d P d Compare and contrast uP and uCDescribe the advantages of uCgExplain the concept of ESDescribe criteria for considering a uCDescribe criteria for considering a uCCompare and contrast the various of the PIC FamilyPIC FamilyCompare the PIC with uC offered by
h others
The PIC uCs 1-3
![Page 4: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/4.jpg)
Microcontroller and Embedded Processors
ll G l PMicrocontroller VS General purpose uPuC for embedded systemsyX86 PC Embedded Application
The PIC uCs 3-4
![Page 5: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/5.jpg)
Figure 1-1. Microprocessor System Contrasted With Microcontroller Contrasted With Microcontroller System
The PIC uCs 3-5
![Page 6: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/6.jpg)
Choosing a uControllerChoosing a uController
h b The major 8-bit Freescale Semiconductor’s (formerly Motorola) 6 H 0 /6 H 1168HC08/68HC11Intel’s 8051Atmel’s AVRZilog’s Z8PIC from Microchip Technology
The PIC uCs 3-6
![Page 7: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/7.jpg)
Criteria for Choosing uController
h d f h k 1. Meeting the computing needs of the task at hand efficiency and cost effectively
2. Availability of SW and HW development tools
CompilersAssemblersDebuggersEmulators
3. Wide availability and reliable source
The PIC uCs 3-7
![Page 8: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/8.jpg)
Criteria for Choosing uController
h d f h k Meeting the computing needs of the task at hand efficiency and cost effectively
Determine its type, 8-bit,16-bit or 32-bitSpeedPackaging (40-Pin or QFP)Power consumptionThe amount of RAM and ROMThe number of I/O pins and the timerCost per unitEase of upgrade.
The PIC uCs
pg
The PIC uCs 3-8
![Page 9: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/9.jpg)
uC Data width uC Data width
b ll8-bit MicrocontrollersPIC10, PIC12, PIC14PIC16, PIC17, PIC18
16-bit MicrocontrollersPIC24F, PIC24H
32-bit Microcontrollers32 bit MicrocontrollersPIC32
16 bit Digital Signal Controllers16-bit Digital Signal ControllersdsPIC30, dsPIC33F
The PIC uCs 3-9
![Page 10: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/10.jpg)
Overview of the PIC18 Family
b ll ll d P An 8-bit uController called PIC is introduces in 1989 by Microchip
h l Technology CorporationIt includes
Small Data RamFew bytes of RomyOne timerI/O portsp
The PIC uCs 3-10
![Page 11: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/11.jpg)
PIC 18 FeathersPIC 18 Feathers
hRISC ArchitectureOn-chip program, Code, ROMp p gData EEPROMTimersTimersADCU RTUSARTI/O Ports
The PIC uCsThe PIC uCs 3-11
![Page 12: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/12.jpg)
Figure 1-2. Simplified View of a PIC Microcontroller
The PIC uCs 3-12
![Page 13: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/13.jpg)
PIC18 Features PIC18 Features
hRISC ArchitectureOn chip Code ROM and Data RAM, Data pEEPROMTimersTimersADCUSARTUSARTI/O ports
The PIC uCs 3-13
![Page 14: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/14.jpg)
Figure 1-3 PIC18 Block DiagramFigure 1-3. PIC18 Block Diagram
The PIC uCs 3-14
![Page 15: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/15.jpg)
Figure 1-3. PIC18 Block Diagram (continued)
The PIC uCs 3-15
![Page 16: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/16.jpg)
Figure 1-4 PIC16 Block DiagramFigure 1-4. PIC16 Block Diagram
The PIC uCs 3-16
![Page 17: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/17.jpg)
Figure 1-4. PIC16 Block Diagram (continued)
The PIC uCs 3-17
![Page 18: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/18.jpg)
uCuC
The PIC uCs 3-18
![Page 19: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/19.jpg)
PIC uC program ROMPIC uC program ROM
P f d ff d d PIC exists in terms of different speed and the amount of on-chip RAM/ROMCompatibility is restricted as far as the instructions are concerns.
The PIC uCs 3-19
![Page 20: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/20.jpg)
PIC uC Program ROMPIC uC Program ROM
P 1 BPIC 18 can support up to 2MBGenerally, they come with 4KB – 128KBy yAvailable in flash, OTP, UV-EPROM, and masked.masked.
The PIC uCsThe PIC uCs 3-20
![Page 21: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/21.jpg)
UV-EPROMUV-EPROM
The PIC uCs 3-21
![Page 22: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/22.jpg)
PIC18Fxxxx with flashPIC18Fxxxx with flash
d f d d lUsed for product development
The PIC uCsThe PIC uCs 3-22
![Page 23: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/23.jpg)
PIC18Cxxxx and Masked PICPIC18Cxxxx and Masked PIC
POTPOne time programmableC indicates the OTP RPMUsed for mass productionCheaper
Maskedprogram will be burned into the PIC chip during the fabrication processp
The PIC uCsThe PIC uCs 3-23
![Page 24: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/24.jpg)
PIC uC data RAM and EEPROMPIC uC data RAM and EEPROM
40 6 B (4 kB) f d Max. 4096 Bytes (4 kB) of data RAM space.Data RAM space has two components
Varied GPR, General Purpose RAMp• For read/write and data manipulation• Divided into banks of 256 B
Fixed SFR, Special Function RegistersSome of PICs have a small amount of EEPROM
Used for critical data storing
The PIC uCs
g
The PIC uCs 3-24
![Page 25: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/25.jpg)
The PIC uCsTransport Layer 3-25
![Page 26: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/26.jpg)
PIC uC peripheralsPIC uC peripherals
N ( ll N k) CAN- (Controller Area Network), LIN- (Local Interconnect Network), USB- (Universal Serial Bus), I²C- (Inter-Integrated Circuit) I C- (Inter-Integrated Circuit), SPI- (Serial Peripheral Interface),
i l E h I fSeriel or Ethernet InterfaceADC - Analog Digital Converterg gUSART- Universal Synchronous Asynchronous Receiver Transmitter
The PIC uCs
synchronous ece ver ransm tter
3-26
![Page 27: PIC Microcontroller and E b dd d S tEmbedded Systemssite.iugaza.edu.ps/hzaq/files/2010/02/ES_Chapter1.pdf · PIC Microcontroller and E b dd d S tEmbedded Systems ... Microcontroll](https://reader031.fdocuments.net/reader031/viewer/2022022606/5b7f7cb27f8b9ae6088c3f35/html5/thumbnails/27.jpg)
Chapter 1: SummaryChapter 1: SummaryWe have Compared We have Compared between uP and uCWe have described the We have described the advantages of uCW h i sim l We have given a simple introduction for PIC18 Next:
PIC Architecture and assembly language programming.
The PIC uCs 3-27