free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
This thread is now closed
Author Post
priya123
Wed Apr 16 2008, 05:07PM
 User Offline
Registered Member #7113
Joined: Wed Apr 09 2008, 02:39AM

Posts: 48
Thanked 0 times in 0 posts
This is the code which i had written for my project,please correct it so that it works properly,please help,its too urgent.actually i want to interface ADC and microcontroller and display data through the ports of microcontroller.Suppose providing a input voltage of 2v microcontroller will display say,033h through its ports.Actually upon providing a voltage of 2v ADC is reading 033h and this data is fed to microcontroller and displayed.
setbp2.5
setb p2.6
intr bit p2.7
setb intr
adc_port equ p1
adc_val equ 30h
back: clr wr
setb wr
acall conv
read: clr rd
mov a,adc_port
mov adc_val,a
setb rd
cjne r3,#00h,check1
acall data_display1
check1: cjne r3,#01h,check2
acall data_display2
check2: cjne r3,#02h,check3
acall data_display3
check3: cjne r3,#03h,check4
acall data_display4
check4: cjne r3,#04h,check5
acall data_display5
check5: cjne r3,#05h,over
over: acall data_display6
smp back
data_display1: mov a,#0h
conversion: mov b,#10h
div ab
mov r7,b
mov b,#10h
div ab
mov r6,b
mov r5,a
mov p3,r7
acall delay
mov p3,r6
acall delay
mov p1,r5
acall delay
data_display2: mov a,#033h
mov b,#10h
div ab
mov r7,b
mov b,#10h
div ab
mov r6,b
mov r5,a
mov p3,r7
acall delay
mov p3,r6
acall delay
mov p1,r5
acall delay
data_display3: mov a,#067h
mov b,#10h
div ab
mov r7,b
mov b,#10
div ab
mov r6,b
mov r5,a
mov p3,r7
acall delay
mov p3,r6
acall delay
mov p1,r5
acall delay
data_display4: mov a,#097h
mov b,#10h
div ab
mov r7,b
mov b,#10h
div ab
mov r6,b
mov r5,a
mov p3,r7
acall delay
mov p3,r6
acall delay
mov p1,r5
acall delay
data_display5: mov a,#099h
mov b,#10h
div ab
mov r7,b
mov b,#10h
div ab
mov r6,b
mov r5,a
mov p3,r7
acall delay
mov p3,r6
acall delay
mov p1,r5
acall delay
data_display6: mov a,#0ffh
mov b,#10h
div ab
mov r7,b
mov b,#10h
div ab
mov r6,b
mov r5,a
mov p3,r7
acall delay
mov p3,r6
acall delay
mov p1,r5
acall delay
delay: mov r4,#200
here: djnz r4,here
ret
end






[ Edited Wed Apr 16 2008, 06:34PM ]

p
Back to top


Ajay
Thu Apr 17 2008, 06:29AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3745
Thanked 695 times in 654 posts
this thread is going to be locked.. you already have about 5 thread running.. Please use them.
Thanks!

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems