Shop OBEX P1 Docs P2 Docs Learn Events
Counter speed? — Parallax Forums

Counter speed?

LeonLeon Posts: 7,620
edited 2008-01-10 01:14 in Propeller 1
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

Comments

  • OzStampOzStamp Posts: 377
    edited 2008-01-09 09:43
    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 GreenMike Green Posts: 23,101
    edited 2008-01-09 14:07
    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.
  • LeonLeon Posts: 7,620
    edited 2008-01-09 15:18
    Thanks, both.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • deSilvadeSilva Posts: 2,967
    edited 2008-01-09 17:40
    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
    650 x 586 - 33K
  • Ken PetersonKen Peterson Posts: 806
    edited 2008-01-09 17:56
    @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?
  • OzStampOzStamp Posts: 377
    edited 2008-01-09 21:26
    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
  • deSilvadeSilva Posts: 2,967
    edited 2008-01-09 23:08
    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.
  • LeonLeon Posts: 7,620
    edited 2008-01-09 23:15
    I was interested in counting external events.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • OzStampOzStamp Posts: 377
    edited 2008-01-09 23:15
    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
  • deSilvadeSilva Posts: 2,967
    edited 2008-01-10 01:14
    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"
Sign In or Register to comment.