This may help you a bit. I've been playing with the 12F683.
Code:@ __CONFIG _INTOSCIO & _FCMEN_OFF & _IESO_OFF & _BOD_OFF & _BOD_OFF & _CP_OFF & _MCLRE_ON & _MCLRE_OFF & _PWRTE_ON & _WDT_OFF DEFINE OSC 8 ' Internal 8MHz DEFINE ADC_BITS 8 ' 8-bit resolution DEFINE ADC_CLOCK 2 ' Set clock source to Frc/32 DEFINE ADC_SAMPLEUS 50 ' Sample time in uS before A/D conversion is started CMCON0 = 7 'Comparators off ADCON0 = %00000001 'ADC enabled and right justified ANSEL = %00001000 'GPIO.0 and GPIO.1 analog input INTCON = 0 'INTERRUPTS off OSCCON = %01110000 '8 Mhz TRISIO = %111011 'GPIO2 output GPIO = %00010000 ' All outputs = 0 on boot




Bookmarks