Yahoo Groups archive

Lpc2000

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

Message

Re: Olimex lpc e2294 board interrupt help - GNU C

2005-07-28 by Angel Sanchez

You have a couple of faults:
In Interruption: VicVectAddr = 0; (Not 0xff)
In main, include:  
  VicIntEnable = 0x10;                    // Enable timer 0 interrupt

Regards


--- In lpc2000@yahoogroups.com, "DECwiz \(Fred van Kempen\)" 
<decwiz@y...> wrote:
> In the ISR, you need to reset the VIC using 0x00, not ff:
>  
> VICVectAddr = 0;
>  
> will work.
>  
> Also, in main:
>  
> VICIntSelect=0x00000000;      //assigne interrupt timer 0 til type 
IRQ
> 
> will not work.. you need to SET the bit for the specific VIC 
channel, such as:
>  
> VICIntSelect |= (1 << VIC_TIMER0);
>  
> or alike.
>  
> --fred
> 
> 
> boje_d <boje_demant@h...> wrote:
> Hi im trying to make the interrupt work om a lpc2294. I am using 
> timer 0 and see the interrupt being enabled (test routine on 
display) 
> but the interrupt does NOT activate the interrupt routine. Ill put 
in 
> some code so maybe someone can see my error??? And give a little 
> help ??
> 
> than you (i hope)
> 
> Best regards 
> Boje Demant
> 
> interrupt routine
> static void Timer0Interrupt(void) __attribute__ ((interrupt 
("IRQ")));
> static void Timer0Interrupt(void){
> //  (*timer_function)(); // Call timer callback function.
> //
> //   T0_TCR=0; //stop timer
> //   T0_TCR=2; //Reset timer
> //   T0_TCR=1; //start timer
>    LIGHT_LCD_ON;
>    T0_IR = 0xff; // Clear timer 0 interrupt line.
>    VICVectAddr=0xff;
> }
> 
> 
> 
> 
> in main:
> 
> T0_PR=58982;  //setup prescaler = 1msek
> T0_TCR=0x00000002; //Reset timer
> T0_MR0= 1500; //2 (2 sek for  interrupt;
> T0_MCR=0x00000003; //generate interrupt on match
> VICProtection=0;  //
> VICIntEnClear=0xffffffff; //disable all interrupts
> VICSoftIntClear=0xffffffff;
> VICDefVectAddr=(unsigned long)&DefInterrupt;
> VICIntSelect=0x00000000;      //assigne interrupt timer 0 til type 
IRQ
> VICVectAddr0= (unsigned long)&Timer0Interrupt;   //opsæt vector
> VICVectCntl0= 0x00000024;                 //enable vector iterrupt 
> 
> 
> 
> 
> SPONSORED LINKS 
> Microcontrollers Microprocessor Intel microprocessors Pic 
microcontrollers 8085 microprocessor 
> 
> ---------------------------------
> YAHOO! GROUPS LINKS 
> 
> 
>     Visit your group "lpc2000" on the web.
>   
>     To unsubscribe from this group, send an email to:
>  lpc2000-unsubscribe@yahoogroups.com
>   
>     Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service. 
> 
> 
> ---------------------------------
> 
> 
> 
> 		
> ---------------------------------
>  Start your day with Yahoo! - make it your home page 
> 
> [Non-text portions of this message have been removed]

Attachments

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.