Ja:
ANSELA = %00000001 'A.0 Analog
ANSELB = %00000000 'All Port B Digital
TRISA = %00000001 'Port A0 input for Comparator 2
TRISB = %00000000 'All Poert B Output
OSCCON = %01110000 '8Mhz internal
CM2CON0 = %10110111 CMOUT pin enabled
CM2CON1 = %00010000 '- To C12IN0-, + to DAC
DACCON0 = %11110000
DACCON1 = %000000001 'Ref = 0,14V