8051 experiments1
Upcoming SlideShare
Loading in...5
×
 

8051 experiments1

on

  • 5,606 views

8051 experiments1

8051 experiments1

Statistics

Views

Total Views
5,606
Views on SlideShare
5,606
Embed Views
0

Actions

Likes
0
Downloads
251
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

8051 experiments1 8051 experiments1 Document Transcript

  • 8051- Microcontroller ExperimentsExp No: 17AIM: To perform 8 bit arithmetic operations using 8051 microcontroller. A) Addition B) Subtraction C) Multiplication D) DivisionADDITION MOV R0,#00 MOV A,#DATA1 ADD A, #DATA2 JNC LABEL INC R0LABEL: MOV DPTR,#4150 MOVX @DPTR,A INC DPTR MOV A,R0 MOVX @DPTR,AHERE: SJMP HERESUBTRACTION CLR C MOV B,#00 MOV A,#DATA1 SUBB A,#DATA2 JNC LABEL CPL A INC A INC BLABEL: MOV DPTR,#4150 MOVX @DPTR, A INC DPTR MOV A,B MOVX @DPTR,AHERE: 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, ALOOP: SJMP LOOPDIVISION MOV A, #DATA1 MOV B,A MOV A, #DATA2 DIV AB MOV DPTR, #4150 MOVX @DPTR, A INC DPTR MOV A, B MOV @DPTR, ALOOP SJMP LOOP
  • EXP NO: 18) INTERFACING OF DAC (Digital to Analog Converter)FORGENERATIG WAVEFORMS18 A) SQUARE WAVE GENERATIONAIM. 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 waveAim To create a sawtooth wave using DACProgram MOV DPTR, #FFC8 MOV A,#00 LOOP: MOVX @DPTR,A INC A SJMP LOOP
  • 18 C) Generation of triangular waveAIM 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 InterfacingAimTo interface the stepper motor with 8051 and run it in clockwise and anticlockwisedirections.ProgramStart: MOV DPTR,#4500 MOV R0,#04HJO : MOVX A,@DPTR PUSH DPH PUSH DPL MOV DPTR,#FFC0 MOV R2,#04 MOV R1,#0FDLY1: MOV R3,#0FDLY: DJNZ R3,DLY DJNZ R1,DLY1 DJNZ R2,DLY1 MOVX @DPTR,A POP DPL POP DPH INC DPTR DJNZ R0,JO SJMP STARTAddress For Clockwise For Rotation Anticlockwise Rotation4500 08 084501 01 024502 04 044503 02 01
  • Clock wise Anticlock wiseStep A1 A2 B1 B2 Step A1 A2 B1 B21 1 0 0 0 8 1 1 0 0 0 82 0 0 0 1 1 2 0 0 1 0 23 0 1 0 0 4 3 0 1 0 0 44 0 0 1 0 2 4 0 0 0 1 1