AM261x MCU+ SDK: ADC SOC software sync

| AM261x MCU+ SDK 26.00.00 |

ADC SOC software sync

# Introduction

## Example Description

This example shows synchronous operation on ADC1 and ADC2 trigger by a software forced by toggling a GPIO. The example uses a GPIO into the INPUTBAR[5] as trigger for the SOC in the given ADC and uses software to toggle to the loopback GPIO trigger the conversions.

Example Block diagram

## SOC Configurations

- ADC 1
  - SOC 0,1 triggers are set to InputXbar[5]
  - SOC 0 samples Channel 0
  - SOC 1 samples Channel 1
- ADC 2
  - SOC 0,1 triggers are set to InputXbar[5]
  - SOC 0 samples Channel 0
  - SOC 1 samples Channel 1 (SOC 1 samples Channel 4 in case of AM261x-LP)

## Interrupt Configurations

- ADC1INT1 source is set to EOC/SOC1
- INTXbar[0] is configured for ADC1INT1

## ISR

- App_adcISR read the results stored by SOC0,1 in ADC1,2.

# External Connections

## AM263Px-CC E2 or AM263x-CC E2

- Connect loopback on GPIO 24, GPIO 23, i.e., HSEC PINS 87, 85
- Feed Analog voltage on
  - ADC 1 Channel 0 : HSEC PIN 12
  - ADC 1 Channel 1 : HSEC PIN 14
  - ADC 2 Channel 0 : HSEC PIN 25
  - ADC 2 Channel 1 : HSEC PIN 27

## AM263x-CC E1

- Connect loopback on GPIO 24, GPIO 23, i.e., HSEC PINS 87, 85.
- Feed Analog voltage on
  - ADC 1 Channel 0 : HSEC PIN 18
  - ADC 1 Channel 1 : HSEC PIN 20
  - ADC 2 Channel 0 : HSEC PIN 24
  - ADC 2 Channel 1 : HSEC PIN 26

## AM263Px-LP or AM263x-LP

- Connect loopback on GPIO 24, GPIO 23, i.e., J5/7 PINS 49,50.
- Feed Analog voltage on
  - ADC 1 Channel 0 : J1/3 PIN 24
  - ADC 1 Channel 1 : J1/3 PIN 29
  - ADC 2 Channel 0 : J1/3 PIN 25
  - ADC 2 Channel 1 : J5/7 PIN 63

## AM261x-LP

- Connect loopback on GPIO 24, GPIO 23, i.e., J5/7 PINS 49,50.
- Feed Analog voltage on
  - ADC 1 Channel 0 : J1/3 PIN 24
  - ADC 1 Channel 1 : J5/7 PIN 42
  - ADC 2 Channel 0 : J1/3 PIN 25
  - ADC 2 Channel 4 : J1/3 PIN 28

## AM261x-SOM E1

- Connect loopback on on GPIO 69 (configured as input) - HSEC connecter pin - 162 or connect it to GPIO 70 (Configured as output) - HSEC Connecter pin - 160
- feed analog input on
  - ADC 1 Channel 0 - HSEC PIN - 12
  - ADC 1 Channel 1 - HSEC PIN - 14
  - ADC 2 Channel 0 - HSEC PIN - 31
  - ADC 2 Channel 1 - HSEC PIN - 33

# Watch Variables

- gAdc1Result0 : Digital representation of Voltages on ADC 1 Channel 0
- gAdc1Result1 : Digital representation of Voltages on ADC 1 Channel 1
- gAdc2Result0 : Digital representation of Voltages on ADC 2 Channel 0
- gAdc2Result1 : Digital representation of Voltages on ADC 2 Channel 1 (Channel 4 in case of AM261x-LP)

# Supported Combinations

Parameter | Value
--- | ---
CPU + OS | r5fss0-0 nortos
Toolchain | ti-arm-clang
Board | am261x-som, am261x-lp
Example folder | examples/drivers/adc/adc_soc_software_sync/

# Steps to Run the Example

- When using CCS projects to build, import the CCS project for the required combination and build it using the CCS project menu (see Using SDK with CCS Projects).
- When using makefiles to build, note the required combination and build using make command (see Using SDK with Makefiles)
- Establish connections as mentioned in External Connections section
- Launch a CCS debug session and run the executable, see CCS Launch, Load and Run
- View the ADC conversion results in UART console logs

# See Also

ADC

# Sample Output

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

ADC Synchronous Software Triggered Conversion Test Started ...
ADC1 ADC2
SOC0 SOC1 SOC0 SOC1
450 619 450 619
678 974 678 974
702 986 702 986
687 986 687 986
698 989 698 989
695 981 695 981
687 981 687 981
703 987 703 987
706 983 706 983
715 987 715 987
728 993 728 993
ADC Synchronous Software Triggered Conversion Test Passed!!
All tests have passed!!