Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Basics of Microcomputer

Basic Of Microprocessor pdf
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Basics of Microcomputer

Basic Of Microprocessor pdf
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 43

Microprocessor

,
Microcomputer
,
Microcontroller

S. D. Ambade
What is the difference?
A microcomputer is a
small, relatively inexpensive
computer with a
microprocessor as its central
processing unit.

It includes:
• a microprocessor
• memory
• input/output (I/O) facilities Commodore 64 Microcomputer
Evan-Amos, . Commodore-64-Computer. 2011.
Photograph. Wikipedia Commons Web. 7 Jan 2014.
<http://en.wikipedia.org/wiki/File:Commodore-64-Computer.jpg>..

2
What is the difference?
Why is it called a “micro”
computer?

Early computers such as


ENIAC filled entire rooms.
U.S. Army Photo, . ENIAC. 197.

A “micro”computer by
Photograph.
Wikipedia Commons Web. 7 Jan 2014.

comparison with a keyboard,


monitor, and mouse are
commonly referred to as a
personal computer today.

The prefix “micro” is not


commonly used in describing 3
What is the difference?
A microprocessor is an IC which
has only the Central Processing Unit
inside them. They only have
processing powers.

Microprocessors don’t have RAM,


ROM, and other peripheral on the
chip.

A system designer has to add them


externally to make them functional.

Once again, the prefix “micro” is


increasingly left today in favor of just 4
Microprocessor
Microcontroller
A microcontroller is a small,
low cost computer on a single
integrated circuit.

ATmega328 Microcontroller
• Processor
• Memory
• Programmable
Arduino Uno Microcontroller
Input/Output(I/O) Board
SparkFun Electronics, . Arduino Uno - R3. 2013.
Photograph. Wikipedia Commons Web. 7 Jan 2014.

Microcontrollers are used to perform one


dedicated task. One specific program.
They are usually embedded in products.
6
What is a
Microcontroller?
Microcontrollers are used to control many everyday
products like garage door openers, traffic lights,
home thermostats, and robots. Embedded controllers
are everywhere.

7
Microcontroller
Comparison

S.No Microprocessor Microcontroller


1
A microprocessor is a general purpose device which is called a CPU A microcontroller is a dedicated chip which is also called single chip
computer.

2 A microcontroller includes RAM, ROM, serial and parallel


A microprocessor do not contain onchip I/OPorts, Timers, Memories etc..
interface, timers, interrupt

circuitry (in addition to CPU) in a single chip.

3 Microcontrollers are used in small, minimum component designs


Microprocessors are most commonly used as the CPU in microcomputer
performing control-oriented applications.
systems

4 Microprocessor instructions are mainly nibble or byte addressable Microcontroller instructions are both bit addressable as well as byte
addressable.
Comparison
5
Microprocessor instruction sets are mainly Microcontrollers have instruction sets catering to
intended for catering to large volumes of the control of inputs and outputs.
data.
6
Microprocessor based system design is Microcontroller based system design is rather
complex and expensive simple and cost effective
7
The Instruction set of microprocessor is The instruction set of a Microcontroller is very
complex with large number of instructions. simple with less number of instructions. For, ex:
PIC microcontrollers have only 35 instructions.
8 A microcontroller has no zero flag.
A microprocessor has zero status flag
Buses
Address bus

Buses Data bus

Control bus
Address bus

• It is a group of conducting wires which carries


address only. Address bus is unidirectional
because data flow in one direction, from
microprocessor to memory or from microprocessor
to Input/output devices (That is, Out of
Microprocessor).
Data bus

• It is a group of conducting wires which carries


Data only. Data bus is bidirectional because data
flow in both directions, from microprocessor to
memory or Input/Output devices and from memory
or Input/Output devices to microprocessor.
• It is a group of conducting wires, which
is used to generate timing and control
signals to control all the associated
peripherals, microprocessor uses
control bus to process data, that is
what to do with selected memory

Control bus location. Some control signals are:


• Memory read
• Memory write
• I/O read
• I/O Write
• Opcode fetch
• Between 1945 & 1951 John von Neumann
Von Neumann set down the structure, layout, interaction,
cooperation, realisation, implementation,
Architecture functionality and activity for the whole
computer as a system.
Advantages of Von Neumann

Control Unit gets data and instruction in the same way from
one memory. It simplifies design and development of the
Control Unit.

Data from memory and from devices are accessed in the


same way.

Memory organization is in the hands of programmers.


• Serial instruction processing does
not allow parallel execution of program.
Parallel executions are simulated later by
Disadvantage the Operating system.
s of Von
Neumann • One bus is a bottleneck. Only one
information can be accessed at the same
time.

• Instruction stored in the same


memory as the data can be accidentally
rewritten by an error in a program.
Harvard Architecture

• MARK II computer was fi nished at Harvard University in 1947. It


wasn't so modern as the computer from von Neumann team. But it
introduced a slightly diff erent architecture. Memory for data was
separated from the memory for instruction. This concept is known as
the Harvard architecture.
Advantages of Harvard

• since it has two memories , this allows parallel access to data and
instructions.

• Development of the Control Unit is expensive and needs more time

• Data and instructions are accessed the same way.

• Both memories can use different cell sizes.


Disadvantages of Harvard

Production of a
Free data memory
computer with two
can’t be used for
buses is more
instruction and vice-
expensive and needs
versa.
more time.
Microcontroller Architectures
Memory
0
Address Bus
Program
CPU Data Bus + Data Von Neumann
2n
Architecture
Memory
0
Address Bus
Program
CPU Fetch Bus Harvard
Address Bus 0
Architecture
Data Bus Data
Harvard vs Von Neumann

