What is a Microcontroller?
A microcontroller is a self-contained system with
peripherals, memory and a processor that can be used as
an embedded system. Most programmable
microcontrollers that are used today are embedded in
other consumer products or machinery including phones,
peripherals, automobiles and household appliances for
computer systems. Due to that, another name for a
microcontroller is "embedded controller." Some
embedded systems are more sophisticated, while others
have minimal requirements for memory and programming
length and a low software complexity. Input and output
devices include solenoids, LCD displays, relays, switches
and sensors for data like humidity, temperature or light
level, amongst others.
Pavithran Puthiyapurayil , Maldives National University 1
2
Microprocessor
• CPU is stand-alone, RAM,
ROM, I/O, timer are separate
• designer can decide on the
amount of ROM, RAM and
I/O ports.
• expensive
• versatility
• general-purpose
• High processing power
• High power consumption
• Instruction sets focus on
processing-intensive
operations
• Typically 32/64 – bit
• Typically deep pipeline (5-20
stages)
Microcontroller
• CPU, RAM, ROM, I/O and timer
are all on a single chip
• fixed amount of on-chip ROM,
RAM, I/O ports
• for applications in which cost,
power and space are critical
• single-purpose (control-oriented)
• Low processing power
• Low power consumption
• Bit-level operations
• Instruction sets focus on control
and bit-level operations
• Typically 8/16 bit
• Typically single-cycle/two-stage
pipeline
Microprocessor vs. Microcontroller
Pavithran Puthiyapurayil , Maldives
National University
3
Some Popular Microcontrollers…
• 8051
• Microchip Technology PIC
• Atmel AVR
• Texas Instruments MSP430 (16-bit)
Pavithran Puthiyapurayil , Maldives
National University
Microcontrollers
• Embedded Systems
– Operations managed behind the scenes by a
microcontroller
• Microcontroller (MCU)
– Integrated electronic computing device that
includes three major components on a single chip
• Microprocessor (MPU)
• Memory
• I/O (Input/Output) ports
4
Pavithran Puthiyapurayil , Maldives
National University
A microcontroller basically contains one
or more following components:
Central processing unit(CPU)
Random Access Memory)(RAM)
Read Only Memory(ROM)
Input/output ports.
Timers and Counters.
Interrupt Controls.
Analog to digital converters.
Digital analog converters.
Pavithran Puthiyapurayil , Maldives
National University
5
Pavithran Puthiyapurayil , Maldives
National University
6
7
CPU
General-
Purpose
Micro-
processor
RAM ROM I/O
Port
Timer
Serial
COM
Port
Data Bus
Address Bus
General-purpose microprocessor:
• CPU for Computers
• Commonly no RAM, ROM, I/O on CPU chip itself
Many chips on motherboard
Pavithran Puthiyapurayil , Maldives
National University
8
RAM ROM
I/O
Port
Timer
Serial
COM
Port
Microcontroller
CPU
• A single-chip computer
• On-chip RAM, ROM, I/O ports...
• Example:Motorola’s 6811, Intel’s 8051, Zilog’s Z8 and PIC 16X
A single chip
Microcontroller :
Pavithran Puthiyapurayil , Maldives
National University
Definition of Embedded Systems
• Embedded system: is a system whose
principal function is not computational,
but which is controlled by a computer
embedded within it.
9
Pavithran Puthiyapurayil , Maldives
National University
Examples: Refrigerator
10
Pavithran Puthiyapurayil , Maldives
National University
Examples: Car Door
11
Pavithran Puthiyapurayil , Maldives
National University
Examples: Electronic Ping-pong
12
Pavithran Puthiyapurayil , Maldives
National University
Examples: Derbot Autonomous Guided
Vehicle
13
Pavithran Puthiyapurayil , Maldives
National University
Examples: Derbot Autonomous Guided
Vehicle
14
Pavithran Puthiyapurayil , Maldives
National University
Microcontrollers
15
Pavithran Puthiyapurayil , Maldives
National University
Microcontroller Packaging and
Appearance
16
From left to right: PIC 12F508, PIC 16F84A, PIC
16C72, Motorola 68HC05B16, PIC 16F877,
Motorola 68000
Pavithran Puthiyapurayil , Maldives
National University
Microcontrollers
• Support Devices
– Timers
– A/D converter
– Serial I/O
• Common communication lines
– System Bus
17
Pavithran Puthiyapurayil , Maldives
National University
Block Diagram
18
Pavithran Puthiyapurayil , Maldives
National University
Microprocessor (MPU)
• MPU (CPU)
– Read instructions
– Process binary data
19
Pavithran Puthiyapurayil , Maldives
National University
Memory
• Storage Device
– Addresses
– Registers
• Major Categories
– Read/Write Memory
(R/W)
– Read-only-Memory
(ROM)
D7 D0
20
Pavithran Puthiyapurayil , Maldives
National University
Input/Output (I/O)
• Input Devices
– Switches and Keypads
– Provide binary information to the MPU
• Output devices
– LEDs and LCDs
– Receive binary information from the MPU
21
Pavithran Puthiyapurayil , Maldives
National University
Microprocessor-Based Systems
22
Pavithran Puthiyapurayil , Maldives
National University
Microprocessor Architecture
• MPU communicates with Memory and I/O
using the System Bus
– Address bus
• Unidirectional
• Memory and I/O Addresses
– Data bus
• Bidirectional
• Transfers Binary Data and Instructions
– Control lines
• Read and Write timing signals
23
Pavithran Puthiyapurayil , Maldives
National University
Microprocessor-Based System
24
Pavithran Puthiyapurayil , Maldives
National University
Example Microprocessor System
25
Pavithran Puthiyapurayil , Maldives
National University
ATMEL MICROCONTROLLER
• Highest performance -- AVR runs 20 MIPS
• Best code density AVR designed for C programme,
and C compilers
• Lowest power – 0.1 micro amps power down , 0.6
Micro amps power safe , 220 micro Amps /MIP fully
running, less than 1 micro second wakeup time
• Best memory technology
• Best integration
• Best tools and supports network
• True RISC architecture HARVARD architecture
• True single cycle execution
• 20 IPS at 20 MHz
• 32 General purpose registers
Pavithran Puthiyapurayil , Maldives
National University
26
Pavithran Puthiyapurayil , Maldives
National University
27
Pavithran Puthiyapurayil , Maldives
National University
28
Pavithran Puthiyapurayil , Maldives
National University
29
Pavithran Puthiyapurayil , Maldives
National University
30
Pavithran Puthiyapurayil , Maldives
National University
31
Pavithran Puthiyapurayil , Maldives
National University
32
Pavithran Puthiyapurayil , Maldives
National University
33
Pavithran Puthiyapurayil , Maldives
National University
34
Pavithran Puthiyapurayil , Maldives
National University
35
Pavithran Puthiyapurayil , Maldives
National University
36
• Mega famaliy is ranges any where 32 up to
100 pin
• Flash memory goes from 4 K to 256 K
Pavithran Puthiyapurayil , Maldives
National University
37
Pavithran Puthiyapurayil , Maldives
National University
38
Pavithran Puthiyapurayil , Maldives
National University
39
Atmel family - Tiny and mega
• Tiny specify is small parts ,28 pins
• Mega is bigger than the tiny in terms of pin
count
• Mega has hardware supply MOS on board
,and tiny has programming flash memory
• Tiny has many types, but pin count is same
Pavithran Puthiyapurayil , Maldives
National University
40

