Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

ultrasonic distance finder with 8051

Status
Not open for further replies.

mhe

Junior Member level 1
Joined
Aug 21, 2005
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,373
ultrasonic 8051

hi ,i will create a project distance finder with 89c51 and ultrasonic sensor.i use assembly language.but i have any problem.i create a40khz freq and send it then i start timer and with first trigger in reciver i stop timer.i obtain 2 value in TL1,TH1.well i want conver 2 byte
TH1,TL1 to a word and then (word/2) * 340(speed of sound) and show in seven segment.i write afew program but i cant commpleate calculate and show TH1,TL1. please commpleate it or help me.plzzzzzzzzzzzz

ORG 0H
MOV P0,#0FFH
MOV P1,#0
LJMP MAIN

ORG 0013H
SETB TR1
HERE: JNB INT1,HERE
CLR TR1
MOV R0,TL1
MOV R1,TH1
LJMP CAL



;====================FREQ=========
FREQ: SETB TR0
H: JNB TF0,H
CLR TR0
CLR TF0
CPL P2.0
SJMP FREQ





;============MAIN========
ORG 30H
MAIN: MOV IE,#10000100B
MOV TMOD,#12H
MOV TH0,#-12
MOV TL1,#0
MOV TH1,#0
F: JB P0.0,F
SJMP FREQ
;===============CALCULATE=======
.
.
.
 

mhe

Junior Member level 1
Joined
Aug 21, 2005
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,373
distance+avr+basic+ultrasonic

any idea

Added after 53 minutes:

i want just, just ,just 8051 project..:cry:
 

roozbeh_s

Newbie level 5
Joined
Jan 7, 2007
Messages
8
Helped
6
Reputation
12
Reaction score
4
Trophy points
1,283
Activity points
1,318
ultrasonic+8051

HI
I coulden't understand your problem.
is it in 16 bit multiplyand division calculations?
 

segmex

Advanced Member level 4
Joined
Oct 25, 2006
Messages
114
Helped
7
Reputation
14
Reaction score
6
Trophy points
1,298
Activity points
1,828
distance measurement 8051

avr is better try it too!
 

hid

Newbie level 6
Joined
Feb 22, 2007
Messages
12
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,283
Activity points
1,378
‌ultrasonic 8051

I think (word/2) * 340(speed of sound) is wrong unless you have seconds in TH1,TL1, and I don't think you do.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top