Hi,
I want to get conversion with the adc, but I the flags at eoc were never set. I'm using the renewable enegery kit with an 28035 microcontroller.
Edit: I just checked, that none of the AdcRegs registers are written - But I tried to access the GPIO registers and it worked with this code expample in the same .c file
EALLOW;
GpioCtrlRegs.GPBMUX1.bit.GPIO34 = 1;
GpioCtrlRegs.GPBDIR.bit.GPIO34 = 1;
EDIS;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Here's my code
watchdog(disable); // Watchdog: on/off
init_adc(); // Power Up ADC
/***********************************
* SOC0 CONFIG ****************
* *********************************/
EALLOW;
AdcRegs.ADCSOC0CTL.bit.CHSEL = Vdc; // Input Voltage Vdc to Soc0 (ADCINA2)
AdcRegs.ADCSOC0CTL.bit.ACQPS = 6; //set SOC0 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1)
AdcRegs.ADCSOC0CTL.bit.TRIGSEL = 0; // Softwaretrigger only
// Interrupt 1 forr SOC0
AdcRegs.INTSEL1N2.bit.INT1E = 1; // Enable Interrupt 1
AdcRegs.INTSEL1N2.bit.INT1CONT = 0; // no interupts till flag clear
AdcRegs.ADCINTSOCSEL1.bit.SOC0 = 2; // ADCINT2 triggers Soc0
/********************************************************************************************************/
// Interrupt 2 für EOC
AdcRegs.INTSEL1N2.bit.INT2E = 1; // Enable Interrupt 2
AdcRegs.ADCCTL1.bit.INTPULSEPOS = 1;
AdcRegs.INTSEL1N2.bit.INT2SEL = 0; // Connect ADCINT2 to EOC0
AdcRegs.INTSEL1N2.bit.INT2CONT = 0;
AdcRegs.ADCSOCFRC1.bit.SOC0 = 1; // Force start SOC0
EDIS;
Wether the AdcRegs.ADCSOCFLG1.bit.SOC0 nor the AdcRegs.ADCINTFLG.bit.ADCINT2 bit is set to one. Would be glad, if anyone can help me.