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

ADuC 70xx timer interupt problem

Hi
I'm starting with ADuC70xx I got a small problem with timer 0 interupt.
Program does not go to handling routine. I tried many egzamples without but didn't fond the wright one for ADuC

#define CLOCK  22544384   // CPU configured for 22.544384 MHz clock
#define T0_Freq  300       // Timer 0 Reload Frequency
#define T0_LD ((unsigned short )(CLOCK / 16 / T0_Freq))

void IRQ_Handler (void) __attribute__ ((interrupt("IRQ_Handler")));

void IRQ_Handler (void)
{  while (!IRQSIG & 0x00000004)  {                     /* Timer0 Interrupt          */

  GP4DAT ^= 0x00040000;
  T0CLRI = 1;                                     /* Clear Timer 0 interrupt   */
 }
 return;
}

void main (void)
{
GP4DAT = 0x04000000;
/*-------------------------------------
Initialize Timer 0 Interrupt
-------------------------------------*/
  IRQEN = 0x00000004;         /* Configure Timer 0                               */
  T0LD  = T0_LD;              /* Timer reload value                              */
  T0CON = 0xC0;               /* Enable Timer 0, Mode: periodic, prescaler = 1   */

while (1){
  }
}

What I'm doing wrong ??

0