
313
REVIEW QUESTIONS
A sine wave form generated by any DAC is also capable of producing acceleration for
any DC motor.
; Process R2 by subtracting 20 from it for next duty cycle.
MOV A, R2 ; decrease off -time duration for next phase
CLR C
SUBB A, #14H ; 20d
MOV R2, A ; R2 = R2 – 20d
DJNZ R1, ACCNXT ; next step of acceleration
RET ; motor runs at full speed
; Variable time delay routine. Variable input from R3 of bank #0.
VDELAY: MOV R6, 03H ; load R6 by R3 of bank #0
DELAY1: MOV R5, #0FAH ; 250 in decimal
DELAY2: DJNZ R5, DELAY2 ; generates 500 microseconds delay
DJNZ R6, DELAY1 ; steps of 20 milliseconds ...