I'm having trouble getting the example code of the adc peripheral, single-ended.c file to work properly on my Tiva C Series TM4C123G dev board. I want to be able to input an analog signal on pin PD7 from a function generator and output digital data representing the signal to my computer. The function generator is set to 50 KHz and 500mV.
I'm able to compile and run the example code on my board but the output is not what it should be. I'm reading random 0's and 1's on a terminal listening to the serial port on my computer. I changed SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD); and GPIOPinTypeADC(GPIO_PORTD_BASE, GPIO_PIN_7); to be port D pin 7. Obviously there is something I'm missing. What other configuration settings do I need to make this work?
I'm quite a beginner on this and I need some help on understanding how this ADC works. I've tried reading from the datasheet on the ADC also. If someone could explain this or point to a reference that does explain this, it would be very helpful. Later on I need to implement a version of this that converts 6 analog signals at once.
Thanks,
Brandon