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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/17/05 13:17
Read: times


 
#95158 - re:code
Responding to: ???'s previous message
Shivani,

I made your code more readable and added a jmp $, so that you will not run the interrupt code as part of the Main code.

Jacob

<PRE>
org 0000h
ljmp program_start ;bypass interupt table

org 0003h
ljmp interrupt0

org 0013h
ljmp interrupt1

org 001bh
ljmp isr_timer1

org 0030h

program_start:
mov PORT0,#0ffh
mov PORT3,#0ffh
mov PORT1,#0ffh
mov PORT2,#0ffh
mov TH1,#00h
mov TL1,#00h
mov TMOD,#11h
mov IE,#10000001b
setb TCON.0
setb TCON.2
jmp $


isr_timer1:
reti

interrupt0:
setb PORT2.0
setb TCON.6
setb IE.2
reti

interrupt1:
clr PORT2.0
clr TCON.6
clr IE.2
reti





List of 15 messages in thread
TopicAuthorDate
interrupt problem            01/01/70 00:00      
   The code doesn't seem to do much            01/01/70 00:00      
   Reti?            01/01/70 00:00      
      are you ok            01/01/70 00:00      
         RETI & CALL            01/01/70 00:00      
            The CPU performs an implicit call            01/01/70 00:00      
               SORRY! i was wrong.            01/01/70 00:00      
                  No loop or no jump around isr_timer1            01/01/70 00:00      
                     Is it need to set P3.2 if v use ext,intr            01/01/70 00:00      
                        read all about it            01/01/70 00:00      
   No "main loop"            01/01/70 00:00      
   re:code            01/01/70 00:00      
      re: code            01/01/70 00:00      
         Yes, and what have we gained?            01/01/70 00:00      
         Superman            01/01/70 00:00      

Back to Subject List