Explanation It’s one of the applications of 8254 Programmable Interval Timer Here, it even uses 74112 J-K Flip Flop which is used to control the operation of transistors A clock of 8 MHz frequency is also used here as the input clock.
Circuit Diagram
DESCRIPTION When the ‘Q’ output of 74112 is at logic 1, base of Q2 is pulled up to +12V and base of Q2 is open-circuited Q1 is off and Q2 is on. Q3 and Q4 both are grounded through inverters Hence, Q3 goes to conduction and Q4 to turn off. Hence, +12V is connected to the positive of motor and negative terminal is grounded when the logic of Q is 1 This results in forward rotation of DC Motor
Contd.. When the Q logic is 0, the base of Q4 register is pulled up to 12V by base pull-up resistor Hence, Q4 is on and Q3 is off. The positive terminal is now grounded. Hence, the direction of rotation will be in the anti-clockwise direction Thus, direction of rotation of motor be controlled
WAVEFORMS
DESCRIPTION Fig a represents the timing diagram for no rotation (torque is developed) Fig b represents the timing diagram for high speed rotation in the reverse direction (Anti-clockwise) Fig c represents the timing diagram for high speed rotation in the forward direction (Clockwise)
Contd.. To control the speed of DC Motor, we have to use AH register (8-bit) When AH = 00H, then the motor runs at high speed in the reverse direction When AH = FFH, then the motor runs at high speed in the forward direction When AH = 128d, it represents 50% duty cycle . i.e. no rotation
PROGRAM
CNTR EQU 706H CNT0 EQU 700H CNT1 EQU 702H COUNT EQU 30720 SPEED PROC NEAR PUSH AX PUSH DX PUSH BX
; SAVE REGISTERS
MOV BL,AL MOV AX,120 MUL BL MOV BX,AX MOV AX,COUNT SUB AX,BX MOV BX,AX
;CALCULATE COUNT
MOV DX,CNTR MOV AL,00100100B OUT DX,AL MOV AL,01110100B OUT DX,AL
;PROGRAM CONTROL WORD
MOV DX,CNT1 MOV AX,COUNT OUT DX,AL MOV AL,AH OUT DX,AL
;PROGRAM COUNTER 1 ;TO GENERATE CLEAR
SPE: IN AL,DX XCHG AL,AH IN AL,DX XCHG AL,AH CMP AX,BX JB SPE
;WAIT FOR COUNTER 1 ;TO REACH COUNT
MOV DX,CNT0 MOV AX,COUNT OUT DX,AL MOV AL,AH OUT DX,AL
;PROGRAM COUNTER0 ;TO GENERATE SET
POP BX POP DX POP AX
;RESTORE REGISTERS
SPEED ENDP