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: F28379D ADC module ( Lab6 using Adca1 and Adcb1 interrupts)

Part Number: LAUNCHXL-F28379D

I wanted to test Tow ADC of the F28379D and watch their output in a memory browser while they are sampling in the same time. I wanted 4130.code.docx to sample ch0 of adca and ch2 of  adcb using ePWM2-ADCSOCA  trigger then I wanted to connect ADCINA0 (pin#30) and ADCINB2 (pin#28)to P18 and P19 of the lunchpad  and view their data in AdcBuf and AdcBuf1 registers, but I keep getting this ERROR: 

"../Adc.c", line 92: error #29: expected an expression
1 error detected in the compilation of "../Adc.c".

can someone please  tell me what  i am missing?

note line 92 is:  IER | = 0x0001;

here is what  I did; I used  Lab6 of the workshop and added the following items:

1-added the following variables to Lab.h:

Global Variables References
//
extern float32 xDelay[FILTER_LEN];
extern float32 coeffs[FILTER_LEN];
extern Uint16 AdcBuf[ADC_BUF_LEN];
extern Uint16 AdcBuf1[ADC_BUF_LEN]; //***MZ
extern Uint16 AdcBufFiltered[ADC_BUF_LEN];
extern Uint16 AdcBuf1Filtered[ADC_BUF_LEN]; ///**mz
extern Uint16 AdcBufRaw[2*ADC_BUF_LEN];
extern Uint16 AdcBuf1Raw[2*ADC_BUF_LEN]; //***mz
extern Uint16 ClaFilteredOutput;
extern Uint16 DacOffset;

2-In main function I added the below variable:

#include "Lab.h" // Main include file

//--- Global Variables
Uint16 DEBUG_TOGGLE = 1; // Used for realtime mode investigation test
Uint16 SINE_ENABLE = 0; // Used for DAC waveform generation
Uint16 AdcBuf[ADC_BUF_LEN]; // ADC buffer allocation
Uint16 AdcBuf1[ADC_BUF_LEN]; // ADC buffer1 allocation ****mz
Uint16 DacOffset; // DAC offset
Uint16 DacOutput; // DAC output

3- in Default ISR I added the below details:

interrupt void ADCB1_ISR(void) // PIE1.1 @ 0x000D40 ADC-B4] interrupt #1
{
static Uint16 *AdcBufPtr1 = AdcBuf1; // Pointer to buffer
//static Uint16 iQuadratureTable = 0; // Quadrature table index
static volatile Uint16 GPIO34_count = 0; // Counter for pin toggle

PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; // Must acknowledge the PIE group

//--- Manage the ADC registers
AdcbRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; // Clear ADCINT1 flag

//--- Read the ADC result
*AdcBufPtr1++ = AdcbResultRegs.ADCRESULT0; // Read the result

//--- Brute-force the circular buffer
if( AdcBufPtr1 == (AdcBuf1 + ADC_BUF_LEN) )
{
AdcBufPtr1 = AdcBuf1; // Rewind the pointer to beginning
}

//--- Example: Toggle GPIO18 so we can read it with the ADC ***/
if(DEBUG_TOGGLE == 1)
{
GpioDataRegs.GPATOGGLE.bit.GPIO18 = 1; // Toggle the pin
}
}

4- in ADC.c i added these details:

Function: InitAdca()
*
* Description: Initializes ADC-A & B on the F28x7x
**********************************************************************/
void InitAdca(void)
{
asm(" EALLOW"); // Enable EALLOW protected register access

//--- Reset the ADC. This is good programming practice.
DevCfgRegs.SOFTPRES13.bit.ADC_A = 1; // ADC is reset
DevCfgRegs.SOFTPRES13.bit.ADC_A = 0; // ADC is released from reset

DevCfgRegs.SOFTPRES13.bit.ADC_B = 1; // ADC is reset
DevCfgRegs.SOFTPRES13.bit.ADC_B = 0; // ADC is released from reset

//--- Configure the ADC base registers
AdcaRegs.ADCCTL1.all = 0x0004; // Main ADC configuration
AdcbRegs.ADCCTL1.all = 0x0004; 
// bit 15-14 00: reserved
// bit 13 0: ADCBSY, ADC busy, read-only
// bit 12 0: reserved
// bit 11-8 0's: ADCBSYCHN, ADC busy channel, read-only
// bit 7 0: ADCPWDNZ, ADC power down, 0=powered down, 1=powered up
// bit 6-3 0000: reserved
// bit 2 1: INTPULSEPOS, INT pulse generation, 0=start of conversion, 1=end of conversion
// bit 1-0 00: reserved

AdcaRegs.ADCCTL2.all = 0x0006; // ADC clock configuration
AdcbRegs.ADCCTL2.all = 0x0006; 
// bit 15-8 0's: reserved
// bit 7 0: SIGNALMODE, configured by AdcSetMode() below to get calibration correct
// bit 6 0: RESOLUTION, configured by AdcSetMode() below to get calibration correct
// bit 5-4 00: reserved
// bit 3-0 0110: PRESCALE, ADC clock prescaler. 0110=CPUCLK/4

AdcaRegs.ADCBURSTCTL.all = 0x0000;
AdcbRegs.ADCBURSTCTL.all = 0x0000; 


//--- Call AdcSetMode() to configure the resolution and signal mode.
// This also performs the correct ADC calibration for the configured mode.
AdcSetMode(ADC_ADCA, ADC_RESOLUTION_12BIT, ADC_SIGNALMODE_SINGLE);
AdcSetMode(ADC_ADCB, ADC_RESOLUTION_12BIT, ADC_SIGNALMODE_SINGLE); 

//--- SOC0 configuration
AdcaRegs.ADCSOC0CTL.bit.TRIGSEL = 7; // Trigger using ePWM2-ADCSOCA
AdcaRegs.ADCSOC0CTL.bit.CHSEL = 0; // Convert channel ADCINA0 (Ch. 0)
AdcaRegs.ADCSOC0CTL.bit.ACQPS = 19; // Acquisition window set to (19+1)=20 cycles (100 ns with 200 MHz SYSCLK)

AdcaRegs.ADCINTSOCSEL1.bit.SOC0 = 0; // No ADC interrupt triggers SOC0 (TRIGSEL field determines trigger)

AdcaRegs.ADCSOCPRICTL.bit.SOCPRIORITY = 0; // All SOCs handled in round-robin mode

//SOC0 configuration ADCB
AdcbRegs.ADCSOC0CTL.bit.TRIGSEL = 7;
AdcbRegs.ADCSOC0CTL.bit.CHSEL = 2; 

//SOC0 will convert ADCINB2
AdcbRegs.ADCSOC0CTL.bit.ACQPS = 19;

AdcbRegs.ADCINTSOCSEL1.bit.SOC0 = 0;

AdcbRegs.ADCSOCPRICTL.bit.SOCPRIORITY = 0;


//--- ADCA1 interrupt configuration
AdcaRegs.ADCINTSEL1N2.bit.INT1CONT = 1; // Interrupt pulses regardless of flag state
AdcaRegs.ADCINTSEL1N2.bit.INT1E = 1; // Enable the interrupt in the ADC
AdcaRegs.ADCINTSEL1N2.bit.INT1SEL = 0; // EOC0 triggers the interrupt

 //ADCB1 interrupt configuration
AdcbRegs.ADCINTSEL1N2.bit.INT1CONT = 1;
AdcbRegs.ADCINTSEL1N2.bit.INT1E = 1;
AdcbRegs.ADCINTSEL1N2.bit.INT1SEL = 0;

//--- Enable the ADC interrupt FOR ADCa
PieCtrlRegs.PIEIER1.bit.INTx1 = 1; // Enable ADCA1 interrupt in PIE group 1
PieCtrlRegs.PIEIER1.bit.INTx2 = 1;
IER | = 0x0001; // Enable INT1 in IER to enable PIE group1

//--- Finish up
AdcaRegs.ADCCTL1.bit.ADCPWDNZ = 1; // Power up the ADC
DelayUs(1000); // Wait 1 ms after power-up before using the ADC
asm(" EDIS"); // Disable EALLOW protected register access

//- Finish up FOR ADCB
AdcbRegs.ADCCTL1.bit.ADCPWDNZ = 1;
DelayUs(1000);
asm(" EDIS");

} // end InitAdc()


//--- end of file -----------------------------------------------------