| ??? 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)
________________________________________________
|



