Yahoo Groups archive

Lpc2000

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

Thread

external interrupt problem

external interrupt problem

2004-07-22 by douglasbolton

When I set up an external edge sensitive interrupt EINT3 on an 
lpc2129 all sorts of problems happen. The jtag stops working and 
won't work again until I reprogram through the ISP.

The pin is sitting stable at about 2.8 volts when I run the following 
code. If I set up for level sensitive it is ok.

// initialise pin 0.30 (EINT3) to have a negative edge 
// triggered interrupt

PINSEL1_bit.P0_30=0x2; 
EXTMODE = 0x08;

// enable the interrupt control	
VICIntSelect &= ~(1<<VIC_EINT3);  // IRQ on external interrupt
VICVectAddr3 = (uint32_t)&ShutdownRamInterrupt;
VICVectCntl3 = 0x20 | VIC_EINT3; // vector interrupt for external 3
VICIntEnable = (1<<VIC_EINT3);    // Enable external 3 interrupt.
		
Anybody used EINT3 edge sensitive on an lpc2129

thanks Doug

Re: external interrupt problem

2004-07-22 by Leighton Rowe

Are u using IAR? I had to modify the header file I got (iolpc2129.h) 
because apparently the EINT3 channel wasn't defined.

Well assuming that you're using channel 17 for EINT3... 

#define VIC_EINT3       17

...the code looks ok. 


Otherwise try clearing the EINT3 flag before enabling the interrupt 
and let me know what happens.

Leighton



--- In lpc2000@yahoogroups.com, "douglasbolton" <doug@c...> wrote:
> When I set up an external edge sensitive interrupt EINT3 on an 
> lpc2129 all sorts of problems happen. The jtag stops working and 
> won't work again until I reprogram through the ISP.
> 
> The pin is sitting stable at about 2.8 volts when I run the 
following 
Show quoted textHide quoted text
> code. If I set up for level sensitive it is ok.
> 
> // initialise pin 0.30 (EINT3) to have a negative edge 
> // triggered interrupt
> 
> PINSEL1_bit.P0_30=0x2; 
> EXTMODE = 0x08;
> 
> // enable the interrupt control	
> VICIntSelect &= ~(1<<VIC_EINT3);  // IRQ on external interrupt
> VICVectAddr3 = (uint32_t)&ShutdownRamInterrupt;
> VICVectCntl3 = 0x20 | VIC_EINT3; // vector interrupt for external 3
> VICIntEnable = (1<<VIC_EINT3);    // Enable external 3 interrupt.
> 		
> Anybody used EINT3 edge sensitive on an lpc2129
> 
> thanks Doug

Re: external interrupt problem

2004-07-22 by douglasbolton

--- In lpc2000@yahoogroups.com, "Leighton Rowe" <leightonsrowe@y...> 
wrote:
> Are u using IAR? I had to modify the header file I got 
(iolpc2129.h) 
> because apparently the EINT3 channel wasn't defined.
> 
> Well assuming that you're using channel 17 for EINT3... 
> 
> #define VIC_EINT3       17
> 
> ...the code looks ok. 
> 
> 
> Otherwise try clearing the EINT3 flag before enabling the interrupt 
> and let me know what happens.
> 
> Leighton
> 
> 
> 
> --- In lpc2000@yahoogroups.com, "douglasbolton" <doug@c...> wrote:
> > When I set up an external edge sensitive interrupt EINT3 on an 
> > lpc2129 all sorts of problems happen. The jtag stops working and 
> > won't work again until I reprogram through the ISP.
> > 
> > The pin is sitting stable at about 2.8 volts when I run the 
> following 
> > code. If I set up for level sensitive it is ok.
> > 
> > // initialise pin 0.30 (EINT3) to have a negative edge 
> > // triggered interrupt
> > 
> > PINSEL1_bit.P0_30=0x2; 
> > EXTMODE = 0x08;
> > 
> > // enable the interrupt control	
> > VICIntSelect &= ~(1<<VIC_EINT3);  // IRQ on external interrupt
> > VICVectAddr3 = (uint32_t)&ShutdownRamInterrupt;
> > VICVectCntl3 = 0x20 | VIC_EINT3; // vector interrupt for external 
3
> > VICIntEnable = (1<<VIC_EINT3);    // Enable external 3 interrupt.
> > 		
> > Anybody used EINT3 edge sensitive on an lpc2129
> > 
> > thanks Doug



Thanks Leighton but I'd already modified my IAR header file for the 
lpc2129.

Clearing the interrupt before the EXTMODE = 0x08 command did not do 
anything either.

The external interrupt works fine in level sensitive mode, but as 
soon as I write the EXTMODE register with 0x08 to enable level 
sensitive mode on interrupt 3 the processor goes into deep space. 

The EXTMODE register I'm writing is at 0xE01FC148 which agrees with 
the manual.