Harvard Von Neumann

 Two memories with two Buses allow  Content of the memory if organised
parallel access to data access and and all installed memory can be used.
instructions.  One bus is simpler for the control unit
 Control unit for two buses is more design
complicated and more expensive.  Computer with one bus is cheaper.
 Program can’t write itself.  Error in a program can rewrite
 Both memories can use different sizes instruction and crash program
execution
 Development of a complicated  Development of the Control Unit is
Control Unit needs more time. cheaper and faster.
 Free data memory can’t be used for  Data and instruction is accessed in the
instruction and vice-versa. same way.
 One Bus ( for Data, instruction and
devices) is a bottleneck.
Why do we need to
learn Microcontrollers ?

• Its not an exaggeration if I say that ,today


there is no electronic gadget on the earth
which is designed without a Microcontroller.
Ex: communication devices, digital
entertainment, portable devices etc…

Not believable ??? See the next slide


Personal information products: Cell phone, pager,
watch, pocket recorder, calculator

Microcontro Laptop components: mouse, keyboard, modem, fax


ller card, sound card, battery charger

Home appliances: door lock, alarm clock, thermostat,


air conditioner, TV remote, VCR, small refrigerator,
exercise equipment, washer/dryer, microwave oven

Industrial equipment: Temperature/pressure


controllers, Counters, timers, RPM Controllers

Toys: video games, cars, dolls, etc.


Types of Microcontrollers
Feature 8031 8051 8052
8751
ROM NO 4kB 8kB 4kB
UV Eprom
MCS-51 RAM (Bytes)
256 128
128 128

“Family” of TIMERS 2 2 3
2
Microcontoller I/O PINS 32 32 32
s 32
SERIAL PORTS 1 1 1
1
INTERRUPT SOURCES 6 6 8
6
4K bytes ROM

128 bytes RAM

Four 8-bit I/O ports


Important
Features of Two 16-bit timers
8051 Serial interface

64K external code memory space

64K data memory space


Specification & comparison of 8951, 89C1051,
89C2051, 89C4051 microcontrollers
AT89C51 from Atmel Corporation –

(‘C’ in the part number indicates CMOS )

To build up a microcontroller based system using AT89C51, it is


essential to have ROM burner that supports flash memory.

Programmed using the serial COM port of IBM PC in order to get rid of
the ROM burner.
Comparison
“Original” 8051 Microcontroller

Oscillator 4096 Bytes 128 Bytes Two 16 Bit


and timing Program Memory Data Memory Timer/Event
(ROM) (RAM) Counters

8051 Internal data bus


CPU

64 K Byte Bus Programmable Programmable


Expansion I/O Serial Port Full
Control Duplex UART
Synchronous Shifter
subsystem interrupts

External interrupts Control Parallel ports Serial Output


Address Data Bus Serial Input
I/O pins
Pin Description of
the 8051
• The 8051 is a 40 pin
device, but out of these
40 pins, 32 are used for
I/O.

• 24 of these are dual


purpose, i.e. they can
operate as I/O or a
control line or as part of
address or date bus.
8051 CPU Registers

A (8-bit Accumulator)
B (8-bit register for Mul &Div)
PSW (8-bit Program Status Word)
SP (8-bit Stack Pointer)
PC (16-bit Program Counter)
DPTR (16-bit Data Pointer)
Special Function Registers

DATA registers

CONTROL registers

•Timers

•Serial ports

•Interrupt system

•Analog to Digital converter Addresses 80h – FFh


•Digital to Analog converter
etc.. Direct Addressing is used to
access SFRs
List of Registers
(*Denotes the SFRs)
Contd…
PSW REGISTER
CY, the carry flag This flag is set whenever there is a carry out
from the D7 bit.

This flag bit is affected after an 8-bit addition or subtraction.

PSW It can also be set to 1 or 0 directly by an instruction such as “SETB


C” and “CLR C”where “SETB C” stands for “set bit carry” and
“CLR C” for “clear carry”.
REGISTER
AC, the auxiliary carry flag If there is a carry from D3 to D4
during an ADD or SUB operation, this bit is set; otherwise, it is
cleared.

This flag is used by instructions that perform BCD (binary coded


decimal) arithmetic.
P, the parity flag The parity flag reflects the number
of 1 s in the A (accumulator) register only.

If the A register contains an odd number of Is, then P


= 1. Therefore, P = 0 if A has an even number
of 1s.

OV, the overflow flag This flag is set whenever the


PSW result of a signed number operation is too large,
causing the high-order bit to overflow into the sign
REGISTER bit.

In general, the carry flag is used to detect errors in


unsigned arithmetic operations.

The overflow flag is only used to detect errors in


signed arithmetic operations
Memory mapping in 8051

ROM memory map in


8051 family
0000H 4k 0000H 8k 0000H 32k

0FFFH

8051
1FFFH

8752
7FFFH

DS5000-32

from Atmel from Dallas


Corporation Semiconductor
RAM memory space allocation
in the 8051
7FH

Scratch pad RAM

30H

2FH
Bit-Addressable RAM

20H
1FH Register Bank 3
18H
17H
Register Bank 2
10H
0FH Register Bank 1 )Stack(
08H
07H
Register Bank 0
00H
Register banks
Stack in the 8051
• The register used to 7FH

access the stack is called Scratch pad RAM


SP (stack pointer)
register. 30H

2FH
Bit-Addressable RAM

• The stack pointer in the 20H


1FH
8051 is only 8 bits wide, 18H
Register Bank 3

which means that it can 17H


Register Bank 2
10H
take value 00 to FFH. 0FH Register Bank 1 )Stack(
When 8051 powered up, 08H

the SP register contains 07H


00H
Register Bank 0
value 07.

You might also like