word AD_word; AMGCR=81;//GAINA=2,GAINB=6 AMSCR=34;//00100010 //AMCDIV[1:0]=00 Analog Module Clock Divider Control Bits, // Set AMCDIV1 and AMCDIV0 bits to //zero for optimum analog module performance. //OPIFR =1 Amplifier Ready Interrupt Flag Reset, //1 = Clear OPIF bit //OPIF=0 Amplifier Ready Interrupt Flag // 1 = Two-stage amplifier output is ready //0 //DOF=0 DC Offset Flag, This is a reserved bit. //CDIFR=1 Current Detect Interrupt Flag Reset, //Writing a logic 1 to this write-only //bit clears the CDIF bit. //CDIF=0 Current Detect Interrupt Flag, //1 = Current detect interrupt has occurred AMCR=240;//11110000 Analog Module Control Register (AMCR) //PWR1 PWR0=1 1 CurrentDetectModule=On //TemperatureSensor=On Two-StageAmplifier=On //OPCH1 OPCH0 1 1 Internal temperature sensor //AMIEN =0 Analog module CPU interrupt requests disabled //DO[2:0]=000 DC Offset Control Bits //Set these bits to zero for optimum analog module performance.