Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN
Hi,
I have enabled RTI and EPWM for ADC notification in the halcogen configuration. I can see the RTI Interupt being triggered in the RTI notification function,but I cannot see the ADC notification is triggered by the EPWM event. I have 3 adc pin input as below, but al the value have the same value as adc_data[0].value.
adc_data[0].value = (uint16)(adcREG1->GxBUF[adcGROUP1].BUF0); ////Get value for first conversion pin 8 from Potentiometer//
adc_data[1].value = (uint16)(adcREG1->GxBUF[adcGROUP1].BUF0); ////Get value for first conversion pin 10 from current sense that triggered by EPWM//
adc_data[2].value = (uint16)(adcREG1->GxBUF[adcGROUP1].BUF0); ////Get value for first conversion pin 11 from current sense that triggered by EPWM//
Could you help check my halcogen & code?:



void Init_all()
{
_enable_IRQ_interrupt_();/* enable irq interrupt in */
sciInit(); //Initialize the SCI (UART) module
adcInit(); //Initialize the ADC module
//hetInit(); //Initialize Het(PWM)//
gioInit(); //Initialize GIO//
etpwmInit();//Initialize PWM//
TI_Fee_Init();// Initialize FEE. This will create Virtual sectors, initialize global variables etc.//
rtiInit();// Initialize RTI driver //
etpwmStartTBCLK();//This function starts the time-base clocks of all eTPWMx modules
adcEnableNotification(adcREG1, adcGROUP1);//ADC enable notification
adcStartConversion(adcREG1, adcGROUP1);
rtiEnableNotification(rtiREG1,rtiNOTIFICATION_COMPARE0);// Enable RTI Compare 0 interrupt notification //
gioEnableNotification(gioPORTA,1);//Enable notifications of GIO//
canInit();//configuring CAN1 MB1,Msg ID-1 to transmit and CAN2 MB1 to receive //
canEnableErrorNotification(canREG1); // enabling error interrupts CAN_Bus1//
canEnableErrorNotification(canREG2); // enabling error interrupts CAN_Bus2//
rtiStartCounter(rtiREG1,rtiCOUNTER_BLOCK0); // Start RTI Counter Block 0 //
}
//////**********************End of Initialization***********************/////
void main(void)
{
Init_all();//Initialize all drivers//
while(1) // Loop to acquire and do the task//
{
}
}
#pragma WEAK(adcNotification)
void adcNotification(adcBASE_t *adc, uint32 group)
{
/* enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (14) */
GetAdcInput();
/* USER CODE END */
}
void GetAdcInput(void)
{
adcData_t adc_data[3]={}; //ADC Data Structure
adc_data[0].value = (uint16)(adcREG1->GxBUF[adcGROUP1].BUF0); ////Get value for first conversion pin 8//
adc_data[1].value = (uint16)(adcREG1->GxBUF[adcGROUP1].BUF0); ////Get value for first conversion pin 10//
adc_data[2].value = (uint16)(adcREG1->GxBUF[adcGROUP1].BUF0); ////Get value for first conversion pin 11//
}
I am refering example below:
Please kindly help to solve the issue.
Thank you.
Best Regards,
Lukman



