SlideShare a Scribd company logo
Lecture 5
INTRODUCTION TO
MICROCONTROLLER
Microprocessor & Microcontroller System
Intended Learning outcomes
 At the end of this topic, students should be
able to:
 eplain briefly the microcontroller-based system
using block diagram.
 list the types of microcontroller and examples of
embedded microcontroller/ embedded system
 describe the features and internal structure of a
microcontroller (PIC16F877A).
 describe how an instruction is executed.
1
Introduction
What is a microcontroller?
 A microcontroller (sometimes abbreviated µC, uC
or MCU) is a small computer on a single integrated
circuit containing a processor core, memory, and
programmable input/output peripherals. It can only
perform simple task. A microcontroller is often
described as a ‘computer-on-a-chip’.
2
 Microcontrollers are purchased ‘blank’ and then
programmed with a specific control program.
 Once programmed the microcontroller is build into a
product to make the product more intelligent and
easier to use.
 A designer will use a Microcontroller to:
- Gather input from various sensors
- Process this input into a set of actions
- Use the output
mechanisms on
the microcontroller
to do something
useful.
3
The Difference between microcomputer system
and microcontroller based system
4
Real inside microcontroller
5
 Microcontrollers are sometimes called embedded
microcontrollers, which just means that they are
part of an embedded system -- that is, one part
of a larger device or system.
 The majority of microcontrollers in use today are
embedded in other machinery, such as
automobiles, telephones, appliances, and
peripherals for computer systems. These are
called embedded system.
Embedded System
6
…cont’d
 Typical input and output devices include
switches, relay, solenoids, LEDs, small or custom
LCD displays, radio frequency devices, and
sensors for data such as temperature, humidity,
light level etc.
 Embedded systems usually have no keyboard,
screen, disks, printers, or other recognizable I/O
devices of a personal computer, and may lack
human interaction devices of any kind.
7
9
Examples of Embedded System
 Consumer Electronic : DVD player, hi-fi, TV, air-conditioner, washing
machine etc.
 Medical Monitoring Devices : ECG (electrocardiogram), blood
pump, blood pressure meter, etc.
 Security System : Alarm, remote sueveilance, smart card + reader etc.
 Closed Loop Process Control : Motor speed control, robot, SCADA
(supervisory control & acquisition) etc.
 Personal Computing : Keyboard, printer, USB hub, SCSI HD, energy
management etc.
 Automotive : Ignition control, A/C, Automatic transmission, anti-lock
brake system (ABS), active suspension, etc
 Military : Missile, torpedo, ejection seat, etc
 Communications : Handphone, modem, radio, radar, satelite etc.
9
8
Types of Microcontroller
 Parallax Propeller
 Freescale 68HC11 (8-bit)
 Intel 8051
 Silicon Laboratories Pipelined 8051 Microcontrollers
 ARM processors (from many vendors) using ARM7 or Cortex-M3
cores are generally microcontrollers
 STMicroelectronics STM8 (8-bit), ST10 (16-bit) and STM32 (32-bit)
 Atmel AVR (8-bit), AVR32 (32-bit), and AT91SAM (32-bit)
 Freescale ColdFire (32-bit) and S08 (8-bit)
 Hitachi H8, Hitachi SuperH (32-bit)
 Hyperstone E1/E2 (32-bit, First full integration of RISC and DSP on
one processor core [1996])
 Infineon Microcontroller: 8, 16, 32 Bit microcontrollers for
automotive and industrial applications.
10
9
 MIPS (32-bit PIC32)
 NEC V850 (32-bit)
 Microchip PIC (8-bit PIC16, PIC18, 16-bit dsPIC33/PIC24)
 PowerPC ISE
 PSoC (Programmable System-on-Chip)
 Rabbit 2000 (8-bit)
 Texas Instruments Microcontroller MSP 430 (16-bit), C2000
(32-bit), and Stellaris (32-bit)
 Toshiba TLCS-870 (8-bit/16-bit)
 Zilog eZ8 (16-bit), eZ80 (8-bit)
 etc
…cont’d
10
 PIC is a family of Harvard architecture
microcontroller made by Microchip Technology. The
name PIC initially referred to "Peripheral Interface
Controller“ . PIC microcontrollers were the first RISC
microcontroller.
 PICs are popular with both industrial developers and
