SlideShare ist ein Scribd-Unternehmen logo
1 von 33
© Copyright 2013, wavedigitech.com.

Latest update: June 15, 2013,
http://www.wavedigitech.com/
Call us on : 91-9632839173
E-Mail : info@wavedigitech.com

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Presentation on
8051 and Addressing
Modes
By :
Faizan Ali Khan
Mail @
faizankhan031@gmail.com
E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
MuP and MuC
Microcontroller
 It itself is a small computer
 It has a CPU, RAM,ROM and other
peripherals embedded on a single
chip
 It has I/O ports and Serial Com port
 Has separate m/ry to store program
and data
 Designed to perform specific tasks.
Ex – mouse, mobile….
 Has its own inbuilt memory
 Lower clock frequency and low
performance simple CPU arch

Microprocessor
•
•

Its just a CPU of a computer
It just has a CPU

•

None. Requires extra devices.(8155
for I/O, 8250 for Serial Com port)
Same memory
Unspecific tasks.
Ex – gaming, websites….
Doesn’t have
higher clock frequency and a high
performance pipelined parallel CPU
arch

•
•

•
•

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Harvard and VON Neumann
Harvard architecture

Von Neumann architecture

•

•

Has shared s/g s and memory

•

Not possible

•

Program can be easily modified by
itself since it is stored in read-write
memory
Slower

•

•
•

•
•

program
memory

Has physically separate memory
and s/g s for code and data memory
Program memory and data memory
can be accessed simultaneously
It is impossible for program
contents to be modified by the
program itself
Faster , as Program memory and
data memory are accessed
simultaneously
Pipelining is possible
Processor can complete an
instruction in one cycle
processor

Data
memory

•

•
•

Not possible
Processor requires 2 clock cycles to
complete an instruction

processor

Program memory
And
Data memory

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
8051 Internal Block Diagram

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Register Banks
Register Banks with Addresses

Selecting the Register Banks

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Stack
• The stack is a section of RAM used by the CPU to
store information temporarily. This information could
be data or an address. The CPU needs this storage
area since there are only a limited number of registers
• Stack is LIFO
• Register used to access the stack is called a Stack
Pointer (SP). Default value of a SP is 07H
• PUSH and POP

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Special Function Registers

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
SFRs
• Accumulator, A – Used in logical and arithmetic
operations
• Register B – Used only in MUL and DIV
• Program Counter – It points to the address of the next
instruction to be executed.
• Stack Pointer - Used to access the stack
• Data Pointer – Address of higher bytes from external
RAM

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Program Status Word

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
PCON
The Power Control SFR is used to control the 8051's
power control modes
SMOD is used to double the effective baud rate
of the 8051's serial port.

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Timer Control (TCON)
Special Function
Register
.

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
BIT

SYMBOL

FUNCTION

7

TF1

Timer 1 Overflow flag. Set when timer rolls from all 1's to 0,i.e overflows. Cleared
when processor vectors to execute interrupt service routine located at program
address 001Bh.

6

TR1

Timer 1 run control bit. Set to 1 by program to enable timer to count; cleared to 0 by
program to off timer.

5

TF0

Timer 0 Overflow flag. Set when timer rolls from all 1's to 0. Cleared when processor
vectors to execute interrupt service routine located at program address 000Bh.

4

TR0

Timer 0 run control bit. Set to 1 by program to enable timer to count; cleared to 0 by
program to halt timer.

3

IE1

External interrupt 1 Edge flag. Set to 1 when a high-to-low edge signal is received.
Cleared when processor vectors to interrupt service routine.

2

IT1

External interrupt 1 signal type control bit. Set to 1 by program to enable external
interrupt 1 to be triggered by a falling edge signal. Set to 0 by program to enable a
low-level signal on external interrupt 1 to generate an interrupt.

1

IE0

External interrupt 0 Edge flag. Set to 1 when a high-to-low edge signal is received.
Cleared when processor vectors to interrupt service routine.

0

IT0

External interrupt 0 signal type control bit. Set to 1 by program to enable external
interrupt 1 to be triggered by a falling edge signal. Set to 0 by program to enable a
low-level signal on external interrupt 0 to generate an interrupt.

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Timer Mode Control
(TMOD) Special
Function Register
.

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
BIT

SYMBOL

FUNCTION

7

Gate

6

C/T

Set to 1 by program to act as a counter by counting pulses from external
input pins 3.5. Cleared to zero by program to act as a timer by counting
internal frequency.

5

M1

Timer/counter operating mode select bit 1. Set/cleared by program to
select mode.

4

M0

Timer/counter operating mode select bit 0. Set/cleared by program to
select mode.

3

GATE

2

C/T

Set to 1 by program to make timer 0 act as a counter by counting pulses
from external input pin 3.4. Cleared to zero by program to make timer act
as a timer by counting internal frequency.

1

M1

Timer/counter operating mode select bit 1. Set/cleared by program to
select mode.

0

M0

Timer/counter operating mode select bit 0. Set/cleared by program to
select mode.

To control start and stop of timer 1.
If GATE=0, SETB TR1 starts timer and CLR TR1 stops timer

