Part 1 How many pins are designated as P3 and which number a
Part 1.
How many pins are designated as P3 and which number are they in the DIP package?(Multiple Choice)
A. 8 pins, pins 00-07
B. 8 pins, pins 10-17
C. 8 pins, pins 01-08
D. 8 pins, pins 20-27
Part 2.
Modify the below \"ONE SEC\" subroutine to perform the following:
A. Counts up from 0 to 21.
B. After reaching 21, the next value should be 0 followed by 1,2,4,8,16,32,64,128 and then restarting the count from 0.
Delay1: MOV R5, #250D
Label: Acall delay
Acall delay
Acall delay
Acall delay
DJNZ R5, label
Ret
Delay2: MOV R6, #250D
MOV R7, #250D
Loop 1: DJNZ R6, Loop 1
Loop 2: DJNZ R7, Loop 2
Ret
Solution
PART 1:
FOR P3 the pis are 10 - 17
PART 2:
A) START:MOV A,00
LOOP:INC A
LCALL DELAY1
CJNE A,#21D,LOOP
JMP START
B) START:MOV A,00
LOOP:INC A
LCALL DELAY1
CJNE A,#21D,LOOP
MOV A,00
INC A
BACK: LCALL DELAY1
CLR C
LSL A
CJNE A,#128D,BACK
JMP START
