QUIZ-2: Priyesh Pandey, 11640710
QUIZ-2: Priyesh Pandey, 11640710
QUIZ-2: Priyesh Pandey, 11640710
QUIZ-2
Priyesh Pandey , 11640710
Objective a) INT1
Framing the assigned question(no.-29) compati- b) INT0
bly with ATMEGA328p. c) none of them
d) both of them
Original Question
Solution
The time period of a square wave in the audio
frequency range is measured using an 8085 micro- As, mentioned in the question the time period
processor by feeding the square wave to one of the of the square wave is measured using the points
four interrupts, namely, RST 7.5, RST 6.5, RST only where a period starts or ends, therefore the
5.5, or INT. The algorithm used starts a timer at interrupt we require to start the timer should
the beginning of a time period, stops the timer at be edge triggered, in the given microprocessor
the beginning of the next time period and reads interrupts both of them can be used as INT0,INT1
the timer values for time measurement. Which of are both edge triggered and level triggered.
the following interrupts should be selected for this Therefore the answer is c.
application?
a) INTR Question based on CODE
b) RST 6.5
c) RST 5.5 Consider the given code, and mark the correct
d) RST 7.5 option:
a) On using INT1, interrupt ocurs when a rising
Solution edge triggering is occuring.
As, mentioned in the question the time period b) On using INT1, interrupt ocurs when a falling
of the square wave is measured using the points edge triggering is occuring.
only where a period starts or ends, therefore the c) On using INT0, interrupt ocurs when a falling
interrupt we require to start the timer should be edge edge triggering is occuring.
triggered, in the given hardware interrupts only RST d) On using INT0, interrupt ocurs when a level
7.5 is a edge triggered interrupt while the rest are triggering is occuring.
level triggered.
. include " m328Pdef.inc"
Therefore well use RST 7.5 and hence the answer .ORG 0
is d. RJMP MAIN
TOGGLE :
LDI R17 ,0 XFF
OUT PORTB ,R17
RCALL DELAY
LDI R17 ,0 X00
OUT PORTB ,R17
RETI
DELAY:
LDI R16 ,0 XFF
L1: LDI R17 ,0 XFF
L2:ldi r18 ,0 X0F
L3:
DEC R18
BRNE L3
DEC R17
BRNE L2
DEC R16
BRNE L1
RET
Solution
From running the code and interfacing with LED
and push button, we can easily observe that rising
edge triggering occurs both at INT1 and INT0.
Hence,the correct answer is a.