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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/20/06 05:37
Read: times


 
#124636 - Ok back on this interupt routine
Responding to: ???'s previous message
Ok let me first apologize for not keeping up on this post, but due to some work priorities and health issues I have been away from the PC for a while.

I am looking to write some code for a zero crossing routine for a 80C320. I would like to watch an external interupt pin for a positive going edge, once it is seen then run a routine that will load a timer with a value from a storage location that is loaded with a separate ladder interperter routine and then start the timer and exit the routine (this is because the ladder interpreter is required to keep running).

Now once the timer over flows I want to stop running the ladder interpreter and run another routine that will turn on an internal bit and then exit back to the ladder interpreter until another external interupt is acknowleged.

I am posting all the code that I have so far. The actual asm file is about 11,000 lines long so I am only posting the revelant snippets.

I am running out of time on this and could use any help that is offered.

Thank you,

Dave


000B            =1  1155            ORG     000BH
000B 02019F     =1  1156            ljmp    INTRET     ;Interrupt vector for 
________________________________________

019F 32         =2  1744    INTRET: reti                    ;Return from interupt
__________________________________________
247E 758921     =1  5287    ST50:   mov     TMOD,#00100001B         ;T1 for Baud,   MODIFIED  8-13-06 OLD VALUE = 00100101
2481 758DFD     =1  5288            mov     TH1,#0FDH               ;T0 for Zero crossing timer
2484 D28E       =1  5289            setb    TR1                     ;Run T1 for Baud rate
                =1  5290    
2486 C28C       =1  5291            clr     TR0                     ;Hold T0
2488 758C00     =1  5292            mov     TH0,#0
248B 758A00     =1  5293            mov     TL0,#0
_____________________________________________
3786            =1 11171    AN00:   
                =1 11172    
                =1 11173           
                =1 11174    
3786 9000FA     =1 11175            mov     DPTR,#TC1        ; COPY OVER REFRESH VALUE FROM TC1
3789 E583       =1 11176          mov     a,DPH
378B F58C       =1 11177            mov    TH0,a            ; STORE HIGH BYTE
378D A3         =1 11178            inc     DPTR             ; INCREMENT TO THE SECOND BYTE
HITECH                                                                                                        PAGE 197

378E E582       =1 11179            mov     a,DPL
3790 F58A       =1 11180            mov    TL0,a            ; STORE LOW BYTE
                =1 11181            
                =1 11182    
                =1 11183    
                =1 11184                                    ;   Changed 8-13-06 This code needS to copy over the new timer value    from
                                                            ;    the holding register TC1 (TC1 is updated through the ladder interperter)
________________________________________________








List of 31 messages in thread
TopicAuthorDate
Interupt question......            01/01/70 00:00      
   quick answer..            01/01/70 00:00      
   Noise            01/01/70 00:00      
   Perplexed......            01/01/70 00:00      
   Interrupt            01/01/70 00:00      
      does not matter            01/01/70 00:00      
         Attack            01/01/70 00:00      
            You did ask for it            01/01/70 00:00      
         Interruptifobia            01/01/70 00:00      
            There's not always a performance penalty            01/01/70 00:00      
               there is always an exception            01/01/70 00:00      
                  the controller task            01/01/70 00:00      
   very busy processor......            01/01/70 00:00      
      most likely it is not            01/01/70 00:00      
         PLC ?            01/01/70 00:00      
            since forever            01/01/70 00:00      
   Definatly a PLC....            01/01/70 00:00      
      a link            01/01/70 00:00      
      The application may be a PLC, but the chip is not            01/01/70 00:00      
         I do not think that is what David does            01/01/70 00:00      
   code......            01/01/70 00:00      
   Sorry......            01/01/70 00:00      
      Just post            01/01/70 00:00      
         code post.....            01/01/70 00:00      
            Posting Code and Idea            01/01/70 00:00      
            Where are ....            01/01/70 00:00      
   Ok back on this interupt routine            01/01/70 00:00      
      put an inverter on the pin            01/01/70 00:00      
   ZERO CROSS DETECTOR....            01/01/70 00:00      
      Saif, please and a note            01/01/70 00:00      
         actually...            01/01/70 00:00      

Back to Subject List