hobbyists alike due to their low cost, wide
availability, large user base, extensive collection of
application notes, availability of low cost or free
development tools, and serial programming (and re-
programming with flash memory) capability.
Microchip PIC
11
Two Different Architectures
12
PIC Microcontroller product family
 8-bit microcontrollers
 PIC10
 PIC12
 PIC14
 PIC16
 PIC17
 PIC18
 16-bit microcontrollers
 PIC24F
 PIC24H
 32-bit microcontrollers
 PIC32
 16-bit digital signal
controllers
 dsPIC30
 dsPIC33F
13
 The F in a name generally indicates the PICmicro uses flash
memory and can be erased electronically.
 The C generally means it can only be erased by exposing the
die to ultraviolet light (which is only possible if a windowed
package style is used). An exception to this rule is the PIC16C84
which uses EEPROM and is therefore electrically erasable.
1 :
14
PIC Microcontroller product family
Why use PIC16F877?
15
 Why PIC16F877A is very popular?
 This is because PIC16F877A is very cheap. Apart from that
it is also very easy to be assembled. Additional components
that you need to make this IC work is just a 5V power supply
adapter, a 20MHz crystal oscillator and 2 units of 22pF
capacitors.
 What is the advantages of PIC16F877A?
 This IC can be reprogrammed and erased up to 10,000
times. Therefore it is very good for new product
development phase.
 What is the disadvantages of PIC16F877A?
 This IC has no internal oscillator so you will need an external
crystal of other clock source.
Features of
PIC16F877
16
8
Key Features PIC16F877
MAX Operating Frequency 20MHz
FLASH Program Memory
(14-bit words)
8K
Data Memory (bytes) 368
EEPROM Data Memory (bytes) 256
I/O Ports
RA0-5 (6)
RB0-7 (8)
RC0-7 (8)
RD0-7 (8)
RE0-2 (3)
Timers 3
CCP 2
Serial Communications MSSP, USART
Parallel Communications PSP
10-bit Analog-to-Digital Module 8 Channels
Instruction Set 35 Instructions
Pins (DIP) 40 Pins
 As you can see the
PIC16F877A is rich
in peripherals so you
can use it for many
different projects.
Bubble diagram
of PIC16F877
17
 Quad Flat Package
(QFP)
 Plastic Leaded Chip Carrier Package
(PLCC)
Pin Diagram of PIC16F877
18
Pin Diagram
of PIC16F877
19
 Plastic dual in-line
package (DIP)
PIC16F877
Architecture
20
 The basic architecture of PIC16F877 consists of
Program memory, file registers and RAM, ALU and
CPU registers.
PIC16F877
Internal Block Diagram
PIC16F877 Internal Block Diagram
21
Memory of the PIC16F877
 divided into 3 types of memories:
1. Program Memory – A memory that contains the program (which we
had written), after we've burned it. As a reminder, Program Counter
executes commands stored in the program memory, one after the other.
2. Data Memory – This is RAM memory type, which contains a special
registers like SFR (Special Function Register) and GPR (General Purpose
Register). The variables that we store in the Data Memory during the
program are deleted after we turn of the micro. These two memories have
separated data buses, which makes the access to each one of them very
easy.
3. Data EEPROM (Electrically Erasable Programmable Read-Only
Memory) – A memory that allows storing the variables as a result of
burning the written program.
22
 Each one of them has a different role. Program
Memory and Data Memory two memories that are
needed to build a program, and Data EEPROM is
used to save data after the microcontroller is turn off.
…cont’d
23
 Is Flash Memory
 Used for storing compiled
code (user’s program)
 Program Memory capacity is
8K x 14 bit  Each location
is 14 bits long
 Every instruction is coded
as a 14 bit word
 PC can address up to 8K
addresses
 Addresses H’000’ and
H’004’ are treated in a
special way
PIC16F877A
Program Memory
24
PIC16F877A Data Memory (RAM)
25
 Memory storage for variables
 Data Memory is also known as Register File and consists of two
components.
 General purpose register file (same as RAM).
 Special purpose register file (similar to SFR in 8051).
 Addresses range from 0 to 511 and partitioned into 4 banks 
each bank extends up to 7Fh (128 bytes).
 The user can only access a RAM byte in a set of 4 banks and
only one bank at a time. The default bank is BANK0.
 To access a register that is located in another bank, one should
