0% found this document useful (0 votes)
5 views12 pages

Prelim Notes

Uploaded by

HAZE-12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views12 pages

Prelim Notes

Uploaded by

HAZE-12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

CPE366 – NOTES Embedded Systems

MICROPROCESSORS and MICROCONTROLLERS  An embedded system is a special-purpose computer


system designed to perform one or a few dedicated
Brief History functions often with real-time
 An integrated device which consists of multiple devices
What is a computer?
o Microprocessor (MPU)
 one that computes; specifically : programmable o Memory
electronic device that can store, retrieve, and process o I/O (Input/Output) ports
data.  Often has its own dedicated software
 a machine that manipulates data according to a list of
Evolution
instructions.
 First came transistors
Classification of Computers (power and price)
 Integrated circuits
 Personal computers o SSI (Small-Scale Integration) to ULSI
 Mainframes o Very Large Scale Integration circuits (VLSI)
 Supercomputers  Microprocessors (MPU)
 Dedicated controllers – Embedded controllers o Microcomputers (with CPU being a
microprocessor)
Mainframes o Components: Memory, CPU, Peripherals (I/O)
o Example: Personal computers
 Massive amounts of memory
 Microcontroller (MCU)
 Use large data words…64 bits or greater
o Microcomputers (with CPU being a
 Mostly used for military defense and large business data
microprocessor)
processing
o Many special function peripheral are
 Examples: IBM 4381, Honeywell DPS8
integrated on a single circuit
o Types: General Purpose or Embedded System
Personal Computers
(with special functionalities)
 Any general-purpose computer
 intended to be operated directly by an end user Transistors
 Range from small microcomputers that work with 4-bit
 Vacuum Tubes: A devise to control, modify, and amplify
words to PCs working with 32-bit words or more
electric signals
 They contain a Processor - called different names
 Then can transistors
 Microprocessor – built using Very-Large-Scale
o Designed by John Bardeen, William Shockley,
Integration technology; the entire circuit is on a single
and Walter Brattain, scientists at the Bell
chip
Telephone Laboratories in Murray Hill, New
 Central Processing Unit (CPU)
Jersey - 1947
 Microprocessor Unit (MPU) – similar to CPU
 In 1960 Jack Kilby and Robert Noyce designed the first
Supercomputers integrated circuit (IC)
 Fairchild company manufactured logic gates
 Fastest and most powerful mainframes
 Contain multiple central processors (CPU)
 Used for scientific applications, and number crunching
 Now have teraflops performance
 FLoating Point Operations Per Second (FLOPS)
 Used to measure the speed f the computer

Examples of special-purpose supercomputers:

 Belle, Deep Blue, and Hydra, for playing chess


 Reconfigurable computing machines or parts of
machines
 GRAPE, for astrophysics and molecular dynamics
 Deep Crack, for breaking the DES cipher
 MDGRAPE-3, for protein structure computation
Integrated Circuits o Clock-driven
o Programmable
 Advances in manufacturing allowed packing more  the “brains” of the computer
transistors on a single chip  its job is to fetch instructions, decode them, and then
 Transistors and Integrated Circuits from SSI (Small-Scale execute them
Integration) to ULSI (Ultra-Large Scale Integration)  8/16/32/etc –bit (how it moves the data)
 Birth of a microprocessor and its revolutionary impact  contains:
o ALU performs computing tasks – manipulates
the data/ performs numerical and logical
Microprocessors computations
o Registers are used for temp. storage
 Noyce and Gordon Moore started Intel o Control unit is used for timing and other
 Intel designed the first calculator controlling functions – contains a program
 Intel designed the first programmable calculator counter (next instruction’s address and status
 Intel designed the first microprocessor in 1971 register)
o Model 4004 o System software: A group of programs that
o 4-bit; 2300 transistors, 640 bytes of memory, monitors the functions of the entire system
108 KHz clock speed

First Processors

 Intel released the 8086, a 16-bit microprocessor, in 1978


 Motorola followed with the MC68000 as their 16-bit
