Other Parts Discussed in Thread: LAUNCHXL-F28379D, C2000WARE
Tool/software: Code Composer Studio
I'm a newbie trying to learn to program TI microcontrollers, so I apologize about the simple question.
In the C2000™ MCU 1-Day Workshop,
I successfully completed Lab 2 (starting on page 57 of the PDF of the above link). In this lab, I output a sine wave from of the DAC pins (pin 70 to be precise) and then jumpered that DAC pin to one of the ADC pins (pin 30 to be precise). This is all working correctly and my plot of the ADC looks like the sine wave shown on page 62 of the PDF.
However, now I'm trying to apply a sine wave from another system (it's coming from a PLECS RT Box). The sine wave is a 1 kHz sine wave ranging from 0.5 V at the bottom to 1.5 V at the top. I used an oscilloscope to measure the voltage between pin 30 and GND on the Launchpad, and everything looks as expected on the scope.
I'm trying to use the unmodified code of Lab2.c to read in this analog input on pin 30. However, the data I'm reading in from the ADC pin and plotting in Code Composer Studio is very noisy and choppy (and not at all like the nice clean sine wave I'm seeing the scope). It also looks like the frequency of the data captured is wrong (although it looks like the min and max values are roughly correct.
I'm really baffled as to why the Lab2.c code worked for reading in the signal jumpered from the DAC pin to the ADC pin, but is not working for reading in an external voltage (which looks good on the scope) to the ADC pin. Is there anything that would need changed in the code when you are reading an external voltage coming from another system rather than a voltage jumpered from the DAC pin of the Launchpad?
Any help would be greatly appreciated.
Thanks,
Kevin