Arduino frequency counter input questions

Discussion in 'Embedded Systems and Microcontrollers' started by KLillie, Jan 21, 2015.

  1. KLillie

    Thread Starter Member

    May 31, 2014
    126
    14
    OK, I've been toying with the idea of making a frequency counter. I bought a Arduino Uno and found some Arduino C code for frequency counting. So here's some questions:

    1. It is my thought that the "A"rduino needs a TTL input. How can I get this? A comparator? I would like to measure up to 8MHz.
    2. Can I run the "A" from an external crystal (or clock) that is faster than 16MHz?
    3. If I do need a comparator, it looks like the lm339 is pretty common, but if the best response time is .3us can I subtract that from...oh whatever. I just had a quart.
    Just could use some help/ideas.
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,446
    3,362
    Find out the switching threshold levels of the Arduino input.
    As long as you satisfy the threshold levels and don't go beyond the min and max input, you're ok.
    A 74LS04 or 74LS14 will do the trick if you want to condition the input signal. You don't need a comparator.

    You can overdrive certain chips but then you're on your own. There is no guarantee it will always work if you operate beyond manufacturer's specs.
     
  3. KLillie

    Thread Starter Member

    May 31, 2014
    126
    14
    Thanks for a response MrChips! I think this will do for one of my answers.
     
  4. KLillie

    Thread Starter Member

    May 31, 2014
    126
    14
    OK, I finally got some 74HC04 Hex Inverters. I'm looking at a couple schematics.
    [​IMG]
    [​IMG]
    As you might notice, both of these use Schmitt trigger input inverters. Will my 74HC04's work alright? Should I use two inverters?

    I think I remember the Arduino accepting voltage inputs of 1.8 - 5 V as a logical 1 (max 40ma) Also, I would like to guarantee my input never exceeds these specs. Ideas? Zeners? Fuse!!?
    I am just getting into this hobby, so don't be shy! I promise I won't be negative. Thanks in advance.
     
  5. KLillie

    Thread Starter Member

    May 31, 2014
    126
    14
  6. sirch2

    Well-Known Member

    Jan 21, 2013
    1,008
    351
  7. Art

    Distinguished Member

    Sep 10, 2007
    785
    61
    diode clamp might be suitable on the input to the logic.
     
  8. MrChips

    Moderator

    Oct 2, 2009
    12,446
    3,362
    Any of the above circuits will work. In the third circuit with the two 74HC14, eliminate the 0.1μF at pin-3.
    74HC04 will work. One inverter will work.
     
  9. KLillie

    Thread Starter Member

    May 31, 2014
    126
    14
    Thanks for the reply Art. I guess I was waiting for people to hold my hand on this one. I guess I just am going to have to dive in. Thanks again one and all. Ready to go! ;)
     
Loading...