This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

T3 interrupt problem

Hi all,

I am using T2 and T3 timer with T3INT interrupt as below:

void init_T2(void)
{
 T2 = 195; // for 10ms with 51,2 resolution
 T2CON = 0x0027;   // reload, timer mode
}

void init_T3(void)
{
T3 = 195;    // for 10ms with 51,2 resolution
T3CON = 0x00C7;
T3IC = 0x0030;  // level 12, group 0
}

interrupt (T3INT) void T3_ISR(void)
{
 counter++;
 sec = counter/100;
 min = sec/60;
 tenth = sec/10;
 hundreth = sec/100;
}
void main(void)
{
   init_T2();
  init_T3();
  IEN = 1;
 while(1)
  {
  }
}

My problem is that I never get into interrupt routine.
I have checked my code a number of times but I don't find anything missing. It should work.
Can somebody point out if I am missing something?
thanks for help
regards
/M

Parents
  • Hi all again,

    I found the reason why interrupt was not active:

    void init_T3(void)
    {
    T3 = 195;    // for 10ms with 51,2 resolution
    T3CON = 0x00C7;
    T3IC = 0x0030;  // level 12, group 0
    }
    
    

    T3IC = 0x0030 disable interrupt
    now I changed to
    T3IC = 0x0070
    and it works

    regards

    /M

Reply
  • Hi all again,

    I found the reason why interrupt was not active:

    void init_T3(void)
    {
    T3 = 195;    // for 10ms with 51,2 resolution
    T3CON = 0x00C7;
    T3IC = 0x0030;  // level 12, group 0
    }
    
    

    T3IC = 0x0030 disable interrupt
    now I changed to
    T3IC = 0x0070
    and it works

    regards

    /M

Children
No data