Yahoo Groups archive

Lpc2000

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

Message

Re: Reading capture pins

2004-04-04 by moostieuk

I've tried this before, it appears that once you've put the pins
capture/compare mode you cannot read the state directly from the pin.  

I was reading a PWM signal, so in the end I just ended up creating a
state machine and in the capture interrupt change the edge triggering
for the next capture.

Adrian

--- In lpc2000@yahoogroups.com, "bobbruce000" <bobbruce000@y...> wrote:
> I have several pins configured as capture pins which interrupt on
> either a rising of falling edge.  Then in the interrupt handler
> I read the IOPIN register to get the value.
> 
> According the description of the IOPIN register on page 81 of the
> Philips 210x User Manual, this should work.  I quote:
> 
>   "The current state of the port pins can always be read from
>     this register, regardless of pin direction and mode."
> 
> But it doesn't seem to work.  I have double and triple checked
> my code, and I 95% sure this is not a software bug.  The capture
> pins always read zero.
> 
> Is the user manual wrong?
> 
>     -bob

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.