To control start and stop of timer 0.
If GATE=0, SETB TR1 starts timer and CLR TR1 stops timer

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
SCON
Serial Control Register

.

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
SMO

.



SM1

SM2

REN

TB8

RB8

TI

SM0 SM1 Mode Baud Rate
----------------------0
0
0
f osc/12
0
1
1
variable
1
0
2
f osc/32 or f osc/64

 SM2 Multiprocessor Mode Control Bit
1 = Multi-processor mode
0 = Normal mode


REN Receiver Enable Bit

1 = Receive Enable
0 = Receive Disabled
 TB8 Transmit Bit 8
Enabled only for modes 2 and 3. Made 0 as its not used
 RB8 Receive Bit 8
Used in modes 2 and 3. it gets a copy of Stop Bit when an 8 bit data is received


RI, TI Serial Interrupts

RI is set to indicate receipt of a serial word and TI is set to indicate completion of a serial transmission and
ready to transfer another byte.

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173

RI
Interrupt Enable
Register
.

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Interrupt Enable Register
EA

----

ET2

ES

ET1

EX1

ET0

EX0

• EA - disable all the interrupts. EA=0, no interrupt is acknowledged.
EA=1, interrupt source is enabled or disabled
• ----- for future use
• ET2 – enables or disables timer 2 overflow interrupt
• ES - enables or disables the serial port interrupt
• ET1 - enables or disables timer 1 overflow interrupt
• EX1 - enables or disables external interrupt 1
• ET0 - enables or disables timer 0 overflow interrupt
• EX0 - enables or disables external interrupt 0

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Interrupt Priority
Register
.

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Interrupt Priority Register
.

----

•
•
•
•
•
•
•

----

PT2

PS

PT1

PX1

PT0

PX0

---- reserved
PT2 – timer2 interrupt priority bit
PS – serial port interrupt priority bit
PT1 – timer1 interrupt priority bit
PX1 – external interrupt 1 priority bit
PT0 – timer0 interrupt priority bit
PX0 – external interrupt 0 priority bit
E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Addressing
Modes

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Addressing modes
• The 8051 instructions use eight addressing modes.
These are:
1.Register
2. Direct
3. Indirect
4. Immediate
5. Relative
6. Absolute
7. Long
8. Indexed
E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Register Addressing
Register Addressing
• In this mode the data, which the instruction operates on, is in one of eight
registers labeled R0 to R7 (Rn, in general). These registers are to be found
in one of four register banks, only one of which can be active at any one
time. The active bank may be selected by using bit 3 and bit 4 of the PSW
(rs0 & rs1). On power-up or reset, the default register bank is bank 0.
• For example, to logically OR the contents of accumulator A with that of
register R3, the following instruction is used:
ORL A, R3
• and the op-code is 01001011B. The upper five bits, 01001, indicate the
instruction, and the lower three bits, 011, the register.

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Direct Addressing
•

Instructions using direct addressing consists of two bytes: op-code and address.

•

Such instructions can access any on-chip variable or hardware register. Note that the
most significant bit of the direct address determines which area in the on-chip is to
be accessed. An address between 00H and 7FH accesses a location in the low-order
on-chip RAM.

•

Any address with bit 7 = 1 refers to one of the special function registers. It is not
necessary to remember the addresses of these special function registers. The
assembler usually understands and converts the mnemonic of a special function
register, e.g. P2 for Port 2, into the appropriate address. An example of a direct
addressing instruction is

•

MOV P1, A
which transfer the content of the accumulator to Port 1. The direct address of Port 1
(90H) is determined by the assembler and inserted as byte 2 of the instruction. The
source of the data, the accumulator, is specified implicitly in the op-code.
E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Indirect Addressing

• In this mode of addressing the instruction performs an
operation on the data whose address is contained in
register R0 or R1. Instructions using indirect addressing
are single byte instructions. In 8051 assembly language
the symbol @ before R0 or R1 denotes indirect
addressing. An example of an indirect addressing
instruction is
SUBB A, @R0
• This instruction performs the operation:
(A)  (A) – (C) – ((R0)).
E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Immediate Addressing
• In an instruction that uses immediate addressing, the operand
of the instruction is given as the byte that follows the op-code.
The operand may be a numeric constant, a symbolic
variable, or an arithmetic expression using
constants, symbols, and operators.
• In assembly language we use the symbol # before an operand
to denote immediate addressing. An example of an instruction
using immediate addressing is
ANL A, #77
which performs the operation: (A)  (A) · #77.

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Relative Addressing
•

•

•

Sometimes this is also called program counter relative addressing. This addressing
mode is used only with certain jump instructions. A relative address (or offset) is an
8-bit signed value, which is added to the program counter to form the address of the
next instruction executed.
The range for such a jump instruction is –128 to +127 locations. Although the range
is rather limited, relative addressing does offers the advantage of providing
position-independent code (since absolute addresses are not used). For example, the
instruction
JZ rel
performs the following operations:
(PC) ¬ (PC) + 2
IF (A) = 0
THEN (PC) ¬ (PC) + rel
ELSE continue
The branch destination is computed by adding the signed relative-displacement in
the second instruction byte to the PC, after incrementing the PC twice.

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Absolute Addressing
• There are only two instructions that use this addressing:
ACALL (absolute call) and AJMP (absolute jump).
• These instructions perform branching within the current 2K
page of program memory. The branch address is obtained by
successively concatenating the five high-order bits of the
program counter, bits 5 – 7 of the op-code, and the second byte
of the instruction.