processor
o The 16-bit processor works with 16 bit words,
rather than 8 bit words Microprocessor-Based Systems
o Instructions are executed faster
o Provide single instructions for more complex  Central Processing Unit (CPU)
instructions such as multiply and divide  Memory
 16 bit processors evolved into 32 bit processors  Input/Output (I/O) circuitry
 Intel released the 80386  Buses
 Motorola released the MC68020 o Address bus
o Data bus
Evolution of CPUs o Control bus

Microprocessor-based Systems : Memory


 In 1965, Gordon Moore, co-founder of Intel, indicated that the
number of transistors per square inch on integrated circuits had  Memory is a group of registers
doubled every year since the integrated circuit was invented.  16 register – address: 0-15 – in binary: 0-1111; Address
Moore predicted that this trend would continue for the
lines: A0-A3
foreseeable future.
 Serves two major purposes
Microprocessor  storing the binary codes for the sequence of instructions
specified by programs (program)
 The microprocessor (MPU) is a computing and logic  storing binary data that the computer needs to execute
device that executes binary instructions in a sequence instructions (data)
stored in memory.
 Characteristics: Microprocessor-based Systems : Memory Types
o General purpose central processor unit (CPU)
 R/W: Read/Write Memory; also called RAM
o Binary
 It is volatile (losses information as power is removed)
o Register-based
 Write means the processor can store information Microprocessor-based Systems : I/O Ports
 Read means the processor can receive information from
the memory  The way the computer communicates with the outside
 Acts like a Blackboard! world devices
 ROM: Read-Only memory;  I/O ports are connected to Peripherals
 It is typically non-volatile (permanent) – can be erasable o Peripherals are I/O devices
 It is similar to a Page from your textbook  Input devices
 Output devices
Microprocessor-based Systems : Memory Classification  Examples
o Printers and modems,
o keyboard and mouse
o scanner
o Universal Serial Bus (USB)

Microprocessor-based Systems : Buses

 Basic Technologies:
o Semiconductor
o Magnetic
 Address, Data, and Control Bus
o Optical(or combination)  The three components – MPU, memory, and I/O – are
 StaticR/WM connected by a group of wires called the BUS
o 4/6 transistor to save a single bit  Address bus
o Volatile o consists of 16, 20, 24, or 32 parallel signal lines
o Fast but expensive (wires) - unidirectional
 Dynamic R/WM o these lines contain the address of the memory
o one transistor and one capacitor to store a bit location to read or written
o Leakage problem, thus requires refreshing  Control bus
o Used for dynamic data/program storage o consists of 4 to 10 (or more) parallel signal
o Cheap and slow lines
o CPU sends signals along these lines to memory
Erasable ROMs
and to I/O ports
o examples: Memory Read, Memory Write, I/O
 Marked Programmed ROM
Read, I/O Write
o Programmed by the manufacturer
 Data bus
 Programmable ROM (PROM)
o consists of 8,16, or 32 parallel signal lines
o Can be programmed in the field via the
o bi-directional
programmer
o only one device at a time can have its outputs
 Erasable Programmable ROM (EPROM)
o Uses ultraviolet light to erase (through a enabled,
o this requires the devices to have three-state
quartz window)
o OTP refers to one-time programmable output
o Electrically Erasable Programmable ROM
Microcontrollers
(EEPROM)
o Each program location can be individually  A microcontroller is a complete microprocessor system,
erased consisting of microprocessor, limited amount of ROM or
o Expensive EPROM, RAM & I/O ports all built on a single integrated
o Requires programmer circuit.
 FLASH  Microcontroller can be used to perform control
o Can be programmed in-circuit (in-system) functions so it is comparable with a microcomputer.
o Easy to erase (no programmer)  It must include full or nearly full implementation of a
o Only one section can be erased/written at a standard microprocessor, ROM or EPROM, RAM, parallel
time (typically 64 bytes at a time) I/O ports, serial ports, timer, clock.
 More complex than a microprocessor. Microcontroller Unit (MCU): Block Diagram
 An integrated electronic computing and logic device that  RISC (Harvard)