access it inside the program. There are special registers which
can be accessed from any bank, such as STATUS register.
PIC16F877A register file map
26

More Related Content

Similar to Lecture 5-Embedde.pdf (20)

PDF
datasheet.pdf
nesrinetaamallah
 
PDF
Datasheet
Aldhair Tlv
 
DOCX
8085 notes g scheme
HarshitParkar6677
 
DOCX
8085 notes g scheme
HarshitParkar6677
 
DOC
8051mc notes-121004121921-phpapp01
blacktricker
 
DOC
8051mc notes-121004121921-phpapp01
ayushi sharma
 
PPTX
Introduction to Microcontroller
Nikhil Sharma
 
PDF
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
Vivek Venugopal
 
PPTX
3.TechieNest microcontrollers
TechieNest Pvt. Ltd .
 
PPTX
embedded system and microcontroller
SHILPA Sillobhargav
 
PPTX
MergeResult_2023_04_02_05_26_56.pptx
bhaveshagrawal35
 
PDF
Pic microcontroller architecture
Jamia Hamdard
 
PPTX
Overview of Microcontroller and ATMega32 microcontroller
Rup Chowdhury
 
PDF
Microcontroller pic 16f877 architecture and basics
Nilesh Bhaskarrao Bahadure
 
PDF
Design and implementation of real time security guard robot using GSM/CDMA ne...
Claude Ndayisenga
 
PPT
PIC Introduction and explained in detailed
Ankita Tiwari
 
PDF
GOWTHAM REPORT
gowtham sekar
 
PPT
Microprocessor and Microcontroller Based Systems.ppt
TALHARIAZ46
 
PPTX
Vinod ppt on es31 08 15
Govt. Engg. Collage Ajmer
 
PPTX
Embedded System basic and classifications
rajkciitr
 
datasheet.pdf
nesrinetaamallah
 
Datasheet
Aldhair Tlv
 
8085 notes g scheme
HarshitParkar6677
 
8085 notes g scheme
HarshitParkar6677
 
8051mc notes-121004121921-phpapp01
blacktricker
 
8051mc notes-121004121921-phpapp01
ayushi sharma
 
Introduction to Microcontroller
Nikhil Sharma
 
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
Vivek Venugopal
 
3.TechieNest microcontrollers
TechieNest Pvt. Ltd .
 
embedded system and microcontroller
SHILPA Sillobhargav
 
MergeResult_2023_04_02_05_26_56.pptx
bhaveshagrawal35
 
Pic microcontroller architecture
Jamia Hamdard
 
Overview of Microcontroller and ATMega32 microcontroller
Rup Chowdhury
 
Microcontroller pic 16f877 architecture and basics
Nilesh Bhaskarrao Bahadure
 
Design and implementation of real time security guard robot using GSM/CDMA ne...
Claude Ndayisenga
 
PIC Introduction and explained in detailed
Ankita Tiwari
 
GOWTHAM REPORT
gowtham sekar
 
Microprocessor and Microcontroller Based Systems.ppt
TALHARIAZ46
 
Vinod ppt on es31 08 15
Govt. Engg. Collage Ajmer
 
Embedded System basic and classifications
rajkciitr
 

Recently uploaded (20)

PDF
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
PPTX
Hashing Introduction , hash functions and techniques
sailajam21
 
PDF
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
PPTX
Types of Bearing_Specifications_PPT.pptx
PranjulAgrahariAkash
 
PDF
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
PPTX
GitOps_Repo_Structure for begeinner(Scaffolindg)
DanialHabibi2
 
PDF
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
PPTX
Green Building & Energy Conservation ppt
Sagar Sarangi
 
PPTX
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
PDF
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
PDF
GTU Civil Engineering All Semester Syllabus.pdf
Vimal Bhojani
 
PPTX
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
PPTX
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
PPTX
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
PPTX
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
PPTX
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
PPTX
Damage of stability of a ship and how its change .pptx
ehamadulhaque
 
PPTX
GitOps_Without_K8s_Training simple one without k8s
DanialHabibi2
 
