Yahoo Groups archive

Lpc2000

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

Message

Capture pin interrupts, part 2

2005-05-05 by jase_ko

Hi guys,

I have a pin (P0.16) set up as a capture pin CAP0.2 to copy timer0
TC value into CR2 every time I detect a rising edge.

This is done using
PINSEL1 |= 0x00000002;
T0CCR = 0x140;

The value 0x140 for T0CCR sets it up to detect rising edges and
generate an interrupt. My problem is:
I want to record the contents of the CR2 register (ie. the TC when a
rising edge is detected). I know the CR2 register gets the TC value
when the rising edge occurs, however I need an interrupt routine to
copy CR2 to my own data structure. My question is, how do I set up
an interrupt method that is called by the capture pin?

I know it's got to do with VIC, but I'm unsure how to link an
interrupt method, with the capture pin P0.16
eg, how do I link the interrupt method specified at vicvectaddr0 to
occur when the capture pin is triggered by the rising edge?

say I have
PINSEL1 |= 0x00000002;
T0CCR = 0x140;
VICVectAddr1 = (unsigned long)myCaptureMethod;

How do I make it so the capture pin calls myCaptureMethod?

thanks

Attachments

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.