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.

LAUNCHXL-F28379D: ADC not working on Core 2

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE

Hello,

I have tried one exercise where ADCA and EPWM1 initialize and run under core 1 and ADCC and EPWM2 initialize under Core 2 code.
I have provide ownership of ADCC and EPWM2 to CPU2 in core 1 code (in main). The ADCA on core 1 working fine but ADC on core 2 is not working even during debug I observed adc control register value not changing and interrupt also not coming.

Here is the code for core 2.

// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "ipc.h"
#include "F28x_Project.h"
//define

#define ADC_SAMPLE_PERIOD 3999

//function prototyping
void InitAdc2(void);
void InitEpwm2(void);
interrupt void Adc2Isr(void);
interrupt void Ipc1_Isr(void);

void main(void)
{
Device_init();
Interrupt_initModule();
Interrupt_initVectorTable();

EALLOW;
CpuSysRegs.PCLKCR2.bit.EPWM2 = 1;
CpuSysRegs.PCLKCR13.bit.ADC_C = 1;

InitEpwm2();
InitAdc2();

IPC_registerInterrupt(IPC_CPU2_L_CPU1_R, IPC_INT1, Ipc1_Isr);
IPC_clearFlagLtoR(IPC_CPU2_L_CPU1_R, IPC_FLAG_ALL);
IPC_sync(IPC_CPU2_L_CPU1_R, IPC_FLAG17);
EINT;
ERTM;
}
void InitAdc2(void)
{
ADC_disableConverter(ADCC_BASE);
ADC_setPrescaler(ADCC_BASE, ADC_CLK_DIV_4_0);
ADC_setInterruptPulseMode(ADCC_BASE, ADC_PULSE_END_OF_CONV);
ADC_setupSOC(ADCC_BASE, ADC_SOC_NUMBER1, ADC_TRIGGER_EPWM2_SOCB,ADC_CH_ADCIN1, 8);
ADC_setInterruptSOCTrigger(ADCC_BASE, ADC_SOC_NUMBER1, ADC_INT_SOC_TRIGGER_NONE);
ADC_setSOCPriority(ADCC_BASE, ADC_PRI_ALL_ROUND_ROBIN);
ADC_enableContinuousMode(ADCC_BASE, ADC_INT_NUMBER1);
ADC_setInterruptSource(ADCC_BASE, ADC_INT_NUMBER1, ADC_SOC_NUMBER1);
ADC_enableInterrupt(ADCC_BASE, ADC_INT_NUMBER1);
Interrupt_register(INT_ADCC1, &Adc2Isr);
Interrupt_enable(INT_ADCC1);
ADC_enableConverter(ADCC_BASE);
DEVICE_DELAY_US(1000);
ADC_clearInterruptStatus(ADCC_BASE, ADC_INT_NUMBER1);
}
void InitEpwm2(void)
{
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
SysCtl_resetPeripheral(SYSCTL_PERIPH_RES_EPWM2);
EPWM_setTimeBaseCounterMode(EPWM2_BASE, EPWM_COUNTER_MODE_STOP_FREEZE);
EPWM_setClockPrescaler(EPWM2_BASE, EPWM_CLOCK_DIVIDER_1,EPWM_HSCLOCK_DIVIDER_1);
EPWM_setTimeBasePeriod(EPWM2_BASE, ADC_SAMPLE_PERIOD);
EPWM_setPeriodLoadMode(EPWM2_BASE, EPWM_PERIOD_SHADOW_LOAD);
EPWM_setPhaseShift(EPWM2_BASE, 0);
EPWM_enableADCTrigger(EPWM2_BASE, EPWM_SOC_B);
EPWM_setADCTriggerSource(EPWM2_BASE, EPWM_SOC_B, EPWM_SOC_TBCTR_PERIOD);
EPWM_setADCTriggerEventPrescale(EPWM2_BASE, EPWM_SOC_B, 1);
EPWM_setTimeBaseCounterMode(EPWM2_BASE, EPWM_COUNTER_MODE_UP);
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
}
interrupt void Adc2Isr(void)
{
uint16_t adcres2;
ADC_clearInterruptStatus(ADCC_BASE, ADC_INT_NUMBER1);
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);

adcres2 = ADC_readResult(ADCCRESULT_BASE, ADC_SOC_NUMBER1);
IPC_sendCommand(IPC_CPU2_L_CPU1_R,IPC_FLAG0, false, 0, 0, (uint32_t)adcres2);
}

Please help me to find what is going wrong.
Regards,
Jay