README
adcsinglechannel
Example Summary
Example that uses the ADC driver to make a number of samples and print them via UART.
Peripherals Exercised
Board_ADC0
- ADC channel 0Board_ADC1
- ADC channel 1
Resources & Jumper Settings
If you’re using an IDE (such as CCS or IAR), please refer to Board.html in your project directory for resources used and board-specific jumper settings. Otherwise, you can find Board.html in the directory <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 found in the SimpleLink MCU SDK User’s Guide.
- Connect the ADC channels to the sampling sources.
- For quick testing, connect
Board_ADC0
toGND
andBoard_ADC1
to3V3
.
- 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:
ADC channel 1 raw result (4): 230
ADC channel 1 convert result (4): 2500000 uV
. . .
. . .
. . .
ADC channel 1 raw result (9): 280
ADC channel 1 convert result (9): 3000000 uV
The example outputs one sample from
Board_ADC0
and ten samples fromBoard_ADC1
.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.
TI-RTOS:
- When building in Code Composer Studio, the kernel configuration project will be imported along with the example. The kernel configuration project is referenced by the example, so it will be built first. The “release” kernel configuration is the default project used. It has many debug features disabled. These feature include assert checking, logging and runtime stack checks. For a detailed difference between the “release” and “debug” kernel configurations and how to switch between them, please refer to the SimpleLink MCU SDK User’s Guide. The “release” and “debug” kernel configuration projects can be found under <SDK_INSTALL_DIR>/kernel/tirtos/builds/<BOARD>/(release|debug)/(ccs|gcc).
FreeRTOS:
- Please view the
FreeRTOSConfig.h
header file for example configuration information.