EmbeddedRelated.com
Forums

lpc2148 Crossworks interrupt problem

Started by "ernst.cozijnsen" February 19, 2009
--- In l..., Ernst Cozijnsen
wrote:
>
> So if i see this correct:
>
> I need to remove the "VECTORED_IRQ_ INTERRUPTS from teh startup file
so i can use the crosworks style ctl libs right?

Just make sure it isn't defined, you shouldn't need to modify the
startup file.

Regards
Michael

>
> Remenber i'm a newb at this so dont start slapping me right away
>
> Ernst
>
> --- On Mon, 2/23/09, nutleycottage wrote:
>
> From: nutleycottage
> Subject: [lpc2000] Re: lpc2148 Crossworks interrupt problem
> To: l...
> Date: Monday, February 23, 2009, 7:33 AM
>
>
> Hi,
>
> Jeff has spotted your problem. With "VECTORED_IRQ_ INTERRUPTS" defined
>
> your interrupt handler will be called directly by the VIC so the
>
> interrupt("IRQ" ) attribute is required. If you remove the define
>
> "VECTORED_IRQ_ INTERRUPTS" then all interrupts are handled by
>
> irq_handler which calls the regular function held in the VIC register.
>
> Regards
>
> Michael
>
> > > Have you set the preprocessor definition "VECTORED_IRQ_ INTERRUPTS" ?
>
> > > Assuming you are using the default startup file that Crossworks sets
>
> > up for a project, look in the Philips_LPC210X_ Startup.s file.
>
> > > Jeff
>
> > > > --- In lpc2000@yahoogroups .com, "ernst.cozijnsen"
>
> > wrote:
>
> > > > > Brothers in ARM(s),
>
> > > > > I'm still having issues getting interrupts ctl api to work
>
> > conrrectly
>
> > > in crossworks.
>
> > > The bottom code only works when i use:
>
> > > void isr (void) __attribute_ _ ((interrupt( "IRQ")));
>
> > > > > As i understood this line should be avoided because the ctl library
>
> > > takes care of this.
>
> > > I read the manuals trough but i cannot get to a sollution for this.
>
> > > > > Does anyone have ran into the same issue or knows a way to fix it?
>
> > > > > > > #include "LPC214x.h"
>
> > > #include > > #define PLOCK 0x400
>
> > > void init(void);
>
> > > void delay_ms(int) ;
>
> > > > > volatile int servo;
>
> > > > > int main(void)
>
> > > {
>
> > > init();
>
> > > init_isr();
>
> > > PINSEL1 = 0x10000000; //p0.30 = AD0.3
>
> > > IODIR0 = 0x00200000; //p0.21 = output
>
> > > AD0CR = 0x00210e08; //start burst A/D on AD0.3
>
> > > T0TCR = 0x02; //reset counter
>
> > > T0IR = 0xff;
>
> > > T0MCR = 0x0003; //interrupt and reset on MR0
>
> > > T0MR0 = 0x00124f80; //compare-hit count
>
> > > T0TCR = 0x01; //enable Timer0
>
> > > ctl_global_interrup ts_enable( );
>
> > >
>
> > > while(1){
>
> > > }
>
> > > }
>
> > > > > > > void init_isr(void)
>
> > > {
>
> > > ctl_set_isr( 4, 0, CTL_ISR_TRIGGER_ FIXED, isr, 0);
>
> > > ctl_unmask_isr( 4);
>
> > > }
>
> > > > > void isr(void)
>
> > > {
>
> > > // DO stuff
>
> > > T0IR = 0x01; //clear interrupt
>
> > > }
>
> > > >
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

An Engineer's Guide to the LPC2100 Series

Ramesh,

Please be so kind and open up a topic for yourself if you need help!

Ernst

--- On Mon, 2/23/09, Hemanandha Ramesh wrote:

From: Hemanandha Ramesh
Subject: Re: [lpc2000] Re: lpc2148 Crossworks interrupt problem
To: l...
Date: Monday, February 23, 2009, 11:55 AM


Hi,

i'm fresher to work with the lpc2106... can anyone help me hw to start the asm program in the KEIL-uV3!! more over i didnt run any instructions for lpcin KEIL.. can anybody help me with proper guidance and asm sample programs for lpc2106!!!

Thanks and Regards,

PHR.

____________ _________ _________ __

From: nutleycottage

To: lpc2000@yahoogroups .com

Sent: Monday, 23 February, 2009 1:03:00 PM

Subject: [lpc2000] Re: lpc2148 Crossworks interrupt problem

Hi,

Jeff has spotted your problem. With "VECTORED_IRQ_ INTERRUPTS" defined

your interrupt handler will be called directly by the VIC so the

interrupt("IRQ" ) attribute is required. If you remove the define

"VECTORED_IRQ_ INTERRUPTS" then all interrupts are handled by

irq_handler which calls the regular function held in the VIC register.

Regards

Michael

>

> Have you set the preprocessor definition "VECTORED_IRQ_ INTERRUPTS" ?

>

> Assuming you are using the default startup file that Crossworks sets

> up for a project, look in the Philips_LPC210X_ Startup.s file.

>

> Jeff

>

>

> --- In lpc2000@yahoogroups .com, "ernst.cozijnsen"

> wrote:

> >

> > Brothers in ARM(s),

> >

> > I'm still having issues getting interrupts ctl api to work

> conrrectly

> > in crossworks.

> > The bottom code only works when i use:

> > void isr (void) __attribute_ _ ((interrupt( "IRQ")));

> >

> > As i understood this line should be avoided because the ctl library

> > takes care of this.

> > I read the manuals trough but i cannot get to a sollution for this.

> >

> > Does anyone have ran into the same issue or knows a way to fix it?

> >

> >

> > #include "LPC214x.h"

> > #include

> > #define PLOCK 0x400

> > void init(void);

> > void delay_ms(int) ;

> >

> > volatile int servo;

> >

> > int main(void)

> > {

> > init();

> > init_isr();

> > PINSEL1 = 0x10000000; //p0.30 = AD0.3

> > IODIR0 = 0x00200000; //p0.21 = output

> > AD0CR = 0x00210e08; //start burst A/D on AD0.3

> > T0TCR = 0x02; //reset counter

> > T0IR = 0xff;

> > T0MCR = 0x0003; //interrupt and reset on MR0

> > T0MR0 = 0x00124f80; //compare-hit count

> > T0TCR = 0x01; //enable Timer0

> > ctl_global_interrup ts_enable( );

> >

> > while(1){

> > }

> > }

> >

> >

> > void init_isr(void)

> > {

> > ctl_set_isr( 4, 0, CTL_ISR_TRIGGER_ FIXED, isr, 0);

> > ctl_unmask_isr( 4);

> > }

> >

> > void isr(void)

> > {

> > // DO stuff

> > T0IR = 0x01; //clear interrupt

> > }

> >

>

Add more friends to your messenger and enjoy! Go to http://messenger. yahoo.com/ invite/





















Hai,
    Tnx for ur help, but i gone through the sample examples in the compiler i.e,(u Vision Help) and the sample programs!!! but i need nw is the linking of the c and asm in same file,
and can u tell me hw to start the asm program i.e start up... that is (_asm or asm) before starting the program? if u hav some more sample programs other than in compiler plz forward that to me.. so tat i can learn quick,.. friend!!!!
Thanks & Regards,
PHR

________________________________
From: jtd
To: l...
Sent: Monday, 23 February, 2009 7:56:43 PM
Subject: Re: [lpc2000] Re: lpc2148 Crossworks interrupt problem
On Monday 23 February 2009 19:30, 42Bastian wrote:
> Hemanandha Ramesh schrieb:
> > Hi,
> > i'm fresher to work with the lpc2106... can anyone help me
> > hw to start the asm program in the KEIL-uV3!! more over i didnt
> > run any instructions for lpc in KEIL.. can anybody help me with
> > proper guidance and asm sample programs for lpc2106!!!
>
> Look in the examples folder of the compiler and read the
> documentation.
>
> Heck, did the new semester start ???

No. the old one is ending. Journal submission is just around the
corner here in India. And NXP or some smart sales guy must be dishing
out arm devices and development kits to the college labs.

--
Rgds
JTD

Connect with friends all over the world. Get Yahoo! India Messenger at http://in.messenger.yahoo.com/?wm=n/



Ok after removing ""VECTORED_IRQ_ INTERRUPTS" from the startup file the complete christmas tree lit up ;-)

Problem solved!

Thanks

Ernst

--- On Mon, 2/23/09, Ernst Cozijnsen wrote:

From: Ernst Cozijnsen
Subject: Re: [lpc2000] Re: lpc2148 Crossworks interrupt problem
To: l...
Date: Monday, February 23, 2009, 12:35 PM

So if i see this correct:

I need to remove the "VECTORED_IRQ_ INTERRUPTS from teh startup file so i can use the crosworks style ctl libs right?

Remenber i'm a newb at this so dont start slapping me right away

Ernst

--- On Mon, 2/23/09, nutleycottage wrote:

From: nutleycottage

Subject: [lpc2000] Re: lpc2148 Crossworks interrupt problem

To: lpc2000@yahoogroups .com

Date: Monday, February 23, 2009, 7:33 AM

Hi,

Jeff has spotted your problem. With "VECTORED_IRQ_ INTERRUPTS" defined

your interrupt handler will be called directly by the VIC so the

interrupt("IRQ" ) attribute is required. If you remove the define

"VECTORED_IRQ_ INTERRUPTS" then all interrupts are handled by

irq_handler which calls the regular function held in the VIC register.

Regards

Michael

>

> Have you set the preprocessor definition "VECTORED_IRQ_ INTERRUPTS" ?

>

> Assuming you are using the default startup file that Crossworks sets

> up for a project, look in the Philips_LPC210X_ Startup.s file.

>

> Jeff

>

>

> --- In lpc2000@yahoogroups .com, "ernst.cozijnsen"

> wrote:

> >

> > Brothers in ARM(s),

> >

> > I'm still having issues getting interrupts ctl api to work

> conrrectly

> > in crossworks.

> > The bottom code only works when i use:

> > void isr (void) __attribute_ _ ((interrupt( "IRQ")));

> >

> > As i understood this line should be avoided because the ctl library

> > takes care of this.

> > I read the manuals trough but i cannot get to a sollution for this.

> >

> > Does anyone have ran into the same issue or knows a way to fix it?

> >

> >

> > #include "LPC214x.h"

> > #include

> > #define PLOCK 0x400

> > void init(void);

> > void delay_ms(int) ;

> >

> > volatile int servo;

> >

> > int main(void)

> > {

> > init();

> > init_isr();

> > PINSEL1 = 0x10000000; //p0.30 = AD0.3

> > IODIR0 = 0x00200000; //p0.21 = output

> > AD0CR = 0x00210e08; //start burst A/D on AD0.3

> > T0TCR = 0x02; //reset counter

> > T0IR = 0xff;

> > T0MCR = 0x0003; //interrupt and reset on MR0

> > T0MR0 = 0x00124f80; //compare-hit count

> > T0TCR = 0x01; //enable Timer0

> > ctl_global_interrup ts_enable( );

> >

> > while(1){

> > }

> > }

> >

> >

> > void init_isr(void)

> > {

> > ctl_set_isr( 4, 0, CTL_ISR_TRIGGER_ FIXED, isr, 0);

> > ctl_unmask_isr( 4);

> > }

> >

> > void isr(void)

> > {

> > // DO stuff

> > T0IR = 0x01; //clear interrupt

> > }

> >

>