void AdcConfig(void) { EALLOW; AdcaRegs.ADCCTL2.bit.PRESCALE = 6; //set ADCCLK divider to /4 AdcbRegs.ADCCTL2.bit.PRESCALE = 6; //set ADCCLK divider to /4 // Sequencia de PowerUp //power up the ADCs AdcaRegs.ADCCTL1.bit.ADCPWDNZ = 1; // Power up ADC AdcbRegs.ADCCTL1.bit.ADCPWDNZ = 1; // Power up ADC //Set pulse positions to late AdcaRegs.ADCCTL1.bit.INTPULSEPOS = 1; // INT pulse generation occurs 1 cycle prior to ADC result latching into its result register AdcbRegs.ADCCTL1.bit.INTPULSEPOS = 1; // INT pulse generation occurs 1 cycle prior to ADC result latching into its result register DELAY_US(500); //ADC_A AdcaRegs.ADCSOC2CTL.bit.CHSEL = 15; // SOC2 will convert pin A15 AdcaRegs.ADCSOC2CTL.bit.ACQPS = 19; // ADCSOC1CTL = 0x0A86, CHSEL -> sample window 7 cycles AdcaRegs.ADCSOC2CTL.bit.TRIGSEL = 1; //ADC_B AdcbRegs.ADCSOC2CTL.bit.CHSEL = 15; // SOC2 will convert pin b2 -> ADCINB2 || J3.26 AdcbRegs.ADCSOC2CTL.bit.ACQPS = 19; // ADCSOC1CTL = 0x0A86, CHSEL -> sample window 7 cycles AdcbRegs.ADCSOC2CTL.bit.TRIGSEL = 1; AdcaRegs.ADCINTSEL1N2.bit.INT1E = 1; //enable INT1 flag EDIS; }