includes three major components on a single chip o Reduced instruction set computer
o Microprocessor o Simple operations
o Memory o Simple addressing modes
o I/O ports o Longer compiled program bust faster to
 Includes support devices execute
o Timers o Uses pipelining
o A/D converter  CISC (Von Neuman)
o Serial I/O o Complex instruction set computer
o Parallel Slave Port o More complex instructions (closer to high-level
 All components connected by common communication language support)
lines called the system bus.  Bench marks: How to compare MCUs together
 MIPS: Million Instructions / second (Useful when the
Microcontroller Architectures compilers are the same)

Embedded controllers

 Used to control smart machines


 Examples: printers, auto braking systems
 Also called microcontrollers or microcontroller units
(MCU)

Embedded System: General Block Diagram

Embedded controllers: Software Characteristics

 No operating systems
 Execute a single program, tailored exactly to the
controller hardware
 Assembly language (vs. High-level language)
 Not transportable, machine specific
 Programmer need to know CPU architecture
 Speed
 Program size
 Uniqueness

Common Microcontrollers

 Atmel
 ARM
 Intel
o 8-bit
 8XC42
 MCS48
 MCS51
 8xC251
o 16-bit
 MCS96
 MXS296
 National Semiconductor
o COP8
 Microchip
o 12-bit instruction PIC
o 14-bit instruction PIC
o PIC16F84 PERIPHERAL INTERFACE CONTROLLER
o 16-bit instruction PIC
 NEC  PIC: Peripheral Interface Controller
 Motorola  Microchip Technology (www.microchip.com)
o 8-bit  Harvard Architecture
 68HC05  Origin: Harvard Architecture for DAPRA Project
 68HC08  Beaten by Princeton (Single memory)
 68HC11  Picked by Signetics 8x300
o 16-bit  PIC for General Instruments
 Compensation for poor I/O
 68HC12
 GI spun off into Arizona Microchip
 68HC16
 Technology (1985)-Microchip Technology
o 32-bit
 683xx
 Texas Instruments
o TMS370, 16/32 bit
o MSP430 , 16 bit
 Zilog
o Z8
o Z86E02

First Microcontrollers

 IBM started using Intel processors in its PC


o Intel started its 8042 and 8048 (8-bit
microcontroller) – using in printers
 Apple Macintosh used Motorola
 1980 Intel abandoned microcontroller business
 By 1989 Microchip was a major player in designing
microcontrollers
o PIC: Peripheral Interface Controller

Applications of Microcontrollers

 Microcontroller is a single chip microcomputer.


 They are used as independent controllers in machines or
as slaves in distributed processing.
 They are used as machine tools, chemical processors,
medical instrumentation & sophisticated guidance
control.
 Many low cost products such as toys, microwave oven
etc., are based on microcontroller.
 The personal computer keyboards are implemented with
microcontroller. It replaces scanning, debounce, matrix
decoding & serial transmission circuits.

MCU VS. MPU

 Cost of microcontroller is less than microprocessor


based system
 Microcontroller has more I/O components than
microprocessorbased system.
 Unlike microprocessors Microcontrollers can be used in
wide variety of intelligent products like personal
computers keyboards or can be used in devices with
artificial intelligence.
 Many low-cost products like toys, washing machines,
microwave ovens, electric drills etc., are based on
microcontrollers & not on microprocessor based system

PIC MICROCONTROLLER ARDUINO


 A Large Register Set: 368 Bytes + W  Security systems
 a RISC Architecture--pipelining  TV, DVD player/recorder, DVR, PVR
 a 35 fixed length (14-bit) single-cycle instructions  Sound system
 8-bit machine
 Operating Speed: Up to 20 MHz COME IN 4-BIT THROUGH 32-BIT
 8K 14-bit Words FLASH Memory (for Program)
 4-bit
 368 Bytes RAM (for Data)
 Very inexpensive
 256 Bytes EEPROM (for Data)
 Power Saving Mode
 Low-power consumption:
