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
You are here: Home / Replies / i m makeing a project for

i m makeing a project for

|

Microcontroller › 8051 › how to start timer by software and stop by external hardware and then taking resultant value of time? › i m makeing a project for

July 21, 2011 at 9:19 pm #6489
ZOBI
Participant

i m makeing a project for blind person navigation
When any obstacle come in front of Ultrasonic range finder SRF04 ,they sends signal to 89C51 controller n  controller vibrates the vibration motors attached to any particular area where the circuit is attached so a blind can understand that he or she is close to any obstacle , n the closer the obstacle the more vibration produce, means vibration should be inversely proportional to distance between person and obstacle,

 

i hav made major part of the programing of this project but still want help from u people to tell me is this source code have some mistakes or not

 

org 0000h

ljmp main

 

ORG 0003H ; INT0 ISR

 

setb TR0 ; starts timer 0 (pin p3.2 will be connected with the pin which is giving 10 usec pulse)

 

ORG 0013H ; INT1 ISR

 

clr TRO ;stops timer 0(pin p3.3 will be connected with ECHO OUTPUT PULSE PIN of SRF04)

mov DPL,TL0             ;save the TL0 values to lower DPTR portion

mov DPH,TH0            ;save the TH0 values to upper DPTR portion

LJMp RANGE_CHECKER ;from here the DPTR value will be shifted to furhter part of this remaining programe

 

ORG 0030H 

MAIN:

setb tcon.3                     ; make INT1 edge triggerd(high-to-low) interrupt

setb tcon.1                     ;make INT0 edge triggerd(high-to-low) interrupt

mov Ie,#10000101b       ;enable external INT0,ITN1

mov tmod,#10011001b  ;make timr to strt/stop by EXTRNAL HARDWARE,MODE 1,16 bit timers

mov tl0,#0000                ;load initial values in timer TLO

mov th0,#0000                ;load initial values in timer THO

setb p1.0                        ;make pin P1.0 HIGH

call delay                        ;this delaywill  HIGH pin P1.0 for 10 usec

delay:

l1:mov r0,#1

djnz r0,l1

nop

nop

clr p1.0

end

 

 

RSS Recent Posts

  • How to power up two stereo audio amplifiers from a single source of power supply August 13, 2022
  • WXmeteo in APRS at 144.8MHz project schematic question August 13, 2022
  • uc3843 Buck-boost August 13, 2022
  • Add a low power indicator LED August 13, 2022
  • ESP32/Arduino OTA problems August 13, 2022

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2022 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