I do not use PM, so this is how I set it up using MPASM.
Not much different than yours...Code:@ __config _CONFIG1, _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _LVP_OFF & _CP_OFF OSCCON = %01110000 DEFINE OSC 8 CM1CON0 = 0 'Comparator Off CM2CON0 = 0 'Comparator Off TRISA = %11111111 'SET PORTA AS INPUTS TRISB = %00000000 'SET PORTB AS OUTPUTS TRISC = %11111111 'SET PORTC AS INPUTS ANSEL = %00001111 'SET INPUTS AN0-AN3 AS ANALOG INPUTS ADCON1 = %10000000 'SETUP ADC RIGHT JUSTIFY SET REFV to VDD & VSS 'Define ADCIN parameters Define ADC_BITS 10 'Set number of bits in result (10) Define ADC_CLOCK 3 'Set clock source (3=rc) Define ADC_SAMPLEUS 50 'Set sampling time in microseconds (50us)





Bookmarks