Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/19/02 22:20
Read: times


 
#29398 - My first attempt at using interupts :-(
Okay, I want to write a little test code that simply lights one LED when the IR demodulator data line goes low. (In other words when I give it any IR source; the visible green LED on my board will light and stay on.)

I'm missing something obviously, but can't pinpoint what it is. I came up with this code (How do I specify what type of edge INT5 is triggered on?) :

$mod51

; IR Demodulator connected to P1.7 (Interupt 5)

MOV P2, #0000 ; Set all LEDs on port 2 LOW
JMP Start

ORG 0h ; Interupt 5 information

INT5:

SetB P2.0 ; LED on P2.0 lights when INT5 triggered


RETI



ORG 100H ; Begin Program
Start:

MOV 0A8h, #10000001b ; Enable "Global" Interupts
MOV 0E8h, #11101000b ; Extended Interupt Enable (Should enable INT5)

Loop:

JMP LOOP ; Loop here waiting for INT5 to trigger


End

List of 13 messages in thread
TopicAuthorDate
My first attempt at using interupts :-(            01/01/70 00:00      
RE: My first attempt at using interupts            01/01/70 00:00      
RE: My first attempt at using interupts            01/01/70 00:00      
RE: My first attempt at using interupts            01/01/70 00:00      
RE: My first attempt at using interupts            01/01/70 00:00      
RE: My first attempt at using interupts            01/01/70 00:00      
RE: My first attempt at using interupts :-(            01/01/70 00:00      
RE: My first attempt at using interupts            01/01/70 00:00      
RE: My first attempt at using interrupts            01/01/70 00:00      
RE: My first attempt at using interupts            01/01/70 00:00      
RE: more            01/01/70 00:00      
RE: My first attempt at using interupts            01/01/70 00:00      
RE: My first attempt at using interupts            01/01/70 00:00      

Back to Subject List