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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/28/03 15:49
Read: times


 
#61459 - pulse width
org 0000h ;power-on reset
JMP main

org 000Bh ;timer 0 interrupt
SETB F0 ;set software flag to indicate overflow
RETI ;return from interrupt

org 001Bh ;timer 1 interrupt
RETI

main: CALL Init
lp1: JNB P3.2, lp1 ;loop whilst INT0 is low
lp2: JB P3.2, lp2 ;loop whilst INT0 is high
;at this point, TL0 has the number of clocks that have
;occurred during the period that INT0 was high. This is
;easily convertable into a time duration.
lp3: JB F0, Error ;test software flag for error
CALL Convert ;perform conversion to time
CLR F0 ;clear software flag
JMP lp1 ;loop around and do again
Init: MOV TH0, #0h
MOV TL0, #0h
MOV TMOD, #07h ;C/T=1, Mode 3, Timer 0
MOV TCON, #10h ;start timer 0
MOV IE, #82h ;enable IRQ's
CLR F0 ;clear software flag
RET

Error: JMP Error
Convert: RET
end

i got this program for finding the width of the pulse.Can you tell me how this program works so that i will be able to understand the concept and be able to modify.
thanking you,
bharath

List of 10 messages in thread
TopicAuthorDate
pulse width            01/01/70 00:00      
   RE: pulse width            01/01/70 00:00      
      RE: pulse width            01/01/70 00:00      
   RE: pulse width            01/01/70 00:00      
      RE: pulse width            01/01/70 00:00      
         RE: pulse width            01/01/70 00:00      
         RE: pulse width            01/01/70 00:00      
            RE: pulse width            01/01/70 00:00      
   RE: pulse width            01/01/70 00:00      
   RE: pulse width            01/01/70 00:00      

Back to Subject List