Yahoo Groups archive

Lpc2000

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

Thread

Problem configuring external interrupts...

Problem configuring external interrupts...

2004-08-04 by Musharraf Hanif

Hi,

I am trying to setup my LPC2129 (MCB2100) to respond
to external interrupts. I am using the following
initialization sequence (For the interrupt):

........
VICVectAddr3 = <whatever>;
VICVectCntl3 = 0x2F;
........
........
//Change mode of the interrupt pin
PIN_Set_Mode(014,1,0); //P0.14 with mode bits 10
........
EXTMODE |= 0x02; //Use Edge triggered
EXTWAKE |= 0x02; //Interrupt wake the processor
........
EXTINT |= 0x02; //Clear the EINT1 interrupt source
........
VICIntEnable |= 0x008000; //Enable EINT1
........
while(1)
  {
  Function_to_toggle_a_GPIO_pin();
  Delay();
  }

In the ISR:
{
EXTINT |= 0x02; //clear the source of the interrupt
Counter_G++;
Display_value_of_Counter();
} 

Now for the problems:

With this initialization sequence, the initialization
stops when changing to edge triggered mode. By
removing this and the following line (Wake up
related), the initialization runs all the way through.
However, in this mode, it is in level triggered mode.
triggering the interrupt causes the counter to be
updated.... however, this happens only once... while
the back ground task continues to run, showing that
the ISR is exited....

I should also mention that incase of an undefined
interrupt, the system goes into an infinite loop...
could this and enabling the VIC channel before setting
up the interrupt be the cause of the problem?

Can anyone help me in solving this problem?

Regards,

Musharraf Hanif


		
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail

Re: Problem configuring external interrupts...

2004-08-05 by douglasbolton

--- In lpc2000@yahoogroups.com, Musharraf Hanif 
<musharraf_hanif@y...> wrote:
> Hi,
> 
> I am trying to setup my LPC2129 (MCB2100) to respond
> to external interrupts. I am using the following
> initialization sequence (For the interrupt):
> 
> ........
> VICVectAddr3 = <whatever>;
> VICVectCntl3 = 0x2F;
> ........
> ........
> //Change mode of the interrupt pin
> PIN_Set_Mode(014,1,0); //P0.14 with mode bits 10
> ........
> EXTMODE |= 0x02; //Use Edge triggered
> EXTWAKE |= 0x02; //Interrupt wake the processor
> ........
> EXTINT |= 0x02; //Clear the EINT1 interrupt source
> ........
> VICIntEnable |= 0x008000; //Enable EINT1
> ........
> while(1)
>   {
>   Function_to_toggle_a_GPIO_pin();
>   Delay();
>   }
> 
> In the ISR:
> {
> EXTINT |= 0x02; //clear the source of the interrupt
> Counter_G++;
> Display_value_of_Counter();
> } 
> 
> Now for the problems:
> 
> With this initialization sequence, the initialization
> stops when changing to edge triggered mode. By
> removing this and the following line (Wake up
> related), the initialization runs all the way through.
> However, in this mode, it is in level triggered mode.
> triggering the interrupt causes the counter to be
> updated.... however, this happens only once... while
> the back ground task continues to run, showing that
> the ISR is exited....
> 
> I should also mention that incase of an undefined
> interrupt, the system goes into an infinite loop...
> could this and enabling the VIC channel before setting
> up the interrupt be the cause of the problem?
> 
> Can anyone help me in solving this problem?
> 
> Regards,
> 
> Musharraf Hanif
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Read only the mail you want - Yahoo! Mail SpamGuard.
> http://promotions.yahoo.com/new_mail


Take a look at the errata data sheet . There are some known problems 
and work arounds with external interrupts. 

Doug

Test

2004-08-05 by FabioDB

test

 
 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Realizza regali originali con le tue foto/immagini/scritte!
* Stelle & Strisce stampa quello che vuoi TU .... dove Vuoi Tu!!
* 
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2118&d=5-8

Re: Problem configuring external interrupts...

2004-08-08 by Musharraf Ahmed Hanif

Thanks for that. The controller now does not hangup during 
initialization, however, it still processes the interrupt only once. 
i.e. after the 1st interrupt, all other interrupts are ignored. I am 
clearing the EINTx flag by writing a 1 to that bit.
Has anyone managed to use external interrupts without such problems?

Regards,

Musharraf Hanif

