Please i've tried everything!
I want this stupid program to work on my PIC 16F685. I programmed it using PIC BASIC and the U2 EPIC programmer. I configured the oscillator to RCIO with the EPIC programming software.
I've been trying to get this to work for hours!!!
Please include an explanation for changes in my code. None of the sample programs coming with the PIC BASIC compiler are working!
What should I configure my oscillator to in the EPIC programmer?
All i want is an A2D conversion to be displayed to my LCD connected to RB.7.
Here is the code I used
' 10-bit A/D conversion
' Connect analog input to channel-0 (RA0)
' Define ADCIN parameters
' Set number of bits in result
DEFINE ADC_BITS 10
' Set clock source (3=rc)
DEFINE ADC_CLOCK 4
' Set sampling time in microseconds
DEFINE ADC_SAMPLEUS 10
adcVar VAR WORD ' Create variable to store result
' Set PORTA to all input
TRISA = %11111111
' Set up ADCON1
ADCON1 = %10000010
Pause 500 ' Wait .5 second
HIGH PORTB.6 ' Turn on status LED
main:
ADCIN 0, adcVar ' Read channel 0
serout portb.7, 6, ["S.1 =", #ADCVAR]
Pause 10 ' Wait.01 second
GoTo main ' Do it forever
Bookmarks