Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

Problems with interrupt using IAR

Problems with interrupt using IAR

2004-03-19 by yura_boc

Hi,

 I'm trying to start-up the interrupt handling.
 Here I configured Timer0 as IRQ source, and forced an interrupt.
 But interrupt sevice routine doesn't run.

 this is a fragment of program:


  //VIC
  VICProtection=0x0;    
  
//clears bits in the Interrupt Enable register  
  VICIntEnClear=0xffffffff;   

  VICIntEnable=0x10;    //Channel#4 is the Timer0

  VICIntSelect=0x00;    //all interrupts are IRQs
//enable and the number of the interrupt request or software interrupt

  VICVectCntl0=0x24;    
  VICVectAddr0=(unsigned long)&Timer0ISR;

  Then I also initialize Timer0:

  T0_IR=0x00;
  T0_MR0=TIMERMATCH;
  T0_MCR=0x01;        
  T0_PR=0xfff;         //Prescaler to fff
  T0_TC=0x00;         //reset Timer counter
  T0_TCR=0x01;        //enable Timer*/

After that 
 //enable irq in ARM-core (intrinsic function)
 //IRQ and FIQ are enable
 __enable_interrupt();      


 I start my program in RAM.
 When I try to run the code in USER or SURERVISOR mode,it
 crashes always. Untill Timer counter not equal TIMERMATCH everything 
is well. But after TC=TIMERMACH the program crashes. But the 
disabling bit in Interrupt register of Timer0 set high and
the disabling bit in VICIRQStatus do the same. But interrupt service 
routine isn't in progress.

 

!!!  My questions are:
!!!  -What did I do wrong?
!!!  -Can someone provide me example source code with interrupt 
for    IAR?

 Thanks.
 Yuri

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.