Shop OBEX P1 Docs P2 Docs Learn Events
High Frequency with BS2 — Parallax Forums

High Frequency with BS2

cagbi2000cagbi2000 Posts: 3
edited 2008-06-18 22:10 in BASIC Stamp
Hi all,
I'm trying to count high frequencies of 150 to 250 KHz into the BS2, and having read the manual and varying posts about the maximum allowable frequency of 120 KHz, I wanted to know if there was a way to work around that. My first idea was to count positive edges only or every other transition. I was wondering if this would work considering that the frequency might still be too fast to catch all the positive edges. My second idea was to cut down the frequency by a known factor using an IC, but I don't know of any relatively cheap ones I can buy and use. I would appreciate if anybody had any companies/prices. Thanks for your help.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-18 16:13
    There is no workaround. You either have to add an external prescaler counter or switch to a faster Stamp model like the BS2px.

    A simple divide by 10 counter is the 4510 (www.doctronics.co.uk/4510.htm). These sell for maybe 40 cents from Jameco, Digikey, or Mouser. There are all sorts of other counters that would be good alternatives depending on your particular circumstances.
  • cagbi2000cagbi2000 Posts: 3
    edited 2008-06-18 16:23
    Do you know of any off-hand that would be good with multiplexing various frequencies as well as dividing the frequencies? I'm trying to conserve space since I have three different signal frequencies to process. Thanks for your help.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-18 16:35
    You'd have to describe in much more detail just what you're trying to accomplish. If you have several independent inputs, keep in mind that the Stamp can only handle one at a time. When it's doing a COUNT, it's ignoring the other inputs. If you really have to handle counting several independent input pulse streams at the same time, you probably need to use something like a Propeller with its 8 independent processors, each with 2 counters that can count pulse streams.
  • cagbi2000cagbi2000 Posts: 3
    edited 2008-06-18 21:00
    I'm aware of that, but nevertheless I would like to divide 3 independent frequencies down and input them into the BASIC Stamp to be counted. That is my goal for now.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-06-18 21:27
    It's easy enough to wire up a divide-by-4 counter with a 74HC74. The attached schematic shows how. This will reduce your 150-250KHz signal to 37.5-62.5KHz, which the Stamp can handle.

    -Phil
    546 x 206 - 2K
  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-18 22:10
    You could use 1/2 of a 74HC153 4-input selector to choose which frequency to examine. It would take 2 I/O pins to select which input to use.
    You'd only need one counter, either a divide-by-4 as Phil suggested or a divide-by-10 or divide-by-16.
Sign In or Register to comment.