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.

TMS570LC4357: ADC Single conversion triggered from PWM Module

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hi,

I am trying to configure the ADC to trigger from PWM in a single conversion mode but I am struggling to trigger it.

I have set the SOC A and the flag is set as per my configuration however the ADC conversion is not triggered.

is there an example that I can follow to configure the ADC module to trigger off from PWM module?

I am trying to trigger group 1.

/* Reset ADC */
ADC_1->RSTCR = (uint32)(1U);
ADC_1->RSTCR = (uint32)(0U);


/* ADC 12 bit ADC Conversion */
ADC_1->OPMODECR |= (uint32)(2147483648U);

/* ADC Clock */
ADC_1->CLOCKCR = (uint32)(9U);

/* 12bit readout format */
ADC_1->GxMODECR[1U] = (uint32)(8U);

/* Event Trigger Source */
ADC_1->G1SRC = (uint32)(16U);

/* Conversion finished Interrupt */
ADC_1->GxINTENA[1U] = (uint32)(4U);

ADC_1->BNDCR = (uint32)((uint32)8U << 16U) | (8U + 8U);
ADC_1->BNDEND = (ADC_1->BNDEND & 0xFFFF0000U) | (2U);

ADC_1->G1SAMP = (uint32)(1U);

ADC_1->GxSEL[1U] = (uint32)(15U);

/* Enable ADC */
ADC_1->OPMODECR |= (uint32)(1U);

/* - Wait for buffer initialization complete */
while (((adcREG1->BNDEND & 0xFFFF0000U) >> 16U ) != 0U)
{
}

ADC_1->PARCR = (uint32)(5U);

ADC_1->GxINTCR[1]=(uint32)(12U);

please let me know what I am doing wrong.

Thanks