• The diagram illustrate how this is done:

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Absolute Addressing

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Long Addressing
• Only two instructions use this addressing mode. These
instructions are LCALL addr16 and LJMP addr16.
• Both of these are three byte instructions with the op-code
being the first byte and the following two bytes are the address
high-byte and address low-byte respectively.
• These instructions enable the program to branch to anywhere
within the full 64 K-bytes of program memory address space.

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Indexed Addressing
• In this mode the 16-bit address in a base register is added to a positive
offset to form an effective address for the jump indirect instruction JMP
@A+DPTR, and the two move code byte instructions MOVC
A,@A+DPTR and MOVC A,@A+PC.
• The base register in the jump instruction is the data pointer and the
positive offset is held in the accumulator. For the move instructions the
base register can either be the data pointer or the program counter, and
again the positive offset is in the accumulator. The operations of these three
instructions are as follows:
JMP @A+DPTR (PC) (A) +(DPTR)
MOVC A,@A+DPTR (A)  ((A) + (DPTR))
MOVC A,@A+PC (PC)  (PC) + 1
(A)  ((A) + (PC))

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
Thank You

© Copyright 2013, wavedigitech.com.
Latest update: Jan 30, 2013,
http://www.wavedigitech.com/
Call us on : 91-9632839173
E-Mail : info@wavedigitech.com

E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173

Weitere ähnliche Inhalte

Was ist angesagt?

PIC introduction + mapping
PIC introduction + mappingPIC introduction + mapping
PIC introduction + mappingOsaMa Hasan
 
GSM 1308 MODEM CONTROL USING PIC-16F877A MICROCONTROLLER
GSM 1308 MODEM CONTROL USING PIC-16F877A MICROCONTROLLERGSM 1308 MODEM CONTROL USING PIC-16F877A MICROCONTROLLER
GSM 1308 MODEM CONTROL USING PIC-16F877A MICROCONTROLLERMd. Moktarul Islam
 
Pic microcontroller [autosaved] [autosaved]
Pic microcontroller [autosaved] [autosaved]Pic microcontroller [autosaved] [autosaved]
Pic microcontroller [autosaved] [autosaved]gauravholani
 
Atmel and pic microcontroller
Atmel and pic microcontrollerAtmel and pic microcontroller
Atmel and pic microcontrollerTearsome Llantada
 
Rfid interface with lpc2148
Rfid interface with lpc2148 Rfid interface with lpc2148
Rfid interface with lpc2148 Ritesh Kumar
 
Introduction to pic microcontroller
Introduction to pic microcontrollerIntroduction to pic microcontroller
Introduction to pic microcontrollerSiva Kumar
 
MICROCONTROLLER 8051- Architecture & Pin Configuration
MICROCONTROLLER 8051- Architecture & Pin Configuration MICROCONTROLLER 8051- Architecture & Pin Configuration
MICROCONTROLLER 8051- Architecture & Pin Configuration AKHIL MADANKAR
 
Programming with PIC microcontroller
Programming with PIC microcontroller Programming with PIC microcontroller
Programming with PIC microcontroller Raghav Shetty
 
Features of ATMEL microcontrollers
Features of ATMEL microcontrollersFeatures of ATMEL microcontrollers
Features of ATMEL microcontrollersSuraj Shandilya
 
Microprocessor Architecture 4
Microprocessor Architecture  4Microprocessor Architecture  4
Microprocessor Architecture 4Dr.YNM
 
Embedded System - Dtmf robot
Embedded System - Dtmf robotEmbedded System - Dtmf robot
Embedded System - Dtmf robotAbhishek Sood
 
Arm7 Interfacing examples
Arm7   Interfacing examples Arm7   Interfacing examples
Arm7 Interfacing examples Dr.YNM
 
PIC-18 Microcontroller
PIC-18 MicrocontrollerPIC-18 Microcontroller
PIC-18 MicrocontrollerASHISH RANJAN
 
PIC 16F877A by PARTHIBAN. S.
PIC 16F877A   by PARTHIBAN. S.PIC 16F877A   by PARTHIBAN. S.
PIC 16F877A by PARTHIBAN. S.parthi_arjun
 
PIC microcontroller review
PIC microcontroller reviewPIC microcontroller review
PIC microcontroller reviewMohsen Sarakbi
 
8-bit PIC Microcontrollers
8-bit PIC Microcontrollers8-bit PIC Microcontrollers
8-bit PIC MicrocontrollersPremier Farnell
 
Introduction to Stellaris Family Microcontrollers
Introduction to Stellaris Family MicrocontrollersIntroduction to Stellaris Family Microcontrollers
Introduction to Stellaris Family MicrocontrollersPremier Farnell
 

