--- In l..., "bobtransformer" wrote: >
>
> > static void timer0ISR(void)
> > {
> > if (IO0PIN=0)
> > {
> > IO0SET=LED;
> > }
> > else
>
>
> Also, did you mean to have the single equals sign in the if
> statement instead of == ? ... if (IO0PIN=0)
I deleted the "=" mark accidentally while formatting the text for posting.
Some more info that I didn't included in my first post:
1. I'm using Crossworks 1.5
2. After Timer match registers are in following states:
VICIrqStatus: 0x00000010
VICRawIntr: 0x00002018
It looks like VICVectorAddr0 is not pointing to the ISR. I tried
adding #define VECTORED_IRQ_INTERRUPTS ; and replacing code in startup.s:
But it didn't work either.
Thanks for your attention.
Reply by bobtransformer●May 29, 20062006-05-29
> static void timer0ISR(void)
> {
> if (IO0PIN=0)
> {
> IO0SET=LED;
> }
> else Also, did you mean to have the single equals sign in the if
statement instead of == ? ... if (IO0PIN=0)
boB
--- In l..., "willem_zx6r" wrote: >
> Hi,
>
> try enabling the interrupt by removing the two slashes at calling the > function __ARMLIB_enableIRQ()...
>
> --- In l..., "federr65" wrote:
> >
> > I'm just starting with LPC ( I have a LPC-H2138 board from Olicom) and > > at the beginning I'm unable to solve the
following problem:
> > I have an Timer0 set to generate interrupts. Timer works just fine, > > but I can't force the ISR to execute.
> > Below is my code:
> >
> > #include
> >
> > #define LED 0xF0000000;
> >
> > static int timer0Count, timer1Count;
> > int marker=1;
> >
> >
> > static void PLL_Init(void)
> > {
> > PLLCON=0x00000003; //Kwarc razy 4
> > PLLCFG = 0x23;
> > PLLFEED = 0xAA;
> > PLLFEED = 0x55;
> > }
> >
> > void inititate (void)
> > {
> > //PLL_Init();
> > //MAMCR = 2;
> > IO0PIN=0x0;
> > IO1PIN=0x0;
> > IO0DIR = 0xFFFFFFFF;
> > IO1DIR = 0xFFFFFFFF;
> > }
> >
> >
> >
> > static void timer0ISR(void) __attribute__ ((interrupt ("IRQ")));
> >
> > static void timer0ISR(void)
> > {
> > if (IO0PIN=0)
> > {
> > IO0SET=LED;
> > }
> > else
> > {
> > IO0CLR=0;
> > }
> > /* Clear the timer 0 interrupt */
> > T0IR = 0xFF;
> > /* Update VIC priorities */
> > VICVectAddr = 0;
> > marker++;
> > }
> >
> >
> > int main(void)
> > {
> > inititate();
> >
> > // Timer 0 interrupt is an IRQ interrupt, none is FIQ */
> > VICIntSelect =0x0;
> > /* Clear all IRQ and Enable timer 0 interrupt */
> > VICIntEnClr = 0xFFFFFFFF;
> > VICIntEnable = 0x10;
> > /* Use slot 0 for timer 0 interrupt and enable it (bit5)*/
> > VICVectCntl0 = 0x24;
> > /* Set the address of ISR for slot 0 */
> > VICVectAddr0 = (unsigned int)timer0ISR;
> > /* Match 0 reset - moe nie bykonieczne do dziaania*/
> > T0IR = 0x1;
> > /* Reset and stop timer 0 */
> > T0TCR = 0x2;
> > /* Set the timer 0 prescale counter */
> > T0PR = 0x0;
> > /* Set timer 0 match register */
> > /* Set timer 0 match register */
> > T0MR0 = 0xffff;
> > /* Generate interrupt and reset counter on match */
> > T0MCR = 0x3;
> > /* Start timer 0 */
> > T0TCR = 1;
> >
> > /* Enable Interrupts */
> > // __ARMLIB_enableIRQ();
> >
> >
> > while(1);
> > }
>
Reply by bobtransformer●May 29, 20062006-05-29
> static void timer0ISR(void)
> {
> if (IO0PIN=0)
> {
> IO0SET=LED;
> }
> else Also, did you mean to have the single equals sign in the if
statement instead of == ? ... if (IO0PIN=0)
boB
--- In l..., "willem_zx6r" wrote: >
> Hi,
>
> try enabling the interrupt by removing the two slashes at calling the > function __ARMLIB_enableIRQ()...
>
> --- In l..., "federr65" wrote:
> >
> > I'm just starting with LPC ( I have a LPC-H2138 board from Olicom) and > > at the beginning I'm unable to solve the
following problem:
> > I have an Timer0 set to generate interrupts. Timer works just fine, > > but I can't force the ISR to execute.
> > Below is my code:
> >
> > #include
> >
> > #define LED 0xF0000000;
> >
> > static int timer0Count, timer1Count;
> > int marker=1;
> >
> >
> > static void PLL_Init(void)
> > {
> > PLLCON=0x00000003; //Kwarc razy 4
> > PLLCFG = 0x23;
> > PLLFEED = 0xAA;
> > PLLFEED = 0x55;
> > }
> >
> > void inititate (void)
> > {
> > //PLL_Init();
> > //MAMCR = 2;
> > IO0PIN=0x0;
> > IO1PIN=0x0;
> > IO0DIR = 0xFFFFFFFF;
> > IO1DIR = 0xFFFFFFFF;
> > }
> >
> >
> >
> > static void timer0ISR(void) __attribute__ ((interrupt ("IRQ")));
> >
> > static void timer0ISR(void)
> > {
> > if (IO0PIN=0)
> > {
> > IO0SET=LED;
> > }
> > else
> > {
> > IO0CLR=0;
> > }
> > /* Clear the timer 0 interrupt */
> > T0IR = 0xFF;
> > /* Update VIC priorities */
> > VICVectAddr = 0;
> > marker++;
> > }
> >
> >
> > int main(void)
> > {
> > inititate();
> >
> > // Timer 0 interrupt is an IRQ interrupt, none is FIQ */
> > VICIntSelect =0x0;
> > /* Clear all IRQ and Enable timer 0 interrupt */
> > VICIntEnClr = 0xFFFFFFFF;
> > VICIntEnable = 0x10;
> > /* Use slot 0 for timer 0 interrupt and enable it (bit5)*/
> > VICVectCntl0 = 0x24;
> > /* Set the address of ISR for slot 0 */
> > VICVectAddr0 = (unsigned int)timer0ISR;
> > /* Match 0 reset - moe nie bykonieczne do dziaania*/
> > T0IR = 0x1;
> > /* Reset and stop timer 0 */
> > T0TCR = 0x2;
> > /* Set the timer 0 prescale counter */
> > T0PR = 0x0;
> > /* Set timer 0 match register */
> > /* Set timer 0 match register */
> > T0MR0 = 0xffff;
> > /* Generate interrupt and reset counter on match */
> > T0MCR = 0x3;
> > /* Start timer 0 */
> > T0TCR = 1;
> >
> > /* Enable Interrupts */
> > // __ARMLIB_enableIRQ();
> >
> >
> > while(1);
> > }
>
Reply by Piotr Fedorowicz●May 29, 20062006-05-29
> ----- Original Message -----
> From: willem_zx6r
> To: l...
> Sent: Monday, May 29, 2006 2:55 PM
> Subject: [lpc2000] Re: Problem with entering ISR
> Hi,
>
> try enabling the interrupt by removing the two slashes at calling the
> function __ARMLIB_enableIRQ()...
Tried that already. Doesn't work :/
Reply by willem_zx6r●May 29, 20062006-05-29
Hi,
try enabling the interrupt by removing the two slashes at calling the
function __ARMLIB_enableIRQ()...
--- In l..., "federr65" wrote: >
> I'm just starting with LPC ( I have a LPC-H2138 board from Olicom) and
> at the beginning I'm unable to solve the following problem:
> I have an Timer0 set to generate interrupts. Timer works just fine,
> but I can't force the ISR to execute.
> Below is my code:
>
> #include
>
> #define LED 0xF0000000;
>
> static int timer0Count, timer1Count;
> int marker=1;
>
>
> static void PLL_Init(void)
> {
> PLLCON=0x00000003; //Kwarc razy 4
> PLLCFG = 0x23;
> PLLFEED = 0xAA;
> PLLFEED = 0x55;
> }
>
> void inititate (void)
> {
> //PLL_Init();
> //MAMCR = 2;
> IO0PIN=0x0;
> IO1PIN=0x0;
> IO0DIR = 0xFFFFFFFF;
> IO1DIR = 0xFFFFFFFF;
> }
>
>
>
> static void timer0ISR(void) __attribute__ ((interrupt ("IRQ")));
>
> static void timer0ISR(void)
> {
> if (IO0PIN=0)
> {
> IO0SET=LED;
> }
> else
> {
> IO0CLR=0;
> }
> /* Clear the timer 0 interrupt */
> T0IR = 0xFF;
> /* Update VIC priorities */
> VICVectAddr = 0;
> marker++;
> }
>
>
> int main(void)
> {
> inititate();
>
> // Timer 0 interrupt is an IRQ interrupt, none is FIQ */
> VICIntSelect =0x0;
> /* Clear all IRQ and Enable timer 0 interrupt */
> VICIntEnClr = 0xFFFFFFFF;
> VICIntEnable = 0x10;
> /* Use slot 0 for timer 0 interrupt and enable it (bit5)*/
> VICVectCntl0 = 0x24;
> /* Set the address of ISR for slot 0 */
> VICVectAddr0 = (unsigned int)timer0ISR;
> /* Match 0 reset - moe nie bykonieczne do dziaania*/
> T0IR = 0x1;
> /* Reset and stop timer 0 */
> T0TCR = 0x2;
> /* Set the timer 0 prescale counter */
> T0PR = 0x0;
> /* Set timer 0 match register */
> /* Set timer 0 match register */
> T0MR0 = 0xffff;
> /* Generate interrupt and reset counter on match */
> T0MCR = 0x3;
> /* Start timer 0 */
> T0TCR = 1;
>
> /* Enable Interrupts */
> // __ARMLIB_enableIRQ();
>
>
> while(1);
> }
>
Reply by federr65●May 29, 20062006-05-29
I'm just starting with LPC ( I have a LPC-H2138 board from Olicom) and
at the beginning I'm unable to solve the following problem:
I have an Timer0 set to generate interrupts. Timer works just fine,
but I can't force the ISR to execute.
Below is my code:
#include
#define LED 0xF0000000;
static int timer0Count, timer1Count;
int marker=1;
static void PLL_Init(void)
{
PLLCON=0x00000003; //Kwarc razy 4
PLLCFG = 0x23;
PLLFEED = 0xAA;
PLLFEED = 0x55;
}
// Timer 0 interrupt is an IRQ interrupt, none is FIQ */
VICIntSelect =0x0;
/* Clear all IRQ and Enable timer 0 interrupt */
VICIntEnClr = 0xFFFFFFFF;
VICIntEnable = 0x10;
/* Use slot 0 for timer 0 interrupt and enable it (bit5)*/
VICVectCntl0 = 0x24;
/* Set the address of ISR for slot 0 */
VICVectAddr0 = (unsigned int)timer0ISR;
/* Match 0 reset - moe nie bykonieczne do dziaania*/
T0IR = 0x1;
/* Reset and stop timer 0 */
T0TCR = 0x2;
/* Set the timer 0 prescale counter */
T0PR = 0x0;
/* Set timer 0 match register */
/* Set timer 0 match register */
T0MR0 = 0xffff;
/* Generate interrupt and reset counter on match */
T0MCR = 0x3;
/* Start timer 0 */
T0TCR = 1;