Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/27/05 10:21
Modified:
  06/27/05 10:30

Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#96003 - Ultrasonic Detection Code!
Responding to: ???'s previous message
Dear Pradono
Because of you didn't post full parts of your code
We can't say you what is exact problem
I select some part of my program which i write previously for your need
Try it and let me know the result
Good Luck
Mehdi


;This program is for ultrasonic range meter(without temperature effect calculating)
;at first mcu sends one 40khz pulse,
;if reflected pulse is received less than 70 msec
;means that distance is short
;but if the timer is overflowed,then mcu sends ten 70khz pulse and T_Flag is set
;if reflected pulse is received less than 70 msec
;means that distance is medium
;but if the timer is overflowed,then mcu sends twenty 70khz pulse and T_Flag is set
;again,if reflected pulse is received less than 70 msec
;means that distance is long
;but if the timer is overflowed,mcu must send this message to display and T_Flag is set
;distance is undetermined (you must add this part of code to your program in START_1:)

T_FLAG                EQU 00H
REC                   EQU P2.3
REC_START             EQU P2.4
TRANS                 EQU P2.5
PULSE_POWER           EQU 40H

CLR T_FLAG

;...
;...
;...

START_OF_MEASURING:
LCALL CHANGE_POWER              ;CHANGE NUMBER OF 40 KHZ PULSES IN TRANSMITTER
MOV TMOD,#00010000B
MOV TH1,#0
MOV TL1,#0
SETB TR1
LCALL PULSE_GEN                 ;SEND 40 KHZ PULSE ACCORDING TO PULSE_POWER VALUE
SETB REC
SAS10:                          ;PREVENTING FROM FATAL ERROR
JB REC,SAS10                    ;FIRST EFFECT OF TRANSMITTER IN RECIEVER
SAS12:
JB TF1,START_1
JNB REC,SAS12                   ;CORRECT REFLECTION IS OBTAINED
CLR TR1                         ;SAVE TIMER VALUE
CLR T_FLAG                      ;POWER OF PULSE IS SUITABLE
                                ;NOW YOU CAN FIND THE DISTANCE EASILY
RET

START_1:
SJMP START_OF_MEASURING         ;DISTANCE IS UNDETERMINED(TIMER IS OVERFLOWED)
                                ;TRY AGAIN


CHANGE_POWER:
JNB T_FLAG,NEXT_3
MOV A,PULSE_POWER
CJNE A,#1,NEXT_1
MOV PULSE_POWER,#10
RET

NEXT_1:
CJNE A,#10,NEXT_2
MOV PULSE_POWER,#20
RET

NEXT_2:
CJNE A,#20,NEXT_3
MOV PULSE_POWER,#1
NEXT_3:
RET

PULSE_GEN:
MOV R7,PULSE_POWER
HEY:
SETB TRANS
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
CLR TRANS
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
DJNZ R7,HEY
SETB TRANS
RET


