3
\$\begingroup\$

I'm working on a frequency counter coursework, where I use MSP430 MCU. I have to measure signals with specifications: frequency from 0.1 Hz to 1 MHz and signal's amplitude from 0.1V to 10V. The problem is with signal’s amplitude, I understand that the voltage of 10V is too high and 0.1V is too low for MCU input. Do you have any ideas how to reduce 10V signal's amplitude to 2.7V-3.6V level and how to amplify 0.1V signal to 2.7V-3.6V level? I tried to find information on the internet, but I found just voltage divider, which one isn’t suitable for me. Maybe, are there any chips which one can do this function?

\$\endgroup\$
  • \$\begingroup\$ What is your ADC reference voltage? Is the system operating vrom 3.3V or 5V? To get maximum dynamic range, these need to be known. Also, surprisingly 0.1V is not too low for the ADC to sample. If you have a 3.3V reference and a 10bit ADC then your measurement resolution is 3.2mV which is approximately 0x20 Hex. How accurate does it need to be? What is your desired resolution? \$\endgroup\$ – Martin Jan 14 '14 at 22:56
  • 1
    \$\begingroup\$ @Martin: He is making a frequency counter. The signal simply needs to be thresholded and fed into a digital input. The waveshape doesn't tell you anything useful, so trying to measure the signal with a A/D would be pointless, would require over 2 MHz sample rate, and significant processing in the micro. You want timer capture hardware to measure periods directly. \$\endgroup\$ – Olin Lathrop Jan 14 '14 at 23:08
  • \$\begingroup\$ My operating voltage is 3.3V, but why I need to use ADC? I need to count the signal's frequency, not voltage value. I use TimerA in capture mode, I am counting rising edges of signal, than divide them from window length. If I put 0.1V square wave signal into MCU input, it will count that’s 0.1V signal's rising edge or not? \$\endgroup\$ – user35551 Jan 14 '14 at 23:10
3
\$\begingroup\$

I agree with Andy about using a comparator, but disagree about attenuating the input signal to fit into the comparator range. I would rather clip it than attenuate it.

Another possibility is to power the comparator from a wide supply range, and use the type that has a open collector output. 1 MHz isn't really all that high, and it's no problem to use a low enough pullup so that the rise time is still small compared to the 1 µs period. Since you're measuring (or possibly counting) periods, a little assymmetry in the digital signal doesn't matter. You just have to make sure that you still get solid edges with a 1 MHz 100 mV sine wave in.

I would also be very careful with hysteresis in this case. It can help to not get a bunch of fast edges with a slow input, but it must still be a small compared to the 100 mV minimum input signal. Perhaps AC couping 10 mV or so back to the positive input would be reasonable. I'd probably try it first without any hystersis.

\$\endgroup\$
2
\$\begingroup\$

Use a comparator - it has a reference input (set to some midrail value) and a "real" input. If the real input rises above the reference input the comparator's output goes high. When the real input falls below the reference input the comparator output falls low. MAX999 springs to mind - it's super fast, has built in hysterisis and works from 3.3V. It should drive your MCU perfectly.

All you have to do is restrict the 10v input signal to about 3.3volts using a potential divider of about 3:1. This will also reduce the smallest signal by the same amount i.e. 0.1 volt to 33mV but the chip will cope I believe.

Hysterisis is useful when the input signal gets close the the reference threshold - it prevents a series of quickly repeating retriggers due to noise being present or the signal wavering a bit.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.