Something is going very wrong with the processor since I have to 
reprogram the flash with the ISP to get it working again. No matter 
what I do the JTAG is finished.

Re: external interrupt problem

2004-07-23 by douglasbolton

I've now got it down to any write to the EXTMODE register causes the 
processor to fail.

Even writing the reset value of 0x0 to it causes a problem. Below is 
the IAR assembler used to write the register with 0x0. I can't see 
anything wrong with this. However as soon as the register is written, 
see you later from the processor.

//  273 	EXTMODE = 0x0;		
   LDR         R3,??LPC210xInitExtIntPin_0+8  ;; 0xe01fc148
   MOV         R1,#+0x0
   STR         R1,[R3, #+0]


Has anybody else out there accessed the EXTMODE register on an 
lpc2129??

Re: [lpc2000] Re: external interrupt problem

2004-07-23 by Leighton Rowe

Hey Doug,

I meant clearing the flags after setting EXTMODE as
suggested on pg.68.

EXTMODE = 0x08; //only controls the sensitivity
EXTINT = 0x08;  //clear EINT3 flag
...
...
VICIntEnable = (1<<VIC_EINT3);    // Enable external 3
interrupt.

Your 2nd reply (which just came) looks kinda spooky.
What kind-off exception r u getting? If EINT0-2 can
work on edge sensitive mode, then I wouldn't give up
on EINT3 quite yet. There's must be a way to get
around to it.

Good luck,
Leighton



		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail

Re: external interrupt problem

2004-07-23 by douglasbolton

--- In lpc2000@yahoogroups.com, Leighton Rowe <leightonsrowe@y...> 
wrote:
> Hey Doug,
> 
> I meant clearing the flags after setting EXTMODE as
> suggested on pg.68.
> 
> EXTMODE = 0x08; //only controls the sensitivity
> EXTINT = 0x08;  //clear EINT3 flag
> ...
> ...
> VICIntEnable = (1<<VIC_EINT3);    // Enable external 3
> interrupt.
> 
> Your 2nd reply (which just came) looks kinda spooky.
> What kind-off exception r u getting? If EINT0-2 can
> work on edge sensitive mode, then I wouldn't give up
> on EINT3 quite yet. There's must be a way to get
> around to it.
> 
> Good luck,
> Leighton


Leighton

I've tried all of the above and even tried another board with no luck.

As soon as I write EXTMODE to a value the JTAG aborts. If I program 
flash and run the processor hangs.

I'm at a loss to where to go from here. For my current application I 
can run using level sensitive (using reset value of EXTMODE). However 
I would like to know why writing to this register causes such a 
problem.

Re: external interrupt problem

2004-07-23 by Karl Olsen

--- In lpc2000@yahoogroups.com, "douglasbolton" <doug@c...> wrote:
> I've now got it down to any write to the EXTMODE register causes 
the 
> processor to fail.
> 
> Even writing the reset value of 0x0 to it causes a problem. Below 
is 
> the IAR assembler used to write the register with 0x0. I can't see 
> anything wrong with this. However as soon as the register is 
written, 
> see you later from the processor.
> 
> //  273 	EXTMODE = 0x0;		
>    LDR         R3,??LPC210xInitExtIntPin_0+8  ;; 0xe01fc148
>    MOV         R1,#+0x0
>    STR         R1,[R3, #+0]
> 
> 
> Has anybody else out there accessed the EXTMODE register on an 
> lpc2129??

The errata sheet mentions an issue with writing to EXTPOLAR or 
EXTMODE.

Karl Olsen

Re: external interrupt problem

2004-07-27 by douglasbolton

--- In lpc2000@yahoogroups.com, "Karl Olsen" <kro@p...> wrote:
> --- In lpc2000@yahoogroups.com, "douglasbolton" <doug@c...> wrote:
> > I've now got it down to any write to the EXTMODE register causes 
> the 
> > processor to fail.
> > 
> > Even writing the reset value of 0x0 to it causes a problem. Below 
> is 
> > the IAR assembler used to write the register with 0x0. I can't 
see 
> > anything wrong with this. However as soon as the register is 
> written, 
> > see you later from the processor.
> > 
> > //  273 	EXTMODE = 0x0;		
> >    LDR         R3,??LPC210xInitExtIntPin_0+8  ;; 0xe01fc148
> >    MOV         R1,#+0x0
> >    STR         R1,[R3, #+0]
> > 
> > 
> > Has anybody else out there accessed the EXTMODE register on an 
> > lpc2129??
> 
> The errata sheet mentions an issue with writing to EXTPOLAR or 
> EXTMODE.
> 
> Karl Olsen


Thank you Karl. I hadn't read the the errata for a while and missed 
that one. 

Anybody else using edge sensitive interrupts should note -

Make sure you do actually write 0x0 to VPBDIV before actually writing 
to EXTMODE. If you just write to EXTMODE at reset when VPBDIV is 0x0 
there still is a problem.

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.