Try this and see how fast it runs:
Code:' PIC 16F690 Fuses @ DEVICE FCMEN_OFF @ DEVICE IESO_OFF @ DEVICE BOD_ON @ DEVICE CPD_OFF @ DEVICE PROTECT_OFF @ DEVICE MCLR_OFF @ DEVICE PWRT_OFF @ DEVICE WDT_OFF @ DEVICE HS_OSC option_reg = $85 : ansel = 1 : anselh = 0 : adcon0 = $82 : adcon1 = $10 cm1con0 = 0 : cm2con0 = 0 : intcon = 0 : trisa = 1 : porta = 0 : trisb = 0 portb = 0 : trisc = 0 : portc = 0 : volt var word : check var portb.6 adtrigger var adcon0.1 MAIN: check=1 : adtrigger = 1 'start the ADC conversion waitforit: if adtrigger = 1 then waitforit 'not done converting yet volt.highbyte = adresh : volt.lowbyte = adresl : check = 0 : goto MAIN end




Bookmarks