Problem with ISR code AT89c51

Status
Not open for further replies.

vreg

Member level 4
Joined
Oct 16, 2012
Messages
70
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Visit site
Activity points
1,935
Hi, could someone please tell me what is wrong with the code. I want to use keyboard interrupts in AT89c51 to turn on an led when someone presses the button


Code:
ORG 0 
LJMP MAIN

;--ISR for INT
ORG 003BH ;Vector Address for Keyboard interrupt
setb P1.3 ;turn on LED
RETI ;return from ISR

ORG 0100H
MAIN:
clr p1.3
mov 0B1h,00000001b ;enable keyboard interrupt
mov 9Dh, 10000000b	;Set KBF. 7 bit in KBF register to enable interrupt request
mov 9Ch, 10000000b	;Set KBLS7 to enable a high level detection on Port line 7.
HERE: SJMP HERE

end
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…