89S52Basics1 BASICS
89S52Basics1 BASICS
89S52Basics1 BASICS
89S52 Basics
By DeccanRobots
What is 89S52?
89S52 is a Microcontroller.
It is based on 8052 Architecture
In simple language we can consider
89S52 as Advanced Version of 89C51.
Q. Do I need to be an Electronics
Engineer to learn 89S52?
Ans: No. You need not to be an
electronics engineer to learn any
microcontroller. The only requirement is
you must have some knowledge of
electronics components and of any
programming language.
For Microcontroller Development Boards --- www.EmbeddedMarket.com -- India
I have some Questions…
Microcontroller is a combination of
Processor + Memory + Ports
Microcontroller can be used for only
ONE application at a time.
In other words, “Microcontrollers are
used for dedicated applications”
General Purpose
Your Code is
Memory
Called as Stored Here
to store values
FLASH
Memory
Processor
Very Important:
– Following Numbers
10d ,10b, 10h Are NOT same
– 10d is 10 decimal
– 10b is 10 binary i.e. 2 decimal
– 10h is 10 hex i.e. 16 decimal
PORT 1
PORT 0
PORT 3
PORT 2
Crystal
8KBytes of In-system
Re-Programmable Flash Memory to
store your Program
256 Bytes of Internal RAM to store
various values
32 Input/Output Lines (Port Pins)
Remember:
From this slide onwards, whenever
Term “Memory” is used, assume it as
Data Memory.
Data Memory is internal memory used
to store various values.
In some cases if other type of memory
is be referred, it will be mentioned
clearly.
For Microcontroller Development Boards --- www.EmbeddedMarket.com -- India
Data Memory
7 6 5 4 3 2 1 0 FFh
7 6 5 4 3 2 1 0 02h
7 6 5 4 3 2 1 0 01h
7 6 5 4 3 2 1 0 00h
For Microcontroller Development Boards --- www.EmbeddedMarket.com -- India
Data Memory
7 6 5 4 3 2 1 0 FFh
7 6 5 4 3 2 1 0 02h
7 6 5 4 3 2 1 0 01h
7 6 5 4 3 2 1 0 00h
Bit Numbers
For Microcontroller Development Boards --- www.EmbeddedMarket.com -- India
Data Memory
MOV 03h,#55h
0 1 0 1 0 1 0 1 02h
0 0 0 0 0 0 0 0 01h
0 0 0 0 0 0 0 0 00h
For Microcontroller Development Boards --- www.EmbeddedMarket.com -- India
Data Memory
0 0 0 0 0 0 0 0 FFh
Memory Location 00h
is also called as R0.
R0 is also called as a
Register
Hence:
MOV R0,#55h
R2 0 0 0 0 0 0 0 0 02h
And
R1 0 0 0 0 0 0 0 0 01h
R0 0 01 0 01 0 01 0 01 00h MOV 00h,#55h will do
the same work
For Microcontroller Development Boards --- www.EmbeddedMarket.com -- India
Data Memory
2Fh
Bit Addressable
Memory
20h
Registers
00h
For Microcontroller Development Boards --- www.EmbeddedMarket.com -- India
Data Memory