How to give analog input from 3.5 mm jack to FPGA (Spartan 3e)
Two problems:


The ADC is (I presume) 0 to 5 V. Your audio will be much less than this.
The ADC accepts positive signals only. Your audio is AC (alternating current). The polarity alternates between + and - with an average value of zero.


At a minimum you need to rectify your signal and ensure that the ADC input on your micro only sees positive signals between zero and the maximum rated input voltage. If you put a diode in circuit (banded end pointing towards the ADC) it might start to work but with the low voltages you will only get low numbers out of your ADC.

For a better job look up precision rectifier circuits. You'll want one that will give you some gain - 5 to 10 would probably do the trick.

[Edit]

I had a look at the data sheet and I understand that the ADC is biased at half V-max. You should connect up as shown here:







simulate this circuit &ndash; Schematic created using CircuitLab

Without the capacitor your audio signal will be +/- with respect to 0 V. Adding the capacitor and resistors will bias it towards 1.65 V, same as the internal reference.

In your software you'll have to run a loop that


Takes a reading.
Subtracts to bias value (half ADC max).
Get the absolute value of the result (remove the - sign, if present).
Average these over some number of cycles since sometimes you'll sample on a peak and sometimes when the audio signal is crossing zero volts.