Electronic – How to make AC signal’s level proper for MCU input

counterfrequencymicrochipmsp430voltage-regulator

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?

Best Answer

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.