Shop OBEX P1 Docs P2 Docs Learn Events
Analog Oscillator Frequency Counting ? — Parallax Forums

Analog Oscillator Frequency Counting ?

Areal PersonAreal Person Posts: 197
edited 2007-11-27 14:17 in Propeller 1
Hi,

I’ve managed to build a simple analog oscillator circuit that’s running at
2.7 vdc.
·
I want to interface it with the propeller demo board and have the propeller
count the frequency with a variable and display it on the screen.
·
QUESTION:
·
How do I do it ?
·
Do I need to first interface a ADC IC chip or other ADC circuit first ?
·
Anyone done this ? I’m trying to learn how to make my Propeller do some
usefull task as a circuit analysis tool. And I really need to be able to check
the frequency on my RLC circuits to start with.
·
Whats the best way to do it? What tool/code resources should I look at ?
·
Thanks,
Areal

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have a tree growing out of my head, but

what do you expect ? I'm a programmer.

Comments

  • AleAle Posts: 2,363
    edited 2007-11-27 07:15
    You can drive a Schmitt-trigger with your analog signal (just be sure that it has rail-to-rail swing, or close) and the output to a pin in the propeller. You can use waitpeq and waitpne to detech changes, counting them over a period of time... will give you the freq. Of course it depends on the frequency. You can also use a compatator like the LM301 or LM319, depending if your analog sinal goes from = v to +2.7 or from -2.7 to 2.7.

    Have fun
  • deSilvadeSilva Posts: 2,967
    edited 2007-11-27 07:38
    The Propellor has "built-in" comparator inputs for Vss/2 (=1.65V) at all of its 32 I/Os. 2.7 V will be recognized without any additional circuitry. This can be called 1-bit ADC

    If you want to know the "shape" of the signal, you have to use a "many-bit ADC, as external device or a home-brew "delta sigma modulator" (have a look at the threads.

    There are two ways two meassure "freqencies"
    (a) To count "slopes" (rising or falling edges of the signal) over a defined time
    (b) Measure the time it takes for a high state and a following low state.

    Both have their obvious pros and cons... (b) is generally used for (very) low frequencies only
    Both methods are vulnerable to "bouncing" by nature..
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-11-27 07:51
    Even in cases where the signal amplitude is otherwise too small, the Propeller's built-in threshold can be used to advantage. The trick is to bias the input to Vdd/2 with a resistive divider, then to couple the signal to the pin through a capacitor.

    -Phil
  • deSilvadeSilva Posts: 2,967
    edited 2007-11-27 07:54
    Ariba gave the circuitry for this some weeks ago... As Ariba posts few but selected things only, it should be easy to find it by reading through all of his postings smile.gif
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-11-27 14:17
    Try this thread and the ones that it links to: http://forums.parallax.com/showthread.php?p=677204
Sign In or Register to comment.