
INTERFACING EXTERNAL PERIPHERALS TO THE 8051 21-13
Example 21.6
ORG 0 ;origin
MOV A,#66H ;load sequence in AL
AGN: MOV P1,A ;send it to Port 1
RR A ;rotate right once
ACALL DELAY ;call a delay
SJMP AGN ;repeat the sequence
DELAY: MOV R2,#69H ;the delay procedure
BACK: MOV R3,#0FFH
BACK1: DJNZ R3,BACK1
DJNZ R2,BACK
RET
END
21.7 | DC Motor Interfacing
This is a type of motor that operates on direct current and is very commonly used in
embedded systems, when continuous movement is needed. The movement may be made
‘controlled’, in the sense that the speed and direction can be changed as per the require-
ments of the application. Robotics ...