--- In lpc2000@yahoogroups.com, "douglasbolton" <doug@c...> wrote:
> --- In lpc2000@yahoogroups.com, Musharraf Hanif 
> <musharraf_hanif@y...> wrote:
> > Hi,
> > 
> > I am trying to setup my LPC2129 (MCB2100) to respond
> > to external interrupts. I am using the following
> > initialization sequence (For the interrupt):
> > 
> > ........
> > VICVectAddr3 = <whatever>;
> > VICVectCntl3 = 0x2F;
> > ........
> > ........
> > //Change mode of the interrupt pin
> > PIN_Set_Mode(014,1,0); //P0.14 with mode bits 10
> > ........
> > EXTMODE |= 0x02; //Use Edge triggered
> > EXTWAKE |= 0x02; //Interrupt wake the processor
> > ........
> > EXTINT |= 0x02; //Clear the EINT1 interrupt source
> > ........
> > VICIntEnable |= 0x008000; //Enable EINT1
> > ........
> > while(1)
> >   {
> >   Function_to_toggle_a_GPIO_pin();
> >   Delay();
> >   }
> > 
> > In the ISR:
> > {
> > EXTINT |= 0x02; //clear the source of the interrupt
> > Counter_G++;
> > Display_value_of_Counter();
> > } 
> > 
> > Now for the problems:
> > 
> > With this initialization sequence, the initialization
> > stops when changing to edge triggered mode. By
> > removing this and the following line (Wake up
> > related), the initialization runs all the way through.
> > However, in this mode, it is in level triggered mode.
> > triggering the interrupt causes the counter to be
> > updated.... however, this happens only once... while
> > the back ground task continues to run, showing that
> > the ISR is exited....
> > 
> > I should also mention that incase of an undefined
> > interrupt, the system goes into an infinite loop...
> > could this and enabling the VIC channel before setting
> > up the interrupt be the cause of the problem?
> > 
> > Can anyone help me in solving this problem?
> > 
> > Regards,
> > 
> > Musharraf Hanif
> > 
> > 
> > 		
> > __________________________________
> > Do you Yahoo!?
> > Read only the mail you want - Yahoo! Mail SpamGuard.
> > http://promotions.yahoo.com/new_mail
> 
> 
> Take a look at the errata data sheet . There are some known 
problems 
Show quoted textHide quoted text
> and work arounds with external interrupts. 
> 
> Doug

Re: Problem configuring external interrupts...

2004-08-08 by haack0815

Hi Musharraf,

at the end of your ISR you must reset the VICVectAddr to 0.

Andreas

--- In lpc2000@yahoogroups.com, "Musharraf Ahmed Hanif"
<musharraf_hanif@y...> wrote:
Show quoted textHide quoted text
> Thanks for that. The controller now does not hangup during 
> initialization, however, it still processes the interrupt only once. 
> i.e. after the 1st interrupt, all other interrupts are ignored. I am 
> clearing the EINTx flag by writing a 1 to that bit.
> Has anyone managed to use external interrupts without such problems?
> 
> Regards,
> 
> Musharraf Hanif
> 
> --- In lpc2000@yahoogroups.com, "douglasbolton" <doug@c...> wrote:
> > --- In lpc2000@yahoogroups.com, Musharraf Hanif 
> > <musharraf_hanif@y...> wrote:
> > > Hi,
> > > 
> > > I am trying to setup my LPC2129 (MCB2100) to respond
> > > to external interrupts. I am using the following
> > > initialization sequence (For the interrupt):
> > > 
> > > ........
> > > VICVectAddr3 = <whatever>;
> > > VICVectCntl3 = 0x2F;
> > > ........
> > > ........
> > > //Change mode of the interrupt pin
> > > PIN_Set_Mode(014,1,0); //P0.14 with mode bits 10
> > > ........
> > > EXTMODE |= 0x02; //Use Edge triggered
> > > EXTWAKE |= 0x02; //Interrupt wake the processor
> > > ........
> > > EXTINT |= 0x02; //Clear the EINT1 interrupt source
> > > ........
> > > VICIntEnable |= 0x008000; //Enable EINT1
> > > ........
> > > while(1)
> > >   {
> > >   Function_to_toggle_a_GPIO_pin();
> > >   Delay();
> > >   }
> > > 
> > > In the ISR:
> > > {
> > > EXTINT |= 0x02; //clear the source of the interrupt
> > > Counter_G++;
> > > Display_value_of_Counter();
> > > } 
> > > 
> > > Now for the problems:
> > > 
> > > With this initialization sequence, the initialization
> > > stops when changing to edge triggered mode. By
> > > removing this and the following line (Wake up
> > > related), the initialization runs all the way through.
> > > However, in this mode, it is in level triggered mode.
> > > triggering the interrupt causes the counter to be
> > > updated.... however, this happens only once... while
> > > the back ground task continues to run, showing that
> > > the ISR is exited....
> > > 
> > > I should also mention that incase of an undefined
> > > interrupt, the system goes into an infinite loop...
> > > could this and enabling the VIC channel before setting
> > > up the interrupt be the cause of the problem?
> > > 
> > > Can anyone help me in solving this problem?
> > > 
> > > Regards,
> > > 
> > > Musharraf Hanif
> > > 
> > > 
> > > 		
> > > __________________________________
> > > Do you Yahoo!?
> > > Read only the mail you want - Yahoo! Mail SpamGuard.
> > > http://promotions.yahoo.com/new_mail
> > 
> > 
> > Take a look at the errata data sheet . There are some known 
> problems 
> > and work arounds with external interrupts. 
> > 
> > Doug

Re: [lpc2000] Re: Problem configuring external interrupts...

2004-08-09 by Robert Adsett

At 05:46 PM 8/8/04 +0000, you wrote:
>at the end of your ISR you must reset the VICVectAddr to 0.
Actually any value will do.  The following works just fine

         ldr     r0, =VICVectAddrRead    /*  Let VIC know we are done.   */
         str     r0,[r0]

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,
be they legal, genetic, or physical.  If you don't believe me, try to
chew a radio signal. "

                         Kelvin Throop, III

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.