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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/19/07 08:34
Read: times


 
#148498 - Long duration timer
Here is another question. I am trying to start a motor and run it for 30 minutes at a particular time of the day without human intervention. How to generate the time interval of 30 minutes with only 89C2051? Earlier stuff I did were for very short intervals and presented no problem.

This is whay I propose - Use a 32.768 crystal which gives a timing interval of approximately 20 seconds. For 30 minutes I need to do the timing approximately 90 times and I tried my hand on the following code.

Do you think it will work? What modification is required to make it work?

I have for referecne both books of Predko and Ayala on 8051

ORG 0
mov sp,#030h
ajmp main

ORG 0Bh
djnz R1,Timer
reti

Timer:
mov th0,#02ah
mov tl0,#0abh
mov tmod,#00000001b
mov ie,#10000010b
mov tcon,#00010000b ;Start timer

main: mov R1,#90
push DPL
push DPH
ajmp Timer
Pop DPH
pop DPL
-|more code for mootor start routine|-

Many thanks for your time and help

Archer

List of 11 messages in thread
TopicAuthorDate
Long duration timer            01/01/70 00:00      
   Any MCU can do this with ease            01/01/70 00:00      
      Long duration timer            01/01/70 00:00      
   I would not trust MCU for this but an RTC            01/01/70 00:00      
      Wrong end of stick            01/01/70 00:00      
         Wrong end of right stick            01/01/70 00:00      
            It's all relative            01/01/70 00:00      
               It\'s all relative , ya            01/01/70 00:00      
                  I see            01/01/70 00:00      
                     ya            01/01/70 00:00      
         Ap is right            01/01/70 00:00      

Back to Subject List