Basics of Microcomputer
Basics of Microcomputer
,
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?
A “micro”computer by
Photograph.
Wikipedia Commons Web. 7 Jan 2014.
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.
7
Microcontroller
Comparison
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
Control bus
Address bus
Control Unit gets data and instruction in the same way from
one memory. It simplifies design and development of the
Control Unit.
• since it has two memories , this allows parallel access to data and
instructions.
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
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 ?
“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
Programmed using the serial COM port of IBM PC in order to get rid of
the ROM burner.
Comparison
“Original” 8051 Microcontroller
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
0FFFH
8051
1FFFH
8752
7FFFH
DS5000-32
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
2FH
Bit-Addressable RAM