o < 2 mA typical @ 5V, 4 MHz
o 20 mA typical @ 3V, 32 kHz
o 1 mA typical standby current
o Wide Operating Voltage: 2.0 – 5.0 V
 Timers
o Timer0: 8-bit timer/counter with 8-bit
prescaler
o Timer1: 16-bit timer/counter with prescaler,
can be
o incremented during sleep via external
crystal/clock
o Timer2: 8-bit timer/counter with 8-bit period
 8-bit
register,prescaler and postscaler
 Still very cheap – often ~$1.00 per chip
 16 and 32 bit
PHILOSOPHY OF PIC ARCHITECTURE
 Priced at $6.00 to 12.00 each
 Embedded processing is pervasive  Evaluation of requirements, chip capability, and cost
 Electronic intelligence in is everyday products come into design decision
 Company Philosophy
TYPICAL AUTOMOTIVE USE
o Have products that fit the problem
o Many systems can be automated using 8-bit
 Engine control – 32-bit microcontroller
microcontrollers  Fuel flow, fuel mixture, valve timing, throttle body
o Much of product line is 8-bit opening, spark timing
 Transmission control –16-bit microcontroller
REASONS FOR PERVASIVENESS?
 Audio system – 16-bit
 Competitive pressure
 Expanded functionality of products
 Provide differentiation in product from that of
competitor
 Cost competitive integrated solution
 Allow creation of new classes of products

MICROCONTROLLER SOLUTION

 Microcontroller features
o CPU – processing unit
o Non-volatile program memory
o Re-settable non-volatile data memory
(EEPROM)
o RAM for data storage
o Direct support for various input/output  Antilock braking – 16-bit
 Up to fifty 8-bit microcontrollers for functions of
SOME TYPICAL APPLICATIONS  Wiper control
 Electric Mirrors
 Automotive air bag systems
 Air Bags
 Remote control
 Handheld tools AUTOMOTIVE TODAY CONTINUED
 Appliances – coffee pot, mixer, stove, refrigerator, dish
washer, washer, dryer  Up to fifty 8-bit microcontrollers for functions of
 Major home systems – heating and cooling  Wiper control
 Cordless phones and cell phones
 Electric Mirrors  Addressable up to 8Kx14-bit
 Air Bags  FLASH Memory
 Fuel pump  Reset Vector: $0000
 Speedometer  Interrupt: $0004
 Security system
 Climate control system
 Power windows

MICROCONTROLLER CHOICE PARAMETERS

 Number of I/O pins


 Amount of program and data memory
 Speed
 Timer Resources
 Interrupt control
 Robustness
 Error recovery – watchdog timers
 Power, I/O expansion, math support

FEATURE OF HARVARD ARCHITECTURE

 Near all instructions are single instruction word


instructions
 Only one fetch per instruction
 Instruction fetch and execute are pipelined so you can
operate at near clock rate instructions per second
 2 separate buses
 One for instructions and one for data

FREQUENCY OF BRANCHES

 On architectures such as the HP during the normal flow


of a program’s execution on 8 to 12 instructions are
executed before a branch occurs.
 (aside) Modern architectures can easily achieve above
90% correct branch prediction.
 This can be factored into actual “speed” of the processor

PROGRAM MEMORY

 13-bit
PC

INTRODUCTION TO ARDUINO

ARDUINO

 single-board microcontroller,
intended to make the application of
interactive objects or environments
more accessible .
 Designed to make the process of
using electronics multidisciplinary projects more
accessible
 Sense the environment by receiving input from variety
of sensors.
 Affect its surroundings by controlling lights, motors, and
other actuators.

BRIEF HISTORY
 In 2005, a project was initiated to make a device for  Bugs? Presents to PC as a mouse or keyboard
controlling student-built interactive design projects that
was less expensive than other prototyping systems DUE
available at the time.
 Much faster
 Founders Massimo Banzi and David Cuartiellesnamed
