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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/28/05 09:45
Read: times


 
#103074 - Has anyone used it ?
Responding to: ???'s previous message
Morning forum members,

After trying every possible thing (which i could think of) from feedback given by forum I still can not make timer 2 work. Has any member ever used it before, please drop us a line on how to intitialise it. I want to use it as 16bit "Auto-reload mode timer", "counting upwards" and sets TF2 on "overflow" from 0FFFF to 0000. when TF2 is set I want the program to go into ISR, please have a look on my code below. I am very much sure that problem is in initialisation of timer 2 and timer 2 interrupt but what the problem is I can not figure out so I am calling for help.


ORG 00H
LJMP MAIN
ORG 002BH
LJMP T2ISR

MAIN:

MOV P1,#0FFH
MOV T2MOD,#02H    ;initialising timer 2 as auto-reload 16 bit
MOV T2CON,#4CH     timer, counting upwards
MOV IE,#0A0H

MOV RCAP2L,#0F0H  ;1ms timer over flow time
MOV RCAP2H,#0D8H
SETB TR2
SETB TF2          ;forcing interrupt, this does not             
                                      seem to be working
SJMP $

T2ISR:

CLR TR2
CLR TF2
CLR EXF2

CPL P1.6
CPL P1.5

SETB TR2
RETI
 

END


thanks for your time

Kaz

List of 27 messages in thread
TopicAuthorDate
Timer 2 in AT89S8252            01/01/70 00:00      
   most often, a '51 datasheet does not            01/01/70 00:00      
      continuing the above            01/01/70 00:00      
   Timer 2 for PWM...            01/01/70 00:00      
      one caution            01/01/70 00:00      
   PWM example code:            01/01/70 00:00      
   Time 2 problem            01/01/70 00:00      
      you are missing this one            01/01/70 00:00      
         I think I have covered that            01/01/70 00:00      
            RCAP2            01/01/70 00:00      
               Program with changes but still problem            01/01/70 00:00      
                  RCAP2 wrong            01/01/70 00:00      
                     Still no good            01/01/70 00:00      
                        So where do you expect the interrupt to            01/01/70 00:00      
                           why enable UART interrupt??            01/01/70 00:00      
                              sorry, early morning here            01/01/70 00:00      
                                 Is it still too early?            01/01/70 00:00      
                                    no and, please read the datasheet            01/01/70 00:00      
            I highlighted "must be cleared by            01/01/70 00:00      
   Has anyone used it ?            01/01/70 00:00      
      the biggest sin            01/01/70 00:00      
         Are you sure?            01/01/70 00:00      
            Jan is right            01/01/70 00:00      
               so am I            01/01/70 00:00      
            No, of course the datsheets are just nov            01/01/70 00:00      
            the third sin            01/01/70 00:00      
               Does this work on anyone's simulator?            01/01/70 00:00      

Back to Subject List