Yahoo Groups archive

Lpc2000

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

Message

Re: PWM demodulation

2005-04-25 by lpc2100_fan

Peter,

use one Timer and capture on both edges.  Depending on your system
setup this limits the minimum pulse width somewhat but assuming it is
more than 1 usec it should be doeable.  You have to make sure that you
did already read the first value before the second got captured.
Another option is to use two capture inputs (not two timers) and do it
like you proposed the difference of the two timer snapshots.

hth Bob


--- In lpc2000@yahoogroups.com, "Peter Gray" <peter_f_gray@y...> wrote:
> 
> On other microcontrollers I've used, it was possible to start a single 
> timer on a rising edge, and capture-and-reset on a falling edge (to 
> capture the pulse time).
> 
> It doesn't look like this method is available on the (for example) 
> LPC2131. What would be a good mechanism for these microcontrollers? 
> Start two timers, feed the PWM to two pins, have one capture-and-reset 
> on rising edge, the other on the falling edge? (the difference between 
> the two capture registers would be the pulse time) or is there a 
> better way?
> 
> Thanks,
> -Pete.

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.