Yahoo Groups archive

Lpc2000

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

Thread

Capture pin interrupt issues

Capture pin interrupt issues

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?

Thanks for any advice,

Jason

Re: [lpc2000] Capture pin interrupt issues

2005-05-05 by Robert Adsett

At 05:40 AM 5/5/05 +0000, jase_ko wrote:
<snip>
>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?

I think there are some interrupt examples with VIC setup in the files 
area.  I know there are a set of support routines for doing the VIC setup 
as well as interrupt shells in the newlib-lpc library (they are independent 
of the actual newlib stubs).

http://www.aeolusdevelopment.com/

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,   be 
they legal, genetic, or physical.  If you don't believe me, try to chew a 
radio signal. "  -- Kelvin Throop, III
http://www.aeolusdevelopment.com/

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.