Was ist angesagt? (20)

PIC introduction + mapping
PIC introduction + mappingPIC introduction + mapping
PIC introduction + mapping
 
8051 MICROCONTROLLER
8051 MICROCONTROLLER 8051 MICROCONTROLLER
8051 MICROCONTROLLER
 
GSM 1308 MODEM CONTROL USING PIC-16F877A MICROCONTROLLER
GSM 1308 MODEM CONTROL USING PIC-16F877A MICROCONTROLLERGSM 1308 MODEM CONTROL USING PIC-16F877A MICROCONTROLLER
GSM 1308 MODEM CONTROL USING PIC-16F877A MICROCONTROLLER
 
Pic microcontroller [autosaved] [autosaved]
Pic microcontroller [autosaved] [autosaved]Pic microcontroller [autosaved] [autosaved]
Pic microcontroller [autosaved] [autosaved]
 
Atmel and pic microcontroller
Atmel and pic microcontrollerAtmel and pic microcontroller
Atmel and pic microcontroller
 
Rfid interface with lpc2148
Rfid interface with lpc2148 Rfid interface with lpc2148
Rfid interface with lpc2148
 
Introduction to pic microcontroller
Introduction to pic microcontrollerIntroduction to pic microcontroller
Introduction to pic microcontroller
 
MICROCONTROLLER 8051- Architecture & Pin Configuration
MICROCONTROLLER 8051- Architecture & Pin Configuration MICROCONTROLLER 8051- Architecture & Pin Configuration
MICROCONTROLLER 8051- Architecture & Pin Configuration
 
Programming with PIC microcontroller
Programming with PIC microcontroller Programming with PIC microcontroller
Programming with PIC microcontroller
 
Features of ATMEL microcontrollers
Features of ATMEL microcontrollersFeatures of ATMEL microcontrollers
Features of ATMEL microcontrollers
 
Mcapptunitvii
McapptunitviiMcapptunitvii
Mcapptunitvii
 
Microprocessor Architecture 4
Microprocessor Architecture  4Microprocessor Architecture  4
Microprocessor Architecture 4
 
Embedded System - Dtmf robot
Embedded System - Dtmf robotEmbedded System - Dtmf robot
Embedded System - Dtmf robot
 
Arm7 Interfacing examples
Arm7   Interfacing examples Arm7   Interfacing examples
Arm7 Interfacing examples
 
PIC-18 Microcontroller
PIC-18 MicrocontrollerPIC-18 Microcontroller
PIC-18 Microcontroller
 
PIC 16F877A by PARTHIBAN. S.
PIC 16F877A   by PARTHIBAN. S.PIC 16F877A   by PARTHIBAN. S.
PIC 16F877A by PARTHIBAN. S.
 
PIC microcontroller review
PIC microcontroller reviewPIC microcontroller review
PIC microcontroller review
 
8-bit PIC Microcontrollers
8-bit PIC Microcontrollers8-bit PIC Microcontrollers
8-bit PIC Microcontrollers
 
Introduction to Stellaris Family Microcontrollers
Introduction to Stellaris Family MicrocontrollersIntroduction to Stellaris Family Microcontrollers
Introduction to Stellaris Family Microcontrollers
 
AVR introduction
AVR introduction AVR introduction
AVR introduction
 

Ähnlich wie 8051

8051 microcontroller and it’s interface
8051 microcontroller and it’s interface8051 microcontroller and it’s interface
8051 microcontroller and it’s interfaceAbhishek Choksi
 
INTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERINTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERAnkita Jaiswal
 
Microprocessors-based systems (under graduate course) Lecture 9 of 9
Microprocessors-based systems (under graduate course) Lecture 9 of 9 Microprocessors-based systems (under graduate course) Lecture 9 of 9
Microprocessors-based systems (under graduate course) Lecture 9 of 9 Randa Elanwar
 
microcontroller 8051 17.07.2023.pdf
microcontroller 8051 17.07.2023.pdfmicrocontroller 8051 17.07.2023.pdf
microcontroller 8051 17.07.2023.pdf818Farida
 
8051 training an interactive tutorial
8051 training an interactive tutorial8051 training an interactive tutorial
8051 training an interactive tutorialFutura infotech
 
Electronic voting machine using mcu 89s52
Electronic voting machine using mcu 89s52Electronic voting machine using mcu 89s52
Electronic voting machine using mcu 89s52Saurav Kumar
 
Electronic voting machine presentation
Electronic voting machine  presentationElectronic voting machine  presentation
Electronic voting machine presentationRavikant Dhayal
 
Best-embedded-corporate-training-in-mumbai
Best-embedded-corporate-training-in-mumbaiBest-embedded-corporate-training-in-mumbai
Best-embedded-corporate-training-in-mumbaiUnmesh Baile
 
Presentation On: "Micro-controller 8051 & Embedded System"
Presentation On: "Micro-controller 8051 & Embedded System"Presentation On: "Micro-controller 8051 & Embedded System"
Presentation On: "Micro-controller 8051 & Embedded System"surabhii007
 