Microcontroller

  • 1.
    What is aMicrocontroller? A microcontroller is a self-contained system with peripherals, memory and a processor that can be used as an embedded system. Most programmable microcontrollers that are used today are embedded in other consumer products or machinery including phones, peripherals, automobiles and household appliances for computer systems. Due to that, another name for a microcontroller is "embedded controller." Some embedded systems are more sophisticated, while others have minimal requirements for memory and programming length and a low software complexity. Input and output devices include solenoids, LCD displays, relays, switches and sensors for data like humidity, temperature or light level, amongst others. Pavithran Puthiyapurayil , Maldives National University 1
  • 2.
    2 Microprocessor • CPU isstand-alone, RAM, ROM, I/O, timer are separate • designer can decide on the amount of ROM, RAM and I/O ports. • expensive • versatility • general-purpose • High processing power • High power consumption • Instruction sets focus on processing-intensive operations • Typically 32/64 – bit • Typically deep pipeline (5-20 stages) Microcontroller • CPU, RAM, ROM, I/O and timer are all on a single chip • fixed amount of on-chip ROM, RAM, I/O ports • for applications in which cost, power and space are critical • single-purpose (control-oriented) • Low processing power • Low power consumption • Bit-level operations • Instruction sets focus on control and bit-level operations • Typically 8/16 bit • Typically single-cycle/two-stage pipeline Microprocessor vs. Microcontroller Pavithran Puthiyapurayil , Maldives National University
  • 3.
    3 Some Popular Microcontrollers… •8051 • Microchip Technology PIC • Atmel AVR • Texas Instruments MSP430 (16-bit) Pavithran Puthiyapurayil , Maldives National University
  • 4.
    Microcontrollers • Embedded Systems –Operations managed behind the scenes by a microcontroller • Microcontroller (MCU) – Integrated electronic computing device that includes three major components on a single chip • Microprocessor (MPU) • Memory • I/O (Input/Output) ports 4 Pavithran Puthiyapurayil , Maldives National University
  • 5.
    A microcontroller basicallycontains one or more following components: Central processing unit(CPU) Random Access Memory)(RAM) Read Only Memory(ROM) Input/output ports. Timers and Counters. Interrupt Controls. Analog to digital converters. Digital analog converters. Pavithran Puthiyapurayil , Maldives National University 5
  • 6.
    Pavithran Puthiyapurayil ,Maldives National University 6
  • 7.
    7 CPU General- Purpose Micro- processor RAM ROM I/O Port Timer Serial COM Port DataBus Address Bus General-purpose microprocessor: • CPU for Computers • Commonly no RAM, ROM, I/O on CPU chip itself Many chips on motherboard Pavithran Puthiyapurayil , Maldives National University
  • 8.
    8 RAM ROM I/O Port Timer Serial COM Port Microcontroller CPU • Asingle-chip computer • On-chip RAM, ROM, I/O ports... • Example:Motorola’s 6811, Intel’s 8051, Zilog’s Z8 and PIC 16X A single chip Microcontroller : Pavithran Puthiyapurayil , Maldives National University
  • 9.
    Definition of EmbeddedSystems • Embedded system: is a system whose principal function is not computational, but which is controlled by a computer embedded within it. 9 Pavithran Puthiyapurayil , Maldives National University
  • 10.
  • 11.
    Examples: Car Door 11 PavithranPuthiyapurayil , Maldives National University
  • 12.
    Examples: Electronic Ping-pong 12 PavithranPuthiyapurayil , Maldives National University
  • 13.
    Examples: Derbot AutonomousGuided Vehicle 13 Pavithran Puthiyapurayil , Maldives National University
  • 14.
    Examples: Derbot AutonomousGuided Vehicle 14 Pavithran Puthiyapurayil , Maldives National University
  • 15.
  • 16.
    Microcontroller Packaging and Appearance 16 Fromleft to right: PIC 12F508, PIC 16F84A, PIC 16C72, Motorola 68HC05B16, PIC 16F877, Motorola 68000 Pavithran Puthiyapurayil , Maldives National University
  • 17.
    Microcontrollers • Support Devices –Timers – A/D converter – Serial I/O • Common communication lines – System Bus 17 Pavithran Puthiyapurayil , Maldives National University
  • 18.
    Block Diagram 18 Pavithran Puthiyapurayil, Maldives National University
  • 19.
    Microprocessor (MPU) • MPU(CPU) – Read instructions – Process binary data 19 Pavithran Puthiyapurayil , Maldives National University
  • 20.
    Memory • Storage Device –Addresses – Registers • Major Categories – Read/Write Memory (R/W) – Read-only-Memory (ROM) D7 D0 20 Pavithran Puthiyapurayil , Maldives National University
  • 21.
    Input/Output (I/O) • InputDevices – Switches and Keypads – Provide binary information to the MPU • Output devices – LEDs and LCDs – Receive binary information from the MPU 21 Pavithran Puthiyapurayil , Maldives National University
  • 22.
  • 23.
    Microprocessor Architecture • MPUcommunicates with Memory and I/O using the System Bus – Address bus • Unidirectional • Memory and I/O Addresses – Data bus • Bidirectional • Transfers Binary Data and Instructions – Control lines • Read and Write timing signals 23 Pavithran Puthiyapurayil , Maldives National University
  • 24.
  • 25.
    Example Microprocessor System 25 PavithranPuthiyapurayil , Maldives National University
  • 26.
    ATMEL MICROCONTROLLER • Highestperformance -- AVR runs 20 MIPS • Best code density AVR designed for C programme, and C compilers • Lowest power – 0.1 micro amps power down , 0.6 Micro amps power safe , 220 micro Amps /MIP fully running, less than 1 micro second wakeup time • Best memory technology • Best integration • Best tools and supports network • True RISC architecture HARVARD architecture • True single cycle execution • 20 IPS at 20 MHz • 32 General purpose registers Pavithran Puthiyapurayil , Maldives National University 26
  • 27.
    Pavithran Puthiyapurayil ,Maldives National University 27
  • 28.
    Pavithran Puthiyapurayil ,Maldives National University 28
  • 29.
    Pavithran Puthiyapurayil ,Maldives National University 29
  • 30.
    Pavithran Puthiyapurayil ,Maldives National University 30
  • 31.
    Pavithran Puthiyapurayil ,Maldives National University 31
  • 32.
    Pavithran Puthiyapurayil ,Maldives National University 32
  • 33.
    Pavithran Puthiyapurayil ,Maldives National University 33
  • 34.
    Pavithran Puthiyapurayil ,Maldives National University 34
  • 35.
    Pavithran Puthiyapurayil ,Maldives National University 35
  • 36.
    Pavithran Puthiyapurayil ,Maldives National University 36
  • 37.
    • Mega famaliyis ranges any where 32 up to 100 pin • Flash memory goes from 4 K to 256 K Pavithran Puthiyapurayil , Maldives National University 37
  • 38.
    Pavithran Puthiyapurayil ,Maldives National University 38
  • 39.
    Pavithran Puthiyapurayil ,Maldives National University 39
  • 40.
    Atmel family -Tiny and mega • Tiny specify is small parts ,28 pins • Mega is bigger than the tiny in terms of pin count • Mega has hardware supply MOS on board ,and tiny has programming flash memory • Tiny has many types, but pin count is same Pavithran Puthiyapurayil , Maldives National University 40