Yahoo Groups archive

Lpc2000

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

Thread

measuring pulse width

measuring pulse width

2005-08-08 by Gus

Hello,

What is the shortest pulse you can mesure on LPC capture module?

I am trying to measure some pulses using the capture hardware on LPC 
chips. The processor is running at 48Mhz and my capture module is 
running at 1us/ticks

Connecting a function generator, I can read valid results up to 1Khz. 
When I go over 10KHz, the reading is not stable at all! About 10% up 
and down.

Thanks,

Gus

Re: [lpc2000] measuring pulse width

2005-08-08 by thomas.kuschel@anton-paar.com

Hi Gus,

I use to capture pulses for measuring own-build semi-digital signals with 
different pulse-width and different periods to encoding information.
My lpc2129 is running at 14.7456 * 4 = 58.9824 MHz with Timer running at 
full speed, so I can capture 1/(58.9824*10^6) s resolution in time 
information,
that's about  17 ns resolution! ... and it really works
Don't know how you're capturing your signal? I capture on rising edge with 
interrupt and on falling edge without interrupt (same signal on two 
different pins). Inside interrupt routine, the values of both
capture-registers are read and compared with with each another and with 
the last value from one periode before; Since the timer is a 32 bit timer, 
the
maximum period is about 2^32 * resolution -> 73 seconds; to get a 
frequency range: 0.014 Hz to near 58.9824 MHz (hi)

Thomas


lpc2000@yahoogroups.com wrote on 08.08.2005 18:36:18:

> Hello,
> 
> What is the shortest pulse you can mesure on LPC capture module?
> 
> I am trying to measure some pulses using the capture hardware on LPC 
> chips. The processor is running at 48Mhz and my capture module is 
> running at 1us/ticks
> 
> Connecting a function generator, I can read valid results up to 1Khz. 
> When I go over 10KHz, the reading is not stable at all! About 10% up 
> and down.
> 
> Thanks,
> 
> Gus
> 
> 
> 
> 
> 
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> 


[Non-text portions of this message have been removed]

Re: measuring pulse width

2005-08-08 by philips_apps

Hello Gus,

LPC2000 samples every CAPx.y input in use at the rate of pclk. It 
takes two consecutive CAPx.y samples for a transition to be detected 
(i.e. if the current CAPx.y sample is high and the previous sample
was low, CAPx.y recognizes a rising edge). 

Assuming no jitter in the processed incoming signal and no jitter in 
the cclk/pclk clock, consecutive readings of the CAPx.y register 
content should not vary for more than 2 ticks in the worst case. The 
first uncertainty tick comes from the detection of the pulse's
leading edge, and the second uncertainty tick comes from the 
detection of the pulse's trailing edge.

What is the duty cycle of the signal you are processing? Do you use 
the same capture input to detect both rising and falling edge or you 
have two dedicated capture configured pins?

Regards,

Philips Apps Team



--- In lpc2000@yahoogroups.com, "Gus" <gus_is_working@y...> wrote:
> Hello,
> 
> What is the shortest pulse you can mesure on LPC capture module?
> 
> I am trying to measure some pulses using the capture hardware on
LPC 
> chips. The processor is running at 48Mhz and my capture module is 
> running at 1us/ticks
> 
> Connecting a function generator, I can read valid results up to 
1Khz. 
> When I go over 10KHz, the reading is not stable at all! About 10%
up 
Show quoted textHide quoted text
> and down.
> 
> Thanks,
> 
> Gus

Re: measuring pulse width

2005-08-09 by Gus

From what you guys are saying, I think my ISR is too slow!! When I 
feed my system with 10KHz 50% duty, I get 10% error around the 
correct value
In my ISR, I mesure the pulse width by subtracting the last timer 
count from the current timer count.

Any suggestions?
On an average, how many interrupts/second can the LPC handle?
On 10KHz with 8 cpture channels, I get 160,000 interrupts per 
second. Is this possible?

Gus

