Staging:CC3220 ADC

Overview
The ADC (Analog-to-Digital Converter) peripheral converts a continuous analog voltage to a discrete digital number. The CC3220 device includes an ADC module with four input channels featuring 12-bit conversion resolution for each of these channels. It supports Sampling rate of 16 μs per channel.

Application details
The objective of this application is to familiarize the developer with ADC specific DriverLib functions. Developer/User can refer to this simple application and re-use the functions in their applications.

This application requires an input command from the user to select pin to be used for the ADC input. The peripheral samples the input on that channel, converts each sample into a digital value and store it in an array via a DMA operation. The number of samples(default: 512) to be taken is specified as a MACRO NO_OF_SAMPLES and can be modified as per the requirement.

A signal generator can be used to generate the input analog signal. Following settings can be used to set up the signal generator:
 * Waveform - Select any suitable waveform - Sine, square, Ramp.
 * Input Frequency - As ADC sampling frequency is set to 62.5 KHz, the input frequency should be less than 31.250 KHz.
 * Input Amplitude - Low Level should be greater than 5 mV and high level should be less than 1.45 V.
 * Note - If there is a setting in the signal/function generator to change the output termination impedance then set it to Infinite/High Z.

For more information on this, please refer to CC32XX ADC Appnote

Source Files briefly explained

 * main.c - The main file that contains the core-logic for analog to digital conversion. The functions in the file uses DriverLib calls to perform analog to digital conversion.

 Supporting files 


 * adc_userinput.c - The function in the file reads the input from the user, parses the input string and feed the core-logic functions in the main.c
 * pinmux.c - Generated by the PinMUX utility. UART0 pins are brought out in this file.
 * cc_launchpad: - Contains mandatory board specific initialization. Also initializes the peripherals exercised.
 * startup_*.c - IDE specific startup functions (not required when working with TI-RTOS)
 * uart_if.c - Functions to display information on UART
 * udma_if.c - Functions to initialize and setup the uDMA controller

 Available Configuration 


 * DMA Basic - Define ADC_DMA_BASIC in project properties to enable DMA for ADC channel. By default it is enabled.
 * DMA with Ping-pong mode - Define ADC_DMA_PING_PONG in project properties to enable DMA with ping-pong mode for ADC channel.
 * Without DMA - Undefine ADC_DMA_BASIC and ADC_DMA_PING_PONG in project properties.

Usage
For this application to work, one needs to populate jumpers at J5 on LP'''


 * 1) Setup a serial communication application (HyperTerminal/TeraTerm). For detail info visit Terminal setup On the host PC, open a hyperterminal, with the following settings
 * 2) *Port: Enumerated COM port (XDS110 Class Application/User UART)
 * 3) *Baud rate: 115200
 * 4) *Data: 8 bit
 * 5) *Parity: None
 * 6) *Stop: 1 bit
 * 7) *Flow control: None
 * 8) Run the reference application (/IAR/CCS).
 * 9) *Flash the bin
 * 10) *Open the project in IAR/CCS. Build and download the application to the board
 * 11) On the Hyperterminal, a prompt appears
 * 12) *Provide the analog input signal to any of the pins mentioned in the usage.
 * 13) *The ADC commands need to be issued and the results can be seen

Limitations/Known Issues
None.