This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Sinewave_ADC_Launchpad

I Used The MSP430g22 and using this made the ADC. It Continuously Give The Normal Voltage Output  and transmit on UART. It   perfect work But when Input Given Sine Wave It Will Not Working Perfectly I have Used 1MHZ Frequency internal oscillator and sine Wave 50 Hz..

it show the Spike Value when plotted on MATLAB Please Suggest me..
so which frequency of Sine Wave preferred for perfect output??
otherwise down the frequency of internal oscillator..??

  • For perfect output, the maximum frequency is 0Hz. Anything else will lead to not perfect output. However, 'not perfect' doesn't mean 'bad'.
    Sampling means taking snapshots of the signal at discrete times. You will never take such a snapshot at exactly the peak of the sine wave. Nor will you get the exact value (unless coincidentally). The question is, how precise is good enough for you.
    If you run the ADC with 1MHz and have a 50Hz wave, this means you have 20000 clock ticks per wave. minimum number of clock ticks per conversion with ADC10 is 17 (SHT_0), which means 1176.5 samples per wave or one sample every 0.306 degrees. This should give you a nice drawing. If not, then your problem is somewhere else:
    With the application UART, your data transfer rate is limited. With 9600Bd (the default baudrate) you can only send 480 samples per second. Which means <10 samples per wave (<5 per half-wave) which will of course give an awful raw drawing. Twice as many if you only send the upper 8 bits of the conversion result, one byte per sample.

**Attention** This is a public forum