Gesture based vehicle movements control and alerting system docu
Gesture based vehicle movements control and alerting system docuGesture based vehicle movements control and alerting system docu
Gesture based vehicle movements control and alerting system docuVignan Munna
 
8051 Microcontroller Overview by Venkatrao Ramisetti
8051 Microcontroller Overview by Venkatrao Ramisetti 8051 Microcontroller Overview by Venkatrao Ramisetti
8051 Microcontroller Overview by Venkatrao Ramisetti VenkatraoRamisetti
 
With suitable diagram explain the working of 8255 a and inerrupts
With suitable diagram explain the working of 8255 a and inerruptsWith suitable diagram explain the working of 8255 a and inerrupts
With suitable diagram explain the working of 8255 a and inerruptsransherraj
 
Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)Vishalya Dulam
 
Embeded system by Mitesh Kumar
Embeded system by Mitesh KumarEmbeded system by Mitesh Kumar
Embeded system by Mitesh KumarMitesh Kumar
 
At 89s51
At 89s51At 89s51
At 89s51Mr Giap
 

Ähnlich wie 8051 (20)

8051 microcontroller and it’s interface
8051 microcontroller and it’s interface8051 microcontroller and it’s interface
8051 microcontroller and it’s interface
 
INTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERINTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLER
 
Uc1(vii sem)
Uc1(vii sem)Uc1(vii sem)
Uc1(vii sem)
 
Microprocessors-based systems (under graduate course) Lecture 9 of 9
Microprocessors-based systems (under graduate course) Lecture 9 of 9 Microprocessors-based systems (under graduate course) Lecture 9 of 9
Microprocessors-based systems (under graduate course) Lecture 9 of 9
 
microcontroller 8051 17.07.2023.pdf
microcontroller 8051 17.07.2023.pdfmicrocontroller 8051 17.07.2023.pdf
microcontroller 8051 17.07.2023.pdf
 
lesson01.ppt
lesson01.pptlesson01.ppt
lesson01.ppt
 
8051 training an interactive tutorial
8051 training an interactive tutorial8051 training an interactive tutorial
8051 training an interactive tutorial
 
Electronic voting machine using mcu 89s52
Electronic voting machine using mcu 89s52Electronic voting machine using mcu 89s52
Electronic voting machine using mcu 89s52
 
Electronic voting machine presentation
Electronic voting machine  presentationElectronic voting machine  presentation
Electronic voting machine presentation
 
Arm
ArmArm
Arm
 
Best-embedded-corporate-training-in-mumbai
Best-embedded-corporate-training-in-mumbaiBest-embedded-corporate-training-in-mumbai
Best-embedded-corporate-training-in-mumbai
 
Presentation On: "Micro-controller 8051 & Embedded System"
Presentation On: "Micro-controller 8051 & Embedded System"Presentation On: "Micro-controller 8051 & Embedded System"
Presentation On: "Micro-controller 8051 & Embedded System"
 
Introduction to PIC.pptx
Introduction to PIC.pptxIntroduction to PIC.pptx
Introduction to PIC.pptx
 
Gesture based vehicle movements control and alerting system docu
Gesture based vehicle movements control and alerting system docuGesture based vehicle movements control and alerting system docu
Gesture based vehicle movements control and alerting system docu
 
8051 Microcontroller Overview by Venkatrao Ramisetti
8051 Microcontroller Overview by Venkatrao Ramisetti 8051 Microcontroller Overview by Venkatrao Ramisetti
8051 Microcontroller Overview by Venkatrao Ramisetti
 
With suitable diagram explain the working of 8255 a and inerrupts
With suitable diagram explain the working of 8255 a and inerruptsWith suitable diagram explain the working of 8255 a and inerrupts
With suitable diagram explain the working of 8255 a and inerrupts
 
AT89C51 Data sheets
AT89C51 Data sheetsAT89C51 Data sheets
AT89C51 Data sheets
 
Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)
 
Embeded system by Mitesh Kumar
Embeded system by Mitesh KumarEmbeded system by Mitesh Kumar
Embeded system by Mitesh Kumar
 
At 89s51
At 89s51At 89s51
At 89s51
 

Mehr von Wave Digitech

54 sms based irrigation system
54 sms based irrigation system54 sms based irrigation system
54 sms based irrigation systemWave Digitech
 
54 a automatic irrigation system
54 a automatic irrigation system54 a automatic irrigation system
54 a automatic irrigation systemWave Digitech
 
Implementation of solar illumination system with three-stage charging and dim...
Implementation of solar illumination system with three-stage charging and dim...Implementation of solar illumination system with three-stage charging and dim...
Implementation of solar illumination system with three-stage charging and dim...Wave Digitech
 
Zl embd045 wireless telemedia system based on arm and web server
Zl embd045 wireless telemedia system based on arm and web serverZl embd045 wireless telemedia system based on arm and web server
Zl embd045 wireless telemedia system based on arm and web serverWave Digitech
 
