This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C2000WARE: driverlib ADC synchronous sampling with software trigger only

Part Number: C2000WARE

I'm working on a project using the F28379D launchpad. I'm using the C2000Ware driverlib HAL drivers for the peripherals configuration.

I am trying to synchronize the sampling of three ADC channels with a software trigger using the C2000Ware driverlib functions.

The chanels are ADCINA0, ADCINB0 and ADCIND0, they are all configured to be triggered by SOC0 :

ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER0, ADC_TRIGGER_SW_ONLY, ADC_CH_ADCIN0, 15);
ADC_setupSOC(ADCB_BASE, ADC_SOC_NUMBER0, ADC_TRIGGER_SW_ONLY, ADC_CH_ADCIN0, 15);
ADC_setupSOC(ADCD_BASE, ADC_SOC_NUMBER0, ADC_TRIGGER_SW_ONLY, ADC_CH_ADCIN0, 15);

 

When I want to trigger the simultaneous sampling, the only option that I found in driverlib is :

ADC_forceSOC(ADCA_BASE, ADC_FORCE_SOC0);
ADC_forceSOC(ADCB_BASE, ADC_FORCE_SOC0);
ADC_forceSOC(ADCD_BASE, ADC_FORCE_SOC0);

But this does not seem to do what I want as the trigger is "per channel" and not "per SOC"... Is there another option for this ?

 

  • Hi,

    External GPIO signal can be used to trigger all the ADCs simultaneously. This is done through enabling ADCEXTSOC signal via input XBAR. Refer the below snippet for configuration specific details. Refer to adc_ex16_sw_interleaved_averaging example available for f2838x under C2000Ware for more details.

    Example location: C2000Ware_4_01_00_00\driverlib\f2838x\examples\c28x\adc 

    // SOC triger should be set as GPIO
    ADC_setupSOC(adcBase, (ADC_SOCNumber)i,
                 ADC_TRIGGER_GPIO,
                 ((i % 2 == 0) ? ADC_CH_ADCIN0 : ADC_CH_ADCIN1),
                 ((EX_ADC_RESOLUTION == ADC_RESOLUTION_16BIT) ? 64U : 15U));
                 
                 
    // Configure GPIO 33 as ADCEXTSOC signal input via XBAR
        GPIO_setDirectionMode(33, GPIO_DIR_MODE_IN);            // input
        XBAR_setInputPin(INPUTXBAR_BASE, XBAR_INPUT5, 33);