processor, many
the project after Arduin of Ivrea and began producing
more pins
boards in a small factory located in Ivrea.
 Operates on 3.3 volts
 Similar to Mega

PROGRAMMING ENVIRONMENT MICRO

 The Arduino Uno can be programmed with the Arduino  When size matters: Micro, Nano, Mini
software IDE(integrated development environment) .  Includes all functionality of the Leonardo
 The Atmega328 on the Arduino Uno comes preburned  Easily usable on a breadboard
with a Bootloader that allows you to upload new code to
it without the use of an external hardware programmer.
 You can also bypass the Bootloader and program the
microcontroller through the ICSP (In-Circuit Serial
Programming) header.
 Arduino IDE works on windows , linux as well as Mac lion
X platforms.

FEATURES OF ARDUINO LILYPAD

 Microcontroller , ex. ATmega328  LilyPad is popular for clothing-based projects.


 Operating Voltage 5V and 3.3 V
 Input Voltage (recommended) 7-12V ESPLORA
 Input Voltage (limits) 6-20V
 Game controller
 Digital I/O Pins 14 (of which 6 provide PWM output)
 Includes joystick, four buttons, linear potentiometer
 Analog Input Pins 6
(slider), microphone, light sensor, temperature sensor,
 DC Current per I/O Pin 40 mA
three-axis accelerometer.
 DC Current for 3.3V Pin50 mA
 Not the standard set of IO pins
 Flash Memory 32 KB (ATmega328) of which 0.5 KB used
by Bootloader
 SRAM 2 KB (ATmega328)
 EEPROM 1 KB (ATmega328)
 Clock Speed 16 MHz

ARDUINO TYPES

 Many different versions


o Number of input/output channels
o Form factor
o Processor ARDUINO UNO CLOSE UP
 Leonardo
 The pins are in three groups:
 Due
 Invented in 2010
 Micro
 14 digital pins
 LilyPad
 6 analog pins
 Esplora
 Power
 Uno

LEONARDO

 Compared to the
Uno, a slight
upgrade.
 Built in USB
compatibility
 Digital inputs will come to the Arduino as either on or off
(HIGH or LOW, respectively).
o HIGH is 5VDC.
o LOW is 0VDC.
CONFIGURING THE ARDUINO
 Analog inputs will come to the Arduino as a range of
 Defaults to COM1, will probably need to change the numbers, based upon the electrical characteristics of the
COM port setting (my work PC uses 7). circuit.
 Appears in Device Manager (Win7) under Ports as a o 0 to 1023
Commport o .0049 V per digit (4.9 mV)
o Read time is 100 microseconds (10,000 a

ARDUINO PROGRAM DEVELOPMENT

 Based on C++ without 80% of the instructions.


 A handful of new commands.
 Programs are called 'sketches'.
 Sketches need two functions:
o void setup( )
o void loop( )
 setup( ) runs first and once.
 loop( ) runs over and over, until power is lost or a new
sketch is loaded.

ARDUINO C

 Arduino sketches are centered around the pins on an


Arduino board.
 Arduino sketches always loop.
o void loop( ) {} is equivalent to while(1) { }
 The pins can be thought of as global variables.

ARDUINO C SPECIFIC FUNCTIONS

 pinMode(pin, mode)
o Designates the specified pin for input or
output
 digitalWrite(pin, value)
o Sends a voltage level to the designated pin second)
 digitalRead(pin)
o Reads the current voltage level from the ANALOG INPUT-APPLICATION
designated pin
 The variable resistor can be replaced with a sensor.
 analog versions of above
 For example, a photo resistor.
o analogRead's range is 0 to 1023
 Depending upon the light level at the photo resistor:
 serial commands
o Turn on a light
o print, println, write
o Increase or decrease the brightness of an LED
(or an LED array)
 Most sensors are simply variable resistors, but vary their
resistance based on some physical characteristic.

SENSORS

 Sensors can be both binary or a range.


 Usually, sensors that measure a range of values vary
their resistance to reflect their detection.
 Arduinos can only sense voltages, not resistances.

INPUTS
 Sensors that only vary their resistances require a circuit  Hierarchy: computers control controllers, controllers
called a voltage divider to provide the Arduino a voltage. control hardware.

ADVANTAGES OF ARDUINO

 Open source
 Simplified and user-friendly programming language
 No additional programmer/burner hardware required
for programming board
 Portable
 Low power consumption
 Best for beginners

DISADVANTAGES OF ARDUINO

 Arduino is not designed to handle large complexity that


comes with advanced projects
 processing power is weaker than the PIC microcontroller
 Limited working memory
 Arduino is not suitable for designing advanced
embedded systems

PIC VS ARDUINO

SOME CONTROLLER THAT CAN BE USE INSTEAD OF ARDUINO Definition:

 PIC controller  Pic - It belongs to the traditional microcontroller family


o Microcontroller programmed with C or with its 8- pin structure.
assembler  Arduino - Arduino does not belong to the family of the
 Alternatives to the Arduino line microcontroller. It is based on an audio/video receiver
o Pinguino – PIC controller and is built on its integrated development environment.
o MSP430 – Texas Instruments; $4.30
o Others: customs, Teensy, etc. Architecture:
 Netduino
 Pic - The microcontroller Pic comprises of EEPROM, CCP,
 Computers
system service processor, program segment prefix, add
o Raspberry Pi
with carrying segments, In-circuit serial programming
o BeagleBones –TI; has computer and controller
processor and LCD.
NETDUINO  Arduino - The Arduino comprises of 2kb of SRAM and
32kb of flash memory
 Microcontroller and development tools created by
Microsoft to work with the .NET Micro Framework. Power Supply
 VASTLY better development environment.
 Pic: It operates on 5v to 6.6V.
o visualmicro.com
 Arduino: The power supply of Arduino lies between 6V
o Other alternatives
and 20V. It is recommended to use 7 to 12V should be
 Differences
provided through the direct current with parallel jack
o Pins on a Netduino are 3.3V (not 5).
current using Vpin.
o Netduinos have a much faster processor.
o 60K of RAM (versus an Uno's 2K). Applications
 Largely compatible with the Arduino, but it is not a drop-
in replacement  Pic: It is implemented in simple toys, control systems,
remote controls, power tools, and automatic engines.
RASPBERRY PI  Arduino: It is used in smart home applications,
electronics, and automobile automation devices and loT
 Low end computer, not a controller equipment.
 Uses Debian Linux
o Arch Linux ARM, Fedora, FreeBSD, Slackware…
 Programmed with Python
o BBC BASIC, C, Perl
 As it is a computer and not a controller, its role in these
Advantages
projects is different.
 Pic - In the advanced form of Pic, multitasking is
available, and it operates as a strong and robust
processor. It can also be used in ports of ethernet, WIFI,
Bluetooth, audio and video output, USB ports, camera
ports, and other HDMI ports. Simple coding is also
possible for the functioning of electronics. It can also be
used to connect multiple components online to
accomplish tasks simultaneously.
 Arduino - It is easy to implement in analog components,
automatic engines, sensors, and other automobile and
electronic automation devices. The different
architecture can add many functionalities to devices. It
doesn't require any complex or longer code just a plugin
is enough to execute a program. It can be deployed
easily to establish many online functions that require
many sensors.

Disadvantages

 Pic - It operates on lengthier code and needs an extra


plugin to connect peripheral hardware devices. Special
programs are fed to execute any simple actions.
 Arduino - It can execute only one code at a time if it runs
any multiple codes, the system becomes slow. It is a
huge learning curve which requires a piece of knowledge
on C/C++

The Arduino can be implemented in:

 Robotics,
 Electrical appliances based on IR, smart home
automation,
 the fault recognition use in an underground cable.

The pic microcontrollers are used in industries as it consumes only


low power.

 It provides maximum efficiency and easily accessing


methods to support software and hardware tools such
as simulators,debuggers, and compilers.

You might also like