PDF
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
DOCX
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
Hashing Introduction , hash functions and techniques
sailajam21
 
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
Types of Bearing_Specifications_PPT.pptx
PranjulAgrahariAkash
 
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
GitOps_Repo_Structure for begeinner(Scaffolindg)
DanialHabibi2
 
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
Green Building & Energy Conservation ppt
Sagar Sarangi
 
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
GTU Civil Engineering All Semester Syllabus.pdf
Vimal Bhojani
 
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
Damage of stability of a ship and how its change .pptx
ehamadulhaque
 
GitOps_Without_K8s_Training simple one without k8s
DanialHabibi2
 
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
Ad

Lecture 5-Embedde.pdf

  • 2. Intended Learning outcomes  At the end of this topic, students should be able to:  eplain briefly the microcontroller-based system using block diagram.  list the types of microcontroller and examples of embedded microcontroller/ embedded system  describe the features and internal structure of a microcontroller (PIC16F877A).  describe how an instruction is executed. 1
  • 3. Introduction What is a microcontroller?  A microcontroller (sometimes abbreviated µC, uC or MCU) is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. It can only perform simple task. A microcontroller is often described as a ‘computer-on-a-chip’. 2
  • 4.  Microcontrollers are purchased ‘blank’ and then programmed with a specific control program.  Once programmed the microcontroller is build into a product to make the product more intelligent and easier to use.  A designer will use a Microcontroller to: - Gather input from various sensors - Process this input into a set of actions - Use the output mechanisms on the microcontroller to do something useful. 3
  • 5. The Difference between microcomputer system and microcontroller based system 4
  • 7.  Microcontrollers are sometimes called embedded microcontrollers, which just means that they are part of an embedded system -- that is, one part of a larger device or system.  The majority of microcontrollers in use today are embedded in other machinery, such as automobiles, telephones, appliances, and peripherals for computer systems. These are called embedded system. Embedded System 6
  • 8. …cont’d  Typical input and output devices include switches, relay, solenoids, LEDs, small or custom LCD displays, radio frequency devices, and sensors for data such as temperature, humidity, light level etc.  Embedded systems usually have no keyboard, screen, disks, printers, or other recognizable I/O devices of a personal computer, and may lack human interaction devices of any kind. 7
  • 9. 9 Examples of Embedded System  Consumer Electronic : DVD player, hi-fi, TV, air-conditioner, washing machine etc.  Medical Monitoring Devices : ECG (electrocardiogram), blood pump, blood pressure meter, etc.  Security System : Alarm, remote sueveilance, smart card + reader etc.  Closed Loop Process Control : Motor speed control, robot, SCADA (supervisory control & acquisition) etc.  Personal Computing : Keyboard, printer, USB hub, SCSI HD, energy management etc.  Automotive : Ignition control, A/C, Automatic transmission, anti-lock brake system (ABS), active suspension, etc  Military : Missile, torpedo, ejection seat, etc  Communications : Handphone, modem, radio, radar, satelite etc. 9 8
  • 10. Types of Microcontroller  Parallax Propeller  Freescale 68HC11 (8-bit)  Intel 8051  Silicon Laboratories Pipelined 8051 Microcontrollers  ARM processors (from many vendors) using ARM7 or Cortex-M3 cores are generally microcontrollers  STMicroelectronics STM8 (8-bit), ST10 (16-bit) and STM32 (32-bit)  Atmel AVR (8-bit), AVR32 (32-bit), and AT91SAM (32-bit)  Freescale ColdFire (32-bit) and S08 (8-bit)  Hitachi H8, Hitachi SuperH (32-bit)  Hyperstone E1/E2 (32-bit, First full integration of RISC and DSP on one processor core [1996])  Infineon Microcontroller: 8, 16, 32 Bit microcontrollers for automotive and industrial applications. 10 9
  • 11.  MIPS (32-bit PIC32)  NEC V850 (32-bit)  Microchip PIC (8-bit PIC16, PIC18, 16-bit dsPIC33/PIC24)  PowerPC ISE  PSoC (Programmable System-on-Chip)  Rabbit 2000 (8-bit)  Texas Instruments Microcontroller MSP 430 (16-bit), C2000 (32-bit), and Stellaris (32-bit)  Toshiba TLCS-870 (8-bit/16-bit)  Zilog eZ8 (16-bit), eZ80 (8-bit)  etc …cont’d 10
  • 12.  PIC is a family of Harvard architecture microcontroller made by Microchip Technology. The name PIC initially referred to "Peripheral Interface Controller“ . PIC microcontrollers were the first RISC microcontroller.  PICs are popular with both industrial developers and hobbyists alike due to their low cost, wide availability, large user base, extensive collection of application notes, availability of low cost or free development tools, and serial programming (and re- programming with flash memory) capability. Microchip PIC 11
  • 14. PIC Microcontroller product family  8-bit microcontrollers  PIC10  PIC12  PIC14  PIC16  PIC17  PIC18  16-bit microcontrollers  PIC24F  PIC24H  32-bit microcontrollers  PIC32  16-bit digital signal controllers  dsPIC30  dsPIC33F 13
  • 15.  The F in a name generally indicates the PICmicro uses flash memory and can be erased electronically.  The C generally means it can only be erased by exposing the die to ultraviolet light (which is only possible if a windowed package style is used). An exception to this rule is the PIC16C84 which uses EEPROM and is therefore electrically erasable. 1 : 14 PIC Microcontroller product family
  • 16. Why use PIC16F877? 15  Why PIC16F877A is very popular?  This is because PIC16F877A is very cheap. Apart from that it is also very easy to be assembled. Additional components that you need to make this IC work is just a 5V power supply adapter, a 20MHz crystal oscillator and 2 units of 22pF capacitors.  What is the advantages of PIC16F877A?  This IC can be reprogrammed and erased up to 10,000 times. Therefore it is very good for new product development phase.  What is the disadvantages of PIC16F877A?  This IC has no internal oscillator so you will need an external crystal of other clock source.
  • 17. Features of PIC16F877 16 8 Key Features PIC16F877 MAX Operating Frequency 20MHz FLASH Program Memory (14-bit words) 8K Data Memory (bytes) 368 EEPROM Data Memory (bytes) 256 I/O Ports RA0-5 (6) RB0-7 (8) RC0-7 (8) RD0-7 (8) RE0-2 (3) Timers 3 CCP 2 Serial Communications MSSP, USART Parallel Communications PSP 10-bit Analog-to-Digital Module 8 Channels Instruction Set 35 Instructions Pins (DIP) 40 Pins
  • 18.  As you can see the PIC16F877A is rich in peripherals so you can use it for many different projects. Bubble diagram of PIC16F877 17
  • 19.  Quad Flat Package (QFP)  Plastic Leaded Chip Carrier Package (PLCC) Pin Diagram of PIC16F877 18
  • 20. Pin Diagram of PIC16F877 19  Plastic dual in-line package (DIP)
  • 22.  The basic architecture of PIC16F877 consists of Program memory, file registers and RAM, ALU and CPU registers. PIC16F877 Internal Block Diagram PIC16F877 Internal Block Diagram 21
  • 23. Memory of the PIC16F877  divided into 3 types of memories: 1. Program Memory – A memory that contains the program (which we had written), after we've burned it. As a reminder, Program Counter executes commands stored in the program memory, one after the other. 2. Data Memory – This is RAM memory type, which contains a special registers like SFR (Special Function Register) and GPR (General Purpose Register). The variables that we store in the Data Memory during the program are deleted after we turn of the micro. These two memories have separated data buses, which makes the access to each one of them very easy. 3. Data EEPROM (Electrically Erasable Programmable Read-Only Memory) – A memory that allows storing the variables as a result of burning the written program. 22
  • 24.  Each one of them has a different role. Program Memory and Data Memory two memories that are needed to build a program, and Data EEPROM is used to save data after the microcontroller is turn off. …cont’d 23
  • 25.  Is Flash Memory  Used for storing compiled code (user’s program)  Program Memory capacity is 8K x 14 bit  Each location is 14 bits long  Every instruction is coded as a 14 bit word  PC can address up to 8K addresses  Addresses H’000’ and H’004’ are treated in a special way PIC16F877A Program Memory 24
  • 26. PIC16F877A Data Memory (RAM) 25  Memory storage for variables  Data Memory is also known as Register File and consists of two components.  General purpose register file (same as RAM).  Special purpose register file (similar to SFR in 8051).  Addresses range from 0 to 511 and partitioned into 4 banks  each bank extends up to 7Fh (128 bytes).  The user can only access a RAM byte in a set of 4 banks and only one bank at a time. The default bank is BANK0.  To access a register that is located in another bank, one should access it inside the program. There are special registers which can be accessed from any bank, such as STATUS register.