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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/29/09 13:41
Read: times


 
#169252 - Timer 2 Interrupt Enable?
Hi all,

I am working with P89V664 micro controller with SDCC .I am using the following function to configure timer 2 in capture mode and generate interrupt when an event occurs.
void init_ir_int(void)
{
        /* initiate the hardware for IR cocommunication in interrupt
         * mode */
        /* Enable timer 2 in capture mode */
        T2CON |= 0x01;
        EXEN2 = 1;
        EA = 1;
        ET2 = 1;
}


The isr is as follows:

void isr_byte_recv(void) __interrupt 7
{
        //the isr toggles led when TF2 overflows.
        if (TF2 == 1) {
                        P1_5 = !P1_5; //P1_5 is connencted to an led.
        }

        TF2 = 0;
        EXF2 = 0;
}


The interrupt is not generated! What's wrong here?
I'd greatly appreciate any comments and suggestions.

Regards,
Sarma

List of 13 messages in thread
TopicAuthorDate
Timer 2 Interrupt Enable?            01/01/70 00:00      
   do you actually clock the T2EX?            01/01/70 00:00      
      Yes I am            01/01/70 00:00      
   prototype visible to main            01/01/70 00:00      
      Some Differences Found in Documentation            01/01/70 00:00      
         who know the most about NXP chips ?            01/01/70 00:00      
            Can't Get Your Point            01/01/70 00:00      
               YES            01/01/70 00:00      
   One Problem Fixed            01/01/70 00:00      
      wrong include            01/01/70 00:00      
         This was the Exact Problem            01/01/70 00:00      
            re include files            01/01/70 00:00      
   Please check .RST file            01/01/70 00:00      

Back to Subject List