Shop OBEX P1 Docs P2 Docs Learn Events
Max COUNT w/ SX28 — Parallax Forums

Max COUNT w/ SX28

$WMc%$WMc% Posts: 1,884
edited 2009-03-22 02:45 in General Discussion
Hello All

What is the Maximum Frequency that the SX28 can count?
I'm using the "Count SX/B" Example program w/ the debug window and the SX-Key set to 75Mhz. 50khz seems to be the highest Freq. that the SX28 will count to reliably.

I have a 5MHz BK-Precision Function Generator that I'm using to supply the signal (5 volt/square wave) to the SX28.

I have a Parallax O-scope and I can verifiy the Frequency and peek to peek voltage from the BK-Prec. Generator.

Is 50khz the Max. count?

__________________$WMc%_________

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there············································ BoogerWoods, FL. USA

Comments

  • BeanBean Posts: 8,129
    edited 2009-03-18 23:49
    From the help file:

    The [b]COUNT[/b] instruction makes the [i]Pin[/i] an input, then for the specified [i]Duration[/i], counts cycles on that pin and stores the total in [i]Variable[/i]. A cycle is a change in state from 1 to 0 to 1, or from 0 to 1 to 0. Each loop in the [b]COUNT[/b] routine requires 40 clock cycles, so the incoming signal must remain high or low for at least 40 cycles to be measured accurately. The maximum frequency that [b]COUNT[/b] can accurately handle is about 1% the clock frequency driving the SX. A 20 MHz clock source, for example, would allow the [b]COUNT[/b] instruction to count transitions in a 200 kHz square wave (or period of 5 µsecs). 
    

    So with a 75MHz clock you should be able to measure 750Khz. with the COUNT command.

    You can measure higher than that by putting the signal into the RTCC pin on the SX28 and setting up OPTIONS to increase the RTCC register by external pin.

    Bean.
    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There is a fine line between arrogance and confidence. Make sure you don't cross it...



    Post Edited (Bean (Hitt Consulting)) : 3/18/2009 11:54:22 PM GMT
  • $WMc%$WMc% Posts: 1,884
    edited 2009-03-19 00:41
    Mr.Bean

    Thanks for the feedback.

    I Fig. 375khz w/ a 75Mhz clock, I made a mistake in My math.

    I seem to have some kind of ground loop or RF interference.

    I set up the Comparator circuit on the Pro.Dev.Board, And have noticed that when I reach for the 10k POT on the Board the LED from RB.0 lights. I can wave My hand over the Board and light the LED Not touching anything.

    I have run into this before w/ the BS2P40. I had a lot of equipment hooked up. And I ruled it out to that.

    I'll have to run down the interference.


    _______Thanks Again____$WMc%__________

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············································ BoogerWoods, FL. USA
  • $WMc%$WMc% Posts: 1,884
    edited 2009-03-22 02:45
    Bean

    Is the example program " COUNT SX/B " and the DEBUG window capable of reading a 77kHz or higher signal?

    Or due I still have some weird ground loop/interference problem?


    __________$WMc%_________

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············································ BoogerWoods, FL. USA
Sign In or Register to comment.