Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 27

WELCOME

LEARN THE ARCHITECTURE AND


INSTRUCTION SET OF THE 8051
MICROCONTROLLER AND PROGRAM
SOME BASIC EXAMPLES USING ASM
ASSEMBLY LANGUAGE

Presented by group 1

Lecturer: PhD. Pham Van Khoa


Meet The Group

Doan Dang Khoa Le Van Thinh Nguyen Tan Duy


20119187 20119160 19119027

Tran Anh Huy Le Van Sy


20142215 20119156
1 Introduction

Table Of 2 Control single blink led by

instruction on 8051

Contents 3 Design a product counter circuit using

8051 microcontroller

4 Design a traffic light circuit using 8051

microcontroller
Chapter 1
Introduction

Introduction Specifications Memory Organization Assembly Instructions


Introduce
A microcontroller is a computer

integrated on a chip, commonly used for

controlling electronic devices. It consists

of a high-performance, cost-effective

processor combined with peripheral

devices such as memory, input/output

modules, and pulse width modulation

(PWM) modules.
Characteristics
• Compact instruction set, focused on controlling input and output operations.

• Can operate with 1-bit data (suitable for controlling 2 states such as On/Off, zero and one, chip

buzzer...).
• Software is permanently loaded into ROM, serving a specific purpose.

• Small size, minimal cost.

• Limited speed, typically in the range of MHz.


Technical specifications:

• 8-bit ALU, 8-bit registers.

• 8-bit data bus.

• 16-bit address bus.

• SRAM data memory of 128 bytes.

• ROM program memory of 4 KB.

• 32 bidirectional input/output pins.

• UART serial communication interface.

• Two 16-bit timer/counters.

• Two external interrupts.


Memory Organization
• Memory is divided into two spaces of

program memory and data memory


⚬ Program memory:

■ Program memory is read-only

memory, where the

microcontroller program is
stored.
■ The first address of the

program memory is 0000H,


which is the reset address of

the microcontroller control.


Memory Organization
⚬ Data Memory
■ RAM has addresses from 00H

to 0FFFH
■ The 8051 internal RAM is

split between register banks


(00H-1FH), bit-addressable

RAM (20H-2FH), general-


purpose RAM (30H-7FH), and
special function registers

(80H-FFH). ).
Memory Organization
• SFR:
⚬ Main register A

⚬ Sub register B
⚬ Port registers P0 - P3
⚬ Program Status Register PSW

⚬ Timer/counter register

⚬ Interrupt register

Internal memory
Assembly Code
• Data movement instructions: MOV, MOVC, MOVX, XCH, XCHD.
• Bit handling instructions:
⚬ CLR (clear bit)

⚬ SETB (set bit instruction)


⚬ CPL (invert bit instruction)
⚬ b. Compare and jump
• Branching instructions
■ CJNE
⚬ a. Jump command
⚬ c. Fall and jump
■ AJMP (jump to absolute address)
■ DJNZ (fall and jump if other than 0)
■ JMP (indirect jump)
⚬ d. Subroutine control instruction
■ JNZ (jumps if bar content contains # 0)
■ ACALL (call to absolute address)
■ JZ (jumps if bar content is zero)
■ LCALL (call subroutine)
■ SJMP (short jump)
■ RET (return to subroutine)
■ LJMP (long jump)
■ RETI (return from interrupt restorer)
Assembly Code
Chapter 2
Control single blink led by
instruction on 8051
Analysis
Flow Chart
Assembly Code
FLowchart
Delay
Function
Analysis Assembly Code
Analysis Assembly Code
Chapter 3
Design a product counter circuit using
8051 microcontroller
Analysis
Flow Chart
Assembly Code
Chapter 4
Design a traffic light circuit using
8051 microcontroller
Flow Chart Analysis
Assembly Code
Conclusion
In conclusion, the 8051 microcontroller architecture has proven to be a reliable and

versatile platform for embedded systems design.


- Its simple architecture and instruction set make it easy to program and integrate

into various applications.


- The block diagram shows the various components of the 8051 microcontroller,

including the CPU, memory, and input/output ports. The memory organization is

also crucial in programming and storing data.


THANK YOU

You might also like