lets assume pin P3.3(INT1) is connected to a pulse generator,write a program in which the falling edge of the pulse will send a high to P1.3,which is connected to an LED.
in this problem should i have to write assembly language for LED interfacing also???
can anyone help me to write the assembly language for this problem....
i have written this....
ORG 8100H ;initialization
LJMP MAIN
;-- hardware interrupt INT1 to turn on LED
ORG 0013H ;INT1 initialization
CLR P1.3 ;LED turn on
MOV R3,#255
BACK: DJNZ R3,BACK ;keep the LED on
SET P1.3 ;off the LED
RETI ;return
;-- main program
ORG 30H ;initialization
MAIN: SETB TCON.2
MOV IE,#10000100B ;enable external INT1
HERE: SJMP HERE ;stay until get interrupted
END
It's better to pull P1.3 down and connect LED (through resistor) to Vcc, otherwise it's your code, should work ..
You may consider though moving the time delay out of the interrupt section and locate it somewhere in the main ..