List of 187 messages in thread
TopicAuthorDate
Ultrasonic Signal Processing            01/01/70 00:00      
   Time dependant gain            01/01/70 00:00      
      Further attenuation...            01/01/70 00:00      
   Signal recovery.            01/01/70 00:00      
      AGC?            01/01/70 00:00      
   AGC as Steve said//            01/01/70 00:00      
   My Algorithm was:            01/01/70 00:00      
      My Algorithm was:            01/01/70 00:00      
   Ultrasonic Ranging            01/01/70 00:00      
   Matched filter on the rescue            01/01/70 00:00      
   matched filters            01/01/70 00:00      
      Phase locked amplifier            01/01/70 00:00      
         Its a different thing            01/01/70 00:00      
            Ah            01/01/70 00:00      
               Thats the one....            01/01/70 00:00      
                  Clever woman            01/01/70 00:00      
      Just an idea            01/01/70 00:00      
   The scope plot tells it all!            01/01/70 00:00      
   Largest signal            01/01/70 00:00      
      'Greatest' echo is the wrong criterion!            01/01/70 00:00      
                     01/01/70 00:00      
         somehow I remember...            01/01/70 00:00      
            No, no...            01/01/70 00:00      
               Oops~ forgot...            01/01/70 00:00      
   the product            01/01/70 00:00      
      Power of transmission pulse            01/01/70 00:00      
   Preamp circuit Here            01/01/70 00:00      
      Add caps to remove base line noise            01/01/70 00:00      
      Another potential problem...            01/01/70 00:00      
   Problem with ADC?            01/01/70 00:00      
   possible solution to the ADC problem            01/01/70 00:00      
      Ok~            01/01/70 00:00      
   Debug Result            01/01/70 00:00      
      ADC Sampling and code debugging            01/01/70 00:00      
         sampling time            01/01/70 00:00      
   Adc for Ultrasonic?            01/01/70 00:00      
   Next, comes to "average"            01/01/70 00:00      
      Why use the adc?            01/01/70 00:00      
         Forgot to tell...            01/01/70 00:00      
   Circle in RED            01/01/70 00:00      
   Asking for help again - Filter            01/01/70 00:00      
      Notch            01/01/70 00:00      
         I don't know            01/01/70 00:00      
            DSP            01/01/70 00:00      
               Nah            01/01/70 00:00      
                  for the sake of learning            01/01/70 00:00      
                     so            01/01/70 00:00      
                        I agree            01/01/70 00:00      
         Amplitude            01/01/70 00:00      
            Op amps            01/01/70 00:00      
               100pF            01/01/70 00:00      
                  bypass ??            01/01/70 00:00      
                     Yes            01/01/70 00:00      
                        No sort of bypass            01/01/70 00:00      
                           BTE054 BTE054USS2            01/01/70 00:00      
                              Better noise control            01/01/70 00:00      
                              re: BTE054            01/01/70 00:00      
                                 Replace LMV6032 with LM324            01/01/70 00:00      
                                    re:low sensitivity            01/01/70 00:00      
                              re:no filtering            01/01/70 00:00      
                                 Note            01/01/70 00:00      
                                 Notch filter?            01/01/70 00:00      
                                    No,            01/01/70 00:00      
      Bandpass            01/01/70 00:00      
         NOT a criticism            01/01/70 00:00      
            Update...            01/01/70 00:00      
               Umm... Nowadays?            01/01/70 00:00      
                  Op amp parameters            01/01/70 00:00      
                     "Filters for Dummy"            01/01/70 00:00      
                        Have you tried it with .....            01/01/70 00:00      
                           Yes, I've tried it and it works well            01/01/70 00:00      
                              Basic electronics            01/01/70 00:00      
                                 0.002uF -> 3300uF            01/01/70 00:00      
                                    re:noise            01/01/70 00:00      
                                       Exactly the same            01/01/70 00:00      
                                          test of signal            01/01/70 00:00      
                                             It's over 1.2m            01/01/70 00:00      
                                    TWO bypass caps.            01/01/70 00:00      
                                 Two were found            01/01/70 00:00      
                                    Usenet            01/01/70 00:00      
                              Why using a PLL, when a bandpass can ...            01/01/70 00:00      
                                 which is why ,,,,            01/01/70 00:00      
                                    Not sure what you meant..            01/01/70 00:00      
                                 Already            01/01/70 00:00      
                                    But it MUST work properly!!            01/01/70 00:00      
                                       Circuit here            01/01/70 00:00      
                                       Op-amp to replace LM324            01/01/70 00:00      
         Non-inverting Input Voltage Divider            01/01/70 00:00      
   LM567            01/01/70 00:00      
   re:LM324            01/01/70 00:00      
      re:wrong link            01/01/70 00:00      
      No AGC            01/01/70 00:00      
         AGC            01/01/70 00:00      
            Yes            01/01/70 00:00      
         re: no AGC            01/01/70 00:00      
      LMC6032 is much more linear than LM324            01/01/70 00:00      
         re:            01/01/70 00:00      
         re:attenuation of signal            01/01/70 00:00      
            Good ones and bad ones            01/01/70 00:00      
         another article of interest            01/01/70 00:00      
   tramsmit & receive            01/01/70 00:00      
      how to measure the distance perfectly?            01/01/70 00:00      
         Fatal Error!            01/01/70 00:00      
            How about this one....            01/01/70 00:00      
               Ultrasonic Detection Code!            01/01/70 00:00      
                  is that right?            01/01/70 00:00      
                     Not right,,,,,            01/01/70 00:00      
                        Thanks!            01/01/70 00:00      
                  another missing!            01/01/70 00:00      
                  i'll try it..            01/01/70 00:00      
   Some Applications of ultrasonic            01/01/70 00:00      
   "Op amps for everyone"            01/01/70 00:00      
   woo... tiring trip            01/01/70 00:00      
      Check this one            01/01/70 00:00      
         Thanks            01/01/70 00:00      
            is it not fundamentally wrong            01/01/70 00:00      
               Both            01/01/70 00:00      
               I knew that...            01/01/70 00:00      
                  Synthetic grounds            01/01/70 00:00      
                  no, Kai            01/01/70 00:00      
                     Steve, Erik            01/01/70 00:00      
         The circuit works, but...            01/01/70 00:00      
            Moral            01/01/70 00:00      
               Puh, what antennas...            01/01/70 00:00      
                  Which means I can't use breadboard            01/01/70 00:00      
                     In one word.            01/01/70 00:00      
            Using the LM318            01/01/70 00:00      
               Missing 10K            01/01/70 00:00      
                  More caps            01/01/70 00:00      
                  Where?            01/01/70 00:00      
                     Parallel            01/01/70 00:00      
                     Does it work now?            01/01/70 00:00      
                        Yes, it works fine            01/01/70 00:00      
               Theoretical work missed            01/01/70 00:00      
   Fatal Error!            01/01/70 00:00      
      Another article to peruse            01/01/70 00:00      
         Another one...            01/01/70 00:00      
            same application            01/01/70 00:00      
               Sorry            01/01/70 00:00      
                  Why sorry?            01/01/70 00:00      
            That's exactly what I want to do            01/01/70 00:00      
            which one is the best way?            01/01/70 00:00      
               Capacitors            01/01/70 00:00      
                  i've got it            01/01/70 00:00      
   not the best solution            01/01/70 00:00      
      Laser ranging            01/01/70 00:00      
         how much            01/01/70 00:00      
      I've withdrawn from the competition            01/01/70 00:00      
         NOT finance            01/01/70 00:00      
            Re: money is not everything            01/01/70 00:00      
               Good Luck            01/01/70 00:00      
               good luck            01/01/70 00:00      
                  Good luck            01/01/70 00:00      
                     Thanks!            01/01/70 00:00      
                        The noise again            01/01/70 00:00      
                           re:link            01/01/70 00:00      
                           Link            01/01/70 00:00      
                              this is the link            01/01/70 00:00      
                                 re:noise            01/01/70 00:00      
                                    5-14 Khz            01/01/70 00:00      
                                       re:5-14kHz            01/01/70 00:00      
                                          The Noise Amplitude            01/01/70 00:00      
                                 gain            01/01/70 00:00      
                                    the problem is gain            01/01/70 00:00      
                                 Schematic            01/01/70 00:00      
                                    Thank You but...            01/01/70 00:00      
                                    Thank You but...            01/01/70 00:00      
                                       1/4Watt is enough            01/01/70 00:00      
                                          Simulation result            01/01/70 00:00      
                                             Strange plots...            01/01/70 00:00      
                                                How about Compensation?            01/01/70 00:00      
                                                   Not needed            01/01/70 00:00      
                                                      Bigger Pulse            01/01/70 00:00      
                                                         Bridge configuration can help            01/01/70 00:00      
                                                            The same circuit but...            01/01/70 00:00      
                                                               ...but much stronger            01/01/70 00:00      
                                                                  I have tried            01/01/70 00:00      
                                                                     What do you mean by ripple?            01/01/70 00:00      
                                                                        The ripple            01/01/70 00:00      
                                                                           No, it is not. The output from a logic            01/01/70 00:00      
                                                                           Answer            01/01/70 00:00      
                                                                              Yup Kai            01/01/70 00:00      
                                                                                 It's to adjust oscillating frequency            01/01/70 00:00      
                                                                                    Finished            01/01/70 00:00      
                        Exams VS academic            01/01/70 00:00      
                           "Plan B"            01/01/70 00:00      
                              Universities in HongKong            01/01/70 00:00      

Back to Subject List