Dear
I am trying to run simple ADC program by using CPU timer prorgamm but I am not getting update value for the variable in watch window
I have added Adc.c file to project from common folder of the example
This are the changes I made to main loop of the existing example programm of CPU timer
EALLOW;
// sampling mode is sequential
AdcRegs.ADCSOC0CTL.bit.CHSEL= 2; //2 A2 2
AdcRegs.ADCSOC0CTL.bit.TRIGSEL= 1; // at first software trigger is kept
AdcRegs.ADCSOC0CTL.bit.ACQPS= 6; //25 is good
AdcRegs.ADCSAMPLEMODE.bit.SIMULEN0= 0; //1 for simultaneous sampling
AdcRegs.SOCPRICTL.bit.SOCPRIORITY= 16;
EDIS;
interrupt void cpu_timer0_isr(void)
{
CpuTimer0.InterruptCount++;
ir_adc= AdcResult.ADCRESULT0;
ir_grid=(ratio_vsen)*((ir_adc*3.3/4096)-dc_offset);
sample[i]=ir_grid;
if(i>7)
{ i=0;}
i++;
// Acknowledge this interrupt to receive more interrupts from group 1
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}