Yahoo Groups archive

Lpc2000

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

Message

Re: Timer as counter...

2006-05-25 by brendanmurphy37

Mukund,

I would imagine the technique I proposed (sampling each channel at a 
rate higher than the maximum expected frequency) would work well in 
the setup you describe.

As regrads accuracy, it's the same as using a counter, as all I'm 
really suggesting is to use software rather than hardware to do the 
counting. The rate at which you read the counters is up to you in 
each case.

In terms of performance, I'd be surprised if you used up more than 2 
or 3% of the CPU to do the actual counting (assuming 10s of MHz as a 
clock rate for the processor). The counting can be done in a single 
timer interrupt, without interfering with anything else going on. 

It mightn't be that pretty, but there's a lot to be said for 
simplicity....

Brendan

--- In lpc2000@yahoogroups.com, Mukund Deshmukh <betacomp_ngp@...> 
wrote:
>
> > You don't say anything about the signals, e.g. whether they're
> > analog or digital, or how stable they are in frequency.
> >
> 
> I am sorry the message was hurriedly posted.
> I am using 4 proximity switches with toothed wheel to determine 
the speed of
> 4 shafts. The shaft are driven by 4 different source and not 
linked.
> The output from each proximity can vary from 0 to kHz.
> 
> Earlier we were using C8051F040 (CAN not used) with 5 timers. We 
had
> allotted a timer/counter channel to each proximity and we could 
get speed
> accurately.
> 
> Now same design is being shifted to LPC2136.
> Any idea how this can be achieved with one timer, and yes I would 
like to
> avoid interrupt.
>  Brendan's idea looks simple, but....?
> 
> Best Regards,
> 
> Mukund Deshmukh.
> Beta Computronics Pvt Ltd
> 10/1, IT Park, Parsodi,
> Nagpur-440022
> Cell - 9422113746
>

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.