I don't know if this will help. This was the header from some working code I did a long time ago. Note I had DEFINE_1K 1 commented out , so it must not have been needed in my application. Change the configs for your needs
Code:
; Initialize your hardware first '
;-----------------------------------------------------------------------------
; pin definitions PIC12F675
; Pin 1 Vdd +5vdc Pin 8 Vss GND
; Pin 2 GP5 Sample 2 Pin 7 GP0 AN0 ISP Data
; Pin 3 GP4 Sample 1 Pin 6 GP1 AN1 ISP CLK
; Pin 4 MCLR tie to Vdd thru 10k Pin 5 GP2 TX pulse
;-----------------------------------------------------------------------------
' __CONFIG _CP_OFF & _CPD_OFF & _BODEN_OFF & _MCLRE_ON & _WDT_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT
DEFINE OSC 8'4
OSCCON = $70
'define OSCCAL_1K 1
DEFINE ADC_BITS 10 ' Set number of bits in AD result
DEFINE ADC_CLOCK 3 ' Set AD clock source (3=rc)
DEFINE ADC_SAMPLEUS 50 ' Set AD sampling time in uS
'CMCON = %00000111
ANSEL = %00010011
TRISIO =%11000011
GPIO =%00000000
WPU =%00000000
'OPTION_REG = %
ADCON0= %10000101
Bookmarks