Zl embd029 arm and rfid based event management monitoring system
Zl embd029 arm and rfid based event management monitoring systemZl embd029 arm and rfid based event management monitoring system
Zl embd029 arm and rfid based event management monitoring systemWave Digitech
 
Projects wavedigitech-2013
Projects wavedigitech-2013Projects wavedigitech-2013
Projects wavedigitech-2013Wave Digitech
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Wave Digitech
 
Difference bw android4.2 to android 4.3
Difference bw android4.2 to android 4.3Difference bw android4.2 to android 4.3
Difference bw android4.2 to android 4.3Wave Digitech
 
Unix Process management
Unix Process managementUnix Process management
Unix Process managementWave Digitech
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013Wave Digitech
 
Android debug bridge
Android debug bridgeAndroid debug bridge
Android debug bridgeWave Digitech
 
Useful Linux and Unix commands handbook
Useful Linux and Unix commands handbookUseful Linux and Unix commands handbook
Useful Linux and Unix commands handbookWave Digitech
 
Wavedigitech training-broucher-june2013
Wavedigitech training-broucher-june2013Wavedigitech training-broucher-june2013
Wavedigitech training-broucher-june2013Wave Digitech
 
Wavedigitech presentation-2013-v1
Wavedigitech presentation-2013-v1Wavedigitech presentation-2013-v1
Wavedigitech presentation-2013-v1Wave Digitech
 
Wavedigitech presentation-2013
Wavedigitech presentation-2013Wavedigitech presentation-2013
Wavedigitech presentation-2013Wave Digitech
 

Mehr von Wave Digitech (16)

54 sms based irrigation system
54 sms based irrigation system54 sms based irrigation system
54 sms based irrigation system
 
54 a automatic irrigation system
54 a automatic irrigation system54 a automatic irrigation system
54 a automatic irrigation system
 
Implementation of solar illumination system with three-stage charging and dim...
Implementation of solar illumination system with three-stage charging and dim...Implementation of solar illumination system with three-stage charging and dim...
Implementation of solar illumination system with three-stage charging and dim...
 
Zl embd045 wireless telemedia system based on arm and web server
Zl embd045 wireless telemedia system based on arm and web serverZl embd045 wireless telemedia system based on arm and web server
Zl embd045 wireless telemedia system based on arm and web server
 
Zl embd029 arm and rfid based event management monitoring system
Zl embd029 arm and rfid based event management monitoring systemZl embd029 arm and rfid based event management monitoring system
Zl embd029 arm and rfid based event management monitoring system
 
Projects wavedigitech-2013
Projects wavedigitech-2013Projects wavedigitech-2013
Projects wavedigitech-2013
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
 
Difference bw android4.2 to android 4.3
Difference bw android4.2 to android 4.3Difference bw android4.2 to android 4.3
Difference bw android4.2 to android 4.3
 
Unix Process management
Unix Process managementUnix Process management
Unix Process management
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
Android debug bridge
Android debug bridgeAndroid debug bridge
Android debug bridge
 
Useful Linux and Unix commands handbook
Useful Linux and Unix commands handbookUseful Linux and Unix commands handbook
Useful Linux and Unix commands handbook
 
Wavedigitech training-broucher-june2013
Wavedigitech training-broucher-june2013Wavedigitech training-broucher-june2013
Wavedigitech training-broucher-june2013
 
Wavedigitech presentation-2013-v1
Wavedigitech presentation-2013-v1Wavedigitech presentation-2013-v1
Wavedigitech presentation-2013-v1
 
Wavedigitech presentation-2013
Wavedigitech presentation-2013Wavedigitech presentation-2013
Wavedigitech presentation-2013
 
Wavedigitech gdb
Wavedigitech gdbWavedigitech gdb
Wavedigitech gdb
 

Kürzlich hochgeladen

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 

Kürzlich hochgeladen (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

8051

  • 1. © Copyright 2013, wavedigitech.com. Latest update: June 15, 2013, http://www.wavedigitech.com/ Call us on : 91-9632839173 E-Mail : info@wavedigitech.com E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 2. Presentation on 8051 and Addressing Modes By : Faizan Ali Khan Mail @ faizankhan031@gmail.com E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 3. MuP and MuC Microcontroller  It itself is a small computer  It has a CPU, RAM,ROM and other peripherals embedded on a single chip  It has I/O ports and Serial Com port  Has separate m/ry to store program and data  Designed to perform specific tasks. Ex – mouse, mobile….  Has its own inbuilt memory  Lower clock frequency and low performance simple CPU arch Microprocessor • • Its just a CPU of a computer It just has a CPU • None. Requires extra devices.(8155 for I/O, 8250 for Serial Com port) Same memory Unspecific tasks. Ex – gaming, websites…. Doesn’t have higher clock frequency and a high performance pipelined parallel CPU arch • • • • E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 4. Harvard and VON Neumann Harvard architecture Von Neumann architecture • • Has shared s/g s and memory • Not possible • Program can be easily modified by itself since it is stored in read-write memory Slower • • • • • program memory Has physically separate memory and s/g s for code and data memory Program memory and data memory can be accessed simultaneously It is impossible for program contents to be modified by the program itself Faster , as Program memory and data memory are accessed simultaneously Pipelining is possible Processor can complete an instruction in one cycle processor Data memory • • • Not possible Processor requires 2 clock cycles to complete an instruction processor Program memory And Data memory E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 5. 8051 Internal Block Diagram E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 6. Register Banks Register Banks with Addresses Selecting the Register Banks E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 7. Stack • The stack is a section of RAM used by the CPU to store information temporarily. This information could be data or an address. The CPU needs this storage area since there are only a limited number of registers • Stack is LIFO • Register used to access the stack is called a Stack Pointer (SP). Default value of a SP is 07H • PUSH and POP E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 8. Special Function Registers E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 9. SFRs • Accumulator, A – Used in logical and arithmetic operations • Register B – Used only in MUL and DIV • Program Counter – It points to the address of the next instruction to be executed. • Stack Pointer - Used to access the stack • Data Pointer – Address of higher bytes from external RAM E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 10. Program Status Word E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 11. PCON The Power Control SFR is used to control the 8051's power control modes SMOD is used to double the effective baud rate of the 8051's serial port. E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 12. Timer Control (TCON) Special Function Register . E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 13. BIT SYMBOL FUNCTION 7 TF1 Timer 1 Overflow flag. Set when timer rolls from all 1's to 0,i.e overflows. Cleared when processor vectors to execute interrupt service routine located at program address 001Bh. 6 TR1 Timer 1 run control bit. Set to 1 by program to enable timer to count; cleared to 0 by program to off timer. 5 TF0 Timer 0 Overflow flag. Set when timer rolls from all 1's to 0. Cleared when processor vectors to execute interrupt service routine located at program address 000Bh. 4 TR0 Timer 0 run control bit. Set to 1 by program to enable timer to count; cleared to 0 by program to halt timer. 3 IE1 External interrupt 1 Edge flag. Set to 1 when a high-to-low edge signal is received. Cleared when processor vectors to interrupt service routine. 2 IT1 External interrupt 1 signal type control bit. Set to 1 by program to enable external interrupt 1 to be triggered by a falling edge signal. Set to 0 by program to enable a low-level signal on external interrupt 1 to generate an interrupt. 1 IE0 External interrupt 0 Edge flag. Set to 1 when a high-to-low edge signal is received. Cleared when processor vectors to interrupt service routine. 0 IT0 External interrupt 0 signal type control bit. Set to 1 by program to enable external interrupt 1 to be triggered by a falling edge signal. Set to 0 by program to enable a low-level signal on external interrupt 0 to generate an interrupt. E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 14. Timer Mode Control (TMOD) Special Function Register . E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 15. BIT SYMBOL FUNCTION 7 Gate 6 C/T Set to 1 by program to act as a counter by counting pulses from external input pins 3.5. Cleared to zero by program to act as a timer by counting internal frequency. 5 M1 Timer/counter operating mode select bit 1. Set/cleared by program to select mode. 4 M0 Timer/counter operating mode select bit 0. Set/cleared by program to select mode. 3 GATE 2 C/T Set to 1 by program to make timer 0 act as a counter by counting pulses from external input pin 3.4. Cleared to zero by program to make timer act as a timer by counting internal frequency. 1 M1 Timer/counter operating mode select bit 1. Set/cleared by program to select mode. 0 M0 Timer/counter operating mode select bit 0. Set/cleared by program to select mode. To control start and stop of timer 1. If GATE=0, SETB TR1 starts timer and CLR TR1 stops timer To control start and stop of timer 0. If GATE=0, SETB TR1 starts timer and CLR TR1 stops timer E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 16. SCON Serial Control Register . E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 17. SMO .  SM1 SM2 REN TB8 RB8 TI SM0 SM1 Mode Baud Rate ----------------------0 0 0 f osc/12 0 1 1 variable 1 0 2 f osc/32 or f osc/64  SM2 Multiprocessor Mode Control Bit 1 = Multi-processor mode 0 = Normal mode  REN Receiver Enable Bit 1 = Receive Enable 0 = Receive Disabled  TB8 Transmit Bit 8 Enabled only for modes 2 and 3. Made 0 as its not used  RB8 Receive Bit 8 Used in modes 2 and 3. it gets a copy of Stop Bit when an 8 bit data is received  RI, TI Serial Interrupts RI is set to indicate receipt of a serial word and TI is set to indicate completion of a serial transmission and ready to transfer another byte. E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173 RI
  • 18. Interrupt Enable Register . E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 19. Interrupt Enable Register EA ---- ET2 ES ET1 EX1 ET0 EX0 • EA - disable all the interrupts. EA=0, no interrupt is acknowledged. EA=1, interrupt source is enabled or disabled • ----- for future use • ET2 – enables or disables timer 2 overflow interrupt • ES - enables or disables the serial port interrupt • ET1 - enables or disables timer 1 overflow interrupt • EX1 - enables or disables external interrupt 1 • ET0 - enables or disables timer 0 overflow interrupt • EX0 - enables or disables external interrupt 0 E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 20. Interrupt Priority Register . E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 21. Interrupt Priority Register . ---- • • • • • • • ---- PT2 PS PT1 PX1 PT0 PX0 ---- reserved PT2 – timer2 interrupt priority bit PS – serial port interrupt priority bit PT1 – timer1 interrupt priority bit PX1 – external interrupt 1 priority bit PT0 – timer0 interrupt priority bit PX0 – external interrupt 0 priority bit E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 23. Addressing modes • The 8051 instructions use eight addressing modes. These are: 1.Register 2. Direct 3. Indirect 4. Immediate 5. Relative 6. Absolute 7. Long 8. Indexed E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 24. Register Addressing Register Addressing • In this mode the data, which the instruction operates on, is in one of eight registers labeled R0 to R7 (Rn, in general). These registers are to be found in one of four register banks, only one of which can be active at any one time. The active bank may be selected by using bit 3 and bit 4 of the PSW (rs0 & rs1). On power-up or reset, the default register bank is bank 0. • For example, to logically OR the contents of accumulator A with that of register R3, the following instruction is used: ORL A, R3 • and the op-code is 01001011B. The upper five bits, 01001, indicate the instruction, and the lower three bits, 011, the register. E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 25. Direct Addressing • Instructions using direct addressing consists of two bytes: op-code and address. • Such instructions can access any on-chip variable or hardware register. Note that the most significant bit of the direct address determines which area in the on-chip is to be accessed. An address between 00H and 7FH accesses a location in the low-order on-chip RAM. • Any address with bit 7 = 1 refers to one of the special function registers. It is not necessary to remember the addresses of these special function registers. The assembler usually understands and converts the mnemonic of a special function register, e.g. P2 for Port 2, into the appropriate address. An example of a direct addressing instruction is • MOV P1, A which transfer the content of the accumulator to Port 1. The direct address of Port 1 (90H) is determined by the assembler and inserted as byte 2 of the instruction. The source of the data, the accumulator, is specified implicitly in the op-code. E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 26. Indirect Addressing • In this mode of addressing the instruction performs an operation on the data whose address is contained in register R0 or R1. Instructions using indirect addressing are single byte instructions. In 8051 assembly language the symbol @ before R0 or R1 denotes indirect addressing. An example of an indirect addressing instruction is SUBB A, @R0 • This instruction performs the operation: (A)  (A) – (C) – ((R0)). E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 27. Immediate Addressing • In an instruction that uses immediate addressing, the operand of the instruction is given as the byte that follows the op-code. The operand may be a numeric constant, a symbolic variable, or an arithmetic expression using constants, symbols, and operators. • In assembly language we use the symbol # before an operand to denote immediate addressing. An example of an instruction using immediate addressing is ANL A, #77 which performs the operation: (A)  (A) · #77. E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 28. Relative Addressing • • • Sometimes this is also called program counter relative addressing. This addressing mode is used only with certain jump instructions. A relative address (or offset) is an 8-bit signed value, which is added to the program counter to form the address of the next instruction executed. The range for such a jump instruction is –128 to +127 locations. Although the range is rather limited, relative addressing does offers the advantage of providing position-independent code (since absolute addresses are not used). For example, the instruction JZ rel performs the following operations: (PC) ¬ (PC) + 2 IF (A) = 0 THEN (PC) ¬ (PC) + rel ELSE continue The branch destination is computed by adding the signed relative-displacement in the second instruction byte to the PC, after incrementing the PC twice. E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 29. Absolute Addressing • There are only two instructions that use this addressing: ACALL (absolute call) and AJMP (absolute jump). • These instructions perform branching within the current 2K page of program memory. The branch address is obtained by successively concatenating the five high-order bits of the program counter, bits 5 – 7 of the op-code, and the second byte of the instruction. • The diagram illustrate how this is done: E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 30. Absolute Addressing E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 31. Long Addressing • Only two instructions use this addressing mode. These instructions are LCALL addr16 and LJMP addr16. • Both of these are three byte instructions with the op-code being the first byte and the following two bytes are the address high-byte and address low-byte respectively. • These instructions enable the program to branch to anywhere within the full 64 K-bytes of program memory address space. E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 32. Indexed Addressing • In this mode the 16-bit address in a base register is added to a positive offset to form an effective address for the jump indirect instruction JMP @A+DPTR, and the two move code byte instructions MOVC A,@A+DPTR and MOVC A,@A+PC. • The base register in the jump instruction is the data pointer and the positive offset is held in the accumulator. For the move instructions the base register can either be the data pointer or the program counter, and again the positive offset is in the accumulator. The operations of these three instructions are as follows: JMP @A+DPTR (PC) (A) +(DPTR) MOVC A,@A+DPTR (A)  ((A) + (DPTR)) MOVC A,@A+PC (PC)  (PC) + 1 (A)  ((A) + (PC)) E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173
  • 33. Thank You © Copyright 2013, wavedigitech.com. Latest update: Jan 30, 2013, http://www.wavedigitech.com/ Call us on : 91-9632839173 E-Mail : info@wavedigitech.com E-mail: info@wavedigitech.com; http://www.wavedigitech.com Phone : 91-9632839173