0 ranging from right to interrupt serviceroutine circuit jnb p1.2 left P1.2 pin to 0 to the left ranging circuit interruptservice routinereturn: SETB EX1 open external interrupt 1 pop acc pop psw retiright: ... right location entrance circuit interrupt service routine Ajmp
Returnleft: ... left Ranging entrance circuit interrupt service routine Ajmp Return3.3 The calculation of ultrasonic propagation time When you start firing at the same time start the single-chip circuitry within the timerT0 the use of timer counting function records the time and the launch of ultrasonicreflected wave received time. When you receive the ultrasonic reflected wave the receivercircuit outputs a negative jump in the end of INT0 or INT1 interrupt request generates asignal single-chip microcomputer in response to external interrupt request theimplementation of the external interrupt service subroutine read the time differencecalculating the distance . Some of its source code is as follows:RECEIVE0: PUSH PSW PUSH ACC CLR EX0 related external interrupt 0 .