--- In lpc2000@yahoogroups.com, "philips_apps" <philips_apps@y...> 
wrote:
> Hello Gus,
> 
> LPC2000 samples every CAPx.y input in use at the rate of pclk. It 
> takes two consecutive CAPx.y samples for a transition to be 
detected 
> (i.e. if the current CAPx.y sample is high and the previous sample
> was low, CAPx.y recognizes a rising edge). 
> 
> Assuming no jitter in the processed incoming signal and no jitter 
in 
> the cclk/pclk clock, consecutive readings of the CAPx.y register 
> content should not vary for more than 2 ticks in the worst case. 
The 
> first uncertainty tick comes from the detection of the pulse's
> leading edge, and the second uncertainty tick comes from the 
> detection of the pulse's trailing edge.
> 
> What is the duty cycle of the signal you are processing? Do you 
use 
> the same capture input to detect both rising and falling edge or 
you 
> have two dedicated capture configured pins?
> 
> Regards,
> 
> Philips Apps Team
> 
> 
> 
> --- In lpc2000@yahoogroups.com, "Gus" <gus_is_working@y...> wrote:
> > Hello,
> > 
> > What is the shortest pulse you can mesure on LPC capture module?
> > 
> > I am trying to measure some pulses using the capture hardware on
> LPC 
> > chips. The processor is running at 48Mhz and my capture module 
is 
Show quoted textHide quoted text
> > running at 1us/ticks
> > 
> > Connecting a function generator, I can read valid results up to 
> 1Khz. 
> > When I go over 10KHz, the reading is not stable at all! About 10%
> up 
> > and down.
> > 
> > Thanks,
> > 
> > Gus

Re: [lpc2000] Re: measuring pulse width

2005-08-09 by Don Williams

Gus,
Why dont you just gate the incoming frequency with a pwm/timer output which
generates an interrupt also when it goes "off" (could be clock tic from ur
RTOS) and with the larger collection of  cycles each millisecond (say) ur
accuracy can be limited only by ur PCLK frequency. The ISR should just read
the timer and reset it allowing the CAP a fresh start and background process
ur calcs for the frequency. You can make it easy by selecting a suitable
PCLK frequency also.
Good grief Charlie Brown!
Rgds
DonW

----- Original Message ----- 
Show quoted textHide quoted text
From: "Gus" <gus_is_working@...>
To: <lpc2000@yahoogroups.com>
Sent: Tuesday, August 09, 2005 10:56 PM
Subject: [lpc2000] Re: measuring pulse width


> >From what you guys are saying, I think my ISR is too slow!! When I
> feed my system with 10KHz 50% duty, I get 10% error around the
> correct value
> In my ISR, I mesure the pulse width by subtracting the last timer
> count from the current timer count.
>
> Any suggestions?
> On an average, how many interrupts/second can the LPC handle?
> On 10KHz with 8 cpture channels, I get 160,000 interrupts per
> second. Is this possible?
>
> Gus
>
> --- In lpc2000@yahoogroups.com, "philips_apps" <philips_apps@y...>
> wrote:
> > Hello Gus,
> >
> > LPC2000 samples every CAPx.y input in use at the rate of pclk. It
> > takes two consecutive CAPx.y samples for a transition to be
> detected
> > (i.e. if the current CAPx.y sample is high and the previous sample
> > was low, CAPx.y recognizes a rising edge).
> >
> > Assuming no jitter in the processed incoming signal and no jitter
> in
> > the cclk/pclk clock, consecutive readings of the CAPx.y register
> > content should not vary for more than 2 ticks in the worst case.
> The
> > first uncertainty tick comes from the detection of the pulse's
> > leading edge, and the second uncertainty tick comes from the
> > detection of the pulse's trailing edge.
> >
> > What is the duty cycle of the signal you are processing? Do you
> use
> > the same capture input to detect both rising and falling edge or
> you
> > have two dedicated capture configured pins?
> >
> > Regards,
> >
> > Philips Apps Team
> >
> >
> >
> > --- In lpc2000@yahoogroups.com, "Gus" <gus_is_working@y...> wrote:
> > > Hello,
> > >
> > > What is the shortest pulse you can mesure on LPC capture module?
> > >
> > > I am trying to measure some pulses using the capture hardware on
> > LPC
> > > chips. The processor is running at 48Mhz and my capture module
> is
> > > running at 1us/ticks
> > >
> > > Connecting a function generator, I can read valid results up to
> > 1Khz.
> > > When I go over 10KHz, the reading is not stable at all! About 10%
> > up
> > > and down.
> > >
> > > Thanks,
> > >
> > > Gus
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>

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.