Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with ISR code AT89c51

Status
Not open for further replies.

vreg

Member level 4
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
led.JPG

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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top