Example Summary
Example that uses the ADC driver to make a number of samples and print them via UART.
Peripherals & Pin Assignments
When this project is built, the SysConfig tool will generate the TI-Driver configurations into the ti_drivers_config.c and ti_drivers_config.h files. Information on pins and resources used is present in both generated files. Additionally, the System Configuration file (*.syscfg) present in the project may be opened with SysConfig’s graphical user interface to determine pins and resources used.
CONFIG_ADC_0- ADC instance.CONFIG_ADC_1- ADC instance.
BoosterPacks, Board Resources & Jumper Settings
For board specific jumper settings, resources and BoosterPack modifications, refer to the Board.html file.
If you’re using an IDE such as Code Composer Studio (CCS) or IAR, please refer to Board.html in your project directory for resources used and board-specific jumper settings.
The Board.html can also be found in your SDK installation:
<SDK_INSTALL_DIR>/source/ti/boards/<BOARD>
Example Usage
Example output is generated through use of Display driver APIs. Refer to the Display driver documentation.
- Connect the ADC channels to the sampling sources.
- For quick testing, connect
CONFIG_ADC_0toGNDandCONFIG_ADC_1to3V3.
- For quick testing, connect
Important: Caution should be used when connecting the pins to analog inputs greater than 3VDC.
- Open a serial session (e.g.
PuTTY, etc.) to the appropriate COM port.- The COM port can be determined via Device Manager in Windows or via
ls /dev/tty*in Linux.
- The COM port can be determined via Device Manager in Windows or via
The connection will have the following settings:
Baud-rate: 115200
Data bits: 8
Stop bits: 1
Parity: None
Flow Control: None
- Run the example.
Example snippet of outputs:
CONFIG_ADC_1 raw result (4): 230
CONFIG_ADC_1 convert result (4): 2500000 uV
. . .
. . .
. . .
CONFIG_ADC_1 raw result (9): 280
CONFIG_ADC_1 convert result (9): 3000000 uV
The example outputs one sample from
CONFIG_ADC_0and ten samples fromCONFIG_ADC_1.The actual conversion result values may vary depending on the reference voltage settings. Please refer to the board specific datasheet for more details.
Application Design Details
This application uses two threads:
threadFxn0 - performs the following actions:
Opens an ADC driver object.
Uses the ADC driver object to perform a single sample and outputs the result.
Closes the ADC driver object.
threadFxn1 - performs the following actions:
Opens an ADC driver object.
Uses the ADC driver object to perform 10 samples and output the results.
Closes the ADC driver object.
FreeRTOS:
- Please view the
FreeRTOSConfig.hheader file for example configuration information.