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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/07/05 10:59
Read: times


 
#86739 - I am sure it is good way for you!
Responding to: ???'s previous message
Kurnia Brahmana said:
Hi for all,

Suppose we arrived at a statement:
JNB P1.0,$

And we would like to escape from that situation
after a number of time if there is no any trigger.




I write this program
for ultrasonic range meter and
it works properly.
see


recieve_pulse:
mov tmod,#1
mov th0,#0
mov tl0,#0
mov r3,#20
setb p1.0
setb tr0
loop:
jnb p1.0,loop1
sjmp exit_loop

loop1:
jnb tf0,loop
clr tf0
djnz r3,loop

exit_loop:
ret


therefore you can load th0,tl0 and r3 for special time delay
and maximum time is 16.71 seconds with 12 mhz xtal

List of 15 messages in thread
TopicAuthorDate
How to escape from an endless loop ?            01/01/70 00:00      
   what is the problem?            01/01/70 00:00      
   Counter            01/01/70 00:00      
      How about another BIT flag            01/01/70 00:00      
         how would you do that            01/01/70 00:00      
         Problem Solved with a combination.            01/01/70 00:00      
   External interrupt            01/01/70 00:00      
      Additional explanation about the problem            01/01/70 00:00      
         loops            01/01/70 00:00      
            Not in the ISR            01/01/70 00:00      
         Answer t o additional explanation            01/01/70 00:00      
   Messing with stack inside interrupt...            01/01/70 00:00      
      Setup stack inside interrupt            01/01/70 00:00      
   I am sure it is good way for you!            01/01/70 00:00      
      Your idea is good.            01/01/70 00:00      

Back to Subject List