PDA

View Full Version : Counter speed?



Leon
01-09-2008, 05:26 PM
How fast are the counters? I've looked through the spec. in the manual but couldn't find anything.

Leon


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle

OzStamp
01-09-2008, 05:43 PM
Hi Leon

From what I understand.. 1/2 the clk speed .
So if 80MHZ (PLL 16 * 5 MHZ crystal) the max count speed is 40MHZ

That's using the CTRA / B hardware ..

Ron Mel oz

Mike Green
01-09-2008, 10:07 PM
The counters will count up to 128MHz in PLL mode. Other modes will count up to the system clock (normally 80MHz). Edge triggered modes will count at 1/2 the system clock (normally 40MHz). It's in the manual in the description of the counter registers.

Leon
01-09-2008, 11:18 PM
Thanks, both.

Leon

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle

deSilva
01-10-2008, 01:40 AM
The counters/timers are very versatile units. It is not easy to answer Leon's question with a few remarks. It is best to habe a thorough look at the functional diagram.

The main, basic, and overall activity of the timers/counters is to add FRQ to PHS each system clock cycle (e.g. 12.5 ns)

All other things depend on the specific mode they are in.

In NCO mode the eventually resulting bit31-strobe can be frequency multiplied by 16 (and after that optionally divided by 2,4,8,16,32,64, or 128).

Post Edited (deSilva) : 1/9/2008 5:45:38 PM GMT

Ken Peterson
01-10-2008, 01:56 AM
@Leon: Have you read the Counter App note from the Download section on the web site? It offers much more details about the counters than the manual does.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


The more I know, the more I know I don't know. Is this what they call Wisdom?

OzStamp
01-10-2008, 05:26 AM
Hi Leon..

Re your question " How fast are the counters "
Do you mean the speed of the internal cntrs for the purpose of generating signals or
do you mean how fast can a cntr collect pulses coming from an outside source..
An outside source for example being a rotary encoder or a high speed sensor...

I think my answer of 40MHZ is correct if your talking about counting external pulses..
Whereas the Propeller can generate pulses at higher frequencies internally...



cheers Ron Mel OZ

deSilva
01-10-2008, 07:08 AM
Ron, as I said above, there is no simple answer... As the timers sample each 12.5 ns a signal of more than 40 Mhz cannot be cleanly identified due to the Nyquist condition.

Leon
01-10-2008, 07:15 AM
I was interested in counting external events.

Leon

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle

OzStamp
01-10-2008, 07:15 AM
Hi DeSilva.

Yes I agree we are on the same "WaveLength"

It is or must be confusing to some people as "ALL" is referred to as "Counters"
A counter to most people is a device that collects pulses and adds them in a register ..
These counters are used in the propeller internals to do trickery like PWM DUTY cycle... pulse in width measurement..


All answers as I see in this post are correct ..

cheers Ron Mel OZ..

Post Edited (OzStamp) : 1/10/2008 1:33:44 AM GMT

deSilva
01-10-2008, 09:14 AM
Leon said...
I was interested in counting external events.

Then you have first to define what an "event" is to you..
A rising edge perhaps?
Then you can count "spikes" of >12.5 ns each "spikewidth" + 12.5 ns.
The reason is that a spike of <12.5 ns will not neccessarily be sampled, also a smaller "gap" between spikes need not be identified...

You just set the counters to "edge mode"