AM64x MCU+ SDK  08.04.00
ADS127

Introduction

This example uses ADS127L11 ADC IC to convert analog input signal on adc channel to samples and store the results in a shared memory which can be configured by the user (using PRU IPC module). The read samples are finally printed to the R5F console, or can also be visualized using CCS Graph plotter. GUI Composer app available on TI Gallery can also be used to evaluate the ADC using a GUI based interface.

The example does the below

  • PRU controls the ADC and reads the samples
  • PRU program implements ADC samples transfer interface
  • PRU then writes the samples to a shared memory and creates an interrupt after writing 1 block of data
  • On interrupt R5F then reads the data and prints it on console

Supported Combinations

Parameter Value
CPU + OS r5fss0-0 freertos
ICSSG ICSSG0 - PRU0
Toolchain ti-arm-clang, pru-cgt
Board am64x-evm
Example folder examples/pru_io/adc/ads127/

Steps to Run the Example

  • When using CCS projects to build, import the CCS project from the above mentioned Example folder path for R5F (It will automatically import PRU project) for the required combination.
  • On importing the project, SysConfig will contain an ADC Config instance with default configurations which are compatible with the T&M SEM Adapter Board. Use SysConfig to configure the required settings for the ADC IC.

ADC SysConfig Options
You will need to edit linker file whenever changes are made to the configuration for PRU IPC module, refer Update linker command file
  • Build only the R5F project using the CCS project menu (see Using SDK with CCS Projects).

    • Build Flow: Once you click on build in R5F project, first, SysConfig files are generated, then the PRU project is compiled according to the configurations set in SysConfig. Finally the R5F project will be generated using both the generated SysConfig and PRU project binaries.
    • Note: The PRU project won't build independently as it is dependent on SysConfig files generated by the R5F project.
    Note
    Prerequisite: PRU-CGT-2-3 (ti-pru-cgt) should be installed at: C:/ti/
  • Launch a CCS debug session and run the executable, see CCS Launch, Load and Run

Features

Supported:

  • Serial Interface
  • Interrupt on receiving a block of data
  • ADC, Pinmux and other configurations through SysConfig interface

Important files and directory structure

Folder/Files Description
${SDK_INSTALL_PATH}/source/pru_io/
firmware/ PRU source files providing macros for interfaces, pru_ipc, etc.
driver/ PRU IPC source files for sending ADC samples from PRU to R5F

Sample Output

Shown below is a sample output when the application is run:

--------------------------------------------------
Initializing App
Initialized
--------------------------------------------------
Powering up ADC...
ADC Powered Up
--------------------------------------------------
Configuring ADC...
ADC Configuration completed
--------------------------------------------------
Starting ADC Conversion
Started ADC Conversion
--------------------------------------------------
----- Channel: 1 -----
Sample 1: 50308
Sample 2: 50304
Sample 3: 50304
Sample 4: 50304

Implementation Details

Refer here for complete implementation explanation: ADS127 Implementation Details