EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / 8051 microcotroller interfacing with an ultrasonic sensor[assembly]

8051 microcotroller interfacing with an ultrasonic sensor[assembly]

|

Microcontroller › 8051 › 8051 microcotroller interfacing with an ultrasonic sensor[assembly]

  • This topic has 1 reply, 2 voices, and was last updated 11 years, 2 months ago by Ashutosh Bhatt.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • March 8, 2014 at 6:47 pm #2931
    mike
    Participant

    Im in an assembly language class at NEIT, im very lost and the fellas at saturday help arent much as theyve passed this class long ago.

     

    the lab project calls for me to sound a buzzer if the Ultrasonic sensor senses anything

     

    so far all that it’s doing is buzzing non stop, its not a matter of sensativity or interfence, its something in my code

     

    just need some help, really dont want to fail this class, Id appreciate any help

     

    START:
    TOP:      setb P3.6       ; turn on utx
    NO:      jb   P3.4, NO
              call beep
              jmp TOP
             

    beep:         
                mov R1, #200
                 mov TMOD, #01H ;setting timer0 in 16 bit mode
    AGAIN:    mov TL0,  #8Dh ; our low value  for our period
                 mov TH0,  #0FFh ; our hi value
            Setb TR0     ; starts timer
    HERE:    JNB TF0, HERE               ; waits for flag to set
            CLR TR0           ; stops timer
            CPL P0.0      ; toggles switch to create our square wave
             
            CLR TF0        ; clears flag
            DJNZ R1,Again
            ret

            end

    March 10, 2014 at 4:49 pm #11267
    Ashutosh Bhatt
    Participant

    ur code seems to be correct. (although i m not sure since i have left assembly language programming before 7 years)

    u might be getting always low logic at P3.4. just check it out.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • An Update On Tarrifs May 16, 2025
  • Trying to use a L9110s motor driver chip May 16, 2025
  • I want to make a CRT with some modifications But i have no Idea where to start May 16, 2025
  • Funny Images Thread! May 16, 2025
  • Need Help Figuring Out the Schematics Of Circuit Board May 16, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise