3
Most read
4
Most read
5
Most read
8051- Microcontroller Experiments

Exp No: 17

AIM:

        To perform 8 bit arithmetic operations using 8051 microcontroller.
               A) Addition
               B) Subtraction
               C) Multiplication
               D) Division


ADDITION

               MOV R0,#00
               MOV A,#DATA1
               ADD A, #DATA2
               JNC LABEL
               INC R0
LABEL:         MOV DPTR,#4150
               MOVX @DPTR,A
               INC DPTR
               MOV A,R0
               MOVX @DPTR,A
HERE:          SJMP HERE




SUBTRACTION


               CLR C
               MOV B,#00
               MOV A,#DATA1
               SUBB A,#DATA2
               JNC LABEL
               CPL A
               INC A
               INC B
LABEL:         MOV DPTR,#4150
               MOVX @DPTR, A
               INC DPTR
               MOV A,B
               MOVX @DPTR,A
HERE:          SJMP HERE
MULTIPLICATION

           MOV A, #DATA1
           MOV B, A
           MOV A, #DATA2
           MUL AB
           MOV DPTR, #4150
           MOVX @DPTR, A
           INC DPTR
           MOV A, B
           MOVX @DPTR, A
LOOP:      SJMP LOOP


DIVISION


           MOV A, #DATA1
           MOV B,A
           MOV A, #DATA2
           DIV AB
           MOV DPTR, #4150
           MOVX @DPTR, A
           INC DPTR
           MOV A, B
           MOV @DPTR, A
LOOP       SJMP LOOP
EXP NO: 18) INTERFACING OF DAC (Digital to Analog Converter)FOR
GENERATIG WAVEFORMS


18 A) SQUARE WAVE GENERATION

AIM.

        To generate square wave using DAC.



PROGRAM



                            START            MOV DPTR,#FFC8
                                             MOV A,#00
                                             MOVX @DPTR,A
                                             LCALL DELAY
                                             MOV    A,#FF
                                             MOVX @DPTR,A
                                             LCALL DELAY
                                             LJMP   START
                            DELAY            MOV    R1, #05
                            LOOP             MOV R2, #FF
                            HERE             DJNZ   R2, HERE
                                             DJNZ   R1, LOOP
                                             RET
                                             .



18 B) Generation of sawtooth wave

Aim

       To create a sawtooth wave using DAC

Program

                                             MOV DPTR, #FFC8
                                             MOV A,#00
                            LOOP:            MOVX @DPTR,A
                                             INC A
                                             SJMP LOOP
18 C) Generation of triangular wave


AIM

      To generate triangular waveform using DAC.


Program

                                        MOV DPTR, #FFC8
                           START        MOV A, #00
                           LOOP1        MOV @DPTR,A
                                        INC A
                                        JNZ LOOP1
                                        MOV A, #FF
                           LOOP2        MOVX @DPTR,A
                                        DEC A
                                        JNZ LOOP2
                                        LJMP START
Exp No: 19 ) Stepper Motor Interfacing



Aim


To interface the stepper motor with 8051 and run it in clockwise and anticlockwise
directions.


Program


Start: MOV          DPTR,#4500
       MOV          R0,#04H
JO : MOVX           A,@DPTR
       PUSH         DPH
       PUSH         DPL
       MOV          DPTR,#FFC0
       MOV          R2,#04
       MOV          R1,#0F
DLY1: MOV           R3,#0F
DLY: DJNZ           R3,DLY
       DJNZ         R1,DLY1
       DJNZ         R2,DLY1
       MOVX         @DPTR,A
       POP          DPL
       POP          DPH
       INC          DPTR
       DJNZ         R0,JO
       SJMP         START

Address For Clockwise For
        Rotation      Anticlockwise
                      Rotation
4500    08            08

4501      01             02

4502      04             04

4503      02             01
Clock wise                      Anticlock wise
Step A1      A2   B1   B2       Step A1 A2       B1   B2
1     1      0    0    0    8   1     1    0     0    0    8
2     0      0    0    1    1   2     0    0     1    0    2
3     0      1    0    0    4   3     0    1     0    0    4
4     0      0    1    0    2   4     0    0     0    1    1

More Related Content

PPTX
discrete time signals and systems
PPT
8051 ch9-950217
PPTX
Types of Sampling in Analog Communication
PPT
Digital Communication: Channel Coding
PPT
Multipliers in VLSI
PPT
Matched filter
PPTX
Verilog Test Bench
PPTX
I/O port programming in 8051
discrete time signals and systems
8051 ch9-950217
Types of Sampling in Analog Communication
Digital Communication: Channel Coding
Multipliers in VLSI
Matched filter
Verilog Test Bench
I/O port programming in 8051

What's hot (20)

PPTX
Pulse Modulation ppt
PDF
Telecommunication switching system
PPTX
PDF
DAC Interfacing with 8051.pdf
PDF
Difference b/w 8085 & 8086
PPTX
Peripherals and interfacing
PPTX
Z Transform
PPT
PULSE CODE MODULATION (PCM)
PDF
Mealy state machine
PPTX
Subroutine in 8051 microcontroller
PPT
Z transfrm ppt
PPTX
CMOS LOGIC STRUCTURES
PDF
Minimum and Maximum Modes of microprocessor 8086
PPTX
FM demodulation using PLL
PPTX
Sample and hold circuit
PPTX
Isolator & Circulator -FT.pptx
PPTX
Serial Communication in 8051
PPT
Pin diagram of 8085
PDF
DSP_2018_FOEHU - Lec 03 - Discrete-Time Signals and Systems
PDF
Automated Traffic Light control using 8051 microcontroller
Pulse Modulation ppt
Telecommunication switching system
DAC Interfacing with 8051.pdf
Difference b/w 8085 & 8086
Peripherals and interfacing
Z Transform
PULSE CODE MODULATION (PCM)
Mealy state machine
Subroutine in 8051 microcontroller
Z transfrm ppt
CMOS LOGIC STRUCTURES
Minimum and Maximum Modes of microprocessor 8086
FM demodulation using PLL
Sample and hold circuit
Isolator & Circulator -FT.pptx
Serial Communication in 8051
Pin diagram of 8085
DSP_2018_FOEHU - Lec 03 - Discrete-Time Signals and Systems
Automated Traffic Light control using 8051 microcontroller
Ad

Viewers also liked (7)

PDF
Solution manual 8051 microcontroller by mazidi
PPTX
8051 Assembly Language Programming
PDF
Homework 2 sol
PPTX
Interfacing Stepper motor with 8051
PDF
Question paper with solution the 8051 microcontroller based embedded systems...
DOC
8051 Microcontroller Notes
Solution manual 8051 microcontroller by mazidi
8051 Assembly Language Programming
Homework 2 sol
Interfacing Stepper motor with 8051
Question paper with solution the 8051 microcontroller based embedded systems...
8051 Microcontroller Notes
Ad

Similar to 8051 experiments1 (20)

DOCX
PPT
Microcontroller 8051 soft
DOCX
Maicrocontroller lab basic experiments
DOCX
Maicrocontroller lab basic experiments
PDF
Maicrocontroller lab basic experiments
PDF
Micro Controller lab basic experiments (1)
PPT
Microcontroller 8051- soft.ppt
DOCX
Micro p test
KEY
CoffeeScript for the Rubyist
KEY
CoffeeScript for the Rubyist
PPTX
PPI Modes.pptx
PPT
Embedded Systems Training & Live Projects @Technogroovy Systems India Pvt Ltd
PPT
Buy Embedded Systems Projects Online,Buy B tech Projects Online
PPT
Addressing mode and instruction set using 8051
PDF
Automatic light project
PPTX
Microprocessor Week 8: Subroutine
PPT
PPTX
Applications of microcontroller(8051)
PPTX
UNIT V - INTERFACING MICROCONTROLLER (1).pptx
PPT
Programs using Microcontrollers.ppt
Microcontroller 8051 soft
Maicrocontroller lab basic experiments
Maicrocontroller lab basic experiments
Maicrocontroller lab basic experiments
Micro Controller lab basic experiments (1)
Microcontroller 8051- soft.ppt
Micro p test
CoffeeScript for the Rubyist
CoffeeScript for the Rubyist
PPI Modes.pptx
Embedded Systems Training & Live Projects @Technogroovy Systems India Pvt Ltd
Buy Embedded Systems Projects Online,Buy B tech Projects Online
Addressing mode and instruction set using 8051
Automatic light project
Microprocessor Week 8: Subroutine
Applications of microcontroller(8051)
UNIT V - INTERFACING MICROCONTROLLER (1).pptx
Programs using Microcontrollers.ppt

More from tt_aljobory (20)

PPT
Lecture12
PPT
Lecture11
PPT
Lecture10
PPT
Lecture9
PPT
Lecture7
PPT
Lecture8
PPT
Lecture6
PPT
Lecture5
PPT
Lecture4
PPT
Lecture3
PPT
Lecture2
PPT
Lecture1
PDF
Lecture 1
PDF
Good example on ga
PPT
PPT
PPT
PDF
Above theclouds
PDF
Inet prog
PDF
Lecture12
Lecture11
Lecture10
Lecture9
Lecture7
Lecture8
Lecture6
Lecture5
Lecture4
Lecture3
Lecture2
Lecture1
Lecture 1
Good example on ga
Above theclouds
Inet prog

Recently uploaded (20)

PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Two-dimensional Klein-Gordon and Sine-Gordon numerical solutions based on dee...
PPTX
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
Getting started with AI Agents and Multi-Agent Systems
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
CloudStack 4.21: First Look Webinar slides
PDF
STKI Israel Market Study 2025 version august
PDF
Five Habits of High-Impact Board Members
PPTX
Configure Apache Mutual Authentication
PDF
UiPath Agentic Automation session 1: RPA to Agents
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PPTX
Modernising the Digital Integration Hub
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
DOCX
search engine optimization ppt fir known well about this
PPT
What is a Computer? Input Devices /output devices
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
Abstractive summarization using multilingual text-to-text transfer transforme...
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
A comparative study of natural language inference in Swahili using monolingua...
Two-dimensional Klein-Gordon and Sine-Gordon numerical solutions based on dee...
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
NewMind AI Weekly Chronicles – August ’25 Week III
Getting started with AI Agents and Multi-Agent Systems
Developing a website for English-speaking practice to English as a foreign la...
CloudStack 4.21: First Look Webinar slides
STKI Israel Market Study 2025 version august
Five Habits of High-Impact Board Members
Configure Apache Mutual Authentication
UiPath Agentic Automation session 1: RPA to Agents
1 - Historical Antecedents, Social Consideration.pdf
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
Modernising the Digital Integration Hub
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
search engine optimization ppt fir known well about this
What is a Computer? Input Devices /output devices
Module 1.ppt Iot fundamentals and Architecture
Abstractive summarization using multilingual text-to-text transfer transforme...

8051 experiments1

  • 1. 8051- Microcontroller Experiments Exp No: 17 AIM: To perform 8 bit arithmetic operations using 8051 microcontroller. A) Addition B) Subtraction C) Multiplication D) Division ADDITION MOV R0,#00 MOV A,#DATA1 ADD A, #DATA2 JNC LABEL INC R0 LABEL: MOV DPTR,#4150 MOVX @DPTR,A INC DPTR MOV A,R0 MOVX @DPTR,A HERE: SJMP HERE SUBTRACTION CLR C MOV B,#00 MOV A,#DATA1 SUBB A,#DATA2 JNC LABEL CPL A INC A INC B LABEL: MOV DPTR,#4150 MOVX @DPTR, A INC DPTR MOV A,B MOVX @DPTR,A HERE: SJMP HERE
  • 2. MULTIPLICATION MOV A, #DATA1 MOV B, A MOV A, #DATA2 MUL AB MOV DPTR, #4150 MOVX @DPTR, A INC DPTR MOV A, B MOVX @DPTR, A LOOP: SJMP LOOP DIVISION MOV A, #DATA1 MOV B,A MOV A, #DATA2 DIV AB MOV DPTR, #4150 MOVX @DPTR, A INC DPTR MOV A, B MOV @DPTR, A LOOP SJMP LOOP
  • 3. EXP NO: 18) INTERFACING OF DAC (Digital to Analog Converter)FOR GENERATIG WAVEFORMS 18 A) SQUARE WAVE GENERATION AIM. To generate square wave using DAC. PROGRAM START MOV DPTR,#FFC8 MOV A,#00 MOVX @DPTR,A LCALL DELAY MOV A,#FF MOVX @DPTR,A LCALL DELAY LJMP START DELAY MOV R1, #05 LOOP MOV R2, #FF HERE DJNZ R2, HERE DJNZ R1, LOOP RET . 18 B) Generation of sawtooth wave Aim To create a sawtooth wave using DAC Program MOV DPTR, #FFC8 MOV A,#00 LOOP: MOVX @DPTR,A INC A SJMP LOOP
  • 4. 18 C) Generation of triangular wave AIM To generate triangular waveform using DAC. Program MOV DPTR, #FFC8 START MOV A, #00 LOOP1 MOV @DPTR,A INC A JNZ LOOP1 MOV A, #FF LOOP2 MOVX @DPTR,A DEC A JNZ LOOP2 LJMP START
  • 5. Exp No: 19 ) Stepper Motor Interfacing Aim To interface the stepper motor with 8051 and run it in clockwise and anticlockwise directions. Program Start: MOV DPTR,#4500 MOV R0,#04H JO : MOVX A,@DPTR PUSH DPH PUSH DPL MOV DPTR,#FFC0 MOV R2,#04 MOV R1,#0F DLY1: MOV R3,#0F DLY: DJNZ R3,DLY DJNZ R1,DLY1 DJNZ R2,DLY1 MOVX @DPTR,A POP DPL POP DPH INC DPTR DJNZ R0,JO SJMP START Address For Clockwise For Rotation Anticlockwise Rotation 4500 08 08 4501 01 02 4502 04 04 4503 02 01
  • 6. Clock wise Anticlock wise Step A1 A2 B1 B2 Step A1 A2 B1 B2 1 1 0 0 0 8 1 1 0 0 0 8 2 0 0 0 1 1 2 0 0 1 0 2 3 0 1 0 0 4 3 0 1 0 0 4 4 0 0 1 0 2 4 0 0 0 1 1