Micro-Controller Basics 1: Nasif M
Micro-Controller Basics 1: Nasif M
Nasif M.
1
Topics
Difference between Micro-processor and Micro-
controller.
2
Microprocessor/Microcontroller and some
of their applications
3
Typical Applications of uP
Microprocessor is basically a CPU, using
CPU general purpose computer can be built
Desktop computers, PCs, Laptops,
Workstations, Servers, Supercomputers
We are in the era of 32- and 64-bit
microprocessor, so we can produce very
powerful computers
4
Typical Application of uC
Using microcontrollers embedded systems are produced
An embedded system is a combination of hardware and software
built for a specific application
Consumer electronics making toys, cameras, camcorders,
robots
Consumer products - washing machines, microwave ovens etc.
Instrumentation - oscilloscopes, various medical equipments,
Process control - data aquisition, controlling various industries
Communication – Telephone, answering machines
Office equipments – Fax, printer, small PABX
Micromedia application – Cell phones, PDAs, teleconferencing
equipment
5
Microprocessor vs Microcontroller
Microprocessor Microcontroller
1. A silicon chip representing a central 1. A microcontroller is a highly
processing unit (CPU), which is capable integrated chip that contains a CPU,
of performing arithmetic as well as RAM, special and general purpose
logical operations according to a pre- register arrays, on chip flash memory
defined set of instructions. for program storage, timer and
interrupt control units and dedicated
I/O ports.
2. It is a dependent unit. It requires the 2. It is a self-contained unit and it does
combination of other chips like timers, not require external interrupt
program and data memory chips, controller, timer, UART etc. for it's
interrupt controllers etc. for functioning.
functionality.
3. Most of the time general purpose in 3. Mostly application-oriented.
design and operation.
4. Targeted for high end market where 4. Targeted for embedded market where
performance is important. performance is not so critical.
5. Limited power saving options 5. Includes lot of power saving features.
compared to microcontrollers.
6
Criteria for choosing a microcontroller or a
microprocessor
7
Criteria for choosing a microcontroller
The first and foremost criterion in choosing
a microcontroller is that it must meet the
task at hand efficiently and cost effectively
In analyzing the need of a microcontroller
based project, we must see whether an 8-bit,
16-bit or 32-bit microcontroller can best
handle the computing needs of the task
most effectively.
8
Criteria for choosing a microcontroller
Among other considerations in this category
are:
(a) Speed: What is the highest speed that the
microcontroller supports?
(b) Power Consumption: critical for battery powered
products
(c) The amount of ROM and RAM on chip
(d ) The number of I/O pins & Analog to Digital
conversion support
(e) Cost per unit
9
Raspberry pi and Arduino
10
11
Features of Raspberry pi and Arduino
Raspberry pi Arduino
12
How to choose right kind of board?
Investigate the goal of the project.
Find the feature of the board, if it fulfils the
goals.
Consider price, CPU processing speed, RAM,
Network capability, Power consumption.
13
Question
Suppose you want to design a system to monitor water
level in a water tank at the rooftop of the building. When
the water level of the tank is zero (empty), the system
automatically switches on the pump motor. The motor is
switched off automatically when the water tank is full.
The system is communicating with the management
station (PC) in your room using I2C protocol. You can use
either Micro-processor based system (e.g. Raspberry pi)
or Micro-controller based system (e.g. Arduino). Which
one you will prefer? To make appropriate choice explain
which criteria need to consider?
14
Types of Computer
Architecture
15
Harvard Architecture Howard Hathaway Aiken
17
Harvard Architecture
In a Harvard architecture, there is no need to
make the two memories share characteristics.
In particular, the word width, timing,
implementation technology, and memory
address structure can differ.
In some systems, instructions can be stored in
read memory while data memory generally
requires read write memory.
18
19
Von Neumann Architecture John von Neumann
21
Processor ISA (instruction set architecture):
RISC versus CISC
• Most PCs use CPU based on CISC architecture.
For instance Intel and AMD CPU's are based on
CISC architectures.
• Many claim that RISC is the architecture of the
future.
• But even though RISC has been in the market
since 1980, it hasn’t managed to kick CISC out
of the picture, some argue that if it is really the
architecture of the future it should have been
able to do this by now.
22
RISC (Reduced instruction set computing) VS CISC (Complex
instruction set computing)
RISC CISC
4. Used with Harvard architecture. 4. Used with Harvard and Von neuman
architecture.
23
Type Flash RAM EEPROM
Size, kB Size, kB Size, kB
Atmega8 8 1 0.5
Atmega32 32 2 1
Atmega64 64 4 2
Atmega128 128 4 4
24