This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Help with interrupt on lpc2368

Hi!

Im using a lpc2368 I need some help setting up external interrupt. I get square waves on P2.13 and P1.31 and want to get interrupts on the raising edge on these ports. How do I this? Im guessing I need to install my interrupt handler with:

VIC_Install_IRQ(DWORD IntNumber, void* HandlerAddr, DWORD Priority)

What is the input parameters for that function?

lets assume that we got these handlers:

void MyEINTHandler0(void) __irq{ //do something...

VICVectAddr = 0; // ACK the VIC
}

and

void MyEINTHandler1(void) __irq{ //do something...

VICVectAddr = 0; // ACK the VIC
}

to install them just run

VIC_Install_IRQ(???,(void *)MyEINTHandler0,???);
VIC_Install_IRQ(???,(void *)MyEINTHandler1,???);

but what is IntNumber and priority? Where do I set which port and bit to trigger the interrupts? Any good examples to look at?

Best wishes.

Parents
  • The processor can have four processor pins that generates external interrupt 0 to external interrupt 3 - all individually enabled and configurable for type of interrupt (such as rising or falling edge).

    The processor also have two pin-change interrupts - all 32 pins on p0 and all 32 pins on p2 can be configured to generate pin change interrupts.

    That one VIC channel is handling both eint3 and pin change interrupts means that if you use both, your interrupt handler needs to check a couple of status bits to figure out the reason for the interrupt.

    If the search function had been working, I would have recommend you to use it. It wasn't more than a couple of weeks since I did cover this in another thread.

    If you the source was a pin-change interrupt, then a different register can tell which of the 32 pins on the port that was causing it.

    The advantage with EINTx from the pin-change interrupts is that you you have better control of priority for the EINTx signals while at the same time get a slightly faster interrupt handler.

    But all this is covered excellently in the NXP user manuals. They really have very good manuals for the ARM families I have been looking at.

Reply
  • The processor can have four processor pins that generates external interrupt 0 to external interrupt 3 - all individually enabled and configurable for type of interrupt (such as rising or falling edge).

    The processor also have two pin-change interrupts - all 32 pins on p0 and all 32 pins on p2 can be configured to generate pin change interrupts.

    That one VIC channel is handling both eint3 and pin change interrupts means that if you use both, your interrupt handler needs to check a couple of status bits to figure out the reason for the interrupt.

    If the search function had been working, I would have recommend you to use it. It wasn't more than a couple of weeks since I did cover this in another thread.

    If you the source was a pin-change interrupt, then a different register can tell which of the 32 pins on the port that was causing it.

    The advantage with EINTx from the pin-change interrupts is that you you have better control of priority for the EINTx signals while at the same time get a slightly faster interrupt handler.

    But all this is covered excellently in the NXP user manuals. They really have very good manuals for the